4 Hands-on 2: Computer vision classification for cattle food grading with a hands-on exercise (Python) on Google Co-lab.

Abstract This workshop explores the potential of computer vision in precision livestock farming, focusing on its applications in automated feeding grading tasks. The example image dataset is collected from a Calan Gate Feeding System on a research facility at Texas A&M University, Department of Animal Science, College Station, TX. Three Reolink PoE (Power over Ethernet) cameras (Model D400) were positioned above the pens to cover six bunks, with each camera capturing the activities of two bunks. These cameras were connected to a Reolink Network Video Recorder (NVR), model RLN8-410 (v.2), to save data at a resolution of Full HD (1920x1080 pixels) with a frame rate of 30 frames per second (FPS). All the frames are extracted and 12,156 images/frames are randomly sampled from 30 days in August 2023 (7 am and 6 pm during the day), which were then segmented into training (70%), validation (15%), and testing (15%) sets. This dataset then is organized into six feeding bunk scores: S00 (no feed), S05 (scattered feed), S10 (thin layer), S20 (25-50%), S30 (> 50%), and S40 (untouched) based on human observation. A well-established computer vision model named ResNet is selected due to its high performance and widely available pre-trained weights (in PyTorch library). Using the training and validation data, the model training was performed on an NVIDIA A100 on a High-Performance Computer (HPC) system at TAMU. The batch size was 4, and the Learning Rate (LR) was scheduled to decrease by 0.1 every five epochs. The initial LR = 0.001 with the Adam optimizer. While testing on the unseen data, the classification model demonstrates strong performance across most classes, with high precision and recall for classes like S00, S05, S30, and moderate performance for S40, but it struggles significantly with Class 2 (S10), due to its similar appearances with S20 and S0. By the end of the workshop, participants will have the understanding and skills to reproduce such computer vision solutions and improve their performance. The workshop underscores the fundamentals of AI systems and machine learning methods, i.e., neural networks, which is the same for other AI systems, including natural language processing (e.g., Chat-GPT), self-driving car (e.g., Tesla), and recommendation systems (e.g. TikTok). The limitation of such AI systems will also be discussed.

Authors

Institutions

Publication Details

Journal
Journal of Animal Science
Published
2025-10-01
DOI
https://doi.org/10.1093/jas/skaf300.090
Primary Topic
Food Supply Chain Traceability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

4 Hands-on 2: Computer vision classification for cattle food grading with a hands-on exercise (Python) on Google Co-lab.

Yalong Pi
Journal of Animal Science
Food Supply Chain Traceability
article

4 Hands-on 2: Computer vision classification for cattle food grading with a hands-on exercise (Python) on Google Co-lab.

Yalong Pi
article en

Abstract

Abstract This workshop explores the potential of computer vision in precision livestock farming, focusing on its applications in automated feeding grading tasks. The example image dataset is collected from a Calan Gate Feeding System on a research facility at Texas A&M University, Department of Animal Science, College Station, TX. Three Reolink PoE (Power over Ethernet) cameras (Model D400) were positioned above the pens to cover six bunks, with each camera capturing the activities of two bunks. These cameras were connected to a Reolink Network Video Recorder (NVR), model RLN8-410 (v.2), to save data at a resolution of Full HD (1920x1080 pixels) with a frame rate of 30 frames per second (FPS). All the frames are extracted and 12,156 images/frames are randomly sampled from 30 days in August 2023 (7 am and 6 pm during the day), which were then segmented into training (70%), validation (15%), and testing (15%) sets. This dataset then is organized into six feeding bunk scores: S00 (no feed), S05 (scattered feed), S10 (thin layer), S20 (25-50%), S30 (> 50%), and S40 (untouched) based on human observation. A well-established computer vision model named ResNet is selected due to its high performance and widely available pre-trained weights (in PyTorch library). Using the training and validation data, the model training was performed on an NVIDIA A100 on a High-Performance Computer (HPC) system at TAMU. The batch size was 4, and the Learning Rate (LR) was scheduled to decrease by 0.1 every five epochs. The initial LR = 0.001 with the Adam optimizer. While testing on the unseen data, the classification model demonstrates strong performance across most classes, with high precision and recall for classes like S00, S05, S30, and moderate performance for S40, but it struggles significantly with Class 2 (S10), due to its similar appearances with S20 and S0. By the end of the workshop, participants will have the understanding and skills to reproduce such computer vision solutions and improve their performance. The workshop underscores the fundamentals of AI systems and machine learning methods, i.e., neural networks, which is the same for other AI systems, including natural language processing (e.g., Chat-GPT), self-driving car (e.g., Tesla), and recommendation systems (e.g. TikTok). The limitation of such AI systems will also be discussed.

Journal of Animal ScienceVol. 103(Supplement_3)
Texas Research Institute (US)
Openalex Percentile: Top 67%
Food Supply Chain Traceability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.