Automatic detection of bumblefoot in cage-free hens using computer vision technologies

586

Cage-free (CF) housing systems are expected to be the dominant egg production system in North America and European Union countries by 2030. Within these systems, bumblefoot (a common bacterial infection and chronic inflammatory reaction) is mostly observed in hens reared on litter floors. It causes pain and stress in hens and is detrimental to their welfare. For instance, hens with bumblefoot have difficulty moving freely, thus hindering access to feeders and drinkers. However, it is technically challenging to detect hens with bumblefoot, and no automatic methods have been applied for hens’ bumblefoot detection (BFD), especially in its early stages. This study aimed to develop and test artificial intelligence methods (i.e., deep learning models) to detect hens’ bumblefoot condition in a CF environment under various settings such as epochs (number of times the entire dataset passes through the network during training), batch size (number of data samples processed per iteration during training), and camera height. The performance of 3 newly developed deep learning models (i.e., YOLOv5s-BFD, YOLOv5m-BFD, & YOLOv5x-BFD) were compared in detecting hens with bumblefoot of hens in CF environments. The result shows that the YOLOv5m-BFD model had the highest precision (93.7%), recall (84.6%), mAP@0.50 (90.9%), mAP@0.50:0.95 (51.8%), and F1-score (89.0%) compared with other models. The observed YOLOv5m-BFD model trained at 400 epochs and batch size 16 is recommended for bumblefoot detection in laying hens. This study provides a basis for developing an automatic bumblefoot detection system in commercial CF houses. This model will be modified and trained to detect the occurrence of broilers with bumblefoot in the future.

INTRODUCTION

Bumblefoot (pododermatitis, footpad dermatitis, or foot rot) is the term used to describe a common bacterial infection and chronic inflammatory reaction in a bird (Shepherd and Fairchild, 2010; Stransky et al., 2016). It is clinically characterized by swelling, abrasion, hyperkeratosis, and ulceration of the digital pad, planta metatarsal region, or both (Wilcox et al., 2009; Stransky et al., 2016). Bumblefoot compromises the foot’s internal tissues, including the mesoderm, tendons, and bones, leading to laminitis (inflammation and damage that affects feet and can lead to lameness), synovitis (acute to chronic systematic disease caused by Mycoplasma synoviae infection), osteomyelitis (an inflammatory condition leading to infection of the bone), and ultimately death if left untreated (McNamee and Smyth, 2000). In a study conducted by Wang et al. (1998), footpad lesions occurred in 38% of hens raised on dry litter and in 92% of hens raised on wet litter. Most bumblefoot cases in poultry were identified in floor housing systems instead of cage housing (Wang et al., 1998; Tauson et al., 1999; Fulton, 2019). However, the increased incidence of bumblefoot in caged laying hens is linked with pressure on the metatarsal foot pad due to perch design (Tauson, 1998) and wet or unsanitary perches (Tauson and Abrahamsson, 1996).

There have been many predisposing factors associated with bumblefoot, including stocking density, seasonal effects, drinker design and maintenance, litter material, litter moisture content, litter depth, and litter additives in floor-housed chickens (Bilgili et al., 2009; Shepherd and Fairchild, 2010; NCC, 2018; Craven et al., 2021). Various nutritional factors, including grain source, vitamin, mineral, and amino acid supplementation, protein level, and diet density, have also been linked to pododermatitis (Nagaraj et al., 2007). In addition, the hen genetic line also significantly affects the occurrence of bumblefoot (Abrahamsson and Tauson, 1995). For example, between Lohmann Selected Leghorn (LSL) and Lohmann Brown, LSL hens resulted in a high bumblefoot incidence (Abrahamsson and Tauson, 1995; Abrahamsson et al., 1998). Among house types, bumblefoot was most prevalent in the aviary or floor-raised hens, followed by enriched colony birds, and was almost nonexistent in conventional caged birds (Fulton, 2019). The bumblefoot issues could be significant as the egg industry is completely moving from caged to cage-free.

Most cases of bumblefoot conditions in laying hens occur at 35 wk of age due to litter conditions and equipment (Abrahamsson et al., 1998). At the age of depopulation, approximately 62% of laying hens had keel bone damage seen in all birds with bumblefoot on both feet (Gebhardt-Henrich and Frohlich, 2015). The research suggested that hens with bumblefoot could be more prone to losing their grip on perches, potentially resulting in falls that increase the risk of keel bone damage. According to Berg (1998), the bumblefoot lesions produce pain and stress, which makes the animal reluctant to move and decreases feed consumption (De Jong et al., 2014; Chuppava et al., 2018). The decrease in feed consumption is due to impediments in walking and perching activities, which may restrict feeder and drinker access (Hester, 1994). In addition, Harms and Simpson 1975, observed an unsteady gait in birds with bumblefoot, and Hester (1994) explained how bumblefoot results in walking with a hobbling gait. Hens with hobbling gait can be a major concern for the poultry industry regarding animal welfare (Bradshaw et al., 2002). Therefore, bumblefoot is considered painful and harms the birds’ well-being (Tauson, 2002; Lay Jr et al., 2011). The bumblefoot is now used as an objective audit criterion in European and American poultry production systems (NCC, 2018). As a measure of farm well-being, the rate of bumblefoot occurrence is becoming more widely recognized (Martrenchar et al., 2002). Therefore, early detection and treatment of pathogens causing bumblefoot are needed.

Staphylococcus aureus (SA) (68%) and Enterococcus faecalis (14%) were the 2 most common bacterial species found in an examination of bacterial pathogens in egg-laying hens with bumblefoot (Heidemann Olsen et al., 2018). The SA is a gram-positive bacterium found on the skin of non-clinical animals and in large concentrations in the dust of chicken houses, feed, and gut contents (Zhu et al., 1999). Infection with SA is one of the most frequent poultry diseases in commercial layers, which decreases production efficiency and results in death rates up to 15% (Youssef et al., 2019). The SA can invade the mesoderm, proliferate, and cause inflammation when the mucosal or skin barriers are compromised due to trauma or stress. If left untreated, it will quickly go up the leg and into the body, where it could cause a fatal septicaemic infection or even cause death (Choudhury, 2019). Therefore, early diagnosis and treatment are essential for a positive prognosis and to prevent complications caused by lameness. Starting with a tiny cut on the bottom of the foot, the infection spreads through it and eventually results in a black scab. Surgery is usually required to open the scab or abscess and carefully remove all necrotic material by avoiding nerves, tendons, and blood vessels (Coles, 2007). The affected area is then treated using a 0.1% potassium permanganate solution, and the pus is surgically removed (Choudhury, 2019). The bird received an antibiotic course as well as other supportive treatments. Topical antiseptics and oral or injected antibiotics may be used to combat the infection. A combination of surgery, local and antibiotic therapy chosen after an antibiotic sensitivity test, and proper post-operative care are effective and helpful in treating these infections. However, performing surgery-based cures in commercial laying hen facilities is hard, time-consuming, and labor-intensive. Therefore, early detection would be useful to optimize treatment to determine the prevalence of bumblefoot in the flock and determine the best course of action for prevention or correction. A potential alternative solution would be to find a detection model or technology that can detect bumblefoot with a higher detection rate. Detection early can helps producers to inform about bumblefoot rates and might give a general idea of what to look after, such as an environmental substrate or foot soaking treatment inside a housing to improve foot health.

In laying hens, infrared thermal imaging technology has been extensively used to assess bumblefoot conditions (Wilcox et al., 2009; Ben Sassi et al., 2016). However, using this technology can be invasive as it may involve holding the hen several times, potentially increasing stress on laying hens. Furthermore, the stress induced in hens could be detrimental to their welfare (Lay Jr et al., 2011). Therefore, there is a need for a non-invasive real-time bumblefoot detection (BFD) system. Several detection algorithms are developed and widely used, but YOLO (You Only Look Once) has proven and outperformed in real-time detection, processing speed, and GPU usage than other models (Huang et al., 2018; Bist et al., 2023b; Subedi et al., 2023a). You Only Look Once is a single-stage object detector that uses a single network to process image data and gives fast object recognition and positioning (Shafiee et al., 2017). Recent research has shown that the YOLOv5 model best detects small objects like chickens (Yang et al., 2022; Bist et al., 2023a; Subedi et al., 2023a) and eggs (Subedi et al., 2023b; Yang et al., 2023a) in cage-free (CF) housing. Similarly, abnormal behavior is hard to detect with higher precision, which is only possible with the YOLOv5 model. For example, Subedi et al. (2023a) detected the pecking behavior in CF hens and predicted it would improve animal welfare after further improvement. Overall, the YOLOv5 model is widely used to detect various objects in the poultry industry. Thus, the YOLOv5 models were used for BFD in the CF facility, where hens with different behaviors and welfare concerns have been reported (Subedi et al., 2023a; Yang et al., 2023b). The objectives of this study were to: i) develop and test a YOLOv5-BFD model as a diagnostic tool for detecting clinical bumblefoot in CF layers; ii) compare the performance of YOLOv5s-BFD, YOLOv5m-BFD, and YOLOv5x-BFD model; and iii) evaluate the performance of optimal YOLOv5-BFD model under different settings (camera heights, epochs, & batch sizes). The final model will give the best BFD model to detect bumblefoot and help to evaluate and improve animal welfare.

MATERIALS AND METHODS

Housing, Animal, and Data Acquisition

