Next Article in Journal
Defect Identification of Trinitario Cacao Beans Using Residual Network-50 for Quality Control
Previous Article in Journal
Tagalog Lip-Reading System Using 3D Convolutional Neural Network with Bidirectional Long Short-Term Memory
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Neocaridina (Cherry Shrimp) Sex Identification Using You Only Look Once Version 9 †

by
Joshua Rei Y. Abundo
*,
Jesus Raphael C. Aquino
and
Jocelyn F. Villaverde
School of Electrical, Electronics, and Computer Engineering, Mapua University, Manila 1002, Philippines
*
Author to whom correspondence should be addressed.
Presented at the 7th Eurasia Conference on IoT, Communication and Engineering 2025 (ECICE 2025), Yunlin, Taiwan, 14–16 November 2025.
Eng. Proc. 2026, 134(1), 54; https://doi.org/10.3390/engproc2026134054
Published: 16 April 2026

Abstract

Cherry shrimp (Neocaridina davidi) are a popular ornamental freshwater species known for their bright colors and ability to thrive in a variety of tank environments. However, due to their small size and the subtle differences between males and females, it can be challenging to determine their sex. A You Only Look Once Version 9 (YOLOv9) object identification model and a Raspberry Pi 4-based system are used in this study to infer and classify the sex of cherry shrimp. A graphical user interface facilitates image collection and classification and displays the results. We developed a Raspberry Pi 4-based device with a camera module that captures images of cherry shrimp and integrated a DynamicDet architecture with Programmable Gradient Information and Generalized Efficient Layer Aggregation Networks to classify the sex of cherry shrimp. We evaluated the performance of the model using a confusion matrix to measure the accuracy of the sex classification. A confusion matrix was used to assess the collected data, and the system achieved an accuracy of 85.00%. The researchers suggest expanding the dataset to include more color variations, focusing on adding more robust male shrimp datasets, enabling the device to function without an enclosure, and updating the technology for faster inference.

1. Introduction

Cherry shrimp (Neocaridina davidi) is a popular freshwater shrimp known for its bright colors and ability to thrive in a variety of tank environments [1,2]. Their ease of care and algae-cleaning habits make them a favorite among aquarium hobbyists and breeders. However, distinguishing between male and female cherry shrimp remains a challenge. These shrimps are small. They measure within 1.5 to 2.0 cm in length, and the physical differences between sexes can be subtle, especially in higher-grade color variants where males and females often share similar hues [2,3]. For breeders aiming to manage their cherry shrimp population, being able to accurately tell their sex is essential.
Typically, female cherry shrimp are more vibrant in color, have a rounded underbelly, and may carry a visible “saddle” that indicates egg development. Males, on the other hand, tend to be slimmer, smaller, and less colorful [3]. Techniques in object detection and classification have shown promise in identifying small and similar-looking figures by improving image quality and feature recognition [4]. One of the most promising tools is the You Only Look Once (YOLO) algorithm. YOLO has already been applied to various fields, including animal detection, plant disease classification, and even mosquito sex identification [5,6,7]. YOLOv9 introduces techniques including Generalized Efficient Layer Aggregation Networks (GELAN), Programmable Gradient Information (PGI), and DynamicDet head, which enhance its ability to handle small and complex objects [8,9,10]. These methods have already been applied to tasks involving small objects where manual identification is unreliable, such as identifying rice grains [11]. In other related studies, YOLO-based models have been used successfully in detecting insect species [12], classifying fish sex [13], and identifying shrimp posture [14], showing that such models can generalize well to small aquatic organisms. Furthermore, researchers have shown that preprocessing techniques improve detection performance by enhancing features like shape, edges, and color intensity [4,15]. Image processing algorithms are especially useful when dealing with visually similar objects, since they present key differences used in classification [5].
Due to the cherry shrimp’s small size, differentiating their sexes is difficult, as the only way to determine their sex differences is through examining their physical characteristics, such as body size, shape, and color intensity. Modern object detection algorithms such as YOLO have been applied to object classification of other small organisms but have not yet been applied to cherry shrimp sex identification. This presents a gap that is available for solutions.
Therefore, we developed a Raspberry Pi 4-based device with a camera module that captures images of cherry shrimp by integrating a DynamicDet architecture with PGI and GELAN to classify the sex of cherry shrimp. We evaluated the performance of the model using a confusion matrix to measure the accuracy of the sex classification. The system combines image processing techniques, such as Open-Source Computer Vision Library (OpenCV)’s unsharp mask and gamma correction functions, with object detection for faster and more accurate sex identification. A graphical user interface (GUI) allows users to interact with the device, capture images, and view results, making it useful for researchers, breeders, and visually impaired people.

2. Materials and Methods

