Video-based Detection and Tracking with Improved Re-Identification Association for Pigs and Laying Hens in Farms