Animal Detection and Tracking from Video Feeds

5 min read
Image Processing

Introduction

Livestock monitoring is an important task in smart farming. Detecting and tracking animals in real-time video feeds can help farmers monitor herd behavior, prevent theft, and improve farm management. This project aims to develop an automated system that uses YOLO (You Only Look Once) for cow detection and DeepSORT for real-time tracking of each animal across frames. The system will provide smooth tracking outputs (tracklets) and maintain consistent IDs for cows. As an advanced extension, students may also integrate the Segment Anything Model (SAM) to segment cows at the pixel level, showing how modern AI techniques can enhance precision.

Functional Requirements

1. Video Input

  • The system shall accept video file uploads in common formats (MP4, AVI, MOV).
  • The system shall support real-time webcam feed.

2. Cow Detection & Tracking

  • The system shall detect cows in video frames.
  • The system shall assign persistent unique IDs to detected cows.
  • The system shall maintain ID consistency when cows are temporarily occluded.

3. Display bounding boxes and IDs

  • The system shall display bounding boxes around detected cows.
  • The system shall display unique IDs near each detected cow.

4. Display of Detection and Tracking Information

  • The system shall display detection information, including the number of detected cows and the average confidence score, during video processing.
  • The system shall display tracking performance indicators, including temporary ID switches and frame rate (FPS), during video playback.

5. User Interface

  • The system shall provide a user interface that enables users to upload videos or access a webcam for efficient detection and tracking.

6. Advanced Feature (Optional)

  • The system shall generate pixel-level segmentation masks for detected cows.

Expected Outcomes

  • A working system that detects and tracks multiple cows in real time.
  • Visualization of bounding boxes and unique IDs on each cow.
  • (Bonus - Optional) Pixel-level segmentation of cows using SAM.
    Tools & Technologies
  • Python
  • Ultralytics YOLOv8
  • DeepSORT
  • OpenCV
  • NumPy
  • Matplotlib
  • Optional: Segment Anything Model (SAM)
  • Spyder
  • Public cow dataset (e.g.
  • MultiCamCows2024)

Share this project:

Faisal Mehmood

Faisal Mehmood Expert in CS619 Final Year Projects and software development.

View all projects