Broilers raised in large-scale cages require prompt health monitoring to minimize economic losses in farming. Hence, precise identification of broiler health status is vital for preventing the spread of bird diseases. This study introduces an approach for recognizing broiler health by using the original YOLOv5 framework combined with the lightweight mobile-EMO network. First, the backbone convolutional, pooling, and connectivity layers of YOLOv5 are substituted with the EMO module, leaving the decoupling head unchanged. This change produces a highly efficient model that significantly boosts overall performance. The EMO module incorporates iRMB, an advanced feature-extraction method that captures multi-scale feature details. In addition, a continuous activation function replaces the standard ReLU to strengthen feature representation. Furthermore, EMO applies 1×1 inflated convolution along with windowed sub-attention to further enhance the network’s capabilities. Moreover, the SPPF module replaces SPP, and Detect is swapped with Decoupled Detect, resulting in an upgraded YOLOv5 architecture tailored for broiler health assessment. After training and testing, a deep learning model was established that effectively identifies the health condition of caged broilers. Results from experiments indicate that, even in challenging environments, the health detection achieves recall of 0.959, an accuracy of 0.956, and an average accuracy of 0.978. When compared to the original YOLOv5, this technique improves average accuracy by 1.5%. Compared with YOLOv7 and YOLOv8, the average accuracy increases by 3.1% and 1.8%, respectively. This method promotes early-stage intelligent health monitoring, reduces reliance on manual labor, lowers breeding costs, enhances economic returns in farming, and serves as a valuable reference for intelligent health detection systems in broiler production.
As living standards rise, the need for meat grows [1], driving steady growth in the scale of the farming sector. To cut expenses, farms have increased livestock and poultry density, leading to larger chicken housing facilities. Under these conditions, disease prevention and control for livestock and poultry [2] demand stricter standards. If birds fall ill or enter a sub-healthy condition without timely discovery and response, serious food safety threats [3] may emerge. Thus, early detection of sick chickens and appropriate actions are of great importance for the progress of the farming industry.
Conventional manual inspection of diseased chickens is slow, effort-heavy, often misses cases, and relies on highly subjective judgment of broiler health, which frequently contributes to pathogen transmission between humans [4] and animals [5]. Thanks to ongoing technological advances, machine learning is now widely used in breeding studies. Yet manual feature selection remains vulnerable to background interference and personal bias. Researchers have therefore turned to physiological and behavioural indicators for early illness tracking [6]. Physiological indicators cover voice [7], body temperature, and faeces [8], whereas behavioural indicators involve morphological and walking patterns [9]. Various trait measurements are calculated to evaluate the birds’ present health level [10]. Common detection tools include Support Vector Machine (SVM) [11], K-nearest Neighbor (KNN) [12], AdaBoost [13], and similar algorithms. Huang et al. [14] introduced a technique that automatically isolates chicken vocalizations from background barn noise using Mel’s inverted spectral coefficients as input features and a support vector machine for classification. This system can identify chickens infected with avian influenza in real time, achieving accuracy of 84%-90%. Cuan et al. [7] presented a deep poultry vocalisation network (DPVN) that merges multi-window spectral subtraction and high-pass filtering to lessen noise impact. Shen et al. [15] employed infrared cameras for thermal imaging of broiler groups inside houses. Images were smoothed using averaging or Gaussian filters, after which Otsu’s automatic thresholding set the grey-scale values to separate heads and feet. Overlapping areas were then divided using the watershed algorithm. Degu and Simegn [16] applied two main algorithms: the YOLO-V3 object detection model and the ResNet50 classification network.
YOLO-V3 extracted regions of interest from faecal images, while ResNet50 sorted the segments into four health categories: healthy, coccidioidomycosis, salmonellosis, and Newcastle disease. Overall detection accuracy reached 87.48%, and ResNet50 classification accuracy was 98.7%. Okinda et al. [17] built a machine vision platform capable of automatically extracting morphological and movement traits from broiler chickens and developed a health prediction model based on those traits. In a 13-day trial following NDV exposure, the system successfully diagnosed illness from the 3rd day onward, enabling effective monitoring and early alerts for affected birds. Zhuang et al. [18] proposed a posture-oriented method for detecting poultry diseases. Square-pair broiler images were gathered, processed with K-means clustering and ellipse fitting, and seven traits — including skeletal posture angle, contour concavity/convexity, elongation, roundness, external rectangle elongation, area linearity, and skeleton splice angle — were extracted automatically. An SVM classifier with a POLY kernel then distinguished healthy from diseased birds, attaining 99.469% accuracy. In a separate work, Zhuang and Zhang [19] designed an IFSSD deep neural network to classify broilers based on feather texture (smooth or fluffy) and typical posture (standing or recumbent). The approach detected sick chickens within flocks in real time with over 90% accuracy. Nasiri et al. [20] developed a posture-estimation model to detect broiler lameness via video analysis. A deep convolutional neural network tracked morphological traits of lame birds, with the resulting time-series features input into a Long Short-Term Memory (LSTM) network for classification. The LSTM achieved 95% overall accuracy. Other research focuses on specific body parts for detection. For instance, Bi et al. [21] developed a head-feature method for sick chicken recognition. Chicken heads were localized via the crown and comb regions using geometric contour relationships. Pupil outlines and H-channel crown color features were extracted to build a co-occurrence matrix. An ARA algorithm selected features to form sick-chicken vectors, which were then classified by a support vector machine, yielding a 92.5% correct recognition rate. Li et al. [22] established a machine vision setup that identifies sick chickens via comb color characteristics, locates their positions after detection, and reports a 96% correct identification rate with only a 2% error rate. Real chicken farm settings are highly complex, with cages often obscuring bird bodies and making reliable manual feature selection difficult. Consequently, relying on basic features and traditional machine learning struggles to deliver strong outcomes. Creating combined feature values from multiple traits also leads to complicated calculations that are hard to implement.
At present, deep learning [23] excels at merging diverse data features and learning advanced representations via hidden layers within convolutional networks. This eliminates tedious manual feature engineering and supports reliable target detection amid cluttered scenes. Modern target-detection frameworks [24] fall into two categories: One-Stage and Two-Stage. One-stage networks directly predict classes and locations from convolutional features; notable examples include SSD [25] and YOLO [26]. Two-stage methods first generate region proposals before using convolutional networks for final classification and positioning, as seen in R-CNN and Faster R-CNN [27]. Ding et al. [28] prepared a sick chicken dataset from caged-farm environments and introduced a multi-region fusion identification model. SSD first located chickens and body parts, integrated their features, and a CNN then performed classification. The system delivered precise whole-bird positioning and real-time sick chicken recognition. Wang [29] outlined a YOLOv5s-based sick chicken detection and environmental monitoring platform that tested various attention modules. The best results were achieved with YOLOv5s paired with the CBAM attention mechanism [30].
Challenges in sick chicken identification involve data imbalance, noise, difficult feature extraction, labeling issues, and limited model generalization. This paper applies a lightweight model using EMO and Decoupled head techniques to address these issues. The EMO module reduces parameter count and computational load through structural simplification and pruning, enabling lightweight deployment and faster operation. This facilitates use in limited-resource settings, such as on mobile devices, enhancing real-time capabilities and practicality. Meanwhile, the decoupled head separates tasks (classification, localization, and detection) that are normally combined, permitting independent optimization of each. This provides greater flexibility and task-specific tuning, ultimately raising accuracy. The mobile-oriented EMO supports real-time identification in dynamic environments, while the Decoupled head grants adaptability for specific needs. Here, EMO [31] and Decoupled head [32] technologies are integrated into the YOLOv5 model to build a lightweight sick chicken identification system. This resolves high complexity and excessive parameters, delivering better performance and speed. Relative to standard YOLOv5, average accuracy improves by 1.5%. Comparisons with YOLOv7 and YOLOv8 show average accuracy gains of 3.1% and 1.8%, respectively.
In summary, this paper employs a lightweight model grounded in EMO and Decoupled head technology. Tackling key obstacles in diseased chicken identification enables efficient, reliable detection while fitting resource-limited environments such as mobile platforms, offering substantial practical value.
The data used in this research were collected from a caged broiler farm in Pingyuan County, Dezhou City, Shandong Province. After data enhancement and cleaning, the dataset size increased to 1031. The dataset was split into training, validation, and test sets at a 6:2:2 ratio, yielding 619, 206, and 206 images, respectively. Figure 1 illustrates the outcomes of the original image after undergoing nine types of data enhancement.

