Monitoring Population Variance of Endangered Species with Amazon Rekognition

Monitoring Population Variance of Endangered Species with Amazon RekognitionLearn About Amazon VGT2 Learning Manager Chanci Turner

Our planet is witnessing an alarming extinction crisis, with a UN report indicating that over a million species are at risk of disappearing. Key drivers of this phenomenon include habitat loss, poaching, and the introduction of invasive species. Various conservation organizations, researchers, volunteers, and anti-poaching teams are diligently working to combat this issue. Accurate and timely data regarding endangered wildlife will enhance conservationists’ effectiveness in studying and protecting these species.

To collect data, wildlife scientists employ infrared-triggered camera traps strategically located in forests to capture images of wildlife. However, the manual review of these images is labor-intensive.

In this article, we present a solution leveraging Amazon Rekognition Custom Labels alongside motion-activated camera traps to streamline the identification of endangered species. Amazon Rekognition Custom Labels is a fully managed computer vision service that enables developers to build tailored models for classifying and identifying objects in images specific to their needs. We will explain how to detect endangered animal species from images gathered by camera traps, draw insights about their population counts, and identify nearby human activities. This information will be invaluable for conservationists, allowing them to make informed decisions to protect these species.

Solution Overview

The following diagram illustrates the architecture of the solution, which implements a scalable and cost-efficient framework using various AI services and serverless technologies:

  • Amazon Athena: A serverless interactive query service that simplifies data analysis in Amazon S3 using standard SQL.
  • Amazon CloudWatch: A monitoring service that collects operational data in logs, metrics, and events.
  • Amazon DynamoDB: A key-value and document database providing single-digit millisecond performance at scale.
  • AWS Lambda: A serverless compute service that executes code in response to triggers from data changes, system state alterations, or user actions.
  • Amazon QuickSight: A serverless, ML-powered business intelligence service that delivers insights and interactive dashboards.
  • Amazon Rekognition: A service that uses ML to identify objects, people, text, scenes, and activities in images and videos while detecting inappropriate content.
  • Amazon Rekognition Custom Labels: Utilizes AutoML to train custom models for identifying objects and scenes in images tailored to specific business requirements.
  • Amazon Simple Queue Service (SQS): A fully managed message queuing service that decouples and scales microservices and serverless applications.
  • Amazon Simple Storage Service (S3): An object storage solution that manages documents and provides centralized management with detailed access controls.

Implementation Steps

The high-level approach consists of the following steps:

  1. Train a Custom Model: Utilize Rekognition Custom Labels to recognize endangered species in the area. In this instance, we will focus on rhinoceroses.
  2. Capture and Upload Images: Images from the camera traps are uploaded to a designated S3 bucket, triggering an event for each uploaded image.
  3. Trigger Lambda Function: Each event prompts a Lambda function which fetches the image from the S3 bucket and passes it to the custom model for species detection.
  4. Identify Species: The Lambda function employs the Amazon Rekognition API to identify any endangered species present in the image.
  5. Update Database: If an endangered rhinoceros is detected, the function updates the DynamoDB database with the count of the animals, the date of the photograph, and any relevant metadata extracted from the image EXIF header.
  6. Visualize Data: Amazon QuickSight is used to create visualizations of the animal counts and location data stored in DynamoDB, allowing conservationists to track population variations over time. Regularly reviewing these dashboards helps identify patterns and potential threats like disease, climate change, or poaching, enabling proactive measures.

Prerequisites

To build an effective model with Rekognition Custom Labels, a quality training set is essential. For this example, we have utilized images from AWS Marketplace (Animals & Wildlife Data Set from Shutterstock) and Kaggle.

Workflow Steps

  • Train a custom model using Rekognition Custom Labels’ AutoML capability to classify endangered species (rhinoceros in our case). You can also follow steps from the Rekognition Custom Labels console for guidance.
  • Upload the captured images to a specific S3 bucket.
  • Set up event notifications in the S3 bucket’s Permissions section to send notifications to a defined SQS queue for each object added.
  • This upload action triggers an event queued in Amazon SQS through the S3 event notification.
  • Adjust the SQS queue’s access policy to permit notifications from the S3 bucket.
  • Configure a Lambda trigger for the SQS queue to invoke the Lambda function when a new message is received.
  • Modify the access policy to grant the Lambda function access to the SQS queue.
  • Set environment variables for code access.

Lambda Function Code

Upon receiving a notification from the SQS queue, the Lambda function executes the following tasks:

exports.handler = async (event) => {
    const id = AWS.util.uuid.v4();
    const bucket = event.Records[0].s3.bucket.name;
    const photo = decodeURIComponent(event.Records[0].s3.object.key.replace(/+/g, ' '));
    const client = new AWS.Rekognition({ region: REGION });
    const paramsCustomLabel = {
        Image: {
            S3Object: {
                Bucket: bucket,
                Name: photo
            },
        },
        ProjectVersionArn: REK_CUSTOMMODEL,
        MinConfidence: MIN_CONFIDENCE
    };
    let response = await client.detectCustomLabels(paramsCustomLabel).promise();
    console.log("Rekognition customLabels response = ", response);
};

– Fetch the EXIF tags from the image to extract the date the picture was taken and other relevant EXIF data.

For further reading on workplace techniques for mothers, check out this blog post. Additionally, if you’re interested in understanding different political viewpoints in the workplace, SHRM provides valuable insights. You may also find Reddit a great resource for onboarding experiences.

For any inquiries, please reach out to us at Amazon IXD – VGT2, 6401 E HOWDY WELLS AVE, LAS VEGAS NV 89115.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *