View a markdown version of this page

Livestock Counting at the Edge - Agriculture Reference Architecture Diagrams

Livestock Counting at the Edge

Publication date: July 12, 2022 (Diagram history)

This architecture enables you to build a near real-time, automated counting application for livestock. Use Amazon SageMaker AI and AWS IoT Greengrass to build and deploy a livestock counting application at the edge.

Livestock Counting at the Edge diagram

Reference architecture diagram showing livestock counting at the edge
  1. Upload videos and images to Amazon Simple Storage Service (Amazon S3) to train the livestock detection model.

  2. Use Amazon SageMaker AI Notebooks to process these videos and create a labeling job using Amazon SageMaker AI Ground Truth.

  3. Split the annotated dataset into training and validation sets, and use Amazon SageMaker AI distributed training for livestock detection.

  4. Use Amazon SageMaker AI Neo to optimize the livestock detection model for specific target devices like NVIDIA Jetson Nano, TX2, Xavier, AWS DeepLens , or Raspberry Pi.

  5. Deploy the machine learning model and counting application AWS Lambda function to the edge device using AWS IoT Greengrass.

  6. Consume live video streams from a camera at the farm using real-time streaming protocol (RTSP) through camera serial interface (CSI) or through USB connected to the edge hardware.

  7. Run ML Inference on the video frames from step 6 and pass the bounding box outputs to the counting application Lambda function.

  8. Connect to the web server running on edge devices and control when to start/stop counting through a mobile application.

  9. Submit near real-time counts to an inventory management system.

Further reading

For additional information, refer to