Our study acquired the bumblefoot datasets (Figure 1) from the 4 identical CF experimental rooms with 720 laying hens (180 Hy-line W36 hens per room) at the University of Georgia Poultry Research Facility, GA, USA. Each room measures 7.3m L × 6.1m W × 3m H (Figure 2A). For the BFD datasets, the 2 cameras were positioned 30 cm and 50 cm above the litter, as shown in Figure 2B. The video was recorded from the 48 to 50 wk of laying hen age with the help of a night-vision network camera (PRO-1080MSB, Swann Communications USA Inc, LA). The data acquisition 16 h daily, from 5 am to 9 pm. The video obtained were recorded with the help of a Swann digital video recorder (DVR-4580, Swann Communications USA Inc, LA) and stored in .avi format with a picture resolution of 1,920 × 1,080 pixels and 15 frames per second (FPS) sampling rate. Next, the videos obtained were converted into images (.jpg format) by Free Video to JPG Converter App (version 5.0). After converting videos into images, images were further selected and separated based on bumblefoot visibility, hens’ positions, and leg orientation. The final image datasets obtained were labeled using the image labeler website (Makesense.AI) with one class as BFD (Figure 3).

Figure 1

  1. Download : Download high-res image (557KB)
  2. Download : Download full-size image

Figure 1. Cage-free laying hen having bumblefoot from (A) side view, (B) top view, and (C) bottom view of the hen’s foot.

Figure 2

  1. Download : Download high-res image (798KB)
  2. Download : Download full-size image

Figure 2. Experimental CF (A) laying hen housing, (B) camera setup at 30 and 50 cm above litter floor.

Figure 3

  1. Download : Download high-res image (672KB)
  2. Download : Download full-size image

Figure 3. Training images with a labeled representation of “0” as BFD. The rectangular box represents the leg with bumblefoot. BFD, bumblefoot detection.

A total of 2,200 images were labeled as BFD datasets, which is 1,100 from each height of 30cm and 50cm. Some of the image’s datasets (30%) used various data augmentation processes (rotation, flip, brightness and contrast adjusting, color jittering, and cropping) to avoid under and overfitting problems and improve performance. The BFDtotal datasets obtained were first compared with the 3 best-performing YOLOv5 models (YOLOv5s, YOLOv5m, and YOLOv5x), and then the best detection model was used to compare other classes or parameters for this study (Table 1). First, images were trained, validated, and tested in the ratio of 7:2:1. The BFDtotal datasets were trained and compared at 100 epochs and batch size 16. Later, the BFD by height dataset was trained based on the best epoch and batch size obtained from the epoch and batch size comparison.

Table 1. Data preprocessing for model detection.

Classa Original dataset Train (70%) Validation (20%) Test (10%)
BFDtotal 2,200 1,540 440 220
BFDbatch4-321 2,200 1,540 440 220
BFDepoch50-4002 2,200 1,540 440 220
BFDheight30cm 1,100 770 220 110
BFDheight50cm 1,100 770 220 110
a

BFD – bumblefoot detection.

1

Batch sizes of 4, 8, 16, and 32 trained each with 2,200 datasets.

2

Epochs of 50, 100, 200, and 400 trained each with 2,200 datasets; BFD-bumblefoot detection; BFDtotal consist of images at different heights (30cm and 50cm), standing position, and walking distances.

Proposed YOLOv5 Model

Many versions of the YOLO series for object detection have been released; YOLOv5 is the fifth YOLO series version, released in 2020 (Jocher, 2022). As it is a single-stage detector instead of a double-stage detector like RCNN, the YOLOv5 model is a faster and more real-time detector model used today (Yang et al., 2022; Subedi et al., 2023a). The architecture of the YOLOv5 model for the proposed method is shown in Figure 4. The YOLOv5-BFD model is mainly composed of Input, backbone as extracting features, neck as a combined structure of a feature pyramid network (FPN) (Lin et al., 2017) and path aggregation network (PANet) (Liu et al., 2018) and head as output or prediction of BFD. In the YOLOv5 model, the main function of the FPN is to handle multiscale feature extraction and fusion, enabling the model to effectively detect objects at various sizes and resolutions within an image. On the other hand, the main function of PANet is to perform feature aggregation across different spatial scales, enhancing the model’s ability to capture context and detail, particularly in complex scenes.

Figure 4

  1. Download : Download high-res image (672KB)
  2. Download : Download full-size image

Figure 4. Architecture of YOLOv5 model used in bumblefoot detection. CBL, convolution, batch normalization, and leaky-ReLu; CSP, cross stage partial; SPP, spatial pyramid pooling; CONV, convolutional kernel; BN, batch normalization; Res, residual; ReLu, rectified linear unit; Concat, concatenate.

