Research on Instance Segmentation Algorithm for Caged Chickens in Infrared Images Based on Improved Mask R-CNN

Youqing Chen, Hang Liu, Lun Wang, Siyu Li, Bo Zhong, J. H. Qiao, Rong Ye, Tong LiSensors 2025 · DOI

TL;DR

This paper introduces an improved Mask R-CNN model for accurately segmenting individual chickens in infrared images, a crucial step for automated health monitoring in large-scale poultry farms. By enhancing the backbone with CBAM and the feature pyramid with AC-FPN, the model achieves significant improvements in segmentation accuracy, even in challenging, high-density environments.

What Problem Does This Paper Address?

Modern large-scale chicken farming relies heavily on dense, multi-dimensional cage systems to maximize efficiency. While beneficial for production, these environments present significant challenges for monitoring individual chicken health. Obstacles like cages, feeders, and drinkers, combined with the close proximity and overlapping of chickens, make it difficult to accurately detect and segment individual birds, especially in infrared imagery which is preferred for low-light conditions but can be affected by heat signatures from the environment. Existing methods often struggle with these complex scenarios, leading to a need for more robust and precise segmentation techniques.

Methods

The core of this research is an enhanced Mask R-CNN architecture. The authors made two key modifications:

  • CBAM Integration: The Convolutional Block Attention Module (CBAM) was incorporated into the ResNet-101 backbone. CBAM is a lightweight module that uses both channel and spatial attention to help the network focus on more relevant features, improving its ability to extract richer information from the infrared images.
  • AC-FPN Architecture: The standard Feature Pyramid Network (FPN) was replaced with an improved version called AC-FPN. AC-FPN incorporates Context Extraction Modules (CEM) and Attention Guidance Modules (AM) to better fuse multi-scale features and capture contextual information, addressing limitations in the original FPN's receptive field and inter-layer communication.

These enhancements aim to improve the model's ability to handle occlusions, dense arrangements, and the unique characteristics of infrared thermal imaging.

Datasets

The study utilized a custom dataset collected from a practical chicken farm at Yunnan Agricultural University.

  • Data Collection: Infrared thermal imaging videos of Yanjin Silky fowl were recorded using a China Iray Tianyan thermal imager. Key frames were extracted from these videos using an inter-frame difference method to create a dataset of 1548 images.
  • Data Augmentation: To increase dataset complexity and improve generalization, the original dataset underwent various augmentations, including mirror flipping, brightness adjustment, noise addition, random black and white dots, and random shifting. This resulted in an augmented dataset of 9288 images.
  • Annotation: The dataset was annotated using the Labelme tool and converted to the COCO dataset format. Four annotation types were defined: Chicken-half, Chicken-whole, Chicken-few (2-3 individuals), and Chicken-many (four or more).

Key Insights and Ideas

  • Infrared Imaging for Health: The paper strongly advocates for infrared imaging as a non-contact, stress-free method for monitoring chicken health, highlighting its ability to detect subtle temperature variations indicative of disease.
  • Attention Mechanisms are Key: The integration of CBAM demonstrates that attention mechanisms are crucial for improving feature extraction in challenging thermal images, allowing the model to better discern chickens from their environment.
  • AC-FPN for Context: Replacing the standard FPN with AC-FPN proved vital for effectively fusing multi-scale features and capturing the complex contextual information present in dense chicken flocks.
  • Synergistic Effects: The combined application of CBAM and AC-FPN yielded significantly better results than either module used in isolation, highlighting their synergistic impact on overall performance.
  • "Chicken-many" is the Toughest, but Achievable: The 'Chicken-many' category, representing the most densely packed scenarios, achieved the highest segmentation accuracy (98.51%), demonstrating the model's robustness even in the most challenging configurations.

Key Results

The improved Mask R-CNN model demonstrated substantial performance gains:

  • Object Detection: Achieved an average AP of 87.31% and ARL of 92.48% with data augmentation, representing improvements of 8.65% and 5.84% over the unaugmented model.
  • Instance Segmentation: Achieved an average AP of 80.78% and ARL of 86.26% with data augmentation, showing improvements of 6.84% and 4.59% over the unaugmented model.
  • Overall Segmentation Improvement: The model achieved a 32.91% improvement in average AP and a 17.78% improvement in average AR10 compared to the original Mask R-CNN model.
  • Category-Specific Accuracy: Achieved segmentation accuracies exceeding 93% for all four chicken categories, with 'Chicken-many' reaching an impressive 98.51%.
  • Comparative Performance: Outperformed other state-of-the-art models like YOLOv8, YOLOv9, YOLOv11, and YOLOv12 in both detection and segmentation tasks, particularly in handling dense chicken flocks. For instance, it achieved an AP of 82.46% in detection, significantly higher than YOLOv12's 51.35%.

Limitations and Future Work

  • Real-time Performance: The authors acknowledge that the current model has limitations in real-time performance and inference speed, suggesting that further simplification is needed for deployment on edge computing devices with limited resources.
  • Dataset Size: The current dataset is considered relatively scarce, and future work should focus on expanding it with more data from different breeds and free-range environments.
  • Hybrid Imaging: The paper suggests combining infrared imaging with visible light images in the future to achieve more comprehensive chicken monitoring.

Summary updated

Abstract

Infrared images of caged chickens can provide valuable insights into their health status. Accurately detecting and segmenting individual chickens in these images is essential for effective health monitoring in large-scale chicken farming. However, the presence of obstacles such as cages, feeders, and drinkers can obscure the chickens, while clustering and overlapping among them may further hinder segmentation accuracy. This study proposes a Mask R-CNN-based instance segmentation algorithm specifically designed for caged chickens in infrared images. The backbone network is enhanced by incorporating the CBAM within this algorithm, which is further combined with the AC-FPN architecture to improve the model's ability to extract features. Experimental results demonstrate that the model achieves average AP and AR<sup>10</sup> values of 78.66% and 85.80%, respectively, in object detection, as per the COCO performance metrics. In segmentation tasks, the model attains average AP and AR<sup>10</sup> values of 73.94% and 80.42%, respectively, reflecting improvements of 32.91% and 17.78% over the original model. Notably, among all categories of chicken flocks, the 'Chicken-many' category achieved an impressive average segmentation accuracy of 98.51%, and the other categories also surpassed 93%. The proposed instance segmentation method for caged chickens in infrared images effectively facilitates the recognition and segmentation of chickens within the challenging imaging conditions typical of high-density caged environments, thereby contributing to enhanced production efficiency and the advancement of intelligent breeding management.
BibTeX
@inproceedings{chen2025research,
  author = {Youqing Chen and Hang Liu and Lun Wang and Chen Chen and Siyu Li and Bo Zhong and J. H. Qiao and Rong Ye and Tong Li},
  title = {{Research on Instance Segmentation Algorithm for Caged Chickens in Infrared Images Based on Improved Mask R-CNN}},
  booktitle = {Sensors},
  year = {2025},
  doi = {10.3390/s25196237},
}
Figure