Next Article in Journal
Insights into the Gut Microbial Diversity of Wild Siberian Musk Deer (Moschus moschiferus) in Republic of Korea
Previous Article in Journal
The Effects of Vessel Traffic on the Behavior Patterns of Common Dolphins in the Tagus Estuary (Portugal)
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Communication

Identification and Counting of Pirapitinga Piaractus brachypomus Fingerlings Fish Using Machine Learning

by
Alene Santos Souza
1,
Adriano Carvalho Costa
1,*,
Heyde Francielle do Carmo França
1,
Joel Jorge Nuvunga
2,3,*,
Gidélia Araújo Ferreira de Melo
1,
Lessandro do Carmo Lima
1,
Vitória de Vasconcelos Kretschmer
1,
Débora Ázara de Oliveira
1,
Liege Dauny Horn
1,
Isabel Rodrigues de Rezende
1,
Marília Parreira Fernandes
1,
Rafael Vilhena Reis Neto
4,
Rilke Tadeu Fonseca de Freitas
5,
Rodrigo Fortunato de Oliveira
1,
Pedro Henrique Viadanna
6,
Brenno Muller Vitorino
1 and
Cibele Silva Minafra
1
1
Department of Science Animal, Federal Institute of Education, Science and Technology of Goiás (IF Goiano), Campus Rio Verde, Goiana South Highway, Km 01, Rio Verde 75901-970, GO, Brazil
2
Center of Excellence in Agri-Food Systems and Nutrition, Eduardo Mondlane University, Julius Nyerere, n° 3453, Maputo P.O. Box 257, Mozambique
3
Faculty of Science and Technology, Joaquim Chissano University, Grande Maputo Street, 88, Maputo P.O. Box 1110, Mozambique
4
Department of Science Animal, State University Paulista Júlio de Mesquita Filho, Nelson Brihi Badur, 480, Registro 11900-000, SP, Brazil
5
Department of Science Animal, Federal University of Lavras, Ignácio Valentin, Lavras 37200-900, MG, Brazil
6
Department of Biological Sciences, College of Arts and Sciences, Washington State University, Pullman, WA 99163, USA
*
Authors to whom correspondence should be addressed.
Animals 2024, 14(20), 2999; https://doi.org/10.3390/ani14202999
Submission received: 18 September 2024 / Revised: 11 October 2024 / Accepted: 16 October 2024 / Published: 17 October 2024
(This article belongs to the Section Aquatic Animals)

Simple Summary

Identification and counting of fish are relevant tools for managing the stocking, harvesting, and marketing of farmed fish. Researchers have used convolutional networks for these purposes and employed various approaches to improve network learning. Batch normalization is one technique that enhances network stability and accuracy. The study aimed to evaluate machine learning for identifying and counting pirapitinga Piaractus brachypomus fry with different batch sizes. The researchers used one thousand photographic images of Pirapitinga fingerlings, labeled with bounding boxes. They trained the adapted convolutional network model with batch normalization layers inserted at the end of each convolution block. The training involved one hundred and fifty epochs, with batch sizes for normalization set to 5, 10, and 20.

Abstract

Identifying and counting fish are crucial for managing stocking, harvesting, and marketing of farmed fish. Researchers have used convolutional networks for these tasks and explored various approaches to enhance network learning. Batch normalization is one technique that improves network stability and accuracy. This study aimed to evaluate machine learning for identifying and counting pirapitinga Piaractus brachypomus fry with different batch sizes. The researchers used one thousand photographic images of Pirapitinga fingerlings, labeled with bounding boxes. They trained the adapted convolutional network model with batch normalization layers added at the end of each convolution block. They set the training to one hundred and fifty epochs and tested batch sizes of 5, 10, and 20. Furthermore, they measured network performance using precision, recall, and mAP@0.5. Models with smaller batch sizes performed less effectively. The training with a batch size of 20 achieved the best performance, with a precision of 96.74%, recall of 95.48%, mAP@0.5 of 97.08%, and accuracy of 98%. This indicates that larger batch sizes improve accuracy in detecting and counting pirapitinga fry across different fish densities.

1. Introduction