Figure 1. Data enhancement renderings.
The YOLOv5 network comprises an input, a backbone, and a Head. The inputs incorporate Mosaic data enhancement, adaptive anchor frame calculation, and adaptive image scaling. The Backbone consists of Focus, CSP, SPP, or SPPF structures. The Head network includes the FPN+PAN structure, the loss function, NMS (non-maximum suppression), and activation functions. By varying the depth and width of the C3 module, four variants with different parameter settings are derived: YOLOv5n, YOLOv5s, YOLOv5m, and YOLOv5l. Given the model’s runtime constraints, the YOLOv5n model was selected as the foundational model for this study.
SPPF represents a spatial pyramid pooling fusion approach designed for image classification and target detection applications. SPPF effectively gathers information across various scales within an image. Using spatial pyramid pooling, it extracts and pools features across image sub-regions at multiple scales, producing a feature representation enriched with multi-scale details. This multi-scale representation helps the model adapt more effectively to objects of varying sizes and enhances robustness against scale variations. By applying pooling across different spatial levels, SPPF captures features spanning global to semi-local and local scales, enabling improved comprehension of spatial structures and contextual links for targets at diverse scales. The pooling process grants SPPF invariance to transformations of the input features, thereby decreasing sensitivity to shifts such as translation, rotation, and scaling. Simultaneously, pooling across multiple spatial levels preserves some variability, boosting the model’s sensitivity to target deformations and posture variations. It transforms variable-length feature vectors into fixed-length representations via subregion pooling. Consequently, SPPF not only reduces the number of model parameters but also lowers computational demands, thereby increasing overall processing efficiency. The structure of SPPF is depicted in the figure below:
In Figure 2, x denotes the original feature, y1 indicates the feature after one pooling, y2 represents the feature after two poolings, and self.m(y2) shows the feature after three poolings. CBS consists of convolution, normalized BN, and SiLU activation functions.