Inputs. The input part of the YOLOv5-BFD model enriches the BFD dataset with mosaic data augmentation, which helps decrease the hardware device requirement and lower computational cost (Wang et al., 2020). This mosaic data augmentation is the same as in the YOLOv4 model but performs better for small object detection (Yao et al., 2021). However, decreasing the original BFD dataset size to smaller might deteriorate the model’s overall BFD performance. All the labeled BFD images that are input later changed into the default image size of 640 × 640 × 3 and further sliced into 4 slices (320 × 320 × 12) by the Focus when it reaches the backbone for extracting features (Figure 5).

Figure 5

  1. Download : Download high-res image (242KB)
  2. Download : Download full-size image

Figure 5. Structure of Focus module used in bumblefoot detection. CBL, convolution, batch normalization, and leaky-ReLu; Concat, concatenate.

Backbone. In the YOLOv5-BFD backbone (Figure 6), Focus reduces parameters, layers, FLOPs, and CUDA memory usage while increasing forward and backward speed and minimizing the impact on mAP (Jocher, 2021). The Cross-Stage-Partial-connections (CSP) module extracts features via the CSPDarkner53 (Bochkovskiy et al., 2020). The CSPDarker53 helps to achieve high and improved processing speed and superior detection accuracy (Wang et al., 2020). Furthermore, the backbone network’s receptive field is efficiently increased by using spatial pyramid pooling (SPP) to concatenate feature maps from various kernel sizes together as an output, separating important context features (He et al., 2015).

Figure 6

  1. Download : Download high-res image (449KB)
  2. Download : Download full-size image

Figure 6. The structure of (A) CSP and (B) SPP module used in YOLOv5-BFD. CSP, cross stage partial; CBL, convolution, batch normalization, and leaky-ReLu; CONV, convolutional kernel; Concat, concatenate; BN, batch normalization; SPP, spatial pyramid pooling.

Neck. In YOLOv5-BFD neck, FPN and PANet aggregate the image feature, which benefits the bumblefoot object in generalizing or identifying the same bumblefoot objects in different sizes and scales. The FPN and PANet use an effective multiscale feature fusion matrix that generates feature pyramids and enhances BFD model detection of different object sizes and scales (Yao et al., 2021). In addition, the FPN module enhances the bottom-up path, improving the low-level feature propagation of the BFD model.

Head. The head of YOLOv5-BFD uses the same head structure used in YOLOv3 and YOLOv4. The head consists of 3 convolution layers and helps in the multiscale prediction of a BFD object. These convolution layers predict the BFD object classes, bounding box locations (x, y, height, width), and the scores (Jocher, 2022).

Loss Function

The loss function in the YOLOv5-BFD model uses binary cross entropy to compute objectness loss and class loss; as a result, YOLOv5-BFD gives 3 outputs of bounding boxes, objectness scores, and detected object classes. First, the loss is calculated by the following equation:(i)

Network Training Parameters

The YOLOv5-BFD model for the BFD was obtained from the GitHub repository developed by Ultralytics in 2020 (Jocher, 2021). The 3 YOLOv5-BFD types (YOLOv5s-BFD, YOLOv5m-BFD, and YOLOv5x-BFD) were compared in this study. Each YOLOv5-BFD model differs based on size, layers, parameters, gradients, and GLOPs (Table 2).

Table 2. Training datasets based on the YOLOv5-BFD model parameters.

Model YOLOv5s YOLOv5m YOLOv5x
Type Small Medium XLarge
Layers 214 291 445
Parameters 7,025,023 20,875,359 86,224,543
Gradients 7,025,023 20,875,359 86,224,543
GFLOPs 16.0 48.2 204.6

BFD, bumblefoot detection; GFLOPs, giga floating point operations per second.

The experimental computing configuration was prepared before the BFD model detector was developed for model evaluation (Table 3). For training BFD datasets, the Oracle cloud computing system (Oracle America, Austin, Texas) was used for data analysis.

Table 3. Experimental computing configuration used for the YOLOv5-BFD model evaluation.

Configuration Computing parameter
GPU (4 counts) 4 × NVIDIA® A10 (24GB)
CPU 64 core OCPU
Memory (RAM) 1024GB
Drive (2 counts) 7.68 TB NVMe SSD
Operating system Ubuntu 22.10 (Kinetic Kudu)
Accelerated environment NVIDIA CUDA
Libraries NumPy 1.18.5, Torch-vision 0.8.1, OpenCV-python 4.1.1, Torch 1.7.0.

GPU, graphics processing units; CPU, central processing units; OCPU, oracle CPU; GB, giga bytes; SSD, solid stage drive; CUDA, compute unifed device architecture.

Performance Evaluation

This study uses precision, recall, mean average precision (mAP), and F1-score to evaluate the performance of the YOLOv5-BFD model. All the parameters are calculated based on true positive (TP; bumblefoot present in the image and model accurately detect it), true negative (TN; bumblefoot is neither present nor detected by the model in the image), false positive (FP; bumblefoot is not present in the image while model detect it), and false negative (FN; bumblefoot present in the image but cannot detected by the model) value obtained from the BFD model (Figure 7).

  • 1.

    Precision represents the proportion of the number of correct bounding box predictions in BFD objects from the BFD datasets.(ii)

  • 2.

    Recall indicates the proportion of the number of correct BFD predictions or true bounding box measures correctly predicted from all samples from the BFD datasets.(iii)

  • 3.

    The F1-score is the weighted average or harmonic mean of precision and recall obtained from evaluating the BFD model.(iv)

  • 4.

    The mAP is the mean average precision metric that helps evaluate the BFD model. The mAP is measured at the intersection over a union (IoU) threshold of 0.50 (mAP@0.50) or 0.5:0.95 (mAP@0.5:0.95).(v)

Figure 7

  1. Download : Download high-res image (794KB)
  2. Download : Download full-size image

Figure 7. Confusion matrix for bumblefoot detection model. The figure with rectangular box represents the legs were detected with the bumblefoot. BFD, bumblefoot detection.

Where, APi represents the average precision of the ith BFD category and C indicates the total number of BFD categories.

RESULTS AND DISCUSSION

Comparative Analysis of Different YOLOv5 Models

Experimental Results. The comparison of YOLOv5-BFD models on test data is shown in Table 4. From Table 4, we can see that the precision, recall, precision-recall (PR), mAP@0.50, mAP@0.50:95, and F1-score of the YOLOv5m-BFD model were 93.7, 84.6, 90.9, 90.9, 51.8, and 89.0%, respectively, which was higher than that of YOLOv5s-BFD and YOLOv5x-BFD model (Table 4). The YOLOv5x-BFD model showed the lowest test detection result. However, many studies have shown that the YOLOv5s model has higher performance in detecting a smaller object (Yang et al., 2022; Subedi et al., 2023a; b), but the overall performance of the YOLOv5m-BFD model (Figure 8) is the best among tested models and can be used to detect BFD in the poultry housing.

Table 4. Test result of YOLOv5-BFD model based on CF laying hen condition.

Data summary YOLOv5s-BFD YOLOv5m-BFD YOLOv5x-BFD
Precision (%) 91.5 93.7 92.5
Recall (%) 81.8 84.6 72.7
PR (%) 88.4 90.9 84.0
mAP@0.50 (%) 88.6 90.9 84.0
mAP@0.50:0.95 (%) 49.8 51.8 47.3
F1-score (%) 86.0 89.0 81.0

CF, cage free; BFD, bumblefoot detection; PR, precision-recall; mAP, mean average precision.

Figure 8

  1. Download : Download high-res image (1MB)
  2. Download : Download full-size image

Figure 8. The bumblefoot detection results of (A) YOLOv5x-BFD, (B) YOLOv5s-BFD, and (C) YOLOv5m-BFD. The figure with rectangular box represents the legs were detected with the bumblefoot. BFD-bumblefoot detection.

Model Performance Curves. From Figure 9, the precision, recall, mAP@0.50, and mAP@0.50:0.95 increased with the epoch, meaning more image training improves the detection performance. For example, the precision score was 0.0019, 0.0020, and 0.0013 during the initial stage of training at one epoch, reaching 0.900, 0.949, and 0.858 at 100 epochs for the YOLOv5s, YOLOv5m, and YOLOv5x, respectively. Similarly, the recall value at one epoch was 0.483, 0.509, and 0.320, while 0.817, 0.760, and 0.646 at 100 epochs for the YOLOv5s, YOLOv5m, and YOLOv5x, respectively. Overall, performance metrics for YOLOv5m perform better than other models from the beginning to the end of the training.

Figure 9

  1. Download : Download high-res image (888KB)
  2. Download : Download full-size image

Figure 9. Performance metrics (A) Precision, (B) Recall, (C) mAP@0.50, and d) mAP@0.50:0.95 comparison of different YOLOv5-BFD models. YOLO, You only look once with small (s), medium (m), and large model (l); mAP, mean average precision; Epochs, number of times the entire dataset passes through network during training.

The PR curve for the YOLOv5-BFD models is shown in Figure 10. The PR curves visualize how the model detects the positive classes. Among YOLOv5s-BFD, YOLOv5m-BFD, and YOLOv5x-BFD, PR curves seem higher for the YOLOv5m-BFD model of 90.9% at mAP@0.5 and lowest for YOLOv5x-BFD of 84.0% at mAP@0.50:0.95. Similarly, the F1-confidence curve for each model is given in Figure 10. The F1 scores give the model’s performance evaluation and the combined information on the precision and recall of a model. The F1-confidence curves show that the F1-score was highest for the YOLOv5m-BFD model at 89.0% at 0.312 confidence level and lowest for the YOLOv5x-BFD model at 81.0% at 0.424 confidence level. The higher the PR and F1 confidence curve value, the better the model performance will be. Thus, the YOLOv5m-BFD model outperforms in both PR and F1-confidence scores.

