
==== Front
Poult Sci
Poult Sci
Poultry Science
0032-5791
1525-3171
Elsevier

S0032-5791(24)00772-7
10.1016/j.psj.2024.104193
104193
ANIMAL WELL-BEING AND BEHAVIOR
Monitoring activity index and behaviors of cage-free hens with advanced deep learning technologies
Yang Xiao
Bist Ramesh
Paneru Bidur
Chai Lilong lchai@uga.edu
1
Department of Poultry Science, University of Georgia, Athens, GA 30602, USA
1 Corresponding author: lchai@uga.edu
11 8 2024
11 2024
11 8 2024
103 11 1041934 6 2024
5 8 2024
© 2024 The Authors
2024
https://creativecommons.org/licenses/by-nc-nd/4.0/ This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Chickens’ behaviors and activities are important information for managing animal health and welfare in commercial poultry houses. In this study, convolutional neural networks (CNN) models were developed to monitor the chicken activity index. A dataset consisting of 1,500 top-view images was utilized to construct tracking models, with 900 images allocated for training, 300 for validation, and 300 for testing. Six different CNN models were developed, based on YOLOv5, YOLOv8, ByteTrack, DeepSORT, and StrongSORT. The final results demonstrated that the combination of YOLOv8 and DeepSORT exhibited the highest performance, achieving a multiobject tracking accuracy (MOTA) of 94%. Further application of the optimal model could facilitate the detection of abnormal behaviors such as smothering and piling, and enabled the quantification of flock activity into 3 levels (low, medium, and high) to evaluate footpad health states in the flock. This research underscores the application of deep learning in monitoring poultry activity index for assessing animal health and welfare.

Key words

cage-free housing
poultry welfare
activity index
precision management
machine vision
==== Body
pmcINTRODUCTION

Animal activities and behaviors provide significant insights into the mental and physical well-being of poultry, serving as a key indicator of their health and subjective states (Yang et al., 2024a). For instance, predicting indoor particulate matter concentration in poultry houses can be informed by broiler activity and ventilation rates (Peña Fernández et al., 2019). Additionally, locomotor activity acts as a proxy for the gait of individual broilers, facilitating gait classification (van der Sluis et al., 2021). Currently, such activity is primarily monitored through manual methods, which are labor-intensive and prone to individual bias (Mao et al., 2023). With the world's population projected to reach 9.5 billion by 2050 and the demand for animal products like meat, eggs, and milk expected to increase by 70% from 2005 levels, developing automated, precise systems for monitoring poultry activity becomes crucial (Guo et al., 2022a). This advancement is especially important for managing health and welfare efficiently under the constraints of limited natural resources such as fresh water, feed, and land (Yang et al., 2022; Bist et al., 2023a).

Automated measurement systems are increasingly vital for monitoring and promoting good welfare within the growing livestock industry. Over recent decades, advancements in digital imaging technologies have spurred the development of automated and precise animal activity tracking systems (Horna et al., 2023). In 1997, a pioneering image analysis method was introduced to quantify the behavioral responses of animals to their micro-environment using a camera system (Panasonic NV-FS200EC) and digitizer board (Turbo Pascal5) (Bloemen et al., 1997a). This method was initially tested on broiler chickens and pigs to measure their activity under different temperatures and has since been widely applied to monitor the behaviors of pigs and individually caged chickens (Oczak et al., 2013). Similarly, the eYeNamic system detects variations in broiler chicken activities by measuring the ratio of object pixels to background pixels via top-view cameras (Kashiha et al., 2013; Peña Fernández et al., 2018a). To enhance farm animal welfare, it is crucial to consider the needs of herds and flocks as well as individual animals.

In recent years, machine vision or deep learning has been applied in animal analysis, particularly for tracking and monitoring poultry's activities and locomotion in complex environments (Leroy et al., 2006; Guzmán et al., 2013, 2016; Yang et al., 2024a, 2024b). As traditional methods often struggle with issues like occlusion, where chickens are obscured by objects, or background clutter that camouflages them, deep learning offers a robust solution. Using advanced neural networks, such as convolutional neural networks (CNN), these systems can learn from raw sensor data to detect, track, and classify chicken movements with minimal preprocessing. This capability is essential for accurately monitoring chicken behavior and welfare in dynamic and crowded settings, where changes in the environment or in the animals' appearance can complicate tracking efforts. Based on CNN architectures, the you only look once (YOLO) + Multilayer Residual Module (MRM) algorithm was developed for detecting broiler stunning states, demonstrating the capability to process up to 180,000 broilers per hour with a high accuracy rate of 96.77% (Ye et al., 2020b). Additionally, other CNN networks such as Visual Geometry Group Network (VGGNet) and Residual Network (ResNet) have been employed to identify 4 common chicken diseases: Avian Pox, Infectious Laryngotracheitis, Newcastle Disease, and Marek's Disease, distinguishing them from healthy birds (Quach et al., 2020). Exceptionally, when CNNs are combined with a Kinect sensor to recognize flock behavior, the accuracy reaches an impressive 99.17% (Pu et al., 2018). Therefore, the integration of CNNs into the poultry industry significantly enhances the automation of poultry welfare and health monitoring (Bist et al., 2023b).

However, previous research didn't build the connection between chicken flock activity index and welfare indicators such as lameness and piling. The objectives of this study were to (1) develop a poultry flock activity and behavior (i.e., piling and smothering) tracker using deep learning models; (2) compare the performance of popular CNN models, including YOLOv5, YOLOv8, ByteTrack, DeepSORT, and StrongSORT in tracking chickens’ behaviors; and (3) evaluate the best model's performance in potential applications such as detecting piling and smothering behaviors, and monitoring flock activity, which could be indicative of footpad health.

MATERIALS AND METHODS

Experimental Design