Figure 2. SPPF structure.
EMO is built solely from iRMB components, without additional varied modules. In comparison, iRMB relies only on standard convolution and multi-head self-attention. Additionally, the DW-Conv module is integrated within iRMB, which performs convolution solely along the input channel dimension without affecting the output channel. This substantially cuts the model’s parameter count and lowers overall complexity. During operation, DW-Conv convolves exclusively along the channel dimension while preserving the spatial dimension of the input feature map, thereby helping retain spatial image characteristics. Each input channel’s feature maps are convolved only with their matching kernel, upholding independence among input channels. This supports more effective feature extraction and mitigates overfitting risks to some extent. The original image or the preceding layer’s output features undergo successive convolution, pooling, normalization, and related procedures. The stem denotes the initial segment of the EMO module, which preprocesses incoming features and performs initial extraction in preparation for later stages. Each iRMB process begins by accepting features from the prior layer, then splits them into several branches. Every branch independently applies multiple convolutional operations to derive features of differing scales and semantics via distinct kernels and filters. Within each branch, an attention mechanism facilitates long-range feature interactions and global context integration. This mechanism dynamically modifies feature weights at each position to amplify key features while diminishing less relevant ones. Branch features are then concatenated along the channel axis to create a unified representation. By leveraging parallel branch processing and attention integration, the iRMB operation maximizes the utilization of multi-scale and multi-semantic features, thereby strengthening the network’s expressive power and representation quality. Through four successive iRMB operations, EMO progressively extracts, merges, and refines features to enhance diversity and expressiveness. The complete EMO framework is shown in Figure 3, with the iRMB module example on the left, where Attn Mat denotes the attention matrix.

Figure 3. EMO overall framework diagram.
Initially, a continuous multilayer perceptron (CMLP) — derived by adding a continuous activation function to an MLP-based structure — nonlinearly transforms input data and extracts features. This produces a query-focused feature vector Q and a key vector K for comparison. Next, a 1×1 inflated convolution generates a value vector V for weighting based on query-key relations. The query’s feature vector then applies a windowed self-attention mechanism on Q, K, and V for long-range interaction, immediately followed by local feature modeling with DW-Conv. Finally, a compressed convolution restores channel numbers and adds the result to the input.
The Decoupled Detect header enables more effective, precise target detection by separating the feature extraction and bounding-box prediction stages. Conventional detection approaches typically rely on a unified head for both processes, resulting in inefficient use of computational and memory resources. Conversely, Decoupled Detect employs two separate heads: one for feature extraction and another for bounding box prediction. The feature extraction head gathers high-level semantic information from the input image, capturing context and object-specific details. The bounding box prediction head then creates candidate boxes from these features and handles classification and localization. Decoupling these processes offers two main benefits. First, it enhances computational and storage efficiency, as feature extraction occurs once per image while predictions run independently per candidate. Second, the separation of structure supports a more adaptable network architecture, enabling independent optimization of extraction and prediction based on task demands.
This study proposes the ED-YOLOv5 algorithm for detecting broiler health states to improve detection precision. Built upon the YOLOv5 architecture as the base, it integrates the lightweight mobile-EMO network model and substitutes the SPP module with the SPPF module. Incorporating SPPF expands the receptive field and strengthens the model’s grasp of global target context. The Decoupled_Detect header replaces the original Detect module, enhancing the detection head’s feature expressiveness. This yields a lightweight, optimized YOLOv5 structure serving as the broiler health recognition and detection network. A deep learning model for identifying broiler health states is then trained. These enhancements target greater model lightness, improved detection accuracy, and better real-time capability, rendering it more appropriate for mobile device deployment. The complete network architecture is presented in Figure 4.

Figure 4. Overall network structure.
To achieve a lighter, more efficient network, the EMO module is embedded within the backbone layers. A range of optimization techniques and module replacements refine the original YOLOv5 architecture to address mobile computing constraints and real-time requirements. The EMO processes input data using the EMO_1M/net.pth parameters. Because EMO features the efficient, modern inverse residual moving block (iRMB), two separate branches are employed for feature extraction, with the region-of-interest (RoI) extractor refined. This provides higher precision in localization and recognition for broiler health assessment. Multi-scale feature extraction on the input map was conducted using pooling at five distinct scales.
Input features undergo a 1×1 convolution, reducing the number of channels to 512. Upsampling then doubles the feature map size. The upsampled map is merged with the backbone output features, and parameter handling for channel count and residual connections is performed. Convolution and feature extraction follow. Another 1×1 convolution reduces the number of channels to 256. Upsampling again enlarges the map by 2 times. This is combined with the backbone output for multi-scale fusion, then processed through convolution and extraction to yield the P3 feature map. Further adjustments via convolution and upsampling occur, with splicing to backbone outputs for scale fusion, leading to convolution, extraction, and P4 feature map generation. Similar operations continue to produce the P5 feature map. Finally, using nc (Number of classes) and anchors as inputs, P3, P4, and P5 maps are decoupled to generate detection outputs. The corresponding detailed flowchart is shown in Figure 5.

Figure 5. ED-CSPDarknet header network flowchart.
The loss function is a critical component of target detection algorithms, quantifying discrepancies between model predictions and ground truth labels during training. Typical loss functions include classification loss and regression loss. Classification loss measures the difference between predicted categories and true labels; common options include Cross-Entropy Loss and Focal Loss. Regression loss assesses the variation between predicted bounding box coordinates and ground truth, often using Smooth L1 Loss or IoU Loss. In this experiment, the CIOU loss function [33] was adopted. The CIOU loss accounts for the overall completeness of the target bounding box rather than just its position and dimensions. It uses the diagonal length of the enclosing box to measure scale and integrates overlap ratios to provide a more comprehensive evaluation of predicted versus real boxes. This provides stronger robustness across different scales and aspect ratios. It effectively manages small targets and those with extreme aspect ratios, thereby improving the algorithm’s generalization in intricate environments. Additionally, it addresses category imbalance by balancing positive and negative sample weights, resulting in superior model optimization and bounding-box regression accuracy. The CIOU formula is as follows:
(1)
(2)
(3)
Where, (c,) represent the Euclidean distances of the centroids of the prediction box and the real box, respectively. represents the square of the diagonal distance of the smallest closure region that can contain both the prediction frame and the real frame.
Training parameters for the model were set as follows: initial learning rate of 0.01, momentum of 0.937, weight decay of 0.0005, training threshold of 0.2, image dimensions standardized to 640×640, total epochs set to 300, and batch size fixed at 16.
This research adopted five key metrics to assess the model: precision, recall, mAP, model size, and detection speed. The mathematical expressions for precision rate, recall rate, and mAP appear as follows:
(4)
(5)
(6)
In the above equation, TP stands for true cases, FP stands for false positive cases, and FN stands for false negative cases; P (precision rate) reflects the proportion of true cases in the retrieved data, including positive samples predicted positively, and positive samples predicted negatively; R (recall rate) reacts to how many positive cases in the total sample were predicted correctly, including positive cases predicted positively, and negative cases predicted positively; and mAP is the mean AP value of all categories.
Upon feeding the test dataset into the finalized enhanced YOLOv5 model, the results showed a P-value of 0.967, an R-value of 0.983, a mAP of 0.975, and a model size of 6.26 MB for identifying broiler chicken health conditions. Findings from the trials confirm that the upgraded YOLOv5 improves prediction confidence and substantially raises accuracy in assessing broiler wellness under the complex conditions of actual poultry facilities, such as crowded groups and partial blocking. These outcomes are illustrated in Figure 6.

Figure 6. PR Diagram.
PR values stood at 0.958 for healthy chickens and 0.992 for sick chickens.
Label 0 in Figure 7 corresponds to healthy chickens, while label 1 corresponds to sick chickens.

Figure 7. Model detection effect diagram.
Performance outcomes across various models are detailed in Table 1.
Table 1. Comparison of detection results of different models.
Arithmetic | P | R | MAP | F1 | Loss function | |
Empty Cell | Empty Cell | Empty Cell | 0.5 | 0.95 | Empty Cell | Empty Cell |
YOLOv7 | 0.894 | 0.97 | 0.947 | 0.712 | 0.946 | CIOU |
YOLOv8 | 0.985 | 0.945 | 0.959 | 0.783 | 0.96 | CIOU |
YOLOv5 | 0.964 | 0.953 | 0.972 | 0.762 | 0.96 | CIOU |
Improved YOLOv5 | 0.967 | 0.983 | 0.975 | 0.789 | 0.97 | CIOU |
According to Table 1, the unmodified YOLOv5 delivers 7% higher accuracy than YOLOv7. Its R value drops by 1.7%, yet mAP_0.5 rises by 2.5% and F1 score grows by 1.4%. In relation to v8, mAP shows a 1.3% gain while the F1 score stays unchanged. Overall, the evaluation of strengths and weaknesses indicates that the enhanced YOLOv5, developed from the base YOLOv5 and v7/v8, delivers noticeable improvements in monitoring broiler health conditions.
Detection performance across multiple YOLOv5 versions is presented in Table 2.
Table 2. Comparison of model detection results of different versions of YOLOv5.
Arithmetic | P | R | MAP | F1 | Parameters | Compute flops | |
Empty cell | Empty cell | Empty cell | 0.5 | 0.95 | Empty cell | Empty cell | Empty cell |
YOLOv5n | 0.964 | 0.953 | 0.972 | 0.762 | 0.96 | 1761871 | 4.1 |
YOLOv5s | 0.966 | 0.915 | 0.961 | 0.739 | 0.94 | 8551519 | / |
YOLOv5m | 0.969 | 0.943 | 0.958 | 0.785 | 0.96 | 20856975 | 47.9 |
YOLOv5l | 0.966 | 0.98 | 0.976 | 0.79 | 0.97 | 46113663 | 107.7 |
Analysis of the table reveals that YOLOv5l achieves the strongest performance, though it demands substantial computational resources. When benchmarked against YOLOv5l, YOLOv5n exhibits only a 0.002 difference in P value, a 0.004 difference in mAP_0.5, and a 0.01 difference in F1 value. These gaps remain minor, yet the parameter count varies by roughly 26 times. Taking all factors into account, YOLOv5n offers superior real-time efficiency. Meanwhile, both YOLOv5s and YOLOv5m display inferior detection capabilities compared to YOLOv5n.
Loss functions evaluated in this study included CIOU, SIOU, EIOU, and WIOU.
The CIOU loss function accounts for the overall shape of the target bounding box rather than focusing solely on its position and dimensions. It leverages the diagonal length of the bounding box to measure scale and factors in overlap ratios to provide a fuller comparison between predicted and actual boxes. This approach provides improved robustness for objects with varying sizes and proportions. It successfully manages small objects and those with extreme width-to-height ratios, thereby strengthening the algorithm’s adaptability in demanding environments. Furthermore, it equalizes contributions from positive and negative samples, supporting better model tuning and higher bounding-box regression precision. Experimental results indicate that SIOU and EIOU perform marginally worse than CIOU and WIOU. Specifically, WIOU produces a P-value 0.5% above that of CIOU, whereas CIOU’s recall R-value exceeds WIOU’s by 1.1%. Both yield identical mAP_0.5 scores of 0.972, with a 0.002 difference in mAP_0.95 that is not significant. Consequently, after a comprehensive review, CIOU was selected as the loss function, with comparative outcomes displayed in Table 3.
Table 3. Comparison of loss function results
Loss function | P | R | MAP | |
Empty cell | Empty Cell | Empty cell | 0.5 | 0.95 |
CIOU | 0.964 | 0.953 | 0.972 | 0.762 |
SIOU | 0.951 | 0.953 | 0.968 | 0.765 |
EIOU | 0.962 | 0.959 | 0.961 | 0.759 |
WIOU | 0.969 | 0.942 | 0.972 | 0.764 |
The ablation experiment comparisons outlined in Table 4 demonstrate that incorporating EMO alone into YOLOv5n led to a drop in R-value, while P-value increased by 0.6% and mAP_0.5 decreased by 0.2%. When Decoupled Detect was substituted for Detect in isolation, R-value climbed by 1.7%, P-value fell to 0.933, and mAP_0.5 declined by 0.11%. In contrast, combining both EMO and Decoupled Detect resulted in gains for both P and R values: R increased by 3%, P by 0.3%, mAP_0.5 by 0.3%, and mAP_0.95 by 3.6%. These findings confirm that YOLOv5n’s performance metrics improved with the simultaneous inclusion of EMO and Decoupled Detect.
Table 4. Comparative results of ablation experiments.
Baseline network | EMO | Decoupled detect | R | P | mAP_0.5 | mAP_0.5:0.95 |
YOLOv5n | √ | Empty Cell | 0.949 | 0.97 | 0.974 | 0.761 |
YOLOv5n | √ | 0.97 | 0.933 | 0.961 | 0.763 | |
YOLOv5n | √ | √ | 0.983 | 0.967 | 0.975 | 0.789 |
Standard YOLOv5 uses an IoU loss, whereas the enhanced version uses a CIOU (Complete IoU) loss. By considering factors such as target frame position, dimensions, and intersection areas, CIOU delivers a more precise evaluation of discrepancies between forecasted and actual frames, thereby improving detection reliability. In place of the classic ReLU activation, SiLU better preserves input feature details and supports stronger model representation and learning capacity. The EMO (Efficient Multi-scale Optimization) module serves as a compact component that enables long-range feature interactions and information fusion via multi-attention mechanisms, thereby enhancing the system’s capacity to sense and articulate features across varying scales. Decoupled Detect employs a separate head design that merges multi-scale information by independently processing feature maps at different resolutions, thereby improving target detection effectiveness. Experimental findings reveal that the refined YOLOv5—after anchor frame adjustments and confirmation of the CIOU loss with SiLU activation—when trained with the added EMO module and Decoupled Detect, attains recall of 0.959, precision of 0.956, and average precision of 0.978 for broiler health monitoring in demanding scenarios. This represents a 1.5% rise in average precision over the baseline YOLOv5 network. Further evaluations against YOLOv7 and YOLOv8 showed average accuracy improvements of 3.1% and 1.8%, respectively. These outcomes highlight the method’s ability to conduct efficient, smart broiler health assessments, reduce overall breeding expenses, and support greater economic performance across farming operations.
None
None
This research was funded by the National Key Research and Development Program (Project number: 2022YFD1601904), China.
This study was organized by Chen Changxi’s team at Tianjin Agricultural University. The data were obtained with the author’s authorization at the Simart Farm in Dezhou City, Shandong Province, China.
Open Access The author(s) retain copyright. This article is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. It may be shared and adapted for non-commercial purposes with appropriate attribution, an indication of changes, and distribution of adaptations under the same license. Third-party material may be subject to separate terms identified in its credit line. View the license at https://creativecommons.org/licenses/by-nc-sa/4.0/.