Excretion Detection in Pigsties Using Convolutional and Transformerbased Deep Neural Networks

Simon Mielke,Anthony Stein
2024-11-30
Abstract:Animal excretions in form of urine puddles and feces are a significant source of emissions in livestock farming. Automated detection of soiled floor in barns can contribute to improved management processes but also the derived information can be used to model emission dynamics. Previous research approaches to determine the puddle area require manual detection of the puddle in the barn. While humans can detect animal excretions on thermal images of a livestock barn, automated approaches using thresholds fail due to other objects of the same temperature, such as the animals themselves. In addition, various parameters such as the type of housing, animal species, age, sex, weather and unknown factors can influence the type and shape of excretions. Due to this heterogeneity, a method for automated detection of excretions must therefore be not only be accurate but also robust to varying conditions. These requirements can be met by using contemporary deep learning models from the field of artificial intelligence. This work is the first to investigate the suitability of different deep learning models for the detection of excretions in pigsties, thereby comparing established convolutional architectures with recent transformer-based approaches. The detection models Faster R-CNN, YOLOv8, DETR and DAB-DETR are compared and statistically assessed on two created training datasets representing two pig houses. We apply a method derived from nested cross-validation and report on the results in terms of eight common detection metrics. Our work demonstrates that all investigated deep learning models are generally suitable for reliably detecting excretions with an average precision of over 90%. The models also show robustness on out of distribution data that possesses differences from the conditions in the training data, however, with expected slight decreases in the overall detection performance.
Computer Vision and Pattern Recognition
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: **How to use deep - learning models to automatically detect animal excreta (urine and feces) in pigsties**. Specifically, the research aims to: 1. **Improve detection accuracy and automation**: Traditional manual detection methods are not only time - consuming and labor - intensive, but also easily affected by subjective factors, resulting in low accuracy. By introducing convolutional neural networks (CNN) and Transformer - based deep - learning models, more efficient and accurate automatic detection can be achieved. 2. **Create and evaluate suitable training data sets**: In order to train these deep - learning models, the researchers created two labeled data sets, which contain thermal infrared images under different environmental conditions. By comparing the performance of different models on these data sets, we can better understand which model and parameter combinations are most suitable for this task. 3. **Compare the performance of different deep - learning models**: The researchers selected four advanced object detection models - Faster R - CNN, YOLOv8, DETR, and DAB - DETR, and compared and evaluated them through a variety of common detection metrics. This helps to determine which model performs best in this specific application. 4. **Ensure the robustness of the model**: The study also tested the robustness of these models under different conditions, such as different pigsty types, lighting and temperature conditions, etc. This is crucial for ensuring the reliability of the model in practical application scenarios. ### Specific problem description - **Background problem**: Agricultural emissions, especially livestock emissions, have a significant impact on the environment. Ammonia volatilization from urine and feces is one of the main pollution sources. Accurately detecting excreta on the floor of pigsties can help improve management processes and reduce environmental pollution. - **Limitations of existing methods**: Current methods rely on manual detection, which is not only inefficient but also error - prone. In addition, simple threshold methods cannot effectively distinguish excreta due to the similar temperatures of other objects (such as the pigs themselves). - **Solution**: By using deep - learning models, especially convolutional neural networks (CNN) and Transformer - based models, combined with thermal infrared images for automatic detection, the above limitations can be overcome. These models can handle complex environmental changes and provide more accurate and reliable detection results. ### Research contributions - **Verify the hypothesis**: Prove the applicability of deep - learning models in detecting pigsty excreta. - **Model comparison**: Systematically compare the performance of different models to provide references for subsequent research and applications. - **Data set creation**: Create and publish two new thermal infrared image data sets to promote further research in related fields. - **Parameter optimization**: Explore the impact of different hyper - parameters on model performance and guide future research directions. Through these efforts, this research provides important technical support for precision livestock management and environmental protection.