In this study, a year-long experiment was conducted at the University of Georgia (UGA)'s Poultry Research Center (Latitude 33°54′23.0″N, Longitude 83°22′43.9″W), specifically within 4 cage-free facilities (labeled 13 to 16), each with dimensions of 7.3 m in length, 6.1 m in width, and 3 m in height, to rear 800 Hy-Line W-36 laying hens (200 in each facility). These hens were approximately 1 day old at the beginning of the experiment. The spatial design within each room was standardized, equipped with 6 suspended feeders and 2 watering kits. Additionally, a single portable A-frame hen perch was introduced to promote natural perching behavior and to reduce instances of piling by providing increased interactional space (Figure 1) (Gray et al., 2020). Pine shavings (5 cm depth) were spread on the floor as bedding. The soy-corn feed, manufactured at the UGA feed mill, was renewed bi-monthly to ensure freshness and prevent mildew. Water and food were provided ad libitum. Videos recorded at birds’ age of 16 to 24 wk . Environmental conditions were controlled adhering to the Hy-Line W-36 commercial layer management guidelines. Parameters maintained included a relative humidity range of 40% to 60%, an air temperature bracket of 21°C to 23°C, a light intensity of 20 lux, and a photoperiod of 19 h of light to 5 h of darkness (19L:5D). Nutrition was provided in the form of a soy-corn feed, freshly prepared bi-monthly at the UGA feed mill to ensure optimal quality and to prevent mildew. Routine monitoring of the hens' growth and environmental conditions was carried out daily in accordance with the UGA Poultry Research Center Standard Operating Procedure. This project received approval from the Institutional Animal Care and Use Committee (IACUC) at the University of Georgia, ensuring adherence to ethical guidelines for animal use and management.Figure 1 Experiment setup of cage-free research houses.

Figure 1

Data Collection

To systematically document the hens' activity and evaluate animal behaviors, each room was outfitted with 6 waterproof HD cameras (Model PRO-1080MSFB, Swann Communications, Santa Fe Springs, CA). The devices were strategically positioned to maximize coverage, with 5 mounted on the ceiling at 90-degree angles and one on the side wall at a 45-degree angle. Each device covered approximately one-fourth of the entire floor area. The cameras were set to record at a resolution of 1,440 × 1,080 pixels and a frame rate of 18 FPS. The installation height was standardized at 3.05 m for ceiling cameras and 1.68 m for side wall cameras. Each continuous video recording consisted of 15-minute segments, captured 24 h a day. To ensure the integrity of the recorded data, the camera lenses were maintained with a lens cleaning cloth to remove dust and other particulates, with cleaning scheduled on a weekly basis. Captured footage was initially saved to a video recorder (Swann Company, Santa Fe Springs, CA) located on-site. After recording, the data was regularly transferred to high-capacity hard disk drives (Western Digital Corporation, San Jose, CA) and stored securely at the data hub within the Department of Poultry Science at the UGA.

Data Labelling

Video selection was conducted manually to ensure inclusion of diverse activity levels and various pilling behaviors of the chickens. This approach aimed to validate the analytical method's applicability across different developmental stages, specifically for both hens and pullets. The random images were obtained from hard disk drives containing both wall and ceiling video recordings, avian imagery was randomly extracted and converted into JPG format using the Free Video to JPG Converter software. The “total function” option was employed during the conversion process to facilitate the acquisition of random images. After conversion, images with blurriness were discarded. The remaining 1,500 clear photographs underwent a labeling process using Labeling Windows_v1.6.1 software, with 900 images allocated for training, 300 for validation, and 300 for testing. For annotation, only chickens with at least one-third of their body visible within the frame were delineated with bounding boxes. If chickens were in different postures, they were annotated as chickens without consideration of their postures.

Model Innovations for Chicken Tracking

Model Selection

In chicken detection, deep learning represents the forefront of technology, employing advanced CNNs and anchor-based detection strategies to identify regions of interest with high precision (Kim and Lee, 2020). The introduction of the YOLO framework was a game-changer, propelling the use of regression methods for chicken detection. YOLO architectures simplify the process by integrating feature extraction and object classification into a single, streamlined regression network (Figure 2). This unified approach is composed of 3 main elements: the backbone, neck, and head (Jocher, 2020).Figure 2 The network structure of YOLO.

Figure 2

The backbone serves as the foundational axis of the network. It comprises various sub-models designed to extract fundamental features from the input data. The innovation of YOLO includes the FOCUS mechanism, which consolidates information about the width and height of the features into the channel space (Elmessery et al., 2023). This addition, along with the enhanced mosaic data augmentation technique, contributes to the improved accuracy of the YOLO model, especially in the detection of smaller objects (Dadboud et al., 2021).

The neck of the model extends the capability of the backbone by incorporating a feature pyramid module known as PAFPN (Zhang et al., 2021b). This component optimizes the processing of different scales and sizes of objects, ensuring consistent recognition across varying dimensions.

The head of the model, through a series of convolutional layers, maintains the essential features of the target, moderating the increase in the number of feature maps and thus streamlining computational demands (Liang et al., 2022).

YOLOv5 and YOLOv8 are the most prevalent versions in the YOLO series (Hussain, 2023). Consequently, this study employs these iterations as foundational models for chicken detection, subsequently integrating them with various tracking algorithms.

Advanced Algorithms for Chicken Multiobject Tracking

Multiobject tracking (MOT) is a critical component of computer vision, tasked with following multiple objects across recorded footage or in live streams (Guo et al., 2022b). For this study, 3 advanced MOT algorithms-deep simple online and real-time tracking (DeepSORT), StrongSORT, and ByteTrack were chosen-each known for its precision and robustness. These algorithms leverage deep learning to detect objects and track their movements effectively, providing reliable performance in dynamic and cluttered settings. Figure 3 presents the workflow of MOT.Figure 3 Chicken tracking workflow: detection and multiobject tracking.

Figure 3

DeepSORT: An advanced computer vision tracking algorithm, extends simple online and real-time tracking (SORT) by integrating a deep learning-based appearance descriptor. This enhancement minimizes identity switches, thus improving the tracking efficiency of objects, such as chickens, by maintaining unique identifiers for each. SORT employs Kalman filters and the Hungarian algorithm for tracking, encompassing detection, estimation, data association, and the management of track identities (Wojke et al., 2017).

