← All Projects
AWS • AI/ML • Computer Vision

Saudi Sheep Breed Identifier

A Dockerized web application that uses Amazon Rekognition to identify local Saudi sheep breeds from uploaded photos.

Context

AWS re/Start – Tuwaiq Academy

Role

Cloud & ML Engineer

Stack

EC2, ECS, ECR, S3, Rekognition

Outcome

4 Breeds • 95%+ Confidence

The Challenge

Saudi Arabia has several distinct local sheep breeds, each with unique physical characteristics. Identifying them accurately requires domain expertise that isn't always available. The goal was to build an accessible web tool that anyone could use — simply upload a photo and get an instant breed classification.

The system needed to:

Architecture Overview

The solution uses a fully AWS-native architecture with Docker containerization, managed container orchestration, and a custom-trained ML model.

AWS Architecture Diagram showing the full flow: Client to Route 53 to Internet Gateway to ECS/EC2 in a VPC, with ECR for container images, S3 for storage, and Rekognition for breed analysis.

Fig 1. AWS Architecture — Sheep Breed Recognition System

How It Works

Step 01 — Build

Docker Image on EC2

The web application was Dockerized and the image was built on a private EC2 instance for security, then pushed to Amazon ECR.

Step 02 — Deploy

ECS Public Service

The container runs on Amazon ECS as a public-facing web service, exposed through an Internet Gateway within a VPC.

Step 03 — Route

Route 53 DNS

Amazon Route 53 handles domain name resolution, providing a clean URL for users to access the application.

Step 04 — Analyze

Rekognition Classification

Uploaded photos are stored in S3. Amazon Rekognition (custom-trained model) analyzes the image and returns the breed type to the client.

Implementation

The core classification logic uses the Boto3 SDK to call Amazon Rekognition's custom labels API:

import boto3 def identify_breed(photo): client = boto3.client('rekognition') response = client.detect_custom_labels( Image={'S3Object': {'Bucket': 'sheep-data', 'Name': photo}}, MinConfidence=95 )

The MinConfidence=95 threshold ensures only high-confidence predictions are returned, reducing false positives across the 4 breed categories.

Tech Stack

EC2 ECR ECS S3 Rekognition Route 53 Docker Python

Infrastructure Details

Key Takeaways

← All Projects