Professional Documents
Culture Documents
AFish Classificationon Imagesusing Transfer Learningand Matlab
AFish Classificationon Imagesusing Transfer Learningand Matlab
net/publication/330780298
CITATIONS READS
27 2,583
7 authors, including:
All content following this page was uploaded by Erland Barlian on 10 February 2019.
Abstract— The Ministry of Marine Affairs and Fisheries (MMAF) supplier to the United Kingdom, United States of America,
carry out the responsibilities and features associated with the Japan and The European Union (EU). In response to the
policy of marine and fisheries. MMAF carry out the increasing, The pole-and-line fishery has been grown
responsibilities and features associated with marine and fisheries predominantly in the eastern area of Indonesia especially in the
policy. One of their duties and functions are organized marine and
fishery statistics, in accordance to Law of The Republic of
water Sulawesi [3], Maluku and northern off Papua. Fishing
Indonesia Number sixteen of 1997 regarding Statistics. The main operation of pole-and-line is mainly within five out of eleven
problem is the number of enumerators at each Basis Landing Of Indonesian Fisheries Management Areas (FMA) namely FMA
Fish. This paper proposed a fish classification on fish images using 713, 714, 715, 716 and 717. In the 2007-2013 period, the
transfer learning and Matlab as the first stage of tackling the average Katsuwonus Pelamis caught is 83.7%, 80.7% and
problem. FishNet is a modification from AlexNet to classify 77.8% at Sorong-Papua, Bitung-North Sulawesi and Kendari-
Katsuwonus Pelamis (Skipjack tuna or Cakalang), Euthynnus Southeast Sulawesi and respectively (see Fig.1).
Affinis (Tongkol) and Coryphaena Hippurus (Mahi-mahi) that
caught by fishermen. There are 15.120 images of 3 type of fishes,
5.040 for each fish. Data is split into 70:30 for training and
validation set. The training process is done using Matlab 2018a on
Windows 7 operating system in a notebook with single CPU i7 with
8 GB RAM for 124 minutes. The validation accuracy is 99.63%.
I. INTRODUCTION
Indonesia is the largest archipelagic country, and it has
more than thirteen thousand islands [1], [2]. Indonesia has
become one of the largest tuna producing countries around the
globe. Indonesia is a significant producer if seafood and a vital
draws a lot of researchers attention in machine learning lately.
Deep learning has been recognized as a handy tool in the
application of image processing, natural language processing,
speech recognition, text classification, robotics and control,
computer vision, and so on [7], [8].
A Convolutional Neural network (CNN) is a practical
machine learning approach from the sector of deep learning.
CNNs are trained using massive collections of numerous
images. From those massive collections, CNNs can learn rich
characteristic representations for an extensive range of images.
Those characteristic representations frequently outperform
hand-crafted features which include a Histogram of Oriented
Gradients (HOG), Local binary pattern (LBP), or Speeded Up
Robust Features (SURF) [9]. An easy way to leverage the energy
of CNNs, without investing effort and time into training, is to
Fig. 1. The Fish Aggregating Devices (FADs) position which indicates as use a pretrained CNN as a characteristic extractor.
pole-and-line fishing ground [3]
A comprehensive analysis of essential metrics in practical
The Fishermen usually catch Katsuwonus Pelamis applications: accuracy, memory footprint, parameters,
(Skipjack tuna or Cakalang), Euthynnus Affinis (Tongkol) and operations count, inference time and power consumption in [10].
Coryphaena Hippurus (Mahi-mahi) [4]. Captain of the boat As shown in Fig. 2 AlexNet has the smallest Top-1 accuracy and
must fill in the logbook and get permit issuance data were smallest operations too. In the next stage of this research will put
obtained from the port authorities of the Oceanic Fishing Port AlexNet into an embedded system such as Raspberry Pi 3B+
(OFP). The logbook data includes departure and arrival dates of [11] and a web camera as its input to recognize three type of
vessels into the port, gross tonnage (GT), the overall length of fishes on fisherman boat.
the vessel (LOA), number of crew, and catch of pole-and-line,
longline, purse-seine and handline vessels for every reported
trip.
Sometimes the captain hesitates to fill the logbook
correctly because he also uses estimation only [5]. At the Basis
Landing Of Fish (Pangkalan Pendaratan Ikan/PPI in Bahasa),
some enumerators who make a record from each fisherman
boats such as the type of fishes and their weight in tonnage. The
record needs to make a national report to FAO [6]. The
enumerator makes the only estimation from by glance at boat
hold. The number of enumerators is minimal compared to the
number of boats. The enumerators cannot catch up the record
when there are many boats came in at the same time. The paper
aims to help the Ministry of Maritime Affairs and Fisheries
(KKP) in improving the sustainability of aquaculture and
capture fisheries implement science and technology innovation
in marine and fisheries area. There are two stages to achieve Fig. 2. Top1 vs. operations, size ∝ parameters. Top-1 one-crop accuracy versus
the number of operations required for a single forward pass [10]
automatic fish catch estimation using a web camera, such as
classify fishes from images than from a web camera. This paper Transfer learning also is known as reuse pretrained network,
proposed a fish classification on fish images using transfer refers to the process of using the weights from pre-trained
learning and Matlab. networks on a large dataset. As the pre-trained networks have
already learned how to identify lower level features such as
edges, lines, curves, and many others. With the convolutional
II. RELATED WORK layers which are frequently the most computationally time-
consuming parts of the process, the use of these weights helps
Deep learning is a kind of machine learning that trains a
the network to converge to an excellent score faster than training
computer to operate human-like tasks, such as recognizing
from scratch. In this paper, we use AlexNet [12], then modified
speech, figuring out images or making predictions. Instead of its final layer to recognize three classes of fish, namely:
organizing statistics to run via predefined equations, deep Katsuwonus Pelamis (Cakalang), Euthynnus Affinis (Tongkol)
learning sets up fundamental parameters about the records and and Coryphaena Hippurus (Mahi-mahi) (See Fig. 3).
trains the computer to analyze on its own through recognizing
patterns the use of many layers of processing. Deep learning
techniques have accelerated the capability to recognize,
classify, discover and describe – in one word, understand. Deep
learning is class methods rest on multilayer neural networks,
Fig. 3. Fish Images namely Katsuwonus Pelamis (Cakalang), Euthynnus
Affinis (Tongkol) and Coryphaena Hippurus (Mahi-mahi) Fig. 4. A 5-degree rotation Augmentation Program
(the program is provided at the end of paper for clarity)
To train a CNN model from scratch successfully, it needs a
huge dataset, and machines with higher computational power are
needed, preferably with GPU [13]. AlexNet has been trained on
more than a million images and can classify images into 1000
object categories (such as coffee mug, a keyboard, pencil, and
animals). AlexNet has learned wealthy characteristic
representations for a vast variety of images. AlexNet takes an
image as input and outputs a label for the object in the image Fig. 5. A 25-degree rotation augmentation result
collectively with the chances for every of the object categories. • Step 3: Prepare the data set. In this paper, there are 15.120
Transfer learning is frequently used in deep learning images of fishes, 5.040 for each fish. Data is split into 70:30
applications. A pretrained network can be taken and use it as a for training and validation set. Where a training set is fixed
starting point to learn a new task. Fine-tuning a network with for examples used for learning, this is to match the
transfer learning is usually much faster and more comfortable parameters of the classifier. On the other hand, the validation
than training a network with randomly initialized weights from set is fixed for examples used to tune the parameters of a
scratch [14]. classifier, for instance, to choose the extensive form of
hidden units in a neural network [16].
III. METHOD AND RESULTS • Step 4: Modify the AlexNet into FishNet with Matlab and
There is five-step to teach machine learning to classify use it to predict the class of the fish. FishNet architecture is
fishes, such as: shown in Fig. 6, with the fully connected layer (FC8) only
three classes for each fish.
• Step 1: Collect fish images from the internet by search with
species name or its other popular names, for examples:
Katsuwonus Pelamis is known as skipjack tuna or Cakalang
in Bahasa, Euthynnus Affinis is known as mackerel tuna or
Tongkol in Bahasa, and Coryphaena Hippurus is known as
mahi-mahi or Lemadang in Bahasa.
• Step 2: Image-preprocessing consists centered crop into the
size of the input layer of the CNN and using augmentation
for rotation since fish will come into boat hold in every
possible angle. Augmentation is used to multiple images for
Fig. 6. The FishNet architecture
creating enough images for deep learning training.
Augmentation can be scale, rotation, flip, skew, crop and so • Step 5: Setting hyperparameter of FishNet. In this paper,
on [15]. Since many augmentation programs when it makes Stochastic gradient descent with momentum (SGDM) is
scale and rotation, it leaves the black area of augmented chosen as the learning algorithm.
images. An augmentation program that utilized an alpha
layer, it helps to avoid the black area effect from the
augmentation process is proposed in this paper, and the
rotation result shown in Fig. 5.
Fig. 8. Confusion matrix of Fishnet
# Import libraries
import os
from os import walk
from os.path import basename
from PIL import Image
import numpy as np
import cv2
import imutils
import matplotlib.pyplot as plt