StrongSORT: StrongSORT enhances tracking capabilities by employing bag of tricks (BoT) with a ResNeSt50 backbone, pretrained on the DukeMTMCreID dataset, for robust appearance feature extraction. This approach, superior to the simpler CNN used in DeepSORT, excels in differentiating individual features, crucial for the precise tracking of chickens. Additionally, StrongSORT incorporates an enhanced correlation coefficient (ECC) correction algorithm to adapt to varying camera viewpoints (Du et al., 2023).

ByteTrack: ByteTrack distinguishes itself in object tracking by treating each detection as a fundamental unit, akin to a byte in programming, thereby not limiting the focus to high-scoring boxes. This approach facilitates a more robust association, recovering objects that may have low detection scores through a secondary association pass. ByteTrack's simplicity is a key advantage; it eschews complex models for appearance and motion, relying instead on precise detections and byte-level association, which proves particularly effective in chicken tracking scenarios. Its efficient design allows for real-time tracking performance on a single GPU, enhancing its practicality for live monitoring (Zhang et al., 2021a). Table 1 shows checkpoints of each experiment.Table 1 Algorithm 1-distance calculation summary.

Table 1Algorithm 1-distance calculation and visualization for chicken flock activity	
def calculate_average_distance (chicken_positions):
total_distance, pair_count = 0, 0
for id1, pos1 in chicken_positions.items():
 for id2, pos2 in chicken_positions.items ():
  if id1 != id2:
   dist = euclidean_distance (pos1, pos2)
   total_distance += dist
   pair_count += 1
return total_distance/pair_count if pair_count else 0
def visualize_activity (times, average_distances):
plt.figure (figsize=(10, 6))
plt.plot(times, average_distances, marker='o', linestyle='-', color='blue')
plt.title ('average distance between chickens over time')
plt.xlabel ('time (s)')
plt.ylabel ('average distance [pixels]')
plt.grid (True)
plt.savefig ('./average_distance_over_time.png')
plt.show ()	

These experiments, which trained for 300 epochs, ran on a system equipped with an Intel i7-8750 CPU at 2.20GHz, an NVIDIA GTX 3090 GPU, and Python 3.7.8, using Pytorch 1.13.0. The software environment included OpenCV 4.3.0 and CUDA 11.1, with PyCharm as the coding environment, all operating on Ubuntu 20.04.

Defining Average Distance

The average distance in this study refers to the mean Euclidean distance (i.e., the distance between 2 points mathematically) between each pair of chickens within a flock (birds in the image), measured in pixels. It is calculated across consecutive video frames to assess the spatial dynamics and activity level of the flock over time. This metric is crucial for understanding social behaviors, space utilization, and overall activity within the open litter environment. Table 1 outlines the detailed operations (Guzmán et al., 2013).

Euclidean distance calculation: The Euclidean distance between center points (x1, y1) and P2 (x2, y2) of 2 bounding boxes in a 2-dimensional space is calculated using following equations:(1) D(P1,P2)=(x2−x1)2+(y2−y1)2

Where D is the shortest distance between 2 points in a video frame, x is horizontal coordinates, y is vertical coordinates.

Average distance calculation: Given a set of n distances D = {d1, d2, …., dn}, the average distance Davg is computer as:(2) Davg=∑i=1ndin

Where Davg represents the average distance, which is the central value or mean of all the distances being considered, i = 1 to n means calculation starts with the first distance d1 and continue to add distance up to the nth distance dn.

In this study, ‘speed’ refers to the absolute change in average distances between detected chickens in a video from frame to frame, measured in pixels per second. This is used as a proxy for the activity level of the chickens, where larger changes in distances may imply more activity. Algorithm 2 presents the work (Table 2).Table 2 Algorithm 1-speed calculation summary.

Table 2Algorithm 2-speed calculation and visualization	
def calculate_speed (average_distances_per_second):
return [abs (average_distances_per_second [i] - average_distances_per_second [i-1])
for i in range (1, len (average_distances_per_second))]
average_distances_per_second = [np.mean(distances) if distances else 0 for distances in distances_per_second.values ()]
times = list (distances_per_second.keys())
speeds = calculate_speed(average_distances_per_second)
plt.figure (figsize=(10, 6))
plt.plot (times[1:], speeds, marker='o', linestyle='-', color='green', label='Speed (pixels/second)')
plt.title ('Change in Average Distance as a Proxy for Speed')
plt.xlabel ('Time (s)')
plt.ylabel ('Speed (pixels/second)')
plt.grid (True)
plt.legend ()
plt.show ()	

Average distance for a second: Let Et be the set of all pairwise average distances at second t. The average distance at second t, denoted as Ēt, is calculated as:(3) E¯t=1|Et|∑dϵEte

Where |Et| means the number of distance measurements included in the set for second t. ∑dϵEte is the sum of all the distances in the set Et.

Speed calculation: Speed S between 2 consecutive second t and t – 1, where t > 0, is calculated as the absolute change in average distances:(4) St=|E¯t−E¯t−1|

Where E¯t represents the average distance between the chickens at second t, E¯t−1 represents the average distance between the chickens at second t – 1.

In our study, we also want to use average distance to quantify piling and smothering behaviors. Piling and smothering are abnormal behaviors in cage-free laying hens, where piling occurs when birds crowd together, while smothering, often leading to chicken deaths, includes stress-induced panic smothering from acute disturbances, preference-based smothering in preferred spaces, and recurring smothering where birds cluster without apparent cause. For manual observation of piling and smothering behavior, we checked our video records to find scenarios where a group of chickens aggregated together for more than 1 minute. Outliers within the analysis of average distance measurements in a chicken flock were identified using a 15% boundary. The average normal distance was considered if it fell within this 15% boundary. We used 1-s intervals due to standard speed metrics being in meters per second. Attempts to use fps resulted in messy data with unacceptable deviations. Each second and data points were compared to their neighboring points within the same time frame. Data points exhibiting extreme fluctuations exceeding 15% were marked as outliers. This threshold was determined through testing various boundaries (e.g., 5%, 10%) and finding that the 15% threshold effectively eliminated outliers. The primary reason for these outliers was the high-speed movement of some chickens, such as flying or running, which introduced significant deviations from the average (Guzmán et al., 2016).

