Deep learning-based facial recognition for identity and sex classification in chicks Authors: Kai Chen, Cong Wu, Ye Wen, Weihai Qiu, Zhijia Luo, Yuyong Ma Published: 2026 ABSTRACT Highlights•Constructed the first facial dataset for Xianghuang chickens with individual identity and sex annotations.•Achieved over 98% Top-1 accuracy in individual identification across five models (ResNet-50, ResNet-101, EfficientNet-B0, EfficientNet-B0+CBAM, and MobileNet-V2) under frontal and side views.•Revealed a biological bottleneck: sex classification from facial features alone peaked at only 71.01% (ResNet-50, side view), with all models exhibiting pronounced overfitting.•Grad-CAM visualization indicated models attended to multiple facial regions including the nasal area and periocular regions for identification. Introduction Amid the rapid expansion of large-scale and intensive poultry farming, precise individual identification and sex determination have become fundamental prerequisites for realizing digital management, smart breeding, and improved animal welfare (Cihan et al., 2026; Zhao et al., 2026). Conventional poultry identification methods primarily rely on physical markers (e.g., leg bands, wing tags) or radio frequency identification technology. However, these approaches are associated with notable limitations: physical markers are susceptible to detachment, abrasion, and human operational errors. Such issues may not only escalate long-term maintenance costs but also induce physiological stress responses in chicks during capture and handling, contradicting contemporary animal welfare standards (Cihan et al., 2026; van Veen et al., 2025). In recent years, non-contact recognition technologies based on computer vision and biometrics have emerged as potential alternatives due to their minimal physical intervention and operational convenience (Cihan et al., 2026; Gao et al., 2025). Deep learning has made significant progress in recognising individual livestock, especially in cattle, sheep, and pigs. Regarding sheep identification, researchers reconstructed datasets and systematically compared 16 state-of-the-art architectures (including EfficientNet and DenseNet), confirming the efficacy of fine-tuning strategies and stacked ensemble methods, thereby elevating recognition accuracy to 93.7% (Cihan et al., 2026). For cattle identification, research has shifted from reliance on coat patterns to leveraging depth data and body conformation features, facilitating the development of breed-agnostic recognition pipelines that achieve high-precision identification even in entirely black or white individuals (Sharma et al., 2025; Ma et al., 2025). Similarly, in swine production, lightweight models integrating attention mechanisms (e.g., Coordinate Attention) with two-stage transfer learning have successfully overcome feature extraction challenges in complex environments, validating the feasibility of non-contact pig face recognition (Yin et al., 2024). However, to situate our work within the existing literature, a preliminary search was conducted across CNKI Scholar, Google Scholar, Scopus, and PubMed (2021-2026) using keywords such as ("chick*" OR "poultry") AND ("facial recognition" OR "individual identification") AND ("deep learning"). Evidence indicates that existing studies predominantly focus on adult livestock or specific large economic animals, leaving a clear gap in facial recognition for chicks - a unique group. Compared to adult chickens, chick facial features are finer and less defined. Moreover, the chick stage represents a critical window for flock segregation, immunization, and early growth performance assessment, imposing stringent demands on real-time capability and accuracy (Qin et al., 2025; Li et al., 2025). Although some studies have addressed non-laying hen detection and abnormal beak recognition in laying hens, these tasks are mostly binary classification or anomaly detection rather than fine-grained identity differentiation among massive individuals (Qin et al., 2025; Li et al., 2025). Furthermore, current poultry vision research largely concentrates on lateral or top-down full-body contours, lacking in-depth exploration of fine-grained facial features (e.g., facial texture, orbital structure) and dedicated model construction. In intensive poultry production, accurate, rapid, and non-invasive chick sex identification is vital for optimizing population management and enhancing production efficiency (Zhao et al., 2026). To meet this demand, researchers have explored diverse technical pathways during both pre-hatch and post-hatch phases. While pre-hatch sexing methods, such as biomarker detection via mass spectrometry (Drouin et al., 2026) and embryonic identification based on gene editing (Chen et al., 2025; Chen et al., 2026), have achieved high accuracy (up to 95.5%), they are generally constrained by high equipment costs, operational complexity, invasiveness, or the need to alter established breeding systems. Conversely, post-hatch research emphasizes automated, non-invasive computer vision methods. Traditional approaches depend on specific genetic phenotypes (e.g., sex-linked barred plumage or rapid/slow feather genes), necessitating the breeding of specific lines through genetic programs, thus limiting their promotion in commercial general-purpose breeds (Cai et al., 2025; Chang et al., 2025; Göhler et al., 2017). Recently, deep learning has been widely applied to directly analyze visual features of one-day-old chicks, utilizing data sources ranging from cloacal and gonadal images to facial imagery (Zhao et al., 2026; Saetiew et al., 2025; Veganzones Rodriguez et al., 2025; Wu et al., 2023). Nevertheless, these deep learning-based visual methods still face severe challenges in real-world farming scenarios: Complex backgrounds, feather occlusion, motion blur, and illumination variations significantly compromise model robustness (Zhao et al., 2026; Chang et al., 2025). More critically, model performance heavily relies on large-scale, high-quality labeled data, which are expensive to acquire (Zhao et al., 2026; Veganzones Rodriguez et al., 2025; Zhu et al., 2025). Although transfer learning strategies utilizing ImageNet pre-trained weights partially alleviate overfitting and accelerate convergence (Zhu et al., 2025), direct migration of mature architectures (e.g., ResNet, EfficientNet, You Only Look Once [YOLO] series) to chick facial recognition tasks often encounters inherent challenges such as insufficient feature resolution and high phenotypic similarity among juvenile individuals. In summary, while deep learning exhibits immense potential in livestock identity recognition, research on specialized facial recognition systems for chicks remains under-explored. Therefore, the primary innovations of this study are threefold: (1) Focusing on the locally distinctive Xianghuang chicken breed, we constructed the first facial dataset for day-old chicks featuring individual identity and sex annotations. (2) By employing multiple cameras to capture frontal and side views, we significantly enhanced model robustness against pose variations. (3) Utilizing multiple advanced CNN architectures and CNN-attention fusion strategies, we simultaneously investigated individual identification and sex classification, providing a comprehensive benchmark, thereby addressing an underexplored application area in the digitalization of early-stage fine-grained individual management within poultry farming. Materials and methods Experimental design The experiment was conducted at the Xianghuang chicken pedigree farm in Hengyang, Hunan Province, utilizing the locally distinctive Xianghuang chickens as the research subject. At the onset of the trial, one-day-old chicks underwent preliminary sex screening via the cloacal vent sexing method performed by experienced technicians, which yields an approximate accuracy of 95%. Subsequently, 180 male and 180 female chicks were selected and fitted with individual wing bands as unique identifiers. To ensure label accuracy, a secondary manual sex confirmation was conducted at six weeks of age based on comb developmental characteristics, thereby verifying the definitive sex of the chicks. To acquire high-quality frontal and side images, three identical smartphones (iPhone 16 Pro) were deployed to synchronously capture videos from different angles (Fig. 1A). The shooting environment consisted of an enclosed darkroom illuminated solely by a 15 W cool-white LED light with a color temperature of approximately 6000 K, positioned 2 meters from the cameras, with black cardboard laid out as the background to minimize reflections and interference. To reduce inter-device variability, all smartphones were operated in manual/professional mode, with auto-HDR, Night Mode, and Live Photo functions disabled. The key imaging parameters were configured as follows: the camera-to-face distance was fixed at 0.6 m; ISO was set to 80; shutter speed (exposure time) was 1/120 s; white balance was manually adjusted to 6000 K; and focus distance was locked at 0.6 m. The three devices were mounted on tripods with their optical axes aligned horizontally with the chick’s head, capturing frontal (0°) and bilateral side views (approximately ±45°). During filming, an operator held each chick manually, maintaining postural stability while slowly rotating it from left to right, allowing the chick’s face to pass sequentially through the field of view of each lens. Video acquisition was set at 30 fps, with a recording duration of 10 seconds per chick, resulting in approximately 60 minutes of raw 720p footage.Fig. 1Experimental design and image collection.Fig. 1 dummy alt text Experimental design and image collection. Note: Panel (a) illustrates the schematic diagram of the shooting setup, where three cameras are arranged at 120° angles to capture videos of hand-held chicks. Panel (b) presents examples of image screening, demonstrating the selection of qualified frontal and side face images and the exclusion of unqualified samples. Image collection and preprocessing Image collection and dataset construction PotPlayer (Version 240812) was used to extract frames one by one. Given that images were captured synchronously by three cameras, the raw dataset comprised approximately 108,000 images per camera view, totaling 324,000 raw frames. Initially, a pilot subset was randomly selected from this pool, comprising 116 qualified frontal images, 92 qualified side images, and 509 discarded images (due to blank images, blurriness, or abnormal posture). These 717 images formed the initial training set, shown in Fig. 1B. Subsequently, the labeled subset was used to train an EfficientNet-B0 network for training, and the trained model generated preliminary predictions for the remaining unlabeled images. Misclassified images identified by the model were manually corrected and merged back into the training set. This iterative refinement process was repeated five times, and the final classification results were manually verified to ensure accuracy. To further ensure clarity and minimize temporal redundancy, frames were sampled at 10-frame intervals from the qualified frontal and side images captured by the three iPhones. Ultimately, a total of 6,024 qualified chick facial images were obtained, comprising 4,073 frontal images (with distributions of 1,045, 1,784, and 1,244 across the three cameras) and 1,951 side images (537, 887, and 527, respectively). It is important to note that while 360 chicks were initially selected, not all individuals contributed qualified images to both datasets. Operational constraints during manual handling occasionally prevented stable postures or proper orientation toward the cameras, resulting in insufficient samples for specific views. Consequently, these individuals were partially or entirely excluded from the final curated datasets, accounting for the discrepancy in individual counts (detailed statistics provided in Table 1).Table 1Distribution of frontal and side images across male and female chicks.Table 1 dummy alt textFemaleMaleFrontal imagesSide imagesFrontal imagesSide imagesTotal images243512751638881Total individuals1548211755Mean images/individual16151416Max images/individual25312725Min images/individual1110109 Table 1Distribution of frontal and side images across male and female chicks.Table 1 dummy alt textFemaleMaleFrontal imagesSide imagesFrontal imagesSide imagesTotal images243512751638881Total individuals1548211755Mean images/individual16151416Max images/individual25312725Min images/individual1110109 Distribution of frontal and side images across male and female chicks. Image cropping The open-source annotation tool LabelImg was used to annotate bounding boxes for chick faces in the screened qualified frontal and side images, yielding annotations for 380 frontal and 200 side images, corresponding to a total of 1,420 annotated chick face instances. To automate chick facial detection and cropping, a YOLOv8 object detection model was trained on this dataset. On the validation set, the model achieved a mean Average Precision (mAP)@0.5 of 99.5% for frontal views and 99.6% for side views, and an mAP@0.5:0.95 of 87.2% and 88.1%, respectively. These results demonstrate that the detection performance is sufficiently reliable for downstream face cropping. Following detection and cropping, all face images were uniformly resized to 224 × 224 pixels, resulting in a finalized chick facial dataset with consistent dimensions. The overall processing pipeline is illustrated in Fig. 2.Fig. 2Automatic detection and cropping of chick faces based on the YOLOv8 model.Fig. 2 dummy alt text Automatic detection and cropping of chick faces based on the YOLOv8 model. Dataset partitioning Across all tasks, the dataset was partitioned into training and validation sets at an 8:2 ratio. For individual identification, this split was performed at the image level in a closed-set manner, ensuring that images from the same individuals (including both frontal and side views) co-existed in both subsets. In contrast, for the sex classification task, a subject-independent partitioning strategy was adopted, strictly separating images of the same chick between the training and validation sets to prevent data leakage. Model comparison for sex and identity recognition To systematically evaluate the adaptability and generalization performance of different deep learning architectures in chick sex determination and individual identity recognition tasks, this study established a comparative framework comprising five typical network models. Specifically, the models included classic deep residual networks (ResNet-50, ResNet-101), lightweight convolutional networks (MobileNetV2, EfficientNet-B0), and an improved model incorporating an attention mechanism (EfficientNet-B0 integrated with the Convolutional Block Attention Module (CBAM)). To address practical issues in our dataset, including complex lighting, unstable imaging from mobile devices, and chick pose variations, and to enhance data generalization, this study implemented multi-dimensional online data augmentation strategies during training. Random Resized Crop and Random Horizontal Flip were applied to simulate diverse poultry postures, while Color Jittering was introduced to mimic brightness and contrast distortions, thereby enhancing the models' robustness to complex environments. All models were initialized with ImageNet-1K pre-trained weights. For ResNet-50, ResNet-101, MobileNetV2, and vanilla EfficientNet-B0, the backbone was frozen during fine-tuning and only the classification head was trained to mitigate overfitting. For the EfficientNet-B0+CBAM variant, the pre-trained EfficientNet-B0 backbone was frozen, while both the inserted CBAM modules and the classification head were fine-tuned, allowing the attention mechanism to adapt to the target task. All experiments were implemented in Python 3.9 using PyTorch (1.13.1) and TIMM (0.9.2), conducted on a system equipped with an AMD Ryzen 7 7840H processor, 16 GB RAM, and an NVIDIA GeForce RTX 4070 Laptop GPU (8 GB). To ensure full reproducibility, the global random seed was fixed at 42 across random, NumPy, and PyTorch(CPU/CUDA). The five architectures comprised ResNet-50 (approximately 25.6 million parameters), ResNet-101 (approximately 44.5 million), MobileNetV2 (approximately 3.5 million), EfficientNet-B0 (approximately 5.3 million), and EfficientNet-B0+CBAM (approximately 5.5 million total; the CBAM module introduces an additional 0.21 million parameters). During fine-tuning, trainable parameters were limited to the classification head for the sex task (0.17–0.27 million for baselines; 0.38 million for CBAM) and to the embedding plus classification layers for the identity task (0.56–0.84 million for baselines; 0.77 million for CBAM). Mixed-precision training (AMP) was enabled throughout. For the sex classification task, frontal and side views were treated as separate experiments, with five models trained independently per view. Each model ran for a maximum of 30 epochs with early stopping (patience = 6), typically converging within 12–18 epochs. On the specified hardware, training a single model (single view) took approximately 0.3–0.7 hours, and the full comparison across both views completed within approximately 5 hours. For the individual identification task, frontal (218 identities) and side (89 identities) views were also treated as separate experiments. Models were trained for 100 epochs with a Cosine Annealing scheduler. Training a single model (single view) required approximately 0.5–1.0 hours, and the complete frontal and side comparisons across all five models concluded within approximately 8 hours. Across both tasks, the inference speed of the optimized models reached 120 frames per second (FPS) at 224 × 224 resolution. The overall structure is illustrated in Fig. 3.Fig. 3Network flow diagrams of different deep learning architectures for chick sex determination and individual identity recognition.Fig. 3 dummy alt text Network flow diagrams of different deep learning architectures for chick sex determination and individual identity recognition. Sex classification task configuration For the chick sex binary classification task, this study constructed a comparative framework comprising baseline models and an attention-enhanced model. For the baseline models (ResNet-50, ResNet-101, MobileNetV2, and EfficientNet-B0), input images were first processed by the backbone network to extract features. These features then sequentially passed through a Global Average Pooling (GAP) layer, a Flatten layer, and a Fully-connected Head to output prediction probabilities. For the EfficientNet-B0 + CBAM model, CBAM was integrated at the end of the backbone. This module sequentially applied Channel Attention and Spatial Attention to adaptively weight the feature maps, thereby enhancing the model's ability to focus on sex-discriminative regions. Given the subtle facial sex differences in chicks, all pre-trained backbone networks were kept frozen except for the CBAM module. Only the classification head was fine-tuned end-to-end to prevent overfitting given the small sample size. Model training employed a subject-independent partitioning strategy, strictly ensuring that all images of a single chick appeared exclusively in either the training set or the validation set, thereby eliminating data leakage. Focal Loss was employed with γ=2.0 and α set to class-balanced weights (α_female=0.84, α_male=1.24 for the frontal training set; α_female=0.85, α_male=1.22 for the side training set). By reducing the weight of easily classified negative samples and focusing on hard-to-classify samples, this approach alleviated potential class imbalance issues and improved the model's recognition capability for minority classes. The AdamW optimizer was employed with default β₁=0.9, β₂=0.999, ε=1e⁻⁸. Training was set with a maximum of 30 epochs, and an Early Stopping mechanism was introduced: training early stopping was triggered if the validation accuracy did not improve significantly for six consecutive epochs. Additionally, Dropout regularization (p=0.5) was embedded in the fully connected layers to reduce model complexity and mitigate overfitting risk. All comparative models were trained with a uniform configuration, utilizing a batch size of 16 and a learning rate of 0.00005. Identity recognition task configuration In response to the fine-grained nature of chick individual identification, targeted adjustments were made to the network structure to extract more discriminative features. For the baseline models (ResNet-50, ResNet-101, MobileNetV2, EfficientNet-B0), features extracted by the backbone network were directly fed into an embedding layer. For the EfficientNet-B0 + CBAM model incorporating the attention mechanism, a CBAM module was added after the backbone for feature recalibration before passing through an average pooling layer into the embedding layer. The embedding layer mapped high-dimensional features (e.g., 1280 dimensions) into a 512-dimensional vector space, incorporating ReLU activation and Dropout regularization, and ultimately outputted individual identification results via a Softmax classifier. The identification task comprised 307 distinct chick identities, including 218 frontal identities and 89 side identities (without sex separation). The dataset was partitioned into training and validation sets at an 8:2 ratio at the image level in a closed-set manner, ensuring that images from the same individuals (including both frontal and side views) co-existed in both subsets. To address class imbalance, class weights were incorporated into the Cross-Entropy Loss to mitigate bias. The AdamW optimizer was employed with hyperparameters identical to those used in the sex classification task. Specifically, the initial learning rate was set to 0.001, and the weight decay coefficient was set to 0.0001. A Cosine Annealing learning rate scheduler (T_max=100 epochs) was used without warm-up. The training was run for a maximum of was set to 100 epochs, with an early stopping mechanism triggered if the validation accuracy did not improve for 10 consecutive rounds. Model evaluation To measure the performance of the proposed models on both chick sex identification and individual identification tasks, this study adopts commonly used multi-dimensional evaluation metrics for classification tasks to conduct quantitative assessments. Specifically, sex identification is a binary classification task, while individual identification is a multi-class classification task; confusion matrices were constructed for both, and corresponding metrics were calculated. Evaluation of sex recognition task For the binary classification sex recognition task (Female as the negative class, Male as the positive class), the prediction results and ground truth labels constitute the following confusion matrix:Predicted Negative (Female)Predicted Positive (Male)Actual Negative (Female)TN (True Negative)FP (False Positive)Actual Positive (Male)FN (False Negative)TP (True Positive) Predicted Negative (Female)Predicted Positive (Male)Actual Negative (Female)TN (True Negative)FP (False Positive)Actual Positive (Male)FN (False Negative)TP (True Positive) Based on the confusion matrix, the following metrics were calculated: Accuracy: The proportion of correctly predicted samples among all samples.Accuracy=TP+TNTP+TN+FN+FP Precision: The proportion of samples predicted as male that are actually malePrecision=TPTP+FP Recall: The proportion of actual male samples that are correctly identified.Recall=TPTP+FN F1 Score: The harmonic mean of Precision and Recall, comprehensively measuring the stability of sex recognition.F1=2×Precision×RecallPrecision+Recall AP (Average Precision): Area under the precision-recall curveAP=∑k−1n(Rk−Rk−1)×P(k) Individual identification task evaluation Individual identification constitutes a multi-class classification task. The model evaluation adopts a combined approach of Overall Accuracy and Macro-averaging to balance global recognition performance with individual fairness. Let N denote the total number of individuals, M the total number of samples, Pi, Ri and F1i the precision, recall, and F1 score for the i-th individual. respectively, and C the total number of correctly predicted samples. TPi represents the number of samples correctly predicted for the i-th individual. The metrics are defined as follows:Top_1Acc=∑j=1M1(y^j=yj)M Where y^j=argmaxcP(c|xj) is the predicted class with the highest probability for the j-th sample, and1(.) is the indicator function.Top_5Acc=∑j=1M1(yj∈Top_5(xj))M Where Top_5(xj) denotes the set of five classes with the highest predicted probabilities for sample xj. Matthews Correlation Coefficient (MCC):MCC=c×s−∑i=1Npiti(s2−∑i=1Npi2)×(s2−∑i=1Nti2) Where s=M is the total number of samples, pi is the number of samples predicted as the i-th individual, ti is the number of samples truly belonging to the i-th individual, and c=∑i=1NTPi is the total number of correctly classified samples.MacroPrecision=1N∑i=1NPiMacroRecall=1N∑i=1NRiMacroF1=1N∑i=1NF1i Confusion pattern of misclassification and confusion matrix and feature space visualization using t-SNE Confusion matrix visualization To comprehensively evaluate the classification performance of each model, confusion matrices were generated for both frontal and side views. For each model, the confusion matrices from all five folds were aggregated to obtain a total confusion matrix. The aggregated confusion matrix was then normalized row-wise to represent the classification accuracy for each true class. Specifically, given the aggregated confusion matrix CM where CMj represents the number of samples with true label i predicted as label j, the normalized confusion matrix CMnorm was computed as:CMnorm(i,j)=CMij∑kCMik The normalized confusion matrices for all five networks (ResNet-50, ResNet-101, EfficientNet-B0, EfficientNet-B0+CBAM, and MobileNet-V2) were visualized in a 2 × 5 grid layout, with rows representing the view (frontal and side) and columns representing the network architecture. A unified color bar indicating normalized frequency was placed on the right side of the figure. The sample size n for each view was calculated as the average number of validation samples per fold. Confusion Pattern of Misclassification To further analyze the error distribution patterns among different individuals, a confusion pattern visualization of misclassification was designed. Unlike the traditional confusion matrix that displays all predictions including correct ones, this approach exclusively visualizes the misclassified samples to highlight the error patterns. For each model-view combination, the confusion matrix CM was first computed from the validation predictions. The diagonal elements (correct classifications) were then set to zero to obtain the error-only matrix CMerror:CMerror_norm(i,j)=CMerror(i,j)∑k≠iCMerror(i,k) In the visualization, each off-diagonal point (i,j) represents a misclassification event where samples from individual i were incorrectly predicted as individual j. The circle size is proportional to the absolute number of misclassified samples, and the color intensity represents the normalized error proportion. A dashed diagonal line was retained as a reference. All five networks were arranged in a 2 × 5 grid (frontal view on top, side view on bottom), with unified color normalization across all subplots to ensure comparability. A shared color bar indicating "Error Proportion" was placed on the right side of the figure. Feature space visualization using t-SNE To investigate the discriminative capability of the learned features in the embedding space, t-Distributed Stochastic Neighbor Embedding (t-SNE) was employed to reduce the high-dimensional feature vectors to a two-dimensional space for visualization. For each fold in the 5-fold cross-validation, the best-performing model checkpoint was loaded, and features were extracted from the penultimate embedding layer (256-dimensional) for all validation samples. The features from all five folds were then concatenated to form the complete feature set. The t-SNE transformation was performed with 2 components, a perplexity of 30, a learning rate of 200, and 1000 iterations, with the random state fixed at 42 for reproducibility. The reduced two-dimensional features were visualized as scatter plots, where each point represents a validation sample. Points were colored according to their true class labels. All five networks were arranged in the same 2 × 5 grid layout as the confusion matrices, with rows representing views and columns representing network architectures. Gradient-weighted class activation mapping attention heatmaps To investigate the recognition mechanisms of the models regarding chick facial features for sex and individual identity, this study employed Gradient-weighted Class Activation Mapping (Grad-CAM) technology to generate attention heatmaps for the EfficientNet-B0 and EfficientNet-B0+CBAM networks, respectively. By visualizing the feature response regions of the models, a comparative analysis was conducted on their focus levels concerning key discriminative areas of chick faces (such as the nares, periocular regions, and beak). This provided exploratory insights into the model's interpretability and feature attribution. The target layer for gradient computation was defined as the last convolutional block preceding the global average pooling layer of the EfficientNet-B0 architecture. Input images were preprocessed identically to the training phase. The resulting activation maps were subjected to ReLU activation to retain only positive influences, followed by min-max normalization to scale pixel intensities to the range [0, 1]. The heatmaps were then overlaid onto the original images using a jet colormap with an opacity of 0.4. For visualization, 20 representative images were randomly selected from the test set, encompassing both correctly and incorrectly classified samples, to comprehensively evaluate the model's attention behavior. Results Results of chick facial sex classification Loss function curves As shown in Fig. 4, the loss curves on the training set decreased gradually; however, the loss curves on the validation set slowly rose, indicating a certain degree of overfitting (final generalization gap > 2). Meanwhile, the training accuracy of all networks exhibited an upward trend, whereas the validation accuracy showed almost no improvement. Concurrently, early stopping was triggered between epochs 8 and 12.Fig. 4Loss and accuracy curves with generalization gap for sex classification models.Fig. 4 dummy alt text Loss and accuracy curves with generalization gap for sex classification models. Comparison of evaluation metrics As presented in Table 2, the performance of five deep learning models for chick gender classification was compared under frontal and side viewing conditions. All models were evaluated using 5-fold group cross-validation, with results reported as mean ± standard deviation along with 95% confidence intervals. For the frontal view, significant differences among models were observed in Accuracy (p = 0.003) and Precision (p = 0.004). ResNet101 achieved the highest Accuracy of 0.6887 ± 0.0592 [0.6152, 0.7622], significantly outperforming EfficientNet-B0 (0.6285 ± 0.0605) and EfficientNet-B0-CBAM (0.6327 ± 0.0623). The Precision results followed a similar pattern, with ResNet101 (0.6020 ± 0.0780) significantly superior to EfficientNet-B0 (0.5369 ± 0.1099) and EfficientNet-B0-CBAM (0.5356 ± 0.0981). For the side view, significant differences were detected only in Accuracy (p = 0.018). ResNet50 achieved the highest Accuracy of 0.7101 ± 0.0711 [0.6219, 0.7984], significantly outperforming EfficientNet-B0 (0.6234 ± 0.0622).Table 2Comparative performance of different models for chick sex identification.1.Table 2 dummy alt textResnet50Resnet101EfficientNet-B0EfficientNet-B0+CBAMMobilenet-v2P-value2FrontalAccuracy0.6659±0.0690ab [0.5802,0.7516]0.6887±0.0592a [0.6152,0.7622]0.6285±0.0605b [0.5534,0.7037]0.6327±0.0623b [0.5553,0.7101]0.6533±0.0358ab [0.6088,0.6978]0.003Precision0.5587±0.1033ab [0.4304,0.6870]0.6020±0.0780a [0.5052,0.6989]0.5369±0.1099b [0.4004,0.6734]0.5356±0.0981b [0.4138,0.6575]0.5584±0.0875ab [0.4497,0.6670]0.004Recall0.6185±0.1451 [0.4383,0.7987]0.6123±0.1645 [0.4081,0.8165]0.6570±0.0860 [0.5502,0.7638]0.6183±0.0533 [0.5522,0.6845]0.6345±0.1023 [0.5074,0.7615]0.809F1_Score0.5866±0.1219 [0.4353,0.7379]0.6007±0.1060 [0.4691,0.7324]0.5832±0.0608 [0.5077,0.6587]0.5716±0.0718 [0.4824,0.6608]0.5886±0.0684 [0.5037,0.6736]0.750Average Precision0.5611±0.1234 [0.4078,0.7143]0.6126±0.0980 [0.4909,0.7343]0.5958±0.0815 [0.4946,0.6969]0.5756±0.0927 [0.4605,0.6907]0.5802±0.0947 [0.4627,0.6978]0.091SideAccuracy0.7101±0.0711a [0.6219,0.7984]0.6619±0.0805ab [0.5620,0.7618]0.6234±0.0622b [0.5462,0.7006]0.6327±0.0848ab [0.5274,0.7379]0.6573±0.0811ab [0.5566,0.7580]0.018Precision0.6322±0.0844 [0.5274,0.7369]0.5699±0.0650 [0.4891,0.6506]0.5284±0.0995 [0.4048,0.6520]0.5457±0.1083 [0.4112,0.6801]0.5679±0.1239 [0.4140,0.7218]0.066Recall0.6709±0.1533 [0.4805,0.8612]0.6423±0.1356 [0.4739,0.8106]0.6297±0.0708 [0.5417,0.7176]0.6808±0.0917 [0.5670,0.7947]0.5842±0.1394 [0.4110,0.7573]0.475F1_Score0.6444±0.1005 [0.5196,0.7692]0.6014±0.0905 [0.4891,0.7138]0.5727±0.0850 [0.4672,0.6782]0.5991±0.0769 [0.5037,0.6946]0.5736±0.1271 [0.4157,0.7314]0.193Average Precision0.6790±0.1040 [0.5498,0.8081]0.6222±0.0810 [0.5217,0.7228]0.5819±0.0761 [0.4874,0.6763]0.5548±0.1359 [0.3861,0.7236]0.6202±0.1022 [0.4934,0.7471]0.0511All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation.2Different lowercase letters within the same row indicate statistically significant differences (p ≤ 0.05) based on Nemenyi post-hoc test following a significant Friedman test. Models sharing at least one common letter are not significantly different from each other. Table 2Comparative performance of different models for chick sex identification.1.Table 2 dummy alt textResnet50Resnet101EfficientNet-B0EfficientNet-B0+CBAMMobilenet-v2P-value2FrontalAccuracy0.6659±0.0690ab [0.5802,0.7516]0.6887±0.0592a [0.6152,0.7622]0.6285±0.0605b [0.5534,0.7037]0.6327±0.0623b [0.5553,0.7101]0.6533±0.0358ab [0.6088,0.6978]0.003Precision0.5587±0.1033ab [0.4304,0.6870]0.6020±0.0780a [0.5052,0.6989]0.5369±0.1099b [0.4004,0.6734]0.5356±0.0981b [0.4138,0.6575]0.5584±0.0875ab [0.4497,0.6670]0.004Recall0.6185±0.1451 [0.4383,0.7987]0.6123±0.1645 [0.4081,0.8165]0.6570±0.0860 [0.5502,0.7638]0.6183±0.0533 [0.5522,0.6845]0.6345±0.1023 [0.5074,0.7615]0.809F1_Score0.5866±0.1219 [0.4353,0.7379]0.6007±0.1060 [0.4691,0.7324]0.5832±0.0608 [0.5077,0.6587]0.5716±0.0718 [0.4824,0.6608]0.5886±0.0684 [0.5037,0.6736]0.750Average Precision0.5611±0.1234 [0.4078,0.7143]0.6126±0.0980 [0.4909,0.7343]0.5958±0.0815 [0.4946,0.6969]0.5756±0.0927 [0.4605,0.6907]0.5802±0.0947 [0.4627,0.6978]0.091SideAccuracy0.7101±0.0711a [0.6219,0.7984]0.6619±0.0805ab [0.5620,0.7618]0.6234±0.0622b [0.5462,0.7006]0.6327±0.0848ab [0.5274,0.7379]0.6573±0.0811ab [0.5566,0.7580]0.018Precision0.6322±0.0844 [0.5274,0.7369]0.5699±0.0650 [0.4891,0.6506]0.5284±0.0995 [0.4048,0.6520]0.5457±0.1083 [0.4112,0.6801]0.5679±0.1239 [0.4140,0.7218]0.066Recall0.6709±0.1533 [0.4805,0.8612]0.6423±0.1356 [0.4739,0.8106]0.6297±0.0708 [0.5417,0.7176]0.6808±0.0917 [0.5670,0.7947]0.5842±0.1394 [0.4110,0.7573]0.475F1_Score0.6444±0.1005 [0.5196,0.7692]0.6014±0.0905 [0.4891,0.7138]0.5727±0.0850 [0.4672,0.6782]0.5991±0.0769 [0.5037,0.6946]0.5736±0.1271 [0.4157,0.7314]0.193Average Precision0.6790±0.1040 [0.5498,0.8081]0.6222±0.0810 [0.5217,0.7228]0.5819±0.0761 [0.4874,0.6763]0.5548±0.1359 [0.3861,0.7236]0.6202±0.1022 [0.4934,0.7471]0.0511All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation.2Different lowercase letters within the same row indicate statistically significant differences (p ≤ 0.05) based on Nemenyi post-hoc test following a significant Friedman test. Models sharing at least one common letter are not significantly different from each other. Comparative performance of different models for chick sex identification.1. All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation. Different lowercase letters within the same row indicate statistically significant differences (p ≤ 0.05) based on Nemenyi post-hoc test following a significant Friedman test. Models sharing at least one common letter are not significantly different from each other. Confusion matrix analysis The confusion matrices for the five networks under frontal and side views are presented in figure 5. For frontal view images, among the five evaluated networks, ResNet-101 achieved the highest correct classification rate for female chicks at 73.06%, whereas EfficientNet-B0 attained the highest correct classification rate for male chicks at 65.02%. In contrast, for side view images, ResNet-50 demonstrated the most balanced and superior performance across both categories, achieving the highest correct classification rates of 72.55% for female chicks and 68.79% for male chicks.Fig. 5Confusion matrix analysis of frontal and side chick faces for sex identification.Fig. 5 dummy alt text Confusion matrix analysis of frontal and side chick faces for sex identification. Feature space visualization using t-SNE The t-SNE visualizations of feature distributions for the five networks under frontal and side views are illustrated in figure 6. For frontal view images, the feature points of female and male chicks across all five networks generally formed an integrated cluster, indicating considerable overlap in the learned feature representations. Notably, the EfficientNet-B0+CBAM network exhibited a more pronounced outward diffusion trend for male feature points compared to the baseline EfficientNet-B0. For side view images, EfficientNet-B0, EfficientNet-B0+CBAM, and MobileNet-V2 showed a tendency for female and male feature points to occupy different spatial regions, suggesting that side-view facial characteristics may provide more gender-discriminative cues for these architectures.Fig. 6Feature space visualization using t-SNE of frontal and side chick faces for sex identification.Fig. 6 dummy alt text Feature space visualization using t-SNE of frontal and side chick faces for sex identification. Attention heatmaps As shown in Fig. 7, qualitative analysis of the Grad-CAM heatmaps for frontal chick faces indicates that for correctly classified samples, the attention of both the EfficientNet-B0 and EfficientNet-B0+CBAM models is primarily localized around the nares and upper beak region, with minimal activation observed in the periocular areas and cheeks. In contrast, misclassified samples exhibit a diffuse attention pattern, broadly covering the eyes, nares, beak, and cheeks without a distinct focal point. A comparison between panels (a) and (b) reveals that the incorporation of the CBAM module does not noticeably alter this spatial attention distribution.Fig. 7Grad-CAM heatmaps of frontal chick faces for sex identification.Fig. 7 dummy alt textNote: Panel (a) displays the Grad-CAM attention heatmaps for the EfficientNet-B0 model without the CBAM module; Panel (b) shows the heatmaps for the EfficientNet-B0 model integrated with the CBAM module. Left: classification-correct samples (correct); Right: misclassified samples (wrong). The same panel notation is used in subsequent figures. Grad-CAM heatmaps of frontal chick faces for sex identification. As shown in Fig. 8, qualitative analysis of the Grad-CAM heatmaps for chick side views indicates that for correctly classified samples, the attention of both the EfficientNet-B0 and EfficientNet-B0+CBAM models is primarily localized around the base of the beak and the nasal region, with minimal activation in the periocular and cheek areas. In contrast, misclassified samples exhibit a diffuse attention pattern, broadly covering the eyes, nares, beak, and cheeks without a distinct singular focus. A comparison between (a) and (b) reveals that the incorporation of the CBAM module does not noticeably alter this spatial attention distribution pattern.Fig. 8Grad-CAM heatmaps of side-view chick faces for sex identification.Fig. 8 dummy alt text Grad-CAM heatmaps of side-view chick faces for sex identification. Results of chick facial individual identification Loss function curves As shown in Fig. 9, in the individual identification task, the training and validation loss curves of all models exhibited a steady downward trend and gradually converged to a stable plateau. Meanwhile, the training and validation accuracy curves showed a steady upward trend and gradually converged as well. No significant divergence was observed between the training and validation curves, indicating that the models possessed good convergence and generalization capabilities, and the overall training performance was satisfactory. Additionally, early stopping was triggered for all models between epochs 35 and 60.Fig. 9Loss and accuracy curves with generalization gap for the individual identification models.Fig. 9 dummy alt text Loss and accuracy curves with generalization gap for the individual identification models. Comparison of evaluation metrics As shown in Table 3, all models demonstrated strong performance in the chick individual identification task, maintaining high levels of all evaluation metrics. Friedman test results showed no significant differences among the five models across all metrics (p > 0.05). A comparison of performance under different views revealed that the recognition difficulty for side-view images was slightly higher than that for frontal-view images.Table 3Comparative performance of different models for chick individual identification.1.Table 3 dummy alt textResnet50Resnet101EfficientNet-B0EfficientNet-B0+CBAMMobilenet_v2P-value2FrontalTop-1 Acc0.9834±0.0057[0.9326, 1.0000]0.9880±0.0057[0.9372, 1.0000]0.9891±0.0008[0.9819, 0.9964]0.9863±0.0048[0.9427, 1.0000]0.9817±0.0016[0.9672, 0.9962]0.3650Top-5 Acc0.9989±0.0016[0.9843, 1.0000]0.9960±0.0008[0.9887, 1.0000]0.9989±0.0016[0.9843, 1.0000]0.9977±0.0000[0.9977, 0.9977]0.9960±0.0008[0.9887, 1.0000]0.1058MCC0.9834±0.0057[0.9323, 1.0000]0.9879±0.0057[0.9368, 1.0000]0.9891±0.0008[0.9818, 0.9964]0.9862±0.0049[0.9425, 1.0000]0.9816±0.0016[0.9670, 0.9963]0.3650Macro Precision0.9832±0.0079[0.9121, 1.0000]0.9881±0.0036[0.9555, 1.0000]0.9895±0.0041[0.9526, 1.0000]0.9889±0.0027[0.9643, 1.0000]0.9794±0.0006[0.9742, 0.9846]0.5249Macro Recall0.9811±0.0069[0.9194, 1.0000]0.9872±0.0036[0.9547, 1.0000]0.9871±0.0022[0.9675, 1.0000]0.9833±0.0074[0.9173, 1.0000]0.9797±0.0004[0.9760, 0.9834]0.5918Macro F10.9791±0.0084[0.9036, 1.0000]0.9858±0.0031[0.9578, 1.0000]0.9855±0.0037[0.9521, 1.0000]0.9827±0.0068[0.9212, 1.0000]0.9768±0.0002[0.9753, 0.9783]0.4628SideTop-1 Acc0.9647±0.0067[0.9049, 1.0000]0.9412±0.0266[0.7020, 1.0000]0.9729±0.0050[0.9281, 1.0000]0.9706±0.0083[0.8958, 1.0000]0.9471±0.0017[0.9321, 0.9620]0.2032Top-5 Acc0.9965±0.0050[0.9516, 1.0000]0.9894±0.0017[0.9745, 1.0000]0.9929±0.0033[0.9630, 1.0000]0.9941±0.0017[0.9792, 1.0000]0.9941±0.0083[0.9194, 1.0000]0.5667MCC0.9644±0.0068[0.9036, 1.0000]0.9407±0.0268[0.7001, 1.0000]0.9726±0.0050[0.9281, 1.0000]0.9703±0.0084[0.8944, 1.0000]0.9466±0.0017[0.9316, 0.9616]0.2644Macro Precision0.9744±0.0126[0.8609, 1.0000]0.9537±0.0183[0.7889, 1.0000]0.9802±0.0010[0.9714, 0.9889]0.9793±0.0051[0.9339, 1.0000]0.9608±0.0076[0.8926, 1.0000]0.3546Macro Recall0.9807±0.0089[0.9011, 1.0000]0.9608±0.0156[0.8207, 1.0000]0.9815±0.0020[0.9637, 0.9993]0.9787±0.0094[0.8939, 1.0000]0.9618±0.0001[0.9608, 0.9628]0.1991Macro F10.9742±0.0117[0.8696, 1.0000]0.9469±0.0246[0.7255, 1.0000]0.9774±0.0009[0.9689, 0.9860]0.9751±0.0087[0.8968, 1.0000]0.9541±0.0032[0.9250, 0.9832]0.19911All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation. Table 3Comparative performance of different models for chick individual identification.1.Table 3 dummy alt textResnet50Resnet101EfficientNet-B0EfficientNet-B0+CBAMMobilenet_v2P-value2FrontalTop-1 Acc0.9834±0.0057[0.9326, 1.0000]0.9880±0.0057[0.9372, 1.0000]0.9891±0.0008[0.9819, 0.9964]0.9863±0.0048[0.9427, 1.0000]0.9817±0.0016[0.9672, 0.9962]0.3650Top-5 Acc0.9989±0.0016[0.9843, 1.0000]0.9960±0.0008[0.9887, 1.0000]0.9989±0.0016[0.9843, 1.0000]0.9977±0.0000[0.9977, 0.9977]0.9960±0.0008[0.9887, 1.0000]0.1058MCC0.9834±0.0057[0.9323, 1.0000]0.9879±0.0057[0.9368, 1.0000]0.9891±0.0008[0.9818, 0.9964]0.9862±0.0049[0.9425, 1.0000]0.9816±0.0016[0.9670, 0.9963]0.3650Macro Precision0.9832±0.0079[0.9121, 1.0000]0.9881±0.0036[0.9555, 1.0000]0.9895±0.0041[0.9526, 1.0000]0.9889±0.0027[0.9643, 1.0000]0.9794±0.0006[0.9742, 0.9846]0.5249Macro Recall0.9811±0.0069[0.9194, 1.0000]0.9872±0.0036[0.9547, 1.0000]0.9871±0.0022[0.9675, 1.0000]0.9833±0.0074[0.9173, 1.0000]0.9797±0.0004[0.9760, 0.9834]0.5918Macro F10.9791±0.0084[0.9036, 1.0000]0.9858±0.0031[0.9578, 1.0000]0.9855±0.0037[0.9521, 1.0000]0.9827±0.0068[0.9212, 1.0000]0.9768±0.0002[0.9753, 0.9783]0.4628SideTop-1 Acc0.9647±0.0067[0.9049, 1.0000]0.9412±0.0266[0.7020, 1.0000]0.9729±0.0050[0.9281, 1.0000]0.9706±0.0083[0.8958, 1.0000]0.9471±0.0017[0.9321, 0.9620]0.2032Top-5 Acc0.9965±0.0050[0.9516, 1.0000]0.9894±0.0017[0.9745, 1.0000]0.9929±0.0033[0.9630, 1.0000]0.9941±0.0017[0.9792, 1.0000]0.9941±0.0083[0.9194, 1.0000]0.5667MCC0.9644±0.0068[0.9036, 1.0000]0.9407±0.0268[0.7001, 1.0000]0.9726±0.0050[0.9281, 1.0000]0.9703±0.0084[0.8944, 1.0000]0.9466±0.0017[0.9316, 0.9616]0.2644Macro Precision0.9744±0.0126[0.8609, 1.0000]0.9537±0.0183[0.7889, 1.0000]0.9802±0.0010[0.9714, 0.9889]0.9793±0.0051[0.9339, 1.0000]0.9608±0.0076[0.8926, 1.0000]0.3546Macro Recall0.9807±0.0089[0.9011, 1.0000]0.9608±0.0156[0.8207, 1.0000]0.9815±0.0020[0.9637, 0.9993]0.9787±0.0094[0.8939, 1.0000]0.9618±0.0001[0.9608, 0.9628]0.1991Macro F10.9742±0.0117[0.8696, 1.0000]0.9469±0.0246[0.7255, 1.0000]0.9774±0.0009[0.9689, 0.9860]0.9751±0.0087[0.8968, 1.0000]0.9541±0.0032[0.9250, 0.9832]0.19911All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation. Comparative performance of different models for chick individual identification.1. All values are presented as mean ± standard deviation [95% confidence interval] based on 5-fold group cross-validation. Confusion pattern of misclassification As shown in Fig. 10, the error proportions across all models exhibited no substantial difference between frontal and side views. The misclassified samples were uniformly distributed across all individual regions in both views, without any apparent concentration on specific individuals.Fig. 10Confusion Pattern of Misclassification of frontal and side chick faces for individual identification.Fig. 10 dummy alt text Confusion Pattern of Misclassification of frontal and side chick faces for individual identification. Feature space visualization using t-SNE As shown in Fig. 11, all five networks demonstrated moderate clustering tendencies, with samples from the same individual generally occupying neighboring regions. However, overlapping regions between different individuals were also observed, indicating that the learned features failed to achieve complete linear separability in the reduced-dimensional space.Fig. 11Feature space visualization using t-SNE of frontal and side chick faces for individual identification.Fig. 11 dummy alt text Feature space visualization using t-SNE of frontal and side chick faces for individual identification. Attention heatmaps Fig. 12 presents Grad-CAM visualizations comparing the EfficientNet-B0 and EfficientNet-B0+CBAM models on frontal chick faces. As shown in panels (a) and (b), the incorporation of CBAM reduces the spatial extent of the attention maps, resulting in a more concentrated focus on facial regions. However, in both correctly classified and misclassified samples, the attention is distributed across multiple facial components—including the nasal area, periocular regions, cheeks, and the area beneath the beak—rather than being confined to the nasal region alone.Fig. 12Grad-CAM heatmaps of frontal chick faces for individual identification.Fig. 12 dummy alt text Grad-CAM heatmaps of frontal chick faces for individual identification. Fig. 13 presents Grad-CAM visualizations comparing the EfficientNet-B0 and EfficientNet-B0+CBAM models on side-profile chick faces. As shown in panels (a) and (b), the incorporation of CBAM similarly reduces the spatial extent of the attention maps. Consistent with the front view, the attention in both correctly classified and misclassified samples is distributed across multiple regions, including the periocular areas, supraorbital regions, crown, nasal area, and beak. Notably, in misclassified samples, the model exhibits minor attention directed toward background regions.Fig. 13Grad-CAM heatmaps of side-view chick faces for individual identification.Fig. 13 dummy alt text Grad-CAM heatmaps of side-view chick faces for individual identification. Discussion This study focused on the visual recognition of Xianghuang chickens. The results demonstrated high accuracy in the individual identification task, whereas the sex classification task faced considerable challenges. This discrepancy may be related to breed-specific characteristics, data distribution, and feature saliency. Table 4 summarizes recent visual recognition studies on sex identification and individual identification in poultry and livestock.Table 4Comparative summary of visual recognition studies in poultry and livestock.Table 4 dummy alt textResearch CategoryResearch SubjectCore MethodPerformance MetricsReferenceSex IdentificationPre-hatch SexingCommercial layer embryos (Xiaoyou 818, Datu 2)PP-HGNetAccuracy close to random probabilityKuang et al., 2026Embryonic SexingJingfen No.6 chick embryos (vascular images)Improved YOLOv7 + CBAM88.79% mAPJia et al., 2023Chick Sex IdentificationCobb 500 broiler chick facial featuresCNN81.89% AccuracyVeganzones et al., 2025Young Fowl Sex IdentificationLohmann pre-peak (comb size)YOLOv5n / YOLOv11xPrecision 87.7% / Recall 56.3%Precision 86.7% / Recall 65.3%Paneru et al., 2025Young Fowl Sex IdentificationLohmann pre-peak (body size)YOLO-based detectionPrecision 89% / Recall 78%Paneru et al., 2025Individual IdentificationAdult LivestockDairy cattle (facial)Improved YOLO model98.36% AccuracyHu et al., 2020Adult LivestockCattle & Sheep (facial)YOLOv895.8% AccuracyYadav et al., 2024Adult LivestockPigs (facial)Attention-based CNN95.28% AccuracyWang et al., 2023Adult LivestockPigs (facial)YOLOv8-CA98.03% mAPYin et al., 2024 Table 4Comparative summary of visual recognition studies in poultry and livestock.Table 4 dummy alt textResearch CategoryResearch SubjectCore MethodPerformance MetricsReferenceSex IdentificationPre-hatch SexingCommercial layer embryos (Xiaoyou 818, Datu 2)PP-HGNetAccuracy close to random probabilityKuang et al., 2026Embryonic SexingJingfen No.6 chick embryos (vascular images)Improved YOLOv7 + CBAM88.79% mAPJia et al., 2023Chick Sex IdentificationCobb 500 broiler chick facial featuresCNN81.89% AccuracyVeganzones et al., 2025Young Fowl Sex IdentificationLohmann pre-peak (comb size)YOLOv5n / YOLOv11xPrecision 87.7% / Recall 56.3%Precision 86.7% / Recall 65.3%Paneru et al., 2025Young Fowl Sex IdentificationLohmann pre-peak (body size)YOLO-based detectionPrecision 89% / Recall 78%Paneru et al., 2025Individual IdentificationAdult LivestockDairy cattle (facial)Improved YOLO model98.36% AccuracyHu et al., 2020Adult LivestockCattle & Sheep (facial)YOLOv895.8% AccuracyYadav et al., 2024Adult LivestockPigs (facial)Attention-based CNN95.28% AccuracyWang et al., 2023Adult LivestockPigs (facial)YOLOv8-CA98.03% mAPYin et al., 2024 Comparative summary of visual recognition studies in poultry and livestock. Analysis of the confusion matrices revealed distinct class-specific sensitivities in ResNet101 and ResNet50: both models achieved higher recall rates for female samples than for males. Specifically, recall for females was 73.06% versus 62.64% for males in ResNet101, and 68.58% versus 63.61% in ResNet50. While the overall precision and recall metrics showed no significant divergence, these results indicate a shift in deep feature learning; both models demonstrated superior discriminative ability regarding female-specific visual cues, thereby mitigating the tendency to generalize uncertain samples as male. Notably, this "female-recall dominance" parallels findings from Paneru et al. (2025) regarding comb-size-based sex identification. Confronted with similar challenges of visual ambiguity and data scarcity (approximately 100 annotated images), their optimal models (e.g., YOLOv5lu/YOLOv11x) exhibited a contrasting trend of significantly higher precision than recall (e.g., 87.7% vs. 56.3%; 86.7% vs. 65.3%), which the authors attributed to extreme class imbalance and occlusion issues. Conversely, when the task was simplified to detecting only males based on body size using a larger sample of approximately 2,500 images, the metrics reached a balanced state (approx. 89% vs. 78%; Paneru et al., 2025). Collectively, whether observed as subtle sensitivity biases in this study or as pronounced metric divergences in previous work, these results underscore the profound impact of data distribution, feature separability, and task definition on deep learning model performance. Furthermore, the present results are lower than those reported by Veganzones Rodriguez et al. (2025), who achieved an accuracy of 81.89% for chick sex classification using facial features. Even with the integration of the Convolutional Block Attention Module (CBAM), the optimal model in this study attained an accuracy of only 71.01%. One possible explanation is differences in growth rates and the resulting degree of sexual dimorphism among breeds. The subjects in this study were local Xianghuang chickens, a slow-growing breed (Ouyang et al., 2025), which typically exhibits weaker phenotypic differentiation between sexes at the juvenile stage. In contrast, the aforementioned studies utilized the Cobb 500 broiler strain, a fast-growing genotype in which sexual dimorphism may manifest more prominently at an earlier age. It should be noted, however, that this gap may also stem from differences in data preprocessing pipelines (e.g., the absence of explicit face alignment in the present study, where pose variation was instead mitigated via rotation-based data augmentation), as well as variations in imaging protocols, environmental conditions, and sample sizes across studies. A deeper analysis revealed that although the CBAM module is a lightweight, plug-and-play hybrid attention mechanism capable of enabling the network to adaptively learn “what” features are important and “where” they are located—thereby suppressing background noise (Woo et al., 2018)—it did not yield the expected performance improvement in the sex classification task. Gradient-weighted Class Activation Mapping (Grad-CAM) visualizations confirmed that the CBAM-integrated model indeed focused more intently on regions such as the chick’s nares, producing more concentrated heatmaps; however, the overall accuracy remained unsatisfactory. Given the validation set (20% of the total dataset), which consists of 487 female images and 328 male images, a majority-class naïve classifier would achieve an image-level baseline accuracy of 59.8% (487 / 815). Our best-performing model attained 71.01% accuracy on the same validation set, corresponding to a 11.21 percentage-point improvement over this baseline. Considering the limited margin above this baseline despite the employment of data augmentation strategies (lighting perturbation, random cropping, color jittering), it is plausible to suggest that the models may not have fully learned robust, generalized facial sex features. Instead, the models may not have learned generalizable sex representations, but rather fitted noise in the data (e.g., down feather textures, subtle postural preferences; Paneru et al., 2025), thereby failing to capture intrinsic sexual dimorphism. This conclusion contrasts with the findings of Yin et al. (2024) in pig face recognition, who confirmed that attention mechanisms can effectively capture unique biometric features and improve accuracy when target features are genuinely present. Similarly, Gao et al. (2025) noted that CBAM suppresses background interference (e.g., fences), enhancing model focus; Jia et al. (2023) also demonstrated that improving YOLOv7 with CBAM achieved an 88.79% mAP in chick embryo sex identification using vascular images. These studies collectively indicate that CBAM effectively improves precision when sex features are real and discernible via imaging. In contrast, the dispersed attention and marginal performance gain in our study suggest that static sex characteristics in chick faces may not yet be apparent or are minimally distinguishable at the current age and observation conditions. This inference is supported by related research: A systematic analysis of 1,008 eggs from two commercial laying hen breeds (Xiaoyou 818 and Datu 2) found no significant differences in external morphological features between male and female embryos, resulting in model prediction accuracy close to random probability (Kuang et al., 2026). This indicates that visual sexual dimorphism in poultry during early developmental stages is often weak, greatly increasing the difficulty of appearance-based identification. By contrast, All models demonstrated strong performance in the chick individual identification task, maintaining consistently high levels across all evaluation metrics. Friedman test results confirmed no significant differences among the five models on any of the metrics (p > 0.05). Visualization analyses revealed that CBAM effectively guided the model to focus on discriminative regions, whereas the baseline models without CBAM were more susceptible to background interference (Sharma et al., 2025). Furthermore, a comparison of performance across viewpoints indicated that side-view images posed slightly greater recognition difficulty than frontal views, likely attributable to the relatively smaller size of the side-view dataset. Despite the limited dataset scale, this study established the first facial recognition dataset for Xianghuang chickens with both individual and sex labels, addressing a critical gap in poultry biometric research. In summary, consistent with successful cases of non-contact recognition in other livestock species—such as Hu et al. (2020) achieving 98.36% accuracy in dairy cow recognition, Yadav et al. (2024) reaching 95.8% accuracy in cattle and sheep recognition, and Wang et al. (2023) achieving 95.28% accuracy in pig face recognition—The high performance of the individual identification task in this study indicates that, under the controlled conditions tested, deep learning models can achieve high-precision identification when stable visual identity features exist in the target species. Conversely, the failure of the sex classification task is likely precisely because the target objects lack stable phenotypic sex features available for the model to learn at this stage. Crucially, this laboratory-based approach aligns well with the realities of modern industrial farms, where vaccination procedures are already highly mechanized and assembly-line operations. Within these established workflows, chicks are inherently immobilized for injection, providing a feasible opportunity for facial image acquisition without additional handling. Therefore, this integration offers a pragmatic and low-stress pathway for deploying chick facial recognition technology in future on-farm settings. Conclusions Focusing on the local specialty breed Xianghuang chickens, this study aims to systematically construct a deep learning-based recognition framework for chick facial identity and sex traits. Addressing an underexplored application area, we conduct a comparative analysis of mainstream convolutional neural networks and investigate the effect of introducing attention mechanisms. Crucially, we reveal a critical discrepancy in chick facial biometrics: individual identity features are easily distinguishable, whereas sex-related features are extremely difficult to discriminate. The main conclusions are as follows:1.Effective Individual Identification: Deep learning models demonstrated strong capabilities in identifying individual chicks via facial features. Under frontal views, all models achieved Top-1 accuracy above 98% and Top-5 accuracy above 99%, with no statistically significant differences detected (p>0.05). Performance remained relatively stable under side views (Top-1 acc> 94%). Grad-CAM visualizations further suggested that the models tended to focus on discriminative areas such as the nasal region, periocular regions, and beak, supporting the potential utility of facial traits for individual identification.2.Challenges in Early Sex Identification: Relying solely on static facial features for chick sex identification often leads to unsatisfactory performance. This may be attributed to two main factors. First, the sexual dimorphism in the facial morphology of one-day-old Xianghuang chicks is inherently subtle, making it difficult to extract discriminative features. Second, experimental conditions and data preprocessing pipelines (e.g., the absence of explicit face alignment in the present study, where pose variation was instead mitigated via rotation-based data augmentation), as well as variations in imaging protocols, environmental conditions, and sample sizes across studies.3.Construction of a Foundational Dataset: Although the overall scale remains modest, this study successfully constructed the first facial recognition dataset for Xianghuang chickens with individual and sex labels. This work fills a gap in poultry facial recognition research. 1.Effective Individual Identification: Deep learning models demonstrated strong capabilities in identifying individual chicks via facial features. Under frontal views, all models achieved Top-1 accuracy above 98% and Top-5 accuracy above 99%, with no statistically significant differences detected (p>0.05). Performance remained relatively stable under side views (Top-1 acc> 94%). Grad-CAM visualizations further suggested that the models tended to focus on discriminative areas such as the nasal region, periocular regions, and beak, supporting the potential utility of facial traits for individual identification. Effective Individual Identification: Deep learning models demonstrated strong capabilities in identifying individual chicks via facial features. Under frontal views, all models achieved Top-1 accuracy above 98% and Top-5 accuracy above 99%, with no statistically significant differences detected (p>0.05). Performance remained relatively stable under side views (Top-1 acc> 94%). Grad-CAM visualizations further suggested that the models tended to focus on discriminative areas such as the nasal region, periocular regions, and beak, supporting the potential utility of facial traits for individual identification. 2.Challenges in Early Sex Identification: Relying solely on static facial features for chick sex identification often leads to unsatisfactory performance. This may be attributed to two main factors. First, the sexual dimorphism in the facial morphology of one-day-old Xianghuang chicks is inherently subtle, making it difficult to extract discriminative features. Second, experimental conditions and data preprocessing pipelines (e.g., the absence of explicit face alignment in the present study, where pose variation was instead mitigated via rotation-based data augmentation), as well as variations in imaging protocols, environmental conditions, and sample sizes across studies. Challenges in Early Sex Identification: Relying solely on static facial features for chick sex identification often leads to unsatisfactory performance. This may be attributed to two main factors. First, the sexual dimorphism in the facial morphology of one-day-old Xianghuang chicks is inherently subtle, making it difficult to extract discriminative features. Second, experimental conditions and data preprocessing pipelines (e.g., the absence of explicit face alignment in the present study, where pose variation was instead mitigated via rotation-based data augmentation), as well as variations in imaging protocols, environmental conditions, and sample sizes across studies. 3.Construction of a Foundational Dataset: Although the overall scale remains modest, this study successfully constructed the first facial recognition dataset for Xianghuang chickens with individual and sex labels. This work fills a gap in poultry facial recognition research. Construction of a Foundational Dataset: Although the overall scale remains modest, this study successfully constructed the first facial recognition dataset for Xianghuang chickens with individual and sex labels. This work fills a gap in poultry facial recognition research. Funding This research was funded by the Modern Agricultural Industry Technology System, grant number: Hunan Agricultural Development [2022] No. 31. Institutional review board statement The animal study protocol was approved by the Institutional Animal Care and Use Committee of Hengyang Academy of Agricultural Sciences (Certification No. SYXK2026-0002). Informed Consent Statement Not applicable. Abbreviations The following abbreviations are used in this manuscript:AIArtificial IntelligenceCBAMConvolutional Block Attention ModuleGAPGlobal Average PoolingGrad-CAMGradient-weighted Class Activation MappingmAPmean Average PrecisionYOLOYou Only Look OnceTNTrue NegativeFNFalse NegativeFPFalse PositiveTPTrue PositiveAPAverage Precision AIArtificial IntelligenceCBAMConvolutional Block Attention ModuleGAPGlobal Average PoolingGrad-CAMGradient-weighted Class Activation MappingmAPmean Average PrecisionYOLOYou Only Look OnceTNTrue NegativeFNFalse NegativeFPFalse PositiveTPTrue PositiveAPAverage Precision CRediT authorship contribution statement Kai Chen: Writing – original draft, Software, Methodology, Conceptualization. Cong Wu: Validation. Ye Wen: Visualization, Data curation. Weihai Qiu: Formal analysis. Zhijia Luo: Validation, Methodology. Yuyong Ma: Writing – review & editing, Supervision, Resources, Project administration, Funding acquisition, Conceptualization. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.