Figure 10

  1. Download : Download high-res image (473KB)
  2. Download : Download full-size image

Figure 10. Graph showing performance comparison along with PR-curves and F1-confidence curve obtained after training with (A) YOLOv5x-BFD, (B) YOLOv5m-BFD, and (C) YOLOv5s-BFD. BFD, bumblefoot detection; PR, precision-recall.

In this study, the confusion matrix offers insights into the performance of various YOLOv5-BFD models (Figure 11). Among these models, YOLOv5m-BFD stands out as the most balanced, achieving an impressive 86% accuracy in detecting BFD cases. Following closely behind, YOLOv5s-BFD exhibits an 84% accuracy rate in BFD detection. On the other hand, YOLOv5x-BFD, while still effective, demonstrates a somewhat lower positive detection rate at 74%. These findings provide valuable guidance for selecting and enhancing models for bumblefoot detection, with YOLOv5m-BFD emerging as a strong candidate.

Figure 11

  1. Download : Download high-res image (291KB)
  2. Download : Download full-size image

Figure 11. Comparison of YOLOv5-BFD models using confusion matrix. YOLO, You only look once with small (s), medium (m), and large model (l); BFD, bumblefoot detection.

Performances in Data Training and Validation. Figure 12 shows each model’s training and validation loss when each model was run at 100 epochs and 16 batch sizes. The training and validation loss function helps to determine and evaluate the model’s performance. From Figure 12, the Val box loss, Val object loss, train box loss, and train object loss values decreased as the number of epochs increased. It is obvious that, in order to improve the model, the various losses should be minimized. However, the Val box loss and Val object loss seem the highest in the YOLOv5x-BFD model, so this model was not a good fit for BFD.

Figure 12

  1. Download : Download high-res image (636KB)
  2. Download : Download full-size image

Figure 12. Training and validation result from (A) Train/box_loss, (B) Val/box_loss, (C) Train/obj_losss, and (D) Val/obj_loss of different YOLOv5 models. Train, training; Val, validation; obj, object. YOLO, You only look once with small (s), medium (m), and large model (l); mAP, mean average precision; Epochs, number of times the entire dataset passes through network during training.

Model Computing Network Performance. From Table 5, the model computing network performance for different YOLOv5 models was used, and performance was evaluated. When comparing different models, the computing parameters play an important role in speed, time consumption, and GPU usage. Higher speed, FPS image processing, and lower training time and GPU usage are recommended for better performance and productivity. When comparing all the computing parameters, YOLOv5s performs better by giving up to 26.2 FPS imaging processing speed, up to 145.0% higher training time, and up to 4.8 times less GPU usage. Therefore, the YOLOv5s outperforms in computing speed, whereas YOLOv5x shows poor computing performance.

Table 5. Comparison of the YOLOv5 model’s performance in computing network performance.

Computing network YOLOv5s YOLOv5m YOLOv5x
FPS 55.3 42.6 29.1
Parameters 7,012,822 20,852,934 86,173,414
Layer 157 212 322
GFLOPs 15.8 47.9 203.8
Epochs (its/s) 11.95 10.57 10.02
OSS used (MB) 14.3 42.1 173.0
Training time (hrs)* 0.420 0.535 1.029
GPU memory (GB) 1.04 1.83 4.95

FPS, frame per second; GFLOPs, giga floating point operations per second; OSS, optimizer stripped space; it/s, iteration per second; hrs, hours; GB, gigabyte; MB, megabyte.

Overall, after comparing the performance metrics and computing parameters used, the YOLOv5m-BFD model performs better and higher in terms of performance metrics (precision, recall, mAP@0.50, and mAP@0.50:0.95) while performing slowly in computing speed (27.4% higher training time) and GPU usage (1.8 times high) than YOLOv5s-BFD model. Sometimes, computing speed and GPU usage can be considered less if performance metrics are higher and better at target object detection.

Comparison Results of Different Classes Using the YOLOv5m Model

Deep learning often overlooks batch sizes and epochs (Lee et al., 2019). However, it has a significant effect on network performance. The model’s performance can be improved by adjusting the number of epochs and batch size. Larger batch sizes and lower epochs can lower the model’s validation performance of the model so the right batch size and epochs should be chosen to enhance performance. However, batch size and epochs depend more on the object detection type and model.