Identifying and counting fish are relevant tools for managing the stocking, harvesting, and marketing of farmed fish. Researchers have developed several studies to facilitate management and automate fish counting using deep learning with convolutional neural networks (CNNs) [1,2,3]. These tools automate management by reducing or eliminating animal handling, making the process easier, faster, and more accurate than manual methods [4,5].
Manual counting methods involve sampling individuals in containers according to species and their average weight. In commercial fish fry operations, practitioners commonly use estimation methods involving sieves. Alternatively, some techniques involve counting each fry individually. However, these methods have notable drawbacks, including stress and secondary infections in the animals and increased strain on labor, which can lead to errors and reduced accuracy in counting [6].
In aquaculture systems, automating the counting process is less invasive and more effective and accurate than manual methods. Convolutional neural networks offer a promising solution for developing automatic counters, as they can detect and identify fish from images and videos. This approach speeds up handling and reduces the stress and injuries associated with manual counting of animals [7].
Convolutional neural networks, combined with detection algorithms, offer enhanced robustness, speed, and lower computational costs for tasks involving fish recognition, classification, and detection [8,9]. Reports indicate that detecting fish in underwater environments achieved a precision of 95.7% and an average precision (mAP@0.5) of 95.4% using the Yolov5 detection algorithm [6]. These results demonstrate the effectiveness and performance of detection algorithms, allowing for more accurate identification of aquatic animals in complex environments [10,11]. Despite these advantages, challenges remain in learning these algorithms, including issues such as fish occlusions due to high densities, low image quality, and varying lighting conditions.
Researchers have proposed various approaches to address these challenges and enhance the performance and robustness of detection algorithms during training [8,12,13]. One such approach is using the batch normalization layer, which improves network stability and provides greater accuracy and learning performance. Additionally, this technique contributes to model regularization, reducing the risk of overfitting [14]. The optimal batch size varies depending on the task, the specific problem, and available computational resources.
Research on the detection and counting of fish fingerlings is limited. Most studies focus on identifying and recognizing larger underwater marine species in images and videos. Therefore, research that examines normalization and batch size for detecting commercial fingerling species is particularly valuable. Fingerlings from the Serrasalmidae family, which includes economically important South American fish such as pacu, tambaqui, and pirapitinga, as well as their hybrids, play a significant role in Latin America [15,16,17]. Our objective was to evaluate the impact of batch size normalization on the counting of Pirapitinga (Piaractus brachypomus) fingerlings using digital photographic images.

2. Materials and Methods

2.1. Dataset

We collected the dataset for the study at Alevinos Rio Verde in Goiás, Brazil, where the company provided the space and pirapitinga specimens for image collection. We took one thousand images of pirapitinga fingerlings (average length 3.5 cm) from a blue-bottomed tank with a capacity of 25 L and a diameter of 40 cm (Figure 1). We stocked the fish at densities ranging from 10 to 50 fingerlings (Figure 2). We used an iPhone XR with a 12-megapixel camera and a resolution of 4608 × 2592 to capture the images.

2.2. Dataset Labeling

We labeled the digital photographic images using the Roboflow online platform. During the labeling process, we identified each fry in the images by applying bounding boxes (masks) (Figure 3).
A team of 10 trained and experienced individuals labeled the database to minimize errors. We organized the team into two groups. The first group, comprising six undergraduate students from fields such as zootechnics, computer science, and biological sciences, visually analyzed the fish and labeled the specimens with bounding boxes. The second group, consisting of four students from the Postgraduate Programme in Zootechnics, reviewed and corrected the labels after analyzing the images.
The dataset contained images with obstructions and low sharpness, and the water used came from the recirculation system where we cultivated the specimens. We included these images in the training to better evaluate the models’ effectiveness under these conditions and to reflect more practical realities. Before starting the training, we applied preprocessing techniques to the dataset, including resizing, normalizing, and converting the image formats to ensure greater uniformity and quality of the data.
We conducted the training process on a computer equipped with an Intel Core i5-10400 processor at 2.90 GHz (Intel, Santa Clara, CA, EUA), 32 GB of RAM (Dell Inc., Round Rock, TX, EUA), and a 240 GB solid-state drive (SSD) (Kingston Technology, Fountain Valley, CA, EUA). During training, we explored different batch sizes and performed 150 epochs to optimize the model.

2.3. Fingerling Detection and Counting

We used an open-source algorithm from GitHub/Google Colab, which Bochkovskiy et al. (2020) developed, to train the fingerling detection model [18,19]. This CNN represents a state-of-the-art real-time object detection and image segmentation model, incorporating advancements in deep learning and computer vision. Bochkovskiy et al. initially trained it on the COCO (Common Objects in Context) dataset, which includes over 330,000 images with annotations for 80 object categories [20]. The designers created the network for various vision AI tasks such as detection, segmentation, pose estimation, tracking, and classification. Researchers widely use the COCO dataset to train and evaluate state-of-the-art models. The extensive pretraining on this dataset enhances the CNN’s speed and accuracy, making it adaptable to a wide range of applications.
We adopted an algorithmic architecture consisting of three fundamental components: the backbone, the neck, and the head. We pretrained the backbone on the ImageNet dataset to extract features from images through convolutions. The neck then connected the feature maps generated by the backbone to the subsequent layers, while the head made predictions of bounding boxes or masks. We applied batch normalization at the end of each convolutional layer to regularize the inputs, thereby enhancing the network’s efficiency and convergence.
The convolutional network exhibited considerable complexity, featuring 415 layers strategically arranged to ensure precise detection of fingerlings at various scales (Figure 4). During training, we explored various convolutional and concatenation operations to enhance progressive feature extraction. We designed the architecture to capture subtle nuances in images, thereby improving the robustness and accuracy of fingerling detection.
Key parameters of the convolutional network are summarized in Table 1.

2.4. Evaluation of Metrics

We utilized a total of 692 images for training (69%), allocated 194 images for validation (19%), and designated 114 images for testing (11%). Due to computational constraints, specifically the limited capacity of the computer used for training, we did not apply data augmentation techniques. However, the volume of data collected sufficed to assess the models’ generalizability, and we plan to explore this approach further in future studies. We evaluated the performance of the convolutional network using metrics from the confusion matrix: true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). TP indicates correctly identified objects, FP represents incorrectly detected objects, TN refers to the number of instances in which the model correctly predicted the negative class; that is, the model did not detect the fish in the image, and in reality, the image did not actually contain the fish, and FN denotes incorrect predictions of the negative class.
Fish detection was based on the intersection between manually defined bounding boxes and those predicted by the convolutional network, using a threshold of 50% intersection over union (IoU) (Figure 5). The metrics used to evaluate performance include accuracy (A), precision (P), recall (R), and average precision (mAP@0.5).
Accuracy (A) = (TP + TN)/(TP + TN + FP + FN)
Precision (P) = TP/(TP + FP)
Recall (R) = TP/(TP + FN)
Average precision metric (mAP) = 1/N ƩNi=1 A × P

3. Results

In general, we observed that the evaluated metrics—precision, recall, and mAP@0.5—showed lower values with a batch size of 0 (Table 2). As the batch size increased, the metrics tended to improve. A batch size of 20 produced optimal results, achieving a precision of 96.74%, a recall of 95.48%, an mAP@0.5 of 97.08%, and an accuracy of 98%.
Figure 6 shows confusion matrices with rows and columns representing the proportions of false positives, false negatives, true positives, and true negatives. This figure also displays the proportions of predicted values from the trained models. We analyzed the results from these matrices to evaluate the performance and efficiency of the neural network models. In matrices without normalization and with varying batch sizes, we observed that the false negative (FN) rate was higher in batches of 5 and 10 compared to batch 20. Batch 20 demonstrated superior performance in correctly detecting fish, achieving an accuracy of 98% (Figure 7 and Figure 8).

4. Discussion

The detection algorithm exhibited satisfactory performance in recognizing and enumerating pirapitinga fingerlings, as evidenced by the mAP@0.5 values and recall exceeding 95%. This validates the accurate predictability of the tested convolutional network. The resulting values were superior to those reported by [6] who found mAP values of 95.4% and a recall of 88% for fish detection in various cultivation systems. However, the tested network encountered challenges in detecting smaller fish.
Although this study did not evaluate the algorithm’s performance in complex environmental settings, such as underwater conditions, it identified other notable limitations. Obstructions and occlusions among the fingerlings, low sharpness in digital images with higher fish density, and variations in the number of fry within the dataset presented significant challenges. These factors can impact the network’s learning and potentially affect accuracy and other metrics [7,21,22]. Despite these challenges, the evaluated model showed partial success in addressing these issues.
The high density of fry can also increase the rate of false negatives (FN) and false positives (FP) in the models. In this study, the confusion matrix revealed no false positives (FP = 0), but all models exhibited some false negative rates. The 50% threshold approach, combined with supervised dataset labelings, kept these rates minimal and did not compromise the effectiveness of detecting fry accurately [23,24].
Regarding the evaluated batch normalization technique, we found that the precision, recall, and mAP values were lower for the model trained without batch normalization compared to those with it. However, the differences between models with various batch sizes were not significant. Larger batch sizes generally led to better performance in the detection algorithm, enhancing metrics such as precision. Nevertheless, increasing batch sizes also raised computational costs [25,26].
A batch size of 10 achieved a precision of 94.23%, while a batch size of 20 yielded a precision of 96.28% [27] for fish detection and classification using an improved CNN. These values closely match those found in this study, confirming that precision increases with batch size [28]. Research on recognizing and counting fingerlings using detection algorithms shows that small batch sizes up to 20 deliver excellent efficiency and performance without significant computational costs [29,30].
Using a batch size of 20 resulted in better stability and convergence during CNN training, with mAP@0.5 percentages slightly exceeding those of other batch sizes, reaching 97.08%. Thus, to achieve optimal performance in detecting pirapitinga fingerlings, we recommend using a batch size of 20 due to computational limitations. Similar studies suggest starting with a batch size of 32 and adjusting it as necessary to avoid unnecessary computational costs while enhancing the accuracy and efficiency of the trained models [29].
High-quality datasets are crucial for achieving excellent results in CNN learning. Creating these datasets involves time-consuming and laborious labeling work [30,31,32]. In this study, the team carefully monitored the labeling process to prevent errors. The dataset included variations to enhance the robustness of the trained models. We used a total of 1000 images, with fingerling densities ranging from 10 to 50 individuals per tank, to build the training set. The images showed slightly turbid water, and we did not use a lighting system to improve visibility. In contrast, Fernandes et al. (2024) used a lighting system to facilitate visualization, achieving metrics above 99% with a much smaller number of images [33,34,35].
Robust data is essential for ensuring that trained models perform efficiently and practically in real-life situations [36]. Although this study collected data from a controlled environment, the observed adverse variations were sufficient to enhance the robustness of the trained networks [26,37]. Therefore, the experimental conditions and models developed for counting pirapitinga fingerlings through images can replace manual methods commonly used in retail businesses, such as sampling with sieves. In such establishments, staff first count the fingerlings before packaging them for transport, often using less turbid water and improved lighting to facilitate visualization.

5. Conclusions

In conclusion, the results demonstrated that a batch size of 20 yielded superior precision, accuracy, mAP@0.5, and recall outcomes compared to smaller batch sizes, thereby substantiating its efficacy in the detection of fry.

Author Contributions

All authors contributed to the study conception and design. Material preparation, data collection and image labeling A.S.S., J.J.N., L.d.C.L., A.C.C., G.A.F.d.M., V.d.V.K., D.Á.d.O., L.D.H., I.R.d.R., M.P.F. and B.M.V. Development of the detection algorithm H.F.d.C.F. Training neural networks A.S.S. and H.F.d.C.F. Original article writing A.S.S. Review and translation of the article P.H.V., R.V.R.N., R.T.F.d.F., R.F.d.O., J.J.N., C.S.M. and A.C.C. All authors have read and agreed to the published version of the manuscript.

Funding

Center of Excellence in Agri-Food Systems and Nutrition—Eduardo Mondlane University—Mupato, Mozambique. Federal Institute of Goiás, Rio Verde Campus (IF Goiano). Coordination for the Improvement of Higher Education Personnel (CAPES). National Council for Scientific and Technological Development (CNPq). Goiás State Research Support Foundation (FAPEG). Centre of Excellence in Exponential Agriculture (CEAGRE).

Institutional Review Board Statement

This research is in accordance with the ethical principles of animal experimentation adopted by the Animal Use Committee of the Instituto Federal Goiano (CEUA/IF Goiano), Goiás, Brazil (Protocol 6002300124, February 2024).

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Acknowledgments

We would like to thank Alevinos Rio Verde for providing the pirapitinga fingerlings used in this research. The Coordination for the Improvement of Higher Education Personnel (CAPES), for the scholarship awarded to the first author. To the Federal Institute of Goiás, Rio Verde Campus, the Center of Excellence in Agri-food Systems and Nutrition—Eduardo Mondlane University—Mupato, Mozambique, the National Council for Scientific and Technological Development (CNPq), the Goiás State Research Support Foundation (FAPEG) and the Centre of Excellence in Exponential Agriculture (CEAGRE), for their partnership in the research project.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Bessa, W.R.B.; Neto, F.M.M.; Barbosa, V.N.; Leite, D.G.; Braga, O.C.; Moreira, M.W.d.L.; Dos Santos, V.S. Solution based on convolutional neural networks for automatic counting of aquatic animals. In Proceedings of the 2023 18th Iberian Conference on Information Systems and Technologies (CISTI), Aveiro, Portugal, 20–23 June 2023; pp. 1–11. [Google Scholar] [CrossRef]
  2. Weber, F.d.L.; Weber, V.A.d.M.; de Moraes, P.H.; Matsubara, E.T.; Paiva, D.M.B.; Gomes, M.d.N.B.; de Oliveira, L.O.F.; de Medeiros, S.R.; Cagnin, M.I. Counting cattle in UAV images using convolutional neural network. Remote Sens. Appl. Soc. Environ. 2023, 29, 100900. [Google Scholar] [CrossRef]
  3. Zhang, J.; Wang, S.; Zhang, S.; Li, J.; Sun, Y. Research on target detection and recognition algorithm of Eriocheir sinensis carapace. Multimed. Tools Appl. 2023, 82, 42527–42543. [Google Scholar] [CrossRef]
  4. Wang, S.-H.; Hong, J.; Yang, M. Sensorineural hearing loss identification via nine-layer convolutional neural network with batch normalization and dropout. Multimed. Tools Appl. 2020, 79, 15135–15150. [Google Scholar] [CrossRef]
  5. Xuan, K.; Deng, L.; Xiao, Y.; Wang, P.; Li, J. SO-YOLOv5: Small object recognition algorithm for sea cucumber in complex seabed environment. Fish. Res. 2023, 264, 106710. [Google Scholar] [CrossRef]
  6. Li, L.; Shi, G.; Jiang, T. Fish detection method based on improved YOLOv5. Aquac. Int. 2023, 31, 2513–2530. [Google Scholar] [CrossRef]
  7. Babu, K.M.; Bentall, D.; Ashton, D.T.; Puklowski, M.; Fantham, W.; Lin, H.T.; Tuckey, N.P.L.; Wellenreuther, M.; Jesson, L.K. Computer vision in aquaculture: A case study of juvenile fish counting. J. R. Soc. N. Z. 2023, 53, 52–68. [Google Scholar] [CrossRef]
  8. Liu, C.; Gu, B.; Sun, C.; Li, D. Effects of aquaponic system on fish locomotion by image-based YOLO v4 deep learning algorithm. Comput. Electron. Agric. 2022, 194, 106785. [Google Scholar] [CrossRef]
  9. Park, J.-H.; Kang, C. A study on enhancement of fish recognition using cumulative mean of YOLO network in underwater video images. J. Mar. Sci. Eng. 2020, 8, 952. [Google Scholar] [CrossRef]
  10. Patro, K.S.K.; Yadav, V.K.; Bharti, V.S.; Sharma, A.; Sharma, A. Fish Detection in Underwater Environments Using Deep Learning. Natl. Acad. Sci. Lett. 2023, 46, 407–412. [Google Scholar] [CrossRef]
  11. Yang, H.; Shi, Y.; Wang, X. Detection Method of Fry Feeding Status Based on YOLO Lightweight Network by Shallow Underwater Images. Electronics 2022, 11, 3856. [Google Scholar] [CrossRef]
  12. Chen, Y.; Liu, H.; Yang, L.; Yu, H.; Li, D.; Mei, S.; Liu, Y. A lightweight detection method for the spatial distribution of underwater fish school quantification in intensive aquaculture. Aquac. Int. 2023, 31, 31–52. [Google Scholar] [CrossRef]
  13. Wang, Z.; Hua, Z.; Wen, Y.; Zhang, S.; Xu, X.; Song, H. E-YOLO: Recognition of estrus cow based on improved YOLOv8n model. Expert Syst. Appl. 2024, 238, 122212. [Google Scholar] [CrossRef]
  14. Kandel, I.; Castelli, M. The effect of batch size on the generalizability of the convolutional neural networks on a histopathology dataset. ICT Express 2020, 6, 312–315. [Google Scholar] [CrossRef]
  15. Costa, A.C.; Balestre, M.; Botelho, H.A.; De Freitas, R.T.F.; Gomes, R.C.D.S.; Campos, S.A.D.S.; Foresti, F.P.; Hashimoto, D.T.; Martins, D.G.; Prado, F.D.D.; et al. Imputation of genetic composition for missing pedigree data in Serrasalmidae using morphometric data. Sci. Agricola 2017, 74, 443–449. [Google Scholar] [CrossRef]
  16. Costa, A.C.; Serafini, M.A.; Neto, R.V.R.; Santos, P.F.; Marques, L.R.; de Rezende, I.R.; Mendonça, M.A.C.; Allaman, I.B.; de Freitas, R.T.F. Similarity between Piaractus mesopotamicus, Colossoma macropomum and their interspecific hybrids. Aquaculture 2020, 526, 735397. [Google Scholar] [CrossRef]
  17. Ribeiro, F.M.; Lima, M.; da Costa, P.A.T.; Pereira, D.M.; Carvalho, T.A.; Souza, T.V.; Botelho, H.A.; e Silva, F.F.; Costa, A.C. Associations between morphometric variables and weight and yields carcass in Pirapitinga Piaractus brachypomus. Aquac. Res. 2019, 50, 2004–2011. [Google Scholar] [CrossRef]
  18. Source Code YOLOv4—Darknet. Available online: https://github.com/AlexeyAB/darknet (accessed on 20 March 2023).
  19. Google Colaboratory. Available online: https://colab.research.google.com (accessed on 20 March 2023).
  20. Bochkovskiy, A.; Wang, C.; Liao, H. YOLOv4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
  21. Barreiros, M.d.O.; Dantas, D.d.O.; Silva, L.C.d.O.; Ribeiro, S.; Barros, A.K. Zebrafish tracking using YOLOv2 and Kalman filter. Sci. Rep. 2021, 11, 3219. [Google Scholar] [CrossRef]
  22. Kuswantori, A.; Suesut, T.; Tangsrirat, W.; Schleining, G.; Nunak, N. Fish Detection and Classification for Automatic Sorting System with an Optimized YOLO Algorithm. Appl. Sci. 2023, 13, 3812. [Google Scholar] [CrossRef]
  23. Kukil. Intersection over Union (IoU) in Object Detection and Segmentation. Learn OpenCV. Available online: https://learnopencv.com/intersection-over-union-iou-in-object-detection-and-segmentation (accessed on 7 February 2024).
  24. Souza, V.; Araújo, L.; Silva, L.; Santos, A. Análise comparativa de redes neurais convolucionais no reconhecimento de cenas. In Proceedings of the XI Computer on the Beach, Balneário Camburiú, SC, Brazil, 2 September 2020. [Google Scholar]
  25. Knausgård, K.M.; Wiklund, A.; Sørdalen, T.K.; Halvorsen, K.T.; Kleiven, A.R.; Jiao, L.; Goodwin, M. Temperate fish detection and classification: A deep learning based approach. Appl. Intell. 2022, 52, 6988–7001. [Google Scholar] [CrossRef]
  26. Sung, M.; Yu, S.-C.; Girdhar, Y. Vision based real-time fish detection using convolutional neural network. In Proceedings of the OCEANS 2017—Aberdeen, Aberdeen, UK, 19–22 June 2017. [Google Scholar] [CrossRef]
  27. Iqbal, M.A.; Wang, Z.; Ali, Z.A.; Riaz, S. Automatic fish species classification using deep convolutional neural networks. Wirel. Pers. Commun. 2021, 116, 1043–1053. [Google Scholar] [CrossRef]
  28. Ioffe, S.; Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 448–456. [Google Scholar]
  29. Lin, R. Analysis on the selection of the appropriate batch size in CNN neural network. In Proceedings of the 2022 International Conference on Machine Learning and Knowledge Engineering (MLKE), Guilin, China, 25–27 February 2022; pp. 106–109. [Google Scholar] [CrossRef]
  30. Radiuk, P.M. Impact of training set batch size on the performance of convolutional neural networks for diverse datasets. Inf. Technol. Manag. Sci. 2017, 20, 20–24. [Google Scholar] [CrossRef]
  31. Krell, M.M.; Kim, S.K. Rotational data augmentation for electroencephalographic data. In Proceedings of the 2017 39th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Jeju Island, Republic of Korea, 11–15 July 2017; pp. 471–474. [Google Scholar] [CrossRef]
  32. Li, D.; Miao, Z.; Peng, F.; Wang, L.; Hao, Y.; Wang, Z.; Chen, T.; Li, H.; Zheng, Y. Automatic counting methods in aquaculture: A review. J. World Aquac. Soc. 2021, 52, 269–283. [Google Scholar] [CrossRef]
  33. Fernandes, M.P.; Costa, A.C.; França, H.F.D.C.; Souza, A.S.; Viadanna, P.H.d.O.; Lima, L.D.C.; Horn, L.D.; Pierozan, M.B.; de Rezende, I.R.; Medeiros, R.M.d.S.d.; et al. Convolutional Neural Networks in the Inspection of Serrasalmids (Characiformes) Fingerlings. Animals 2024, 14, 606. [Google Scholar] [CrossRef]
  34. Rehman, S.; Gora, A.H.; Ahmad, I.; Rasool, S.I. Stress in aquaculture hatcheries: Source, impact and mitigation. Int. J. Curr. Microbiol. Appl. Sci. 2017, 6, 3030–3045. [Google Scholar] [CrossRef]
  35. Li, W.; Zhu, Q.; Zhang, H.; Xu, Z.; Li, Z. A lightweight network for portable fry counting devices. Appl. Soft Comput. 2023, 136, 110140. [Google Scholar] [CrossRef]
  36. Lyu, K.; Li, Z.; Arora, S. Understanding the Generalization Benefit of Normalization Layers: Sharpness Reduction. arXiv 2022, arXiv:2206.07085. [Google Scholar]
  37. Tsigler, A.; Bartlett, P.L. Benign overfitting in ridge regression. arXiv 2020, arXiv:2009.14286. [Google Scholar]