Performance Evaluation

To effectively assess the performance of chicken tracking model, the primary metrics used will be Multiple objects tracking accuracy (MOTA), Identification F1 score (IDF1), Identity switches (IDS), and frames per second (FPS).

MOTA consolidates false positives (FP), false negatives (FN). IDF1 gauges the correct identification of individual chickens, considering both detection and identification precision and recall. IDS counts the number of times a tracked chicken is incorrectly identified after being previously correctly identified, which is crucial for understanding the consistency of tracking. Lastly, FPS measures the processing speed, indicating how many frames of video the model can handle per second, which is vital for real-time tracking applications. By focusing on these 4 metrics, the model's performance in terms of accuracy, identification robustness, tracking consistency, and operational speed can be evaluated.(5) MOTA=1−(FP+FN+IDS)/Totalnumberofgroundtruthobjects

(6) IDF1=2*(Precision*Recall)/(Precision+Recall)

Where precision is defined as the ratio of the number of correctly identified trajectories to the number of identified trajectories. Recall is defined as the ratio of the number of correctly identified trajectories to the total number of ground truth trajectories.(7) FPS=TotalframesTotalpocessingtime

RESULTS AND DISCUSSION

Model Comparison in Tracking Chickens’ Activities

Six individual experiments on chicken tracking were conducted to discover the optimal tracker for monitoring birds’ activity. The evaluation compared models based on the YOLO architecture, enhanced with tracking algorithms such as DeepSORT, StrongSORT, and ByteTrack (Table 3). The YOLOv5 models, combined with DeepSORT, StrongSORT, and ByteTrack, displayed commendable results (Figure 4). The YOLOv5+DeepSORT model achieved a MOTA of 80%, an IDF1 score of 78%, processed at 25 FPS, and recorded 50 identity switches. YOLOv5+StrongSORT improved these results with a MOTA of 85%, an IDF1 score of 83%, fewer identity switches 35, and a slightly lower FPS of 22. The integration of ByteTrack further adjusted the trade-off, with YOLOv5+ByteTrack exhibiting an 83% MOTA, 81% IDF1, 40 identity switches, and the highest FPS of 28 among the YOLOv5 series.Table 3 The summary of model comparison.

Table 3Model	MOTA	IDF1	IDS	FPS	
YOLOv5+DeepSORT	80%	78%	50	25	
YOLOv5+StrongSORT	85%	83%	35	22	
YOLOv5+ByteTrack	83%	81%	40	28	
YOLOv8+DeepSORT	94%	90%	41	27	
YOLOv8+StrongSORT	89%	85%	38	23	
YOLOv8+ ByteTrack	84%	88%	43	24	

Figure 4 Comparison of models using radar chart.

Figure 4

A notable advancement was seen with the introduction of YOLOv8+DeepSORT, which significantly elevated the MOTA to 94% and IDF1 to 90%, with a marginal increase in identity switches to 41, while maintaining a good FPS rate of 27. The combination of YOLOv8 with StrongSORT also performed well, achieving a MOTA of 89%, an IDF1 of 85%, 38 identity switches, and 23 FPS. The YOLOv8+ByteTrack variant showed a unique outcome, with an exceptional IDF1 score of 88%, albeit with a slightly lower MOTA of 84%, 43 identity switches, and an FPS of 24 (Figure 5, Figure 6, Figure 7).Figure 5 MOTA comparison results for different tracker based on deep learning.

Figure 5

Figure 6 IDF1 comparison results for different tracker based on deep learning.

Figure 6

Figure 7 ID switches (IDS) comparison results for different tracker based on deep learning.

Figure 7

These results suggest that the newer YOLOv8 models, when combined with advanced tracking algorithms, offer superior tracking and identification accuracy with a reasonable processing speed, marking a significant improvement in the field of chicken tracking.

The central goal of this study was to identify an ideal tracking model that would enable precise monitoring of bird activity in cage-free poultry farms, which present unique challenges due to the birds' unrestricted movement patterns (Neethirajan, 2022). The assessment of the YOLO architecture, enhanced with advanced tracking algorithms DeepSORT, StrongSORT, and ByteTrack, revealed that each combination has merits that could be practical for real-world applications.

Beginning with the YOLOv5 series, each model's integration with tracking algorithms showcased promising results. The YOLOv5+StrongSORT variant exhibited enhanced performance with a higher MOTA and IDF1, coupled with fewer identity switches, suggesting a more stable tracking under varied activity levels. However, it compromised on the processing speed, a trade-off that requires consideration depending on real-time monitoring needs. YOLOv5+ByteTrack balanced performance and speed, offering an improved FPS rate, thus aligning more closely with the requirements for real-time application without a substantial drop in accuracy. The advent of YOLOv8 models brought significant improvements. The YOLOv8+DeepSORT pairing reached impressive heights in accuracy with MOTA of 94% and IDF1 of 90%, with a manageable increase in identity switches, which is indicative of the model's robustness in distinguishing individual birds effectively. This aspect is particularly important in monitoring the welfare of poultry, as flock tracking allows for the detection of flock activity patterns over time. On the other hand, YOLOv8+StrongSORT and YOLOv8+ByteTrack offered a nuanced view of the trade-offs between accuracy, identity retention, and processing speed, reflecting the complex balance that tracking algorithms must strike in dynamic environments such as cage-free poultry farms.

Despite these technological advancements, challenges in precision tracking persist. For instance, false detections can occur when chickens are occluded by feeders, drinking equipment, and other installations, a complication previously observed in broiler chicken houses (Guo et al., 2020). Additionally, the dusty conditions within cage-free poultry houses contribute to this issue, as dust particles in the air and on the camera, lenses can lead to inaccuracies (Yang et al., 2023). Furthermore, the camera view poses another issue, as hens frequently enter and leave the field of view, which may prevent the model from detecting all chickens in the house consistently.

In summary, the sophisticated interplay between tracking algorithm development and environmental management is crucial for advancing the analysis of flock activity indices. Maintaining a low-dust environment and simplifying the infrastructure in cage-free houses can significantly enhance the accuracy of detection systems.

Average Distance Detection Within a Chicken Flock

To rigorously evaluate the advanced YOLOv8+DeepSORT model's capability in monitoring cage-free poultry environments, we conducted an analysis using a 73-s video to ascertain the model's efficacy in determining the average distance among the flock. In this video, the model successfully identified a maximum of 91 chickens. The calculated average distance ranged between 590.75 and 892.95 pixels, as illustrated in Figure 8. During the initial 49 s of the footage, the chickens exhibited aggregation behavior, resulting in an increasing average distance. After this period, most of the chickens moved out of the camera's field of view. The remaining chickens distributed near corners or feeders, showed a decrease in average distance. This dynamic was captured in visualized results, and corresponding images highlighting detection overlays are presented in Figure 9.Figure 8 Temporal variations in the spatial distribution of chickens in a cage-free environment.

Figure 8

Figure 9 Integrated approach to poultry behavior study: original video (a), flock network analysis (b), and individual tracking with temporal distance data (c).

Figure 9

Figure 9. Integrated approach to pouly behavior study: original video (1), flock network analysis (2), and individual tracking with temporal distance data. The number following “ID” represents the tracking ID, and the number following “bird” indicates the confidence score (3).

In the analysis of average distance measurements within a chicken flock, outliers are identified within each second, marked in red in Figure 10. These outliers are attributed to their extreme fluctuations, exceeding 15% compared to their neighboring data points within the same second (Kwak and Kim, 2017). Outliers can significantly skew the calculated average distances, leading to erroneous estimations in subsequent speed detection analyses. These outliers mainly come from high-speed chickens, such as flying or running chickens. To mitigate this issue, algorithms described in Table 4 are employed to filter out these outliers and reduce noise in the distance measurements. After the removal of outliers, the detection graph becomes smoother and less variable. The range of values changes from 590.75 to 892.95 pixels to 641.72 to 892.95 pixels. The minimum value shifts by 7.94%, while the maximum value remains unchanged, providing a more accurate and reliable estimation of the distances within the flock per second.Figure 10 Temporal variations in the spatial distribution of chickens in a cage-free environment (filtered).

Figure 10

Table 4 Algorithm 3-speed calculation summary.

Table 4Algorithm 3-distance filtering for noise reduction	
def filter_distances (average_distances, times):
filtered_distances = []
filtered_times = []
excluded_distances = []
excluded_times = []
for i in range (1, len (average_distances) - 1):
 prev_dist = average_distances [i - 1]
 next_dist = average_distances [i + 1]
 current_dist = average_distances [I]
 avg_neighbor_dist = (prev_dist + next_dist) / 2
 margin = 0.15 * avg_neighbor_dist
 if abs (current_dist - avg_neighbor_dist) ≤ margin:
  filtered_distances.append (current_dist)
  filtered_times.append (times[I])
 else:
  excluded_distances.append (current_dist)
  excluded_times.append (times[I])
return filtered_distances, filtered_times, excluded_distances, excluded_times	

Average Speed Detection Within a Chicken Flock

In terms of the flock's locomotion, the detected average speed within the chicken population ranged from 0 to 97 pixels per second. Observation indicated a stable velocity pattern during periods of flock aggregation. Notably, after the 49-second mark, an incremental increase in speed was observed as chickens started to move out of the camera's field of view. The entire analysis is showed in the Figure 11.Figure 11 Fluctuations in the velocity of a free-range chicken flock over time.

Figure 11

For the detection of average speed, red points were used to represent data points excluded due to noise during the summation process over several seconds. After removing outliers, the overall speed profile became more stable. For instance, in Figure 11, around 50 s, there was a drastic fluctuation within 3 seconds when unfiltered; however, this fluctuation was stabilized after filtering, representing a more natural progression in the movement of a large group of chickens, with reduced aggression within the flock. Additionally, from time 0 to 10 s, the highest speed detection points lowered, and their proximity to other data points within this time range increased, which more accurately reflects the movement speed of chickens (Figure 12). This enhancement in the speed detection graph better aids in identifying movement patterns within chicken flocks.Figure 12 Fluctuations in the velocity of a free-range chicken flock over time (filtered).

Figure 12

Compare With Related Research

Our studies can be compared to prior work on flock activity estimation using 4 criteria: (1) accuracy across different postures, (2) potential for automation, (3) the level of detail in detection, and (4) capability to assess flock activity. Table 5 delineates how each method fares against these standards. Regarding posture variation, the methods by Bloemen et al (1997a) and Sherlock et al (2010) rely on calculating the pixels attributed to ‘animals’ within predefined gridlines, leading to inaccuracies when chickens change from dust bathing to walking due to the significant reduction in visible body size (Bloemen et al., 1997; Sherlock et al., 2010). In contrast, our method, along with that of Neethirajan (2022) employs deep learning detection bounding boxes to track the central point of each chicken, thereby mitigating errors associated with pose changes (Neethirajan, 2022).Table 5 The summary of comparable experiments.

Table 5Study	Activity index	Unaffected by posture	Automation	Identification level	Flock activity	
Bloemen et al. (1997a)	Image, table 5	Image, table 5	Image, table 5	3 mm	Image, table 5	
Sherlock et al. (2010)	Image, table 5	Image, table 5	Image, table 5	Individual chicken	Image, table 5	
Neethirajan (2022)	Image, table 5	Image, table 5	Image, table 5	Pixel	Image, table 5	
This study	Image, table 5	Image, table 5	Image, table 5	Pixel	Image, table 5	

