Skip to content

Repository files navigation

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

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages