Related Experiment Video
Updated: Oct 14, 2026

Accurate and Phenol Free DNA Sexing of Day 30 Porcine Embryos by PCR
Published on: February 14, 2016
Deep-learning-based classification of pig carcasses according to sex
Matteo D'Angelo1, Rocco D'Alterio2, Beatrice Armeni1
1Department of Veterinary Medicine, University of Teramo, Teramo, Italy.
Abstract:
Slaughterhouses provide an opportunity for the automated collection of data from large numbers of animals under standardised conditions. This study investigated the use of deep learning for automated classification of pig carcasses according to sex. A total of 4,219 images of female, entire male and surgically castrated male pigs slaughtered in Italy, Spain and the Netherlands were used. Images were acquired from different perspectives, and the vulva, scrotum or perianal region was annotated according to sex category. A YOLO11m object-detection model was trained and evaluated on an independent test set comprising 672 images from 224 carcasses. Classification performance was assessed both at the single-image level and at the animal level by combining predictions from three views of each carcass. Image-level accuracy was 97.5%, with macro-averaged precision, recall and F1-score of 97.7%, 97.5% and 97.6%, respectively. At the animal level, 219/224 carcasses were correctly classified, corresponding to an accuracy of 97.8%, with macro-averaged precision, recall and F1-score of 97.9%, 98.0% and 97.9%, respectively. All classification errors involved castrated males, particularly their distinction from females, whereas direct confusion between entire males and females did not occur. These results demonstrate the feasibility of deep learning-based sex classification of pig carcasses and support its potential integration into automated slaughterhouse data-collection systems.