Concerning automation, the first 2 studies in Table 5 require manual oversight to count birds or differentiate between animal pixels and their surroundings. However, the latter 2 studies utilize pretrained deep learning models that independently track chickens, allowing for automated activity calculation.

In terms of identification precision, the Bloemen et al (1997a) achieved a 3 mm accuracy in detecting chickens within images. Based on it, a dynamic mathematical model was developed to predict how broilers respond to step-wise light intensity changes in terms of activity (Kristensen et al., 2006). Additionally, individual chicken activity was correlated with leg health. However, manual observation is limited by the inability of human analysts to discern minute changes over extended periods, restricting identification to no more than 15 subjects. Conversely, deep learning models in our study can track over 48 chickens simultaneously with pixel-level accuracy. While both studies can detect such detail, our research extends up to 72 s of continuous tracking, surpassing the 40-s tracking at free-range farms reported by Neethirajan (2022). While our approach provides detailed tracking, it should be noted that extremely high spatial accuracy may have limited biological relevance; even minor movements of the birds could result in significant movements in the context of their behavior. Therefore, while our method provides valuable insights, its practical application should consider these limitations.

As for flock activity, although Bloemen et al (1997a) could calculate an activity index, it is dependent on human observation, which cannot ensure precision due to potential observational errors. Our study, on the other hand, can monitor changes in distance and velocity, visualizing the activity index based on the average distance within the entire flock and concurrent speed variations, all while maintaining high precision. In conclusion, our research underscores deep learning models, as the most effective method for analyzing the activity of cage-free chickens across a variety of postures and behaviors. These advanced computational approaches exhibit outstanding performance, particularly in their capacity to maintain high precision in tracking and analyzing the activity of broiler chickens, unaffected by a variety of postures and behaviors, because we track the middle of the chickens based on the center of the bounding box. This technological advancement represents a significant leap over traditional manual methods, which are limited by human observational constraints. Our methodology sets a new standard in poultry activity index research, providing a scalable and reliable framework for future studies.

Detection of Piling and Smothering Behaviors

Piling and smothering are abnormal behaviors in cage-free laying hens, where piling happens when birds crowd together, and smothering is the serious condition that results from long-term crowding, often leading to the death of chickens (Gray et al., 2020). Three types of smothering are most common among laying hens. Stress-induced panic smothering occurs due to acute disturbances that trigger fear, causing hens to densely pack together, leading to high mortality rates (Barrett et al., 2014). Preference-based nest box or seeking warm place smothering reflects the hens' choice to occupy the same preferred space, which can cause varying levels of mortality based on the birds' overcrowding in preferred locations. Seemingly reasonless, recurring smothering involves slow-moving groups of birds that cluster together without apparent cause, persisting throughout the laying period and resulting in lower mortality rates (Winter et al., 2021). Therefore, the most apparent signs of piling and smothering are their crowded postures, which indicate a lower average distance between chickens. For example, in our study, piling and smothering behaviors occur most frequently when strangers enter the chicken house to collect eggs. The chickens pile up due to their fear of unfamiliar people (Figure 13A), and they also gather in preferred resting places at night (Figure 13B). Under these 2 piling and smothering behaviors, the average distance between chickens is 255.99 pixels and 456.78 pixels, respectively, which is at least 28.82% lower than in normal situations, which means the range of average distance detection within a chicken flock is between 641.72 and 892.95 pixels, as discussed in part 3.2. We used the minimum value, 641.72 pixels, to compare with 456.78 pixels and found it to be 28.82% lower, based on our 73-s continuous monitoring of normal activities. Additionally, when piling and smothering occur in only a portion of the camera view, we can use region-based detection to identify these behaviors in high-risk areas like side walls, doors, and nesting boxes (Ye et al., 2020a; Bist et al., 2023b). Moreover, in the absence of clear fear-inducing elements in the camera footage, environmental data can be combined to investigate potential causes of piling and smothering. According to the Hy-Line W-36 Commercial Layers Management Guide, chicks are prone to cluster together in response to cold temperatures. Additionally, uneven ventilation or light distribution within the enclosure may prompt chicks to congregate in specific areas, seeking to avoid drafts or noise (Hy-line, 2020).Figure 13 The detection of piling behavior in cage-free houses: A shows piling due to stressful conditions, while B depicts piling resulting from birds gathering in a preferred location.

Figure 13

Compared with other observation methods, such as manual observation and labeling piling behavior to train CNN models, our method can serve as a real-time detector without human observation, providing a summary of the location, frequency, and duration of piling incidents (Campbell et al., 2016; Jensen et al., 2024). Moreover, our approach overcomes the shortcomings of labeling groups of chickens as exhibiting piling behavior, which may cause errors when the entire flock is densely packed, making the whole flock appear crowded.

Measuring Activity Levels in Poultry Flocks

According to the speed detection data presented in Figure 12, activity levels can be classified into 3 categories: low (0–30 pixels/s), medium (30–50 pixels/s), and high (50–80 pixels/s). These levels correspond to the different flock activity observed throughout the detection period and are consistent with manual observations (Figure 14). Continuous activity levels of chickens can serve as indicators of the overall health status of the flock. For example, research from the UK has demonstrated that turkey poults with high levels of footpad dermatitis (FPD) exhibit reduced walking speeds (Wyneken et al., 2015). Similarly, studies indicate that broiler chickens with lameness walk significantly slower compared to their healthy counterparts. Observed improvements in gait speed following the administration of carprofen, an analgesic, further corroborate this finding (McGeown et al., 1999). Consequently, walking speed can serve as a reliable indicator of foot issues. However, there is a limitation when chickens jump up and down from perches. Sometimes the horizontal movement distance is small, requiring an additional depth sensor on the camera to monitor such changes. By utilizing technology to detect activity levels, we can identify flocks with consistently lower walking speeds, suggesting potential FPD issues. Additionally, deviations in broiler activity patterns have been correlated with hock burns (R2= 0.70) (Peña Fernández et al., 2018b). Thus, deviations in activity levels in our study could also be used to monitor hock burns by calculating variations in activity levels. This approach not only enhances our understanding of avian health dynamics but also enables proactive management practices to mitigate potential welfare issues within poultry flocks.Figure 14 Visualization of activity levels in cage-free houses, where the blue bar represents the range of low activity level, the green bar represents the range of moderate activity level, and the red bar represents the range of high activity level.

