Abstract
To address the issues of high breakage rates and substantial labor costs in pigeon egg farming, this study proposes an intelligent pigeon egg recognition and positioning system based on an improved YOLOv12n object detection algorithm and OpenCV barcode recognition technology. Visual sensors installed on feeding machines were used to collect real-time video data of pigeon cages, with images obtained through frame extraction. The images were annotated using LabelImg to construct a pigeon egg detection dataset containing 1500 training images, 215 validation images, and 215 test images. After data augmentation, the dataset was used to train the pigeon egg recognition model. Additionally, customized barcodes were designed according to actual farm conditions and recognized using OpenCV through preprocessing steps including grayscale conversion, filtering, and binarization to extract positional information. Experimental results demonstrate that the proposed YOLOv12n-pg recognition model requires only 4.9 GFLOPS computational load, contains 1.56 M parameters, and has a model size of 3.5 MB, significantly lower than other models in the YOLO-n series. In inference tests, it achieved 99.4% mAP50 and 83.6% mAP50-95. The implementation of a majority voting method in practical testing further reduced the missed detection rate. The system successfully records "cage location-egg count" information as key-value pairs in a database. This system effectively enables automated management of pigeon eggs, improves recognition performance, and demonstrates higher efficiency and accuracy compared to manual operations, thereby establishing a foundation for subsequent research in pigeon egg recognition.