Excretion Detection in Pigsties Using Convolutional and Transformerbased Deep Neural Networks
Pith reviewed 2026-05-23 07:45 UTC · model grok-4.3
The pith
Deep learning models detect animal excretions in pig barns with average precision above 90 percent.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
This work is the first to compare convolutional and transformer-based detection models for excretions in pigsties. The models Faster R-CNN, YOLOv8, DETR and DAB-DETR are evaluated on two datasets from different pig houses using nested cross-validation. They demonstrate suitability for reliable detection with average precision over 90 percent and robustness on out-of-distribution data with only slight performance decreases.
What carries the argument
Comparison of object detection architectures (Faster R-CNN, YOLOv8, DETR, DAB-DETR) on thermal images for identifying animal excretions.
If this is right
- Automated detection supports improved barn management processes.
- Information from detections can help model emission dynamics from livestock.
- The approach handles variations due to housing type, animal factors, and weather.
- Models maintain performance on data with differences from training conditions.
Where Pith is reading between the lines
- Similar models could be applied to detect excretions in other livestock settings like cattle barns.
- Real-time implementation could enable proactive cleaning schedules.
- The method might reduce the need for human monitoring in large-scale farming operations.
- Further testing on more diverse farms could confirm broader applicability.
Load-bearing premise
The created datasets sufficiently represent the range of conditions in pigsties so that performance generalizes to new barns.
What would settle it
If a new set of thermal images from an unseen pig barn yields average precision significantly below 90 percent, the claim of reliable and robust detection would be challenged.
Figures
read the original 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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims that deep learning models (Faster R-CNN, YOLOv8, DETR, DAB-DETR) are suitable for reliable automated detection of animal excretions (urine and feces) in pigsties, achieving average precision above 90% on two newly created datasets from distinct pig houses. It further claims robustness to out-of-distribution images with only slight performance drops, using a nested cross-validation approach and eight standard detection metrics, positioning this as the first such comparison of convolutional and transformer architectures for the task motivated by heterogeneity in housing, species, age, sex, weather, and other factors.
Significance. If the performance claims hold under proper documentation, the work offers a practical DL-based alternative to manual or threshold-based detection of soiled areas, with potential applications in emission modeling and barn management. It provides a direct empirical head-to-head comparison of established CNN detectors against recent transformer detectors on a real-world agricultural vision task, which is a useful contribution even if generalization claims require further validation.
major comments (3)
- [Abstract] Abstract: The central claim of average precision >90% and robustness on OOD data is load-bearing for the paper's conclusions, yet the abstract (and presumably the results section) supplies no dataset sizes, number of annotated images, annotation protocol details, or explicit train-test split ratios. Without these, the reported metrics cannot be assessed for statistical reliability or overfitting risk.
- [Abstract] Abstract / Methods (nested cross-validation description): The claim that the two training datasets adequately represent heterogeneity across housing type, animal species, age, sex, weather, and unknown factors (explicitly listed as motivation for DL) is not supported by any quantitative characterization of inter-house or OOD variability; the OOD robustness is described only qualitatively as 'slight decreases,' leaving open whether the test truly probes the motivating sources of variation or only minor intra-house shifts.
- [Abstract] Abstract: The statement that models were 'statistically assessed' on eight metrics lacks any mention of specific tests (e.g., significance testing of AP differences across models or periods), which is required to substantiate the comparative suitability claim.
minor comments (2)
- [Title] Title: 'Transformerbased' should be 'Transformer-based'.
- [Abstract] Abstract: Minor phrasing issues such as 'not only be accurate' (duplicate 'be') and 'in form of' (should be 'in the form of').
Simulated Author's Rebuttal
We thank the referee for the constructive feedback on the abstract and methods description. We address each major comment below and will make revisions to improve clarity and support for the claims.
read point-by-point responses
-
Referee: [Abstract] Abstract: The central claim of average precision >90% and robustness on OOD data is load-bearing for the paper's conclusions, yet the abstract (and presumably the results section) supplies no dataset sizes, number of annotated images, annotation protocol details, or explicit train-test split ratios. Without these, the reported metrics cannot be assessed for statistical reliability or overfitting risk.
Authors: We agree that the abstract would benefit from including these details to allow independent assessment of the results. The Methods section already describes the two datasets (including image counts from each pig house), the annotation process by domain experts, and the nested cross-validation procedure with explicit train/validation/test ratios. In the revised manuscript, we will condense and add the key figures (e.g., total annotated images, split ratios) into the abstract. revision: yes
-
Referee: [Abstract] Abstract / Methods (nested cross-validation description): The claim that the two training datasets adequately represent heterogeneity across housing type, animal species, age, sex, weather, and unknown factors (explicitly listed as motivation for DL) is not supported by any quantitative characterization of inter-house or OOD variability; the OOD robustness is described only qualitatively as 'slight decreases,' leaving open whether the test truly probes the motivating sources of variation or only minor intra-house shifts.
Authors: The two datasets come from distinct commercial pig houses that differ in housing design, ventilation, and animal management, which we describe qualitatively as capturing the listed sources of variation. However, we acknowledge that no quantitative metrics (such as feature distribution statistics or inter-house image similarity measures) are provided to characterize the degree of heterogeneity. The OOD test uses images from a third barn with documented differences, and performance drops are reported numerically per metric rather than only qualitatively. We will add a quantitative comparison of variability (e.g., temperature histograms or bounding-box statistics) between the datasets in the revision. revision: partial
-
Referee: [Abstract] Abstract: The statement that models were 'statistically assessed' on eight metrics lacks any mention of specific tests (e.g., significance testing of AP differences across models or periods), which is required to substantiate the comparative suitability claim.
Authors: The phrase 'statistically assessed' refers to the nested cross-validation protocol, which yields mean and standard deviation values for each of the eight metrics across multiple folds and thereby quantifies variability due to data partitioning. No additional hypothesis tests (such as paired t-tests on AP scores between models) were performed. We believe the cross-validation results already provide a robust basis for comparing the models; however, if the referee considers pairwise significance tests necessary, we can include them in a revision. revision: partial
Circularity Check
No circularity: empirical model comparison on held-out image data
full rationale
The paper reports an empirical evaluation of four object detection architectures (Faster R-CNN, YOLOv8, DETR, DAB-DETR) trained and tested on image datasets collected from two pig houses, with additional OOD testing. All reported figures are direct performance measurements (average precision, etc.) on held-out images; no equations, parameter fits, or predictions are claimed to derive from first principles or to reduce to the training data by construction. No self-citation chain is invoked to justify a uniqueness result or ansatz. The work is therefore self-contained against external benchmarks and receives the default non-circularity finding.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
Jour- nal of Agricultural Engineering Research 66, 93–102
Effect of Type of Slatted Floor and Degree of Fouling of Solid Floor on Ammonia Emission Rates from Fattening Piggeries. Jour- nal of Agricultural Engineering Research 66, 93–102. doi: 10.1006/ jaer.1996.0121. https://www.sciencedirect.com/science/article/ pii/S0021863496901213. Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Gh...
-
[2]
https://www.sciencedirect.com/ science/article/pii/S0021863497902158
doi: 10.1006/jaer.1997.0215. https://www.sciencedirect.com/ science/article/pii/S0021863497902158. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S., 2020. End-to-End Object Detection with Transformers, in: Vedaldi, A., Bischof, H., Brox, T., Frahm, J.M. (Eds.), Computer Vision – ECCV
- [3]
-
[4]
MMDetection: Open MMLab Detection Toolbox and Benchmark
doi: 10.1007/978-3-030-58452-8_13 . https://link.springer. com/10.1007/978-3-030-58452-8_13 . Caro, D., Davis, S.J., Bastianoni, S., Caldeira, K., 2014. Global and regional trends in greenhouse gas emissions from livestock. Climatic Change 126, 203–216. doi:10.1007/s10584-014-1197-x . https://doi.org/10.1007/ s10584-014-1197-x. Chen, K., Wang, J., Pang, J...
work page internal anchor Pith review Pith/arXiv arXiv doi:10.1007/978-3-030-58452-8_13 2014
-
[5]
doi: 10.1109/CVPR.2009.5206848. https://ieeexplore.ieee.org/ document/5206848. Eurich-Menden, B., Wolf, U., Horlacher, D., Dehler, G., Smirnov, A., 2024. Ermittlung von Emissionsdaten f¨ ur die Beurteilung der Umweltwirkun- gen der Nutztierhaltung (EmiDaT). Abschlussbericht. Technical Re- port. Kuratorium f¨ ur Technik und Bauwesen in der Landwirtschaft e...
-
[6]
Environ- mental Pollution 86, 43–82
Effects of atmospheric ammonia on vegetation—A review. Environ- mental Pollution 86, 43–82. doi:10.1016/0269-7491(94)90008-6. https: //www.sciencedirect.com/science/article/pii/0269749194900086. G¨ abel, G., Loeffler, K., Pfannkuche, H., 2018. Anatomie und Physiologie der Haustiere. UTB. 15., vollst¨ andig ¨ uberarbeitete und erweiterte Auflage ed., Verla...
-
[7]
https://openreview.net/forum?id=H1oyRlYgg
On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima, in: International Conference on Learning Representa- tions. https://openreview.net/forum?id=H1oyRlYgg. Kim, J., Baek, J., Choi, H., Kim, E., 2016. Wet area and puddle detection for Advanced Driver Assistance Systems (ADAS) using a stereo camera. International Journal of Contro...
-
[8]
Microsoft COCO: common objects in context,
doi: 10.1007/978-3-319-10602-1_48 . Liu, S., Li, F., Zhang, H., Yang, X., Qi, X., Su, H., Zhu, J., Zhang, L.,
-
[9]
Dab-detr: Dynamic anchor boxes are better queries for detr.arXiv preprint arXiv:2201.12329, 2022
DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR, in: DAB-DETR: Dynamic Anchor Boxes Are Better Queries for DETR. doi:10.48550/arXiv.2201.12329. https://openreview.net/forum?id= oMI9PjOb9Jl. Mao, R., Shen, D., Wang, R., Cui, Y., Hu, Y., Li, M., Wang, M., 2024. An Integrated Gather-and-Distribute Mechanism and Attention-Enhanced Deformable Convol...
-
[10]
https://www.mdpi.com/2076-2615/ 14/9/1316
doi: 10.3390/ani14091316. https://www.mdpi.com/2076-2615/ 14/9/1316. McCulloch, W.S., Pitts, W., 1943. A logical calculus of the ideas immanent in nervous activity. The bulletin of mathematical biophysics 5, 115–133. doi:10.1007/BF02478259. https://doi.org/10.1007/BF02478259. Melfsen, A., Lepsien, A., Bosselmann, J., Koschmider, A., Hartung, E., 2023. Des...
-
[11]
doi: 10.1128/mr.53.1.85-108.1989. https://pubmed.ncbi.nlm. nih.gov/2651866/. Optris GmbH & Co.KG, . Optris. Optris GmbH & Co.KG. https://www.optris.com/en/products/infrared-cameras/ software-pix-connect/. Pan, S.J., Yang, Q., 2010. A Survey on Transfer Learning. IEEE Transactions on Knowledge and Data Engineering 22, 1345–
-
[12]
https://ieeexplore.ieee.org/ document/5288526/footnotes#footnotes-id-fn1
doi: 10.1109/TKDE.2009.191. https://ieeexplore.ieee.org/ document/5288526/footnotes#footnotes-id-fn1. Parmiggiani, A., Liu, D., Psota, E., Fitzgerald, R., Norton, T., 2023. Don’t get lost in the crowd: Graph convolutional network for online an- imal tracking in dense groups. Computers and Electronics in Agricul- ture 212, 108038. doi: 10.1016/j.compag.202...
-
[13]
doi: 10.1109/TPAMI.2016.2577031. http://ieeexplore.ieee. org/document/7485869/. 45 Riekert, M., Opderbeck, S., Wild, A., Gallmann, E., 2021. Model selection for 24/7 pig position and posture detection by 2D camera imaging and deep learning. Computers and Electronics in Agricul- ture 187, 106213. doi: 10.1016/j.compag.2021.106213. https://www. sciencedirec...
-
[14]
doi:10.1016/j.compag.2017.03.012. https://www.sciencedirect. com/science/article/pii/S0168169916301338. Snoek, D.J.W., Stigter, J.D., Ogink, N.W.M., Groot Koerkamp, P.W.G., 2014b. Sensitivity analysis of mechanistic models for estimating am- monia emission from dairy cow urine puddles. Biosystems Engineering 121, 12–24. doi: 10.1016/j.biosystemseng.2014.0...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.