Figure 1. Collection platform scheme. (h) Height in centimeter (cm); (d) Diameter in cm.
Figure 1. Collection platform scheme. (h) Height in centimeter (cm); (d) Diameter in cm.
Animals 14 02999 g001
Figure 2. Different densities of pirapitinga fingerlings were used in the study. (A) Tank with 10 fingerlings; (B) Tank with 20 fingerlings; and (C) Tank with 30 fingerlings.
Figure 2. Different densities of pirapitinga fingerlings were used in the study. (A) Tank with 10 fingerlings; (B) Tank with 20 fingerlings; and (C) Tank with 30 fingerlings.
Animals 14 02999 g002
Figure 3. Bounding boxes around the fish, created using Labelimg.
Figure 3. Bounding boxes around the fish, created using Labelimg.
Animals 14 02999 g003
Figure 4. Architecture of the convolutional network used in the study. The blocks in blue represent the network’s numerous convolution layers. The grey blocks correspond to the batch normalization (BN) layers that were applied at the end of the convolution blocks. The network starts with the entrance with dimensions 640 × 640 × 3 (height × width × depth). The first part is the backbone and neck, which includes several layers of convolutions and pooling that reduce the spatial dimension of the input image and extract features. The last part is the dense prediction layers which operate in the dimensions 3 × 3 × 1024, allowing for precise and detailed object detection. The blocks representing the convolution layers are connected by arrows, which represent the operations that alter the spatial dimensions, reducing the width and height of the image, maintaining or increasing the number of channels, while the lines indicate the continuous flow of data, preserving the spatial dimensions between successive layers. Adapted from [20].
Figure 4. Architecture of the convolutional network used in the study. The blocks in blue represent the network’s numerous convolution layers. The grey blocks correspond to the batch normalization (BN) layers that were applied at the end of the convolution blocks. The network starts with the entrance with dimensions 640 × 640 × 3 (height × width × depth). The first part is the backbone and neck, which includes several layers of convolutions and pooling that reduce the spatial dimension of the input image and extract features. The last part is the dense prediction layers which operate in the dimensions 3 × 3 × 1024, allowing for precise and detailed object detection. The blocks representing the convolution layers are connected by arrows, which represent the operations that alter the spatial dimensions, reducing the width and height of the image, maintaining or increasing the number of channels, while the lines indicate the continuous flow of data, preserving the spatial dimensions between successive layers. Adapted from [20].
Animals 14 02999 g004
Figure 5. Illustrative scheme of the intersection of the manually defined bounding box (light blue) and that predicted by the network (dark blue). When the overlap (IOU) between them is 50%, the convolutional network identifies the fish as correct.
Figure 5. Illustrative scheme of the intersection of the manually defined bounding box (light blue) and that predicted by the network (dark blue). When the overlap (IOU) between them is 50%, the convolutional network identifies the fish as correct.
Animals 14 02999 g005
Figure 6. Confusion matrix. (a) Without normalization; (b) Model with batch size 5; (c) Model with batch size 10; and (d) Model with batch size 20.
Figure 6. Confusion matrix. (a) Without normalization; (b) Model with batch size 5; (c) Model with batch size 10; and (d) Model with batch size 20.
Animals 14 02999 g006
Figure 7. Images with 30 fingerlings detected by the network through mask prediction (light green). Red circles show false positives.
Figure 7. Images with 30 fingerlings detected by the network through mask prediction (light green). Red circles show false positives.
Animals 14 02999 g007
Figure 8. Fry detected by predicting the delimiting bands using the CNN, in light green. (a) 10 fry detected; (b) 20 fry detected; (c) 30 fry detected; (d) 40 fry detected; (e) 50 fry detected.
Figure 8. Fry detected by predicting the delimiting bands using the CNN, in light green. (a) 10 fry detected; (b) 20 fry detected; (c) 30 fry detected; (d) 40 fry detected; (e) 50 fry detected.
Animals 14 02999 g008
Table 1. Parameters used in the configuration of the convolutional network.
Table 1. Parameters used in the configuration of the convolutional network.
Implementation DetailsParameters
Trainingr0 = 0.01
l rf = 0.1, momentum = 0.937
weight_decay = 0.0005
box = 0.05,
loss ota = 1
Batch size = 5, 10, 20
Max-epochs = 150
Loss_function = BCE (Binary Cross Entropy)
Input_size = 768 × 1024
IOU_thres = 0.45
Table 2. Values of the evaluated metrics in the study according to the application of normalization and batch size.
Table 2. Values of the evaluated metrics in the study according to the application of normalization and batch size.
BatchPrecision (%)Recall (%)mAp@0.5 (%)Accuracy (%)
096.195.3895.6997
596.3795.5996.8197
1096.495.4896.2897
2096.7496.0197.0898
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Souza, A.S.; Costa, A.C.; França, H.F.d.C.; Nuvunga, J.J.; Ferreira de Melo, G.A.; Lima, L.d.C.; Kretschmer, V.d.V.; de Oliveira, D.Á.; Horn, L.D.; Rezende, I.R.d.; et al. Identification and Counting of Pirapitinga Piaractus brachypomus Fingerlings Fish Using Machine Learning. Animals 2024, 14, 2999. https://doi.org/10.3390/ani14202999

AMA Style

Souza AS, Costa AC, França HFdC, Nuvunga JJ, Ferreira de Melo GA, Lima LdC, Kretschmer VdV, de Oliveira DÁ, Horn LD, Rezende IRd, et al. Identification and Counting of Pirapitinga Piaractus brachypomus Fingerlings Fish Using Machine Learning. Animals. 2024; 14(20):2999. https://doi.org/10.3390/ani14202999

Chicago/Turabian Style

Souza, Alene Santos, Adriano Carvalho Costa, Heyde Francielle do Carmo França, Joel Jorge Nuvunga, Gidélia Araújo Ferreira de Melo, Lessandro do Carmo Lima, Vitória de Vasconcelos Kretschmer, Débora Ázara de Oliveira, Liege Dauny Horn, Isabel Rodrigues de Rezende, and et al. 2024. "Identification and Counting of Pirapitinga Piaractus brachypomus Fingerlings Fish Using Machine Learning" Animals 14, no. 20: 2999. https://doi.org/10.3390/ani14202999

APA Style

Souza, A. S., Costa, A. C., França, H. F. d. C., Nuvunga, J. J., Ferreira de Melo, G. A., Lima, L. d. C., Kretschmer, V. d. V., de Oliveira, D. Á., Horn, L. D., Rezende, I. R. d., Fernandes, M. P., Reis Neto, R. V., Freitas, R. T. F. d., Oliveira, R. F. d., Viadanna, P. H., Vitorino, B. M., & Minafra, C. S. (2024). Identification and Counting of Pirapitinga Piaractus brachypomus Fingerlings Fish Using Machine Learning. Animals, 14(20), 2999. https://doi.org/10.3390/ani14202999

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop