Shrimp Size Estimation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Computer Vision Based Estimation of Shrimp

Population Density and Size


Trung Thanh N. Thai 1,2 Thanh Sang Nguyen 1,2 Viet Cuong Pham1,2
1Ho 1Ho 1Ho
Chi Minh City Uni. of Technology Chi Minh City Uni. of Technology Chi Minh City Uni. of Technology
2Vietnam National University HCM 2Vietnam National University HCM 2Vietnam National University HCM

thanh.thai.nt@hcmut.edu.vn tsang0949@gmail.com pvcuong@hcmut.edu.vn

Abstract—Shrimp is one of the most important aquaculture Flowchart of the computer vision system is given in Fig. 1.
products in Vietnam and it is desired to continuously estimate Images captured from shrimp ponds are first processed by the
shrimp population density and size. This paper presents our initial U-net segmentation technique to obtain greyscale images.
steps in supervising aqua farming based on computer vision Resulting images are then processed by the marker-controlled
techniques. The computer vision system includes U-net watershed segmentation to improve the segmentation,
segmentation, marker-controlled watershed segmentation, especially in cases of touching/overlapping shrimps.
thresholding, contour tracing, etc. Experiment results show that Thresholding technique is then used to extract shrimps.
the proposed method can obtain good results in counting shrimps Finally, contours and bounding boxes are found to count
(mean absolute error of 0.093) and estimating shrimp lengths
2021 International Symposium on Electrical and Electronics Engineering (ISEE) | 978-1-6654-1487-6/21/$31.00 ©2021 IEEE | DOI: 10.1109/ISEE51682.2021.9418638

shrimps and to estimate shrimp length.


(RMS error of 0.293 cm) when they are separately located.

Keywords— shrimp farming, computer vision, deep learning,


U-Net, watershed segmentation

I. INTRODUCTION
Tracking the sustainability of aquaculture population is
highly desirable but challenging. It is well known that cultured
shrimps are vulnerable to environmental changes that can
cause mass deaths leading to severe losses of farmers. In Fig. 1. Flowchart of the computer vision system.
Southern Vietnam especially in the Mekong Delta region,
natural farming conditions have become more and more A. U-Net segmentation
severe due to saltwater intrusion and climate change. Shrimp U-Net [3] is a well-known segmentation method which
farming in Vietnam was reported suffering a considerable won the IEEE International Symposium on Biomedical
decrease in production and mass export in the first ten months Imaging cell tracking challenge in 2015. It is a fully
of 2019, in comparison with that of 2018. To support shrimp convolutional network that can assign a class label to each
farming, it is desirable to continuously supervise and timely pixel of an image. It is claimed to be able to work well even
feedback statistics of the aquaculture population to help with a small dataset.
farmers making right decisions.
The network has a U sharp with 23 convolutional layers,
Computer vision techniques have been applied to the field including a contracting path and an expansive path. The
of shrimp farming. In [1], a highly sensitive underwater video contracting path has an architecture similar to that of a
system was developed to obtain high-quality videos and convolutional neural network, consisting of repeated blocks of
images in turbid, low-light aquafarming ponds. The system two 3×3 convolutions, each followed by a rectified linear unit
can be utilized for monitoring shrimp feeding, evaluating (ReLU) and a downsampling 2×2 max pooling block with a
shrimp size, shrimp health, and excess organic matters. In [2], stride of 2. The number of feature channels is doubled at each
a model of a smart underwater monitoring system was downsampling step. Every step in the expansive path consists
proposed to control feeding and to manage water quality based of an upsampling of the feature map followed by a 2 × 2
on underwater observation and analysis. The system can convolution that halves the number of feature channels, a
detect shrimp and shrimp food however the detection accuracy concatenation with the correspondingly cropped feature map
was not discussed. from the contracting path, and two 3×3 convolutions, each
This paper presents our initial steps in supervising shrimp followed by a ReLU. A 1×1 convolution is used at the final
farms based on computer vision techniques. In particular, a layer to map each 64-component feature vector to the desired
computer system is built to capture and analyze images of number of classes.
shrimps to estimate shrimp population density and Our dataset includes 181 images collected from the
individual’s length. laboratory environment in which 100 images were used for
training and the rest for testing. For each image in the training
II. METHODOLOGY set, binary masks are manually created as shown in Fig. 2. Data
The proposed solution comprises three parts. First, images augmentation technique was used to enrich the training
of shrimps are captured and transferred to a processing dataset.
computer. A computer vision system, including U-net
segmentation, watershed segmentation, thresholding, contour
finding, etc., is then utilized to count shrimps and to estimate
shrimp length. Finally, a friendly web interface was
established to provide an easy and efficient usage of the
system.

