Back to search

Texas State University

A Transformer-Based Perception and Analytics Framework for Cattle Behavior Analysis across Diverse Ranch Environments

Abstract

dc:description.abstract

Cattle behavior provides important information about animal health and welfare. Visionbased monitoring systems provide a non-contact means of observing these behaviors at scale. However, most existing systems are designed for controlled settings and perform poorly when applied to new ranch environments. Variations in lighting, weather, camera viewpoint, and scene layout often lead to performance degradation. This thesis investigates whether a unified computer vision framework can support reliable cattle behavior analysis across diverse ranch conditions without environment-specific retraining. The proposed system integrates detection, instance segmentation, multi-object tracking, and temporal behavior recognition into a single perception pipeline. Transformer-based models are used where global spatial or temporal context is required, while the overall design remains modular and dataset-driven. Identity-preserved animal tracks are used to generate per-animal temporal sequences for behavior recognition. A knowledge distillation approach is used to train a lightweight segmentation student model from a large foundation model teacher, achieving real-time inference throughput on commodity hardware. A central contribution of this work is an explicit generalization and robustness evaluation layer. Performance is analyzed under both in-domain and out-of distribution conditions using cross-dataset testing and controlled environmental perturbations. Detection performance ranged from 73.0% Mean Average Precision (mAP)@50 on a visually similar outdoor dataset to 27.3% on an overhead-viewpoint indoor dataset, with camera angle identified as the dominant generalization factor. In-domain behavior classification achieved a macro-F1 of 0.777; cross-domain transfer without fine-tuning dropped to 0.172–0.225, establishing the empirical cost of environmental domain shift. Beyond behavior classification, the system produces behavior timelines and activity summaries for individual animals. These analytics provide ecologically coherent outputs: outdoor cattle allocated 49.2% of observed time to foraging, while indoor barn cattle allocated 52.6% to standing, consistent with the known behavioral differences between pasture and confinement environments. The proposed framework emphasizes measurement, interpretability, and practical relevance for long-term monitoring of cattle.

Degree

thesis:*
Name thesis:degree_name
Master of Science
Level thesis:degree_level
Masters
Discipline thesis:degree_discipline
Engineering
Department thesis:degree_department
Engineering
Grantor
Texas State University
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Khan, Md Sakif Uddin
Advisor dc:contributor.advisor
  • Valles Molina, Damian
Committee members dc:contributor.committeemember
  • Asiabanpour, Bahram
  • Drewery, Merritt L.

Subjects

dc:subject × 8

Rights

Language dc:language.iso
en

Identifiers

dc:identifier.*
Dc Identifier Citation
Khan, M. S. U. (2026). A transformer-based perception and analytics framework for cattle behavior analysis across diverse ranch environments. [Master's thesis, Texas State University].

Chain of custody

source
Harvested from
Texas State University
Base URL
digital.library.txst.edu/server/oai/request
Last updated
2026-11-20
Source record
OAI-PMH GetRecord
citation

Khan, Md Sakif Uddin. A Transformer-Based Perception and Analytics Framework for Cattle Behavior Analysis across Diverse Ranch Environments. Masters thesis, Texas State University, 2026. https://hdl.handle.net/10877/25176