Batch Sizes. The results of different batch sizes and their effects on YOLOv5m-BFD model performance are shown in Table 6. As batch size increases, the precision increases while recall value decreases after batch size 8, which ultimately decreases mAP@0.50 and other performance metrics. For example, the batch size of 4 showed lower precision (89.2%), while the batch size 32 resulted in 94.4% precision. If we look at the recall, mAP@0.50, mAP@0.50:0.95, and F1-score decreased while increasing the batch size, but the performance metrics were higher for batch sizes 8 and 16, while the lowest was for batch size 32. The model’s generalization ability appears to have deteriorated because of the large batch size (Lee et al., 2019). Therefore, Batch size 16 is recommended for enhancing model accuracy.

Table 6. Performance comparison of the YOLOv5-BFD model at different batch sizes.

Data summary1 Precision (%) Recall (%) mAP@0.50 (%) mAP@ 0.50:0.95 (%) F1-score Training time (h) GPU memory (GB)
BFDbatch4 89.2 79.8 85.5 48.9 84.0 0.932 1.27
BFDbatch8 89.7 86.9 90.1 52.4 88.0 0.498 1.34
BFDbatch16 93.7 84.6 90.9 51.8 89.0 0.535 1.83
BFDbatch32 94.4 75.2 85.2 48.7 84.0 0.204 3.38
1

Run at 100 epochs; BFD, bumblefoot detection; mAP, mean average precision; GB, gigabytes.

Similarly, training time increases, and GPU usage decreases as batch size increases (Abri et al., 2019). Therefore, a larger batch size can help lower the GPU usage cost per epoch (Lee et al., 2019). For example, the training time for batch size 4 is higher because it takes a smaller number of images for training at one time (4 images at one time), but for batch size 32, training time decreases because it uses 32 images of total images at once for processing and it will be quick to finish training. In the case of GPU usage, the higher the number of images used for training, the higher the GPU usage. GPU usage was found to be highest for batch size 32 and lowest for batch size 4. Overall, based on the evaluation of performance, computing speed, and GPU usage, batch size 16 outperformed (Figure 13).

Figure 13

  1. Download : Download high-res image (1MB)
  2. Download : Download full-size image

Figure 13. Performance metrics (A) Precision, (B) Recall, (C) mAP@0.50, and d) mAP@0.50:0.95 of YOLOv5m-BFD model at different batch sizes. YOLO, You only look once with small (s), medium (m), and large model (l); mAP, mean average precision; Epochs, number of times the entire dataset passes through network during training; Batch size, number of data samples processed per iteration during training.

Epochs. Table 7 shows the comparative results of the YOLOv5m model at different epochs in detecting hens’ bumblefoot. In terms of precision, as the epochs number increases, the precision, mAP@0.50:0.95, and F1-score increases. For example, the YOLOv5m-BFD model of epoch 400 resulted in higher precision, mAP@0.50:0.95, and F1-score up to 10.7, 36.9, and 7%, respectively. However, the YOLOv5m-BFD model was stopped at 304 epochs because no improvement was observed in the last 100 epochs; the best epoch was observed at 204. Therefore, there was a chance to consider 200 epochs, but the YOLOv5m-BFD model ran at 200 epochs and stopped at 192 epochs because no improvement was observed in the last 100 epochs; the best epoch was observed at 92. Although the model stopped before the set epochs, the model trained with epoch 400 should be considered for future detection model training because of better detection results. According to Lee et al. (2019), a larger epoch size slows the model training speed, which, in turn, achieves lower validation accuracy. However, we found the highest validation results with more training time consumption. It appears that longer training durations lead to improved accuracy in the result. The overall performance metrics were comparatively highest at epoch 400, as seen in Figure 14.

Table 7. Performance comparison of the YOLOv5m-BFD model at different epochs.

Data summary1 Precision (%) Recall (%) mAP@0.50 (%) mAP@ 0.50:0.95 (%) F1-score Training time (h) GPU memory (GB)
BFDepoch50 88.0 76.0 82.2 46.6 82.0 0.258 1.34
BFDepoch100 89.7 86.9 90.1 52.4 88.0 0.498 1.34
BFDepoch200 94.9 77.2 90.6 51.7 85.0 0.919 1.34
BFDepoch400 98.7 80.8 89.2 83.5 89.0 1.471 1.34
1

Run at batch size 16; BFD, bumblefoot detection; mAP, mean average precision; GB, gigabytes.

Figure 14

  1. Download : Download high-res image (1MB)
  2. Download : Download full-size image

Figure 14. Performance metrics (A) Precision, (B) Recall, (C) mAP@0.50, and (D) mAP@0.50:0.95 of YOLOv5m-BFD model at different epochs. YOLO, You only look once with small (s), medium (m), and large model (l); mAP, mean average precision; Epochs, number of times the entire dataset passes through network during training.