978-0-7381-3196-2/21/$31.00 ©2021 IEEE 145

Authorized licensed use limited to: UNIVERSITY OF WESTERN ONTARIO. Downloaded on May 26,2021 at 11:51:42 UTC from IEEE Xplore. Restrictions apply.
Fig. 2. Training data including original images and manually labeled binary
masks.
Fig. 3. Binary mask (left) and result after implementing Euclidean distance
B. Marker-controlled Watershed Segmentation calculation algorithm (right).
For shrimps touching or overlapping each other, U-net
Markers are then found as shown in Fig. 4 while result after
tends to recognize them as one segment. To deal with this
using thresholding technique is illustrated in Fig. 5. Finally,
situation, the marker-controlled watershed segmentation is
contours and bounding boxes are found to count shrimps and
employed. Marker-controlled watershed segmentation
to estimate shrimp lengths.
algorithm has been shown to be a robust and flexible method
for the segmentation of objects with closed contours, where
the boundaries are expressed as ridges. The marker image
used for watershed segmentation is a binary image consisting
of single marker points or marker regions, where each
connected marker is localized inside an object of interest.
After segmentation, the boundaries of the watershed regions
are arranged on the desired ridges separating each object from
its neighbors.
The marker-controlled watershed segmentation algorithm
is as follows:
Fig. 4. Masks (left) and markers (right, markers are magnified for
• Step 1: Assign a unique label to each minimum. illustration).
Initialize set S of labeled points, V contains
watershed lines (V is empty initially).
• Step 2: Insert unlabeled neighboring pixels in the Q
priority queue, sorted by grayscale value.
• Step 3: Take pixel x from the top of the queue Q
follows by: F(x) = min{F(y) | y ∈ Q}: If x is adjacent
to a labeled region, we label x by that region (with
the same label), and add it to S, then add the
unlabeled neighbors to queue Q.
• Repeat Step 3 until Q is empty.
The number of markers equals the number of watershed Fig. 5. Input grayscale image on the left with thresholded image on the right
regions thus each marker has a one-to-one mapping to a
particular watershed region. The markers can be manually or III. WEB-BASED SHRIMP FARMING MONITORING
automatically selected, but automatically generated markers Heroku, developed since 2007, is a cloud computing
are preferred. Markers can be created by various methods. In service supporting several programming languages [5, 6].
the paper, the Euclidean distance calculation algorithm [4] is Heroku is considered as a polyglot platform thanks to its
employed where value of each pixel is replaced with its supporting developers to build and run applications in a
Euclidean distance to the nearest zero-value pixel (x0, y0) (the similar manner across most languages.
nearest background pixel) as shown in Fig. 3, calculated by:
After submitting some required parameters, the
, application does the processing job at Heroku server-side
where all the algorithms are deployed, then displays the
farming specifications which include shrimp lengths and
shrimp of population density as shown in Fig. 6.

146

Authorized licensed use limited to: UNIVERSITY OF WESTERN ONTARIO. Downloaded on May 26,2021 at 11:51:42 UTC from IEEE Xplore. Restrictions apply.
Fig. 6. One of our ultimate results displayed on web application

IV. EXPERIMENTAL RESULTS


The proposed method was evaluated on its capability of
counting shrimps and estimating shrimp lengths. The shrimp
counting ability is assessed on 81 images collected from our
laboratory environment. Each image contains from one to
four shrimps. The total number of shrimps in those images is
175. Some typical images are shown in Fig. 7.

Fig. 8. Correct estimation of shrimp number in an image.

