Professional Documents
Culture Documents
Shrimp Lenght Using Yolo
Shrimp Lenght Using Yolo
DOI: https://doi.org/10.13031/aim.201900724
Paper Number: 1900724
Hong-Yang Lina, Hsin-Chen Leea, Woei-Ling Ngb, Jyh-Nain Paic, Yuan-Nan Chua, Chyng-Hwa
Lioub, Kuo-Chi Liaoa, Yan-Fu Kuoa
a
Department of Bio-Industrial Mechatronics Engineering, National Taiwan University, Taipei, Taiwan.
b
Department of Aquaculture, National Taiwan Ocean University, Keelung, Taiwan.
c
Aquaculture Research Center, Fisheries Research Institute, Council of Agriculture, The Executive Yuan,
Changhua, Taiwan.
Written for presentation at the
2019 ASABE Annual International Meeting
Sponsored by ASABE
Boston, Massachusetts
July 7–10, 2019
ABSTRACT. The body length of shrimp is the major indicator for feeding management in shrimp aquaculture. Food
intake for shrimp is linearly correlated with its body length. Conventionally, the body length of shrimp was measured
using naked-eye inspection and relied on the experience of shrimp farmers. However, manual observation might be
subjective. Imprecise measurement can lead to mistaken feeding strategies and, hence, economic losses in shrimp
aquaculture. This study proposed an automatic method to measure the body length of shrimp in-vivo using underwater
camera and deep learning. In the approach, underwater cameras with infrared light source were designed and established
to observe shrimp activities. A convolutional neural network model was developed to locate shrimps in the images. Next,
image processing algorithms were applied to segment the shrimps from the background and estimate the length of the
shrimp. The results achieved a mAP of 85.08% in shrimp detection and localization, and an RMSE of 5.76% in shrimp
body length estimation.
Keywords. Convolutional neural network, deep learning, image processing, shrimp body length, underwater camera.
Introduction
Shrimp is one major protein source in diet worldwide. According to Global Aquaculture Alliance, the global shrimp
aquaculture production in 2018 reached to about 4.5 million MT (Anderson et al., 2016). Among all the varieties of shrimps,
white shrimp (Litopenaeus vannamei) accounts for a large proportion of production because its eurysalinity, high tolerance
to low level of dissolved oxygen in water, and fast growth. In Taiwan, the production of white shrimp reached 10 thousand
MT in 2015, and the export value was 1.9 billion TWD (Chen et al., 2017). One major cost for shrimp aquaculture is the
feed. Shrimps have to be fed based on the body lengths and appetite to optimize their growth. Conventionally, the body
lengths of shrimps were estimated using naked-eye inspection. However, manual observation might be subjective. Imprecise
The authors are solely responsible for the content of this meeting presentation. The presentation does not necessarily reflect the official position of the
American Society of Agricultural and Biological Engineers (ASABE), and its printing and distribution does not constitute an endorsement of views
which may be expressed. Meeting presentations are not subject to the formal peer review process by ASABE editorial committees; therefore, they are
not to be presented as refereed publications. Publish your paper in our journal after successfully completing the peer review process. See
www.asabe.org/JournalSubmission for details. Citation of this work should state that it is from an ASABE meeting paper. EXAMPLE: Author’s Last
Name, Initials. 2019. Title of presentation. ASABE Paper No. ---. St. Joseph, MI.: ASABE. For information about securing permission to reprint or
reproduce a meeting presentation, please contact ASABE at www.asabe.org/permissions (2950 Niles Road, St. Joseph, MI 49085-9659 USA).1
Figure 1. Acquisition modes of camera: (a) RGB, (b) black-hot, and (c) white-hot.
Some studies have measured the sizes of objects using computer vision. White et al. (2006) measured the length of fish
and determined the orientation of fish using the silhouette of the fish, line-drawing processing, and moment-invariant
method. Wang et al. (2017) detected fruits and estimated fruit lineal dimensions using histogram of oriented gradients, Otsu’s
method, depth information from RGB-D cameras, and thin lens formula. Si et al. (2017) localized multiple potato tubers in
an image using watershed segmentation and estimated the length to width ratios of the potatoes using region labeling and
manual selection. Zhou et al. (2017) enhanced the contrast of the images in recirculating aquaculture system using multi-
scale retinex (MSR; Rahman et al., 1996) algorithm and incomplete Beta function. Although achieved good performances,
the aforementioned approaches required images acquired under controlled conditions.
Recently, convolutional neural network (CNN)-based approaches have been introduced to tackle images acquired under
uncontrolled conditions in the field of agriculture. Li et al. (2015) detected and recognized fish species from underwater
images using faster region-based CNN (Faster R-CNN; Ren et al., 2015). Christiansen et al. (2016) detected obstacles and
anomalies in an agricultural field using an algorithm combining Faster R-CNN and anomaly detection. Liang et al. (2018)
detected on-tree mangoes in outdoor orchards using single shot multi-box detector (Liu et al., 2015). Zhao and Qu (2019)
detected healthy and diseased tomatoes using You Only Look Once version 2 (YOLOv2; Redmon & Farhadi, 2016).
This study proposed to measure the body lengths of shrimp in-vivo using underwater camera and YOLO. The specific
objectives were to (1) acquire shrimp videos using an underwater camera, (2) detect the shrimps in the videos using
YOLO, and (3) estimate the body lengths of the shrimps using image processing (Fig. 2).
Image augmentation was applied to the training images to enhance the robustness of the model to be trained. The
augmentation operations included rotation (randomly between 60° and 60°), saturation variation (randomly between 1 and
1.5), exposure variation (randomly between 1 and 1.5), and hue variation (randomly between 0.9 and 1.1).
Figure 4. Architecture of YOLOv3. conv: convolutional layer, C: convolutional layer with LeakyReLu and BN, CS: convolutional set, RS:
residual structure, CB: convolutional block, n: size of the convolutional layer, d: dimension of the convolutional layer.
Figure 5. Shrimp image processing: (a) patch image with measurable shrimp, (b) median blur, (c) MSR algorithm, (d) gamma correction, (e)
Otsu’s method, (f) the largest connected-component, and (g) image with bounding box.
Results
The performance of the shrimps detection
The performance of the developed YOLOv3 model was examined using the 100 test images (Table 1). Using a threshold
of 0.5 for the class probability, the model achieved a mean average precision (mAP) of 85.08%. Category “measureable”
achieved higher precision, recall, F1-score and average precision compared with the category “visible”. This results may be
caused by the fact that the features of visible shrimps were not complete. Some of visible shrimps were blurred, and the
bodies of some other visible shrimps were incomplete. These facts made it difficult for YOLOv3 to learn the features of the
“visible” shrimps.
Table 1. Performance of YOLOv3 model.
Class Precision (%) Recall (%) F1-Score (%) AP (%) mAP (%)
Measurable 92.38 90.02 91.19 88.13
85.08
Visible 82.66 81.61 82.13 82.03
Figure 7. Result images with uneven background: (a) binary image, and (b) image with bounding box.
Conclusion
This study proposed to detect shrimps in complex images using YOLOv3 and to measure the body lengths of the shrimps
using image processing. In the study, shrimp images were acquired using underwater cameras with infrared light source.
YOLOv3 was developed to detect and locate shrimps in the images. The body lengths of shrimps were next estimated using
image processing algorithms. The proposed approach achieved a mAP of 85.08% in shrimp detection and localization, and
an RMSE of 5.76% in shrimp body length estimation.
References
Babakhani, P., & Zarei, P. (2015). Automatic gamma correction based on average of brightness. 2015, 4 %J Advances in
Computer Science : an International Journal.
Chan, F. H. Y., Lam, F. K., & Hui, Z. (1998). Adaptive thresholding by variational method. IEEE Transactions on Image
Processing, 7(3), 468-473. doi:10.1109/83.661196
Christiansen, P., Nielsen, L. N., Steen, K. A., Jørgensen, R. N., & Karstoft, H. (2016). DeepAnomaly: Combining
Background Subtraction and Deep Learning for Detecting Obstacles and Anomalies in an Agricultural Field.
16(11), 1904.
Deng, J., Dong, W., Socher, R., Li, L., Kai, L., & Li, F.-F. (2009, 20-25 June 2009). ImageNet: A large-scale hierarchical
image database. Paper presented at the 2009 IEEE Conference on Computer Vision and Pattern Recognition.
Ioffe, S., & Szegedy, C. (2015). Batch Normalization: Accelerating Deep Network Training by Reducing Internal
Covariate Shift. arXiv e-prints. https://ui.adsabs.harvard.edu/abs/2015arXiv150203167I
Liang, Q., Zhu, W., Long, J., Wang, Y., Sun, W., & Wu, W. (2018). A Real-Time Detection Framework for On-Tree Mango
Based on SSD Network, Cham.
Lin, T.-Y., Dollár, P., Girshick, R., He, K., Hariharan, B., & Belongie, S. (2016). Feature Pyramid Networks for Object
ASABE 2019 Annual International Meeting Page 6
Detection. arXiv e-prints. https://ui.adsabs.harvard.edu/abs/2016arXiv161203144L
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., & Berg, A. C. (2016). SSD: Single Shot MultiBox
Detector, Cham.
Otsu, N. (1979). A Threshold Selection Method from Gray-Level Histograms. IEEE Transactions on Systems, Man, and
Cybernetics, 9(1), 62-66. doi:10.1109/TSMC.1979.4310076
Rahman, S., Rahman, M. M., Abdullah-Al-Wadud, M., Al-Quaderi, G. D., Shoyaib, M. J. E. J. o. I., & Processing, V.
(2016). An adaptive gamma correction for image enhancement. 2016(1), 35. doi:10.1186/s13640-016-0138-1
Rahman, Z., Jobson, D. J., & Woodell, G. A. (1996, 19-19 Sept. 1996). Multi-scale retinex for color image enhancement.
Paper presented at the Proceedings of 3rd IEEE International Conference on Image Processing.
Redmon, J. (2013-2016). Darknet: Open Source Neural Networks in C. http://pjreddie.com/darknet/
Redmon, J., & Farhadi, A. (2017, 21-26 July 2017). YOLO9000: Better, Faster, Stronger. Paper presented at the 2017 IEEE
Conference on Computer Vision and Pattern Recognition (CVPR).
Redmon, J., & Farhadi, A. (2018). YOLOv3: An Incremental Improvement. arXiv e-prints.
https://ui.adsabs.harvard.edu/abs/2018arXiv180402767R
Ren, S., He, K., Girshick, R., & Sun, J. (2017). Faster R-CNN: Towards Real-Time Object Detection with Region
Proposal Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6), 1137-1149.
doi:10.1109/TPAMI.2016.2577031
Si, Y., Sankaran, S., Knowles, N. R., & Pavek, M. J. J. A. J. o. P. R. (2017). Potato Tuber Length-Width Ratio Assessment
Using Image Analysis. 94(1), 88-93. doi:10.1007/s12230-016-9545-1
Wang, Z., Walsh, K. B., & Verma, B. (2017). On-Tree Mango Fruit Size Estimation Using RGB-D Images. 17(12), 2738.
White, D. J., Svellingen, C., & Strachan, N. J. C. (2006). Automated measurement of species and length of fish by
computer vision. Fisheries Research, 80(2), 203-210. doi:https://doi.org/10.1016/j.fishres.2006.04.009
Wu, K., Otoo, E., Suzuki, K. J. P. A., & Applications. (2009). Optimizing two-pass connected-component labeling
algorithms. 12(2), 117-135. doi:10.1007/s10044-008-0109-y
Xiu, L., Min, S., Qin, H., & Liansheng, C. (2015, 19-22 Oct. 2015). Fast accurate fish detection and recognition of
underwater images with Fast R-CNN. Paper presented at the OCEANS 2015 - MTS/IEEE Washington.
Xu, B., Wang, N., Chen, T., & Li, M. (2015). Empirical Evaluation of Rectified Activations in Convolutional Network.
arXiv e-prints. https://ui.adsabs.harvard.edu/abs/2015arXiv150500853X
Yadav, G., Maheshwari, S., & Agarwal, A. (2014, 24-27 Sept. 2014). Contrast limited adaptive histogram equalization
based enhancement for real time video system. Paper presented at the 2014 International Conference on Advances
in Computing, Communications and Informatics (ICACCI).
Zhao, J., & Qu, J. (2019). Healthy and Diseased Tomatoes Detection Based on YOLOv2, Cham.
Zhou, C., Yang, X., Zhang, B., Lin, K., Xu, D., Guo, Q., & Sun, C. (2017). An adaptive image enhancement method for a
recirculating aquaculture system. Scientific Reports, 7(1), 6243. doi:10.1038/s41598-017-06538-9