2.1. Research Methodology

We developed and evaluated a device capable of classifying the sex of Neocaridina davidi. A Raspberry Pi 4 equipped with a 12-megapixel Camera Module 3 by Raspberry Pi Ltd., manufactured at Pencoed, Wales, UK, was used to capture images of red, yellow, and blue cherry shrimps from various angles, ensuring that the dataset reflected realistic conditions found in breeding tanks [4,15,16]. A confusion matrix was used as the primary statistical method to measure true positives (TP), true negatives (TN), and misclassifications for each sex category. The accuracy of the system was calculated using the confusion matrix to determine how effectively the device identified male and female shrimps [16,17].

2.2. Hardware Components

Figure 1 illustrates the Hardware Block Diagram of the system. The system uses a Raspberry Pi 4, a Raspberry Pi Camera Module V3, and a 4.3 in Waveshare Touchscreen Display Serial Interface LCD by Waveshare, manufactured at Shenzhen, China. The camera module is the input device to capture images of cherry shrimp for object detection. The cherry shrimp sex detection model is processed on the Raspberry Pi 4. To control the system, a graphical user interface (GUI) is used to control the camera to capture a clear photo to be inferred on the pretrained YOLOv9 cherry shrimp sex detection model. The 4.3 Touchscreen LCD allows users to interact with the GUI, as well as display the results of the inference. A power supply provides power to all the components, and the system is stored on an SD card in the Raspberry Pi 4.

2.3. Software Development

The program is designed to run on a Raspberry Pi 4 and begins by initializing the GUI and loading the trained YOLOv9 model. During initialization, it hides GUI elements to set up for the camera preview mode. During the camera preview mode, the system outputs a video feed from the Raspberry Pi Camera Module 3. Users can adjust the focus or run autofocus continuously to capture a clearer image. When an image is captured, it is processed using OpenCV’s unsharp_mask and gamma_correction_bright functions. The YOLOv9 classification model, which has been trained to distinguish between male and female cherry shrimps based on visual traits like size, body shape, and color, runs an inference on the processed image. The sex prediction is then displayed on the touchscreen interface with a bounding box and label, giving immediate feedback to the researchers. After viewing the result, the researchers can either capture a new image to repeat the process or end the session. This loop allows for continuous use of the system, making it easy to scan multiple shrimp in one session.

2.4. Data Gathering

A container is filled using water sourced from the shrimp’s original holding tank to minimize stress and ensure that the shrimp maintains natural coloration and behavior during data collection. Individual cherry shrimps of red, yellow, and blue color variants were placed in the container, one or two at a time, in a well-lit enclosure to ensure clarity in image capture. Using the Raspberry Pi Camera Module 3, images were captured through a GUI. Images of the same cherry shrimp in different positions were taken to help the model learn to recognize the shrimp from different angles. The sex of each shrimp was manually verified and labeled for use in model training and validation. Images were organized into appropriate folders by sex category.

2.5. Model Training and Testing

The dataset is composed of 23,039 self-captured images of 90 shrimp in red, blue, and yellow variations in different positions, to train and validate a YOLOv9-based detection model. The YOLOv9 detection model is trained on 17,919 self-captured cherry shrimp images, augmented to increase the training set to 53,633 images. These images were taken in the enclosure, using the container of the final system to ensure that the model is trained on real-world use cases. Each sample’s predicted sex classification was compared against its actual sex. Figure 2 shows sample images captured.

3. Results and Discussion

We split the dataset into a training set and a test set. A total of 20 cherry shrimps were used to procure the 20 images of cherry shrimps. This test set was used to evaluate the performance of the system. Due to the heavier nature of the YOLOv9 version used, the inferences are rather long, with 10 to 15 s before getting the results. We focused on accuracy over speed. The images taken by the GUI are 1920 × 1080 pixels. To take these photos, we utilized the libcamera Python 3.14 library to leverage the Raspberry Pi Camera Module 3. The GUI enables users to control the clarity of the image with the focus controls and whether to use the image processing. The inference with image processing from a female cherry shrimp is shown in Figure 3. The cherry shrimp is highlighted by the bounding box, with a label of the predicted sex. The GUI shows a label at the bottom of the image, with the list of instances, their labels, and their confidence percentage.
The confusion matrix illustrates the validation data (Table 1). The system correctly predicted male cherry shrimps and female cherry shrimps. However, the female cherry shrimp predictions were predicted as male cherry shrimps.
A c c u r a c y = T P + T N T P + T N + F P + F N × 100 %
To evaluate the accuracy of the trained YOLOv9 model, we referred to the data presented in the confusion matrix. By summing the correct predictions (true positives and true negatives) and dividing this value by the total number of predictions made (true positives, true negatives, false positives, and false negatives), then multiplying the result by 100, we obtained an overall accuracy of 85.00%. This level of accuracy demonstrates that the system is both reliable and effective.

