• This study pioneers image-based recognition and lightweight high-precision detection of the big and small ends of eggs. • A novel RepVitASF12 model, built on YOLOv12n, integrates RepVit and ASF modules to achieve optimal accuracy, stability, and efficiency. • RepVitASF12 reached Precision 96.6%, mAP@0.5 99.2%,and mAP@0.5:0.95 69.6%, outperforming comparison models. • The model provides a practical pathway for lightweight, high-accuracy detection in intelligent eggs grading and packaging. Identification of the big and small ends of poultry eggs plays an important role in promoting intelligent packaging, damage reduction, internal quality assurance and freshness. Therefore, it is key to create a high-precision, lightweight, and rapid identification model suitable for identifying the ends of poultry eggs. This study focused on three common types of eggs in the market. An improved version of YOLOv12, named RepVitASF12, was proposed to detect the big and small ends. The backbone and neck are optimized while maintaining standardization. In the backbone, a lightweight vision transformer (ViT) model replaces the original architecture to facilitate deployment. An attentional scale sequence fusion (ASF) structure is introduced that exhibits high recognition accuracy for subtle and difficult-to-identify features. Model fusion significantly enhances the network’s ability to extract and recognize the features of multiple target types. The experimental results demonstrated that RepVitASF12 outperformed YOLOv12 on multiple recognition tasks. Moreover, RepVitASF12 achieved a significant improvement in recognition accuracy (precision), achieving more than 91% for red-, white- and green-shelled eggs. For the big ends of green- and red-shelled eggs, the precision has improved. Ablation studies confirmed the effectiveness of the improved model. Although the FLOPs and model size increased slightly, the inference times for YOLOv12, YOLOv12 + RepVit, YOLOv12 + ASF and RepVitASF12 remained similar. The proposed RepVitASF12 is a high-precision, lightweight deployment potential, and rapid recognition model, and it represents a significant advancement in identifying the ends of poultry eggs, demonstrating its potential for application in automated poultry eggs packaging.
Li et al. (Wed,) studied this question.