Figure 14

CONCLUSIONS

In this study, multiple hen trackers were developed using YOLO networks combined with ByteTrack, StrongSORT, and DeepSORT to monitor the activity index of cage-free hens. Results indicate that the average MOTA for each tracker ranged from 80% to 94%, with the highest performance observed in the YOLOv8 combined with DeepSORT configuration. This tracker can detect piling and smothering behaviors, as well as footpad issues in cage-free hen environments. The classifiers successfully mitigate errors stemming from changes in hen postures and can quantify flock activity by calculating average distance and speed within a chicken flock. The findings offer a practical and visual approach for monitoring the activity index of cage-free hens without the need for human observation. This study is among the pioneers in integrating deep learning technologies with statistical methods to monitor the activity level of cage-free hens, providing valuable information for assessing animal health and welfare.

DISCLOSURES

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.

ACKNOWLEDGMENTS

The study was sponsored by the USDA-NIFA AFRI (2023-68008-39853 ), Georgia Research Alliance (Venture Fund), Oracle America (Oracle for Research Grant, CPQ-2060433 ), and UGA IIPA Equipment grant.
==== Refs
REFERENCES

Barrett J. Rayner A.C. Gill R. Willings T.H. Bright A. Smothering in UK free-range flocks. Part 1: incidence, location, timing and management Veterinary Record 175 2014 19 24836430
Bist R.B. Subedi S. Chai L. Yang X. Ammonia emissions, impacts, and mitigation strategies for poultry production: A critical review J. Environm. Manag. 328 2023 116919
Bist R.B. Subedi S. Yang X. Chai L. A novel YOLOv6 object detector for monitoring piling behavior of cage-free laying Hens Agri. Engineer. 5 2023 905 923
Bloemen H. Aerts J.-M. Berckmans D. Goedseels V. Image analysis to measure activity index of animals Equine Vet. J. 29 1997 16 19
Campbell D.L.M. Makagon M.M. Swanson J.C. Siegford J.M. Litter use by laying hens in a commercial aviary: Dust bathing and piling Poult. Sci. 95 2016 164 175 26354762
Dadboud F. Patel V. Mehta V. Bolic M. Mantegh I. Single-stage UAV detection and classification with YOLOV5: Mosaic data augmentation and PANet 2021 17th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS) 2021 1 8
Du Y. Zhao Z. Song Y. Zhao Y. Su F. Gong T. Meng H. StrongSORT: Make DeepSORT great again IEEE Transact. Multimed. 25 2023 8725 8737
Elmessery W.M. Gutiérrez J. Abd El-Wahhab G.G. Elkhaiat I.A. El-Soaly I.S. Alhag S.K. Al-Shuraym L.A. Akela M.A. Moghanm F.S. Abdelshafie M.F. YOLO-based model for automatic detection of broiler pathological phenomena through visual and thermal images in intensive poultry houses Agriculture 13 2023 1527
Gray H. Davies R. Bright A. Rayner A. Asher L. Why do hens pile? Hypothesizing the causes and consequences Front. Vet. Sci. 7 2020 616836
Guzmán D.A. Pellegrini S. Kembro J.M. Marin R.H. Social interaction of juvenile Japanese quail classified by their permanence in proximity to a high or low density of conspecifics Poult. Sci. 92 2013 2567 2575 24046402
Guzmán D.A. Pellegrini S. Flesia A.G. Aon M.A. Marin R.H. Kembro J.M. High resolution, week-long, locomotion time series from Japanese quail in a home-box environment Scient. Data 3 2016 1 7
Guo Y. Aggrey S.E. Wang P. Oladeinde A. Chai L. Monitoring behaviors of broiler chickens at different ages with deep learning Animals 12 2022 3390 36496910
Guo Y. Chai L. Aggrey S.E. Oladeinde A. Johnson J. Zock G. A machine vision-based method for monitoring broiler chicken floor distribution Sensors 20 2020 3179 32503296
Guo S. Wang S. Yang Z. Wang L. Zhang H. Guo P. Gao Y. Guo J. A review of deep learning-based visual multi-object tracking algorithms for autonomous driving Appl. Sci. 12 2022 10741
Horna F. Leandro G.S. Bícego K.C. Macari M. Reis M.P. Cerrate S. Sakomura N.K. Energy cost of physical activities in growing broilers Br. Poult. Sci. 64 2023 483 490 36947419
Hussain M. YOLO-v1 to YOLO-v8, the rise of YOLO and its complementary nature toward digital manufacturing and industrial defect detection Machines 11 2023 677
Liang S. Wu H. Zhen L. Hua Q. Garg S. Kaddoum G. Hassan M.M. Yu K. Edge YOLO: Real-time intelligent object detection system based on edge-cloud cooperation in autonomous vehicles IEEE Transactions on Intelligent Transportation Systems 23 2022 25345 25360
Hy-line. 2020. Hy-line W36 management guide. https://www.hyline.com/filesimages/Hy-Line-Products/Hy-Line-Product-PDFs/W-36/36%20COM%20ENG.pdf. Accessed Dec. 2022.
Jensen, D., M. Toscano, E. Heide, M. Grønvig, and F. Hakansson. 2024. Comparison of strategies for automatic video-based detection of piling behaviour in poultry. Available at https://papers.ssrn.com/abstract=4781006 (Accessed May 6, 2024).
Jocher, G. 2020. YOLOv5 by Ultralytics. Available at https://github.com/ultralytics/yolov5 (Accessed March 26, 2023).
Kashiha M. Pluk A. Bahr C. Vranken E. Berckmans D. Development of an early warning system for a broiler house using computer vision Biosystems Engineering 116 2013 36 45
Kim, K., and H. S. Lee. 2020. Probabilistic anchor assignment with IoU prediction for object detection. Available at http://arxiv.org/abs/2007.08103 (Accessed Dec 29 , 2022).
Kristensen H.H. Aerts J.M. Leroy T. Wathes C.M. Berckmans D. Modelling the dynamic activity of broiler chickens in response to step-wise changes in light intensity Appl. Anim. Behav. Sci. 101 2006 125 143
Kwak S.K. Kim J.H. Statistical data preparation: Management of missing values and outliers Korean J. Anesthesiol. 70 2017 407 411 28794835
Leroy T. Vranken E. Van Brecht A. Struelens E. Sonck B. Berckmans D. A computer vision method for on-line behavioral quantification of individually caged poultry Transact. ASABE 49 2006 795 802
Mao A. Huang E. Wang X. Liu K. Deep learning-based animal activity recognition with wearable sensors: Overview, challenges, and future directions Comput. Electr. Agric. 211 2023 108043
McGeown D. Danbury T.C. Waterman-Pearson A.E. Kestin S.C. Effect of carprofen on lameness in broiler chickens Vet. Rec. 144 1999 668 671 10404606
Neethirajan S. ChickTrack – A quantitative tracking tool for measuring chicken activity Measurement 191 2022 110819
Oczak M. Ismayilova G. Costa A. Viazzi S. Sonoda L.T. Fels M. Bahr C. Hartung J. Guarino M. Berckmans D. Vranken E. Analysis of aggressive behaviours of pigs by automatic video recordings Comput. Electr. Agric. 99 2013 209 217
Peña Fernández A. Demmers T.G.M. Tong Q. Youssef A. Norton T. Vranken E. Berckmans D. Real-time modelling of indoor particulate matter concentration in poultry houses using broiler activity and ventilation rate Biosyst. Engineer. 187 2019 214 225
Peña Fernández A. Norton T. Tullo E. van Hertem T. Youssef A. Exadaktylos V. Vranken E. Guarino M. Berckmans D. Real-time monitoring of broiler flock's welfare status using camera-based technology Biosyst. Engineer. 173 2018 103 114
Peña Fernández A. Norton T. Tullo E. van Hertem T. Youssef A. Exadaktylos V. Vranken E. Guarino M. Berckmans D. Real-time monitoring of broiler flock's welfare status using camera-based technology Biosyst. Engineer. 173 2018 103 114
Pu H. Lian J. Fan M. Automatic recognition of flock behavior of chickens with convolutional neural network and Kinect sensor Int. J. Patt. Recogn. Artif. Intell. 32 2018 1850023
Quach L.-D. Pham-Quoc N. Tran D.C. Hassan M.F. Identification of chicken diseases using VGGNet and ResNet models Vo N.-S. Hoang V.-P. Pages 259–269 in Industrial networks and intelligent systems 2020 Springer International Publishing Cham
Sherlock L. Demmers T.G.M. Goodship A.E. Mccarthy I.D. Wathes C.M. The relationship between physical activity and leg health in the broiler chicken Br. Poult. Sci. 51 2010 22 30 20390566
van der Sluis M. Ellen E.D. de Klerk B. Rodenburg T.B. de Haas Y. The relationship between gait and automated recordings of individual broiler activity levels Poult. Sci. 100 2021 101300
Weber Wyneken C. Sinclair A. Veldkamp T. Vinco L.J. Hocking P.M. Footpad dermatitis and pain assessment in turkey poults using analgesia and objective gait analysis Br. Poult. Sci. 56 2015 522 530 26248222
Winter J. Toscano M. Stratmann A. Piling behaviour in Swiss layer flocks: Description and related factors Appl. Anim. Behav. Sci. 236 2021 105272
Wojke, N., A. Bewley, and D. Paulus. 2017. Simple online and realtime tracking with a deep association metric. arXiv.org Available at https://arxiv.org/abs/1703.07402v1 (Accessed April 5, 2024).
Yang X. Bist R. Subedi S. Wu Z. Liu T. Chai L. An automatic classifier for monitoring applied behaviors of cage-free laying hens with deep learning Engineer. Applicat. Artif. Intell. 123 2023 106377
Yang X. Chai L. Bist R.B. Subedi S. Wu Z. A deep learning model for detecting cage-free hens on the litter floor Animals 12 2022 1983 35953972
Yang X. Dai H. Wu Z. Bist R.B. Subedi S. Sun J. Lu G. Li C. Liu T. Chai L. An innovative segment anything model for precision poultry monitoring Comput. Electron. Agric. 222 2024 109045
Yang X. Bist R.B. Paneru B. Chai L. Deep learning methods for tracking the locomotion of individual chickens Animals 14 2024 911 38540009
Ye C. Yousaf K. Qi C. Liu C. Chen K. Broiler stunned state detection based on an improved fast region-based convolutional neural network algorithm Poult. Sci. 99 2020 637 646 32416852
Ye C. Yu Z. Kang R. Yousaf K. Qi C. Chen K. Huang Y. An experimental study of stunned state detection for broiler chickens using an improved convolution neural network algorithm Comput. Electron. Agric. 170 2020 105284
Zhang, Y., P. Sun, Y. Jiang, D. Yu, F. Weng, Z. Yuan, P. Luo, W. Liu, and X. Wang. 2021a. ByteTrack: Multi-object tracking by associating every detection box. arXiv.org Available at https://arxiv.org/abs/2110.06864v3 (Accessed April 5, 2024).
Zhang Y. Xie F. Huang L. Shi J. Yang J. Li Z. A lightweight one-stage defect detection network for small object based on dual attention mechanism and PAFPN Front. Phys. 9 2021 708097 Available at https://www.frontiersin.org/article/10.3389/fphy.2021.708097 (Accessed March 31, 2022)