4. Conclusions

We developed a system capable of inferring the sex of cherry shrimps with red, blue, and yellow color variations using the YOLOv9 model, enhanced by OpenCV functions such as unsharp masking and gamma correction. The system fulfills the first research objective by employing a Raspberry Pi 4 and a Raspberry Pi Camera Module 3 to capture images of cherry shrimps. This process is facilitated through a Python-based GUI program that captures and processes the images. GUI integrates a YOLOv9 model trained to detect and classify cherry shrimps according to sex. The use of YOLOv9 satisfies the second research objective, as it is a DynamicDet architecture that incorporates PGI and GELAN techniques. To support the collected data and achieve the third research objective, we employed a confusion matrix. This matrix provides a visual representation of the data and serves as a quantitative tool to assess the system’s ability to detect and classify the sex of cherry shrimps. The evaluation results confirm that the system achieves an accuracy of 85.00%, thereby validating its effectiveness in meeting the research objectives.

Author Contributions

Conceptualization, J.R.Y.A., J.R.C.A. and J.F.V.; methodology, J.R.Y.A., J.R.C.A. and J.F.V.; software, J.R.Y.A. and J.R.C.A.; validation, J.R.Y.A. and J.R.C.A.; data curation, J.R.Y.A. and J.R.C.A.; writing—original draft preparation, J.R.Y.A. and J.R.C.A.; writing—review and editing, J.R.Y.A., J.R.C.A. and J.F.V.; supervision, J.F.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The image dataset used in this study is not publicly available; however, it is available upon reasonable request to the authors.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Rodríguez, D.; Moscoso, M.; Desco, M.; Ripoll, J.; Fernández, R. Development and testing of a sedation protocol for Neocaridina davidi. Sci. Rep. 2024, 14, 9536. [Google Scholar] [CrossRef] [PubMed]
  2. Serezli, R.; Hamzaçebi, S.; Atalar, S.; Kurtoğlu, İ.Z.; Yandi, I. To what extent does temperature affect sex ratio in red cherry shrimp, neocaridina davidi? The scenario global warming to offspring sex ratio. Fresenius Environ. Bull. 2017, 26, 7575–7579. [Google Scholar]
  3. Luna-Vivaldo, I.; Pérez-Legaspi, I.A.; Jiménez-García, M.I.; Ortega-Clemente, L.A.; Pinos, A.L.P. The coloration of Neocaridina davidi (Bouvier, 1904) (Caridea, Atydae) fed with live microalgae Haematococcus pluvialis and the cyanobacteria Spirulina (Arthrospira) platensis. Lat. Am. J. Aquat. Res. 2024, 52, 298–306. [Google Scholar] [CrossRef]
  4. Chan, C.J.L.; Reyes, E.J.A.; Linsangan, N.B.; Juanatas, R.A. Real-time Detection of Aquarium Fish Species Using YOLOv4-tiny on Raspberry Pi 4. In Proceedings of the 4th IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET 2022), Kota Kinabalu, Malaysia, 13–15 September 2022. [Google Scholar]
  5. Thakur, K.; Banerjee, P.; Naaz, F.; Banerjee, P. Real Time Object Detection and Clasification Using Small and Similar Figures in Image Processing. In Proceedings of the 2023 3rd Asian Conference on Innovation in Technology (ASIANCON 2023), Pune, India, 25–27 August 2023. [Google Scholar]
  6. Kittichai, V.; Pengsakul, T.; Chumchuen, K.; Samung, Y.; Sriwichai, P.; Phatthamolrat, N.; Tongloy, T.; Jaksukam, K.; Chuwongin, S.; Boonsang, S. Deep learning approaches for challenging species and sex identification of mosquito vectors. Sci. Rep. 2021, 11, 4838. [Google Scholar] [CrossRef] [PubMed]
  7. Vazquez, N.D.; Delevati-Colpo, K.; Sganga, D.E.; López-Greco, L.S. The Crustacean Society Density and sex segregation effects in the culture of the caridean ornamental red cherry shrimp Neocaridina davidi Bouvier, 1904 (Caridea: Atyidae). J. Crustacean Biol. 2017, 37, 367–373. [Google Scholar]
  8. Balangue, R.D.; Padilla, C.D.M.; Linsangan, N.B.; Cruz, J.P.T.; Juanatas, R.A.; Juanatas, I.C. Ear Recognition for Ear Biometrics Using Integrated Image Processing Techniques via Raspberry Pi. In Proceedings of the 2022 IEEE 14th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2022), Boracay Island, Philippines, 1–4 December 2022. [Google Scholar]
  9. Santo, L.A.G.E.; Placido, R.J.D.; Linsangan, N.B. Potato skin defect detection and classification through image processing. In Proceedings of the Thirteenth International Conference on Graphics and Image Processing (ICGIP 2021), Kunming, China, 18–20 August 2021. [Google Scholar]
  10. Nijjar, R.K.; Tan, J.R.G.; Linsangan, N.B.; Adtoon, J.J. Valgus and Varus Disease Detection using Image Processing. In Proceedings of the 2020 IEEE 12th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2020), Manila, Philippines, 3–7 December 2020. [Google Scholar]
  11. Medina, J.K.; Tribiana, P.J.P.; Villaverde, J.F. Disease Classification of Oranda Goldfish Using YOLO Object Detection Algorithm. In Proceedings of the 2023 15th International Conference on Computer and Automation Engineering (ICCAE 2023), Sydney, Australia, 3–5 March 2023. [Google Scholar]
  12. Cabalar, C.D.; Cleofas, S.M.; Caya, M.V. Identification of Philippine Chili Peppers using Canny Edge Detection and Feed—Forward Artificial Neural Network. In Proceedings of the 2022 IEEE 14th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2022), Boracay Island, Philippines, 1–4 December 2022. [Google Scholar]
  13. Legaspi, J.; Pangilinan, J.R.; Linsangan, N. Tomato Ripeness and Size Classification Using Image Processing. In Proceedings of the 2022 5th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI 2022), Yogyakarta, Indonesia, 8–9 December 2022. [Google Scholar]
  14. Yadao, G.G.; Julkipli, O.M.Y.; Manlises, C.O. Performance Analysis of EfficientNet for Rice Grain Quality Control-An Evaluation against YOLOv7 and YOLOv8. In Proceedings of the 2024 7th International Conference on Information and Computer Technologies (ICICT 2024), Honolulu, HI, USA, 15–17 March 2024. [Google Scholar]
  15. Gamara, R.P.C.; Baldovino, R.G.; Loresco, P.J.M. Image-Based Shrimp Length Determination using OpenCV. In Proceedings of the 2021 IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2021), Manila, Philippines, 28–30 November 2021. [Google Scholar]
  16. Legaspi, K.R.B.; Sison, N.W.S.; Villaverde, J.F. Detection and Classification of Whiteflies and Fruit Flies Using YOLO. In Proceedings of the 2021 13th International Conference on Computer and Automation Engineering (ICCAE 2021), Melbourne, Australia, 20–22 March 2021. [Google Scholar]
  17. Leynes, L.J.D.; Razon, I.C.L.; Caya, M.V.C. Development of Identification System for Cactaceae Plants using YOLO Algorithm. In Proceedings of the 2023 IEEE 5th Eurasia Conference on IOT, Communication and Engineering (ECICE 2023), Yunlin, Taiwan, 27–29 October 2023. [Google Scholar]