Camera Settings. The camera’s height affects the model detection and depends on the objects used. For example, Li et al. (2020) used cameras at various heights to detect floor eggs but found no significant difference in accuracy. However, in Table 8, camera height showed a huge difference in precision, recall, mAP@0.50, mAP@0.50:0.95, and F1-score for the detection model. Camera height at 30 cm resulted in 12.6, 22.3, 19.6, 12.6, and 17% higher precision, recall, mAP@0.50, mAP@0.50:0.95, and F1-score, respectively, than height at 50 cm. Camera height might differ in the accuracy of detecting objects based on object conditions, whether objects are moving, fixed, or of variable shape and size. Thus, the camera height of 30 cm is the best for BFD, as seen in Figures 15 and 16.

Table 8. Performance comparison of the YOLOv5-BFD model for different heights.

Data summary1 Precision (%) Recall (%) mAP@0.50 (%) mAP@
0.50:0.95 (%)
F1-score Training time (h)
BFDheight30cm 89.7 86.9 90.1 52.4 88.0 0.497
BFDheight50cm 77.1 64.6 70.5 39.8 71.0 0.506
1

Run at batch size 16, epoch 100; BFD, bumblefoot detection; mAP, mean average precision.

Figure 15

  1. Download : Download high-res image (1MB)
  2. Download : Download full-size image

Figure 15. Performance metrics (A) Precision, (B) Recall, (C) mAP@0.50, and d) mAP@0.50:0.95 of YOLOv5m-BFD model at a different height. YOLO, You only look once with small (s), medium (m), and large model (l); mAP- mean average precision; Epochs, number of times the entire dataset passes through network during training.

Figure 16

  1. Download : Download high-res image (522KB)
  2. Download : Download full-size image

Figure 16. YOLOv5m detection results of bumblefoot at camera: (A) height of 30 cm and (B) height of 50 cm. The figure with rectangular box represents the legs were detected with the bumblefoot. BFD, bumblefoot detection.

Since bumblefoot is small and found in digital pads, plantar metatarsal, or both, it is very hard to detect when a hen is far from the camera. With the increase of camera height, the distance between the cameras and the targeted objects would increase, thus resulted in higher train box losses, train object losses, Val object losses, and Val box losses (Figure 17). As a result of BFD at the height of 50 cm, the Val box loss and Val object loss were the highest, which resulted in the lowest detection performance.

Figure 17

  1. Download : Download high-res image (630KB)
  2. Download : Download full-size image

Figure 17. Training and validation results (A) train/box loss, (B) val/box loss, (C) train/object loss, and (D) val/object loss of the YOLOv5m-BFD models at different camera heights. BFD, bumblefoot detection; Train, training; Val, validation; obj, object. YOLO, You only look once; mAP, mean average precision; Epochs, number of times the entire dataset passes through network during training.

Limitation and Future Direction

The YOLOv5 model assists in accurately identifying bumblefoot conditions in laying hens, yet it has notable limitations. Firstly, detection becomes challenging when birds are densely packed together, as the occlusion of bumblefoot by neighboring hens impedes accurate detection. Secondly, environmental factors such as higher dust concentrations in cage-free housing can obscure camera lenses, necessitating regular cleaning. Thirdly, the study’s experimental setup with fewer hens per room than commercial housing may pose challenges in scaling up detection for larger groups of hens. To address these limitations, continual testing, data collection, and model training with commercial hen images are essential for enhancing detection accuracy.

Furthermore, the presence of manure on litter floors can obscure bumblefoot conditions or artificially enlarge foot sizes, reducing detection accuracy. Despite these limitations, the research offers an innovative solution for early detection of footpad conditions, providing producers with timely alerts to address worsening conditions. Future improvements entail training the model on large commercial datasets and considering various environmental scenarios affecting footpad health. Additionally, future iterations aim to detect bumblefoot and identify factors contributing to its occurrence. Ultimately, achieving near-perfect accuracy in bumblefoot detection across different hen types (white, brown, broilers) will enhance user-friendliness for producers, who can install cameras and connect to the system for real-time monitoring. Regular updates to the model or software will ensure continual improvement in accuracy. Early detection of bumblefoot conditions enables prompt intervention, improving footpad health and overall animal welfare.

CONCLUSIONS

The YOLOv5m-BFD model demonstrated superior performance in bumblefoot detection compared to other models. In addition, the model trained with batch size 16 and epochs 400 resulted in higher detection results. Similarly, a lower camera height (30 cm) for capturing closer imaging of chicken feet is recommended for future bumblefoot detection. The success of this model establishes a foundation for the development of a ground robot for bumblefoot scanning in CF houses, with future plans to extend its application to commercial broiler and layer housing. Early bumblefoot detection facilitated by this technology holds promise for improving animal welfare and overall farm productivity by early detection.

Source: Science Direct