Fig. 9. Underestimation of shrimp number in an image.

The system is quite robust in segmenting small parts of


shrimps as shown in Fig 10. As can be seen, a small part of a
shrimp, almost only the tail, can also be correctly segmented.

Fig. 7. Typical images captured from laboratory environment.

Among 81 test images, there are 59 images containing


only one shrimp or separately located shrimps as illustrated
in Fig. 7. For those images, the proposed method performs
well in counting shrimp with mean absolute error of 0.093
(error of 11 over 118 shrimps). Most of the time (50/59
images) the method counted exactly the number of shrimps
in images, sometimes (9/59 images) it under-estimated the
number of shrimps. Some results are illustrated in Fig. 8 and
Fig. 9. Fig. 10. Correct segmentation of small parts of shrimps.

For the remaining 22 images containing shrimps


touching or overlapping each other (besides
touching/overlapping shrimps, those images may also contain
other separately located shrimps) as illustrated in Fig. 11, the
proposed method often counted two touching/overlapping
shrimps as one as shown in Fig. 12 thus the mean absolute error
in this case is 0.298 (error of 17 over 57 shrimps). The overall
mean absolute error for all 81 images is 0.160 (error of 28
over 175 shrimps).

147

Authorized licensed use limited to: UNIVERSITY OF WESTERN ONTARIO. Downloaded on May 26,2021 at 11:51:42 UTC from IEEE Xplore. Restrictions apply.
Fig. 11. Images with shrimps touching or overlapping each other.

Fig. 14. Estimation of shrimp length.

V. CONCLUSIONS
This paper presents our initial steps in solving the
Fig. 12. Segmentation result for images with shrimps touching or problem of shrimp farming supervision based on computer
overlapping each other. vision. The proposed method, utilizing U-net and watershed
segmentation techniques, can estimate shrimp length and
The capability of shrimp length estimation was also count shrimps well when they are separately located.
evaluated. Shrimp lengths were first determined by using a However, its performance degrades when shrimps are
tap measure (Fig. 13) then they were estimated by the proposed touching or overlapping each other. Object detection
method (Fig. 14). The average length of shrimps used in this approach will be investigated to deal with this challenging
assessment is 14.92 cm. The root mean square error is 0.293 situation.
cm.
ACKNOWLEDGEMENT
We would like to thank Ho Chi Minh City University of
Technology (HCMUT), VNU-HCM for the support of time
and facilities for this study.
REFERENCES
[1] Chin-Chang Hung, Shih-Chieh Tsao, Kuo-Hao Huang, Jia-Pu Jang,
Hsu-Kuang Chang & Fred C. Dobbs, “A highly sensitive underwater
video system for use in turbid aquaculture ponds,” Scientific Reports,
August 2016.
[2] Ing-Jer Huang, Chin-Chang Hung, Shiann-Rong Kuang, Yun-Nan
Chang, Kuan-Yu Huang, Chang-Ru Tsai and Kai-Lin Feng, “The
Prototype of a Smart Underwater Surveillance System for Shrimp
Farming,” 2018 IEEE International Conference on Advanced
Manufacturing (IEEE ICAM 2018), pp. 177– 180. IEEE.
[3] Olaf Ronneberger, Philipp Fischer, and Thomas Brox, “U-Net:
Convolutional Networks for Biomedical Image Segmentation,”
arXiv:1505.04597v1 [cs.CV], May. 2015.
[4] Ivan Dokmanic, Reza Parhizkar, Juri Ranieri and Martin Vetterli,
“Euclidean Distance Matrices: Essential Theory, Algorithms and
Fig. 13. Manual measurement of shrimp length. Applications”, arXiv: 1502.07541v2 [cs.OH], 15, Aug 2015.
[5] “Heroku”, Crunchbase, Retrieved March 2016.
[6] “About Heroku”, Stack Overflow, Retrieved March 2016.

148

Authorized licensed use limited to: UNIVERSITY OF WESTERN ONTARIO. Downloaded on May 26,2021 at 11:51:42 UTC from IEEE Xplore. Restrictions apply.

You might also like