Figure 1. Hardware components.
Figure 1. Hardware components.
Engproc 134 00054 g001
Figure 2. Sampled captured cherry shrimp images: (a) female cherry shrimp; (b) male cherry shrimp.
Figure 2. Sampled captured cherry shrimp images: (a) female cherry shrimp; (b) male cherry shrimp.
Engproc 134 00054 g002
Figure 3. System GUI.
Figure 3. System GUI.
Engproc 134 00054 g003
Table 1. Confusion matrix.
Table 1. Confusion matrix.
ObservationPredicted
MaleFemale
Male23
Female015
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

Abundo, J.R.Y.; Aquino, J.R.C.; Villaverde, J.F. Neocaridina (Cherry Shrimp) Sex Identification Using You Only Look Once Version 9. Eng. Proc. 2026, 134, 54. https://doi.org/10.3390/engproc2026134054

AMA Style

Abundo JRY, Aquino JRC, Villaverde JF. Neocaridina (Cherry Shrimp) Sex Identification Using You Only Look Once Version 9. Engineering Proceedings. 2026; 134(1):54. https://doi.org/10.3390/engproc2026134054

Chicago/Turabian Style

Abundo, Joshua Rei Y., Jesus Raphael C. Aquino, and Jocelyn F. Villaverde. 2026. "Neocaridina (Cherry Shrimp) Sex Identification Using You Only Look Once Version 9" Engineering Proceedings 134, no. 1: 54. https://doi.org/10.3390/engproc2026134054

APA Style

Abundo, J. R. Y., Aquino, J. R. C., & Villaverde, J. F. (2026). Neocaridina (Cherry Shrimp) Sex Identification Using You Only Look Once Version 9. Engineering Proceedings, 134(1), 54. https://doi.org/10.3390/engproc2026134054

Article Metrics

Back to TopTop