SlideShare a Scribd company logo
Building an AI-Powered Photo Gallery
with Serverless and Event-Driven
Magic
Srushith Repakula
Who am I?
Head of Engineering, KonfHub
AWS Serverless Hero
Organiser of AWS User Group
Tirupati
Co-organiser of Serverless
Group
01. What Are We Trying to Build?
02. How Did We Build It - The Architecture?
03. Under the Hood: The AI Sorcery
04. Optimisation & Performance
05. Scalability & Privacy
06. The Download Challenge
07. Key Takeaways
CONTENTS
“
What are we trying to build?
An intelligent photo gallery that can:
● Automatically compress uploaded images for
beer performance
● Detect and index faces using AI (Amazon
Rekognition)
● Let users search by face – no manual tagging
needed!
● Scale eortlessly without managing any servers
How did we build it?
Under the
Hood: The AI
Sorcery
Amazon Rekognition
“
Amazon Rekognition is an AI service from AWS
that makes it easy to analyze images and
videos using deep learning - no ML expertise
needed!
“
● Label Detection - Identifies objects, scenes, and
activities in an image.
● Image Properties - Analyzes brightness, sharpness,
and contrast of images.
● Image Moderation - Flags inappropriate or unsafe
content in images.
● Facial Analysis - Detects facial aributes like age,
gender, and emotions.
● Face Comparison - Compares two faces and returns
similarity confidence.
● Face Liveness - Determines if a face in an image is
from a live person (anti-spoofing).
“
Amazon Rekognition - IndexFace
A Rekognition API that detects
faces in an image and stores
facial features in a face
collection for future matching
and search
“
What’s a Face Collection?
● Think of it as a searchable database of faces
● You create a collection (like a named folder)
● Each face is stored with:
○ A unique FaceId
○ Optional ExternalImageId (e.g., user or image reference)
○ Bounding box & facial landmarks
“
What is happening under the hood?
This allows us to:
1. Search across images by uploading another face
2. Retrieve matching photos instantly
3. Do all this with no manual tagging or sorting
An API that compares a new
input face against faces
stored in a collection and
returns the most similar
matches with confidence
scores.
Amazon Rekognition - SearchImageByFace
● Define the collection to search within
● Can specify match threshold (e.g., 90% confidence)
● Response includes:
○ FaceId
○ ExternalImageId
○ Similarity score
○ Bounding box
Amazon Rekognition - SearchImageByFace
Optimisation & Performance
On-the-fly Image
Compression
Uploaded images are
compressed using a Lambda
function to:
● Reduce image size by up
to 80%
● Improve load speed on
the gallery view
● Save on bandwidth and
storage costs
CloudFront for Global
Caching
Serve all user-facing images via
Amazon CloudFront, which:
● Caches compressed
images at edge locations
● Reduces latency for
global users
● Adds resilience and
scalability
Instead of mapping face IDs back to the image manually:
● We store the image URLas ExternalImageId when calling
IndexFaces
● This gives us a direct reference to the original photo for
any face match
● Avoids the need for a separate DB lookup or reverse
mapping
Smart usage of ExternalImageId
● Using Arm64 as the Lambda instruction set for beer cost savings and
performance - 10-15% faster compression times & 20% cost reduction
● Parallel processing of image compression + indexing via SQS → Lambda
triggers
● Use S3 transfer acceleration for uploads from the dashboard. Helps with
faster uploads, especially when the original images are larger in size
● Seing up S3 lifecycle policy - Automatically transition or delete old objects
using S3 lifecycle rules:
Other optimisations
Scalability &
Privacy
Built entirely with
Serverless services like
S3, Lambda, and
Rekognition — which
scale automatically
with no infra
provisioning
Using SQS decouples
processing workloads
(compression &
indexing), ensuring
resilience and elasticity
during spikes
Each image triggers its
own independent
processing — no shared
bolenecks or thread
locks.
Delivers compressed
images globally with
low latency regardless
of upload volume.
Scalability
Serverless by
Design
Asynchronous &
Event-Driven
Parallelism in Image
Workflows
CloudFront Edge
Caching
Original images
uploaded from the
dashboard are via
signed URLs for beer
security
Rekognition doesn’t
store actual images -
only facial metadata.
You retain full control
of the original image
in S3.
Maintain separate
Rekognition face
collections per event,
per environment
Each Lambda only has
scoped-down
permissions (ex, no
Rekognition write
access unless
needed)
Privacy
Signed URLs for
S3 Access
No PII Stored Beyond
Face Features
Face Collection
Isolation
IAM Role Isolation
Delivering thousands of high-resolution gallery images isn’t just about
downloading files. It’s about doing it eiciently, reliably, and serverlessly!
The Download
Challenge
Delivering thousands of high-resolution gallery images isn’t just about
downloading files. It’s about doing it eiciently, reliably, and serverlessly!
The problems?
● Users want to download thousands of high-res images
● Large file sizes = risk of Lambda timeouts and memory limits
● Single large ZIPs are slow, unreliable, and hard to manage
● Needs to be serverless, scalable, and user-friendly
The Download
Challenge
● Step Functions orchestrate the entire
flow
● Images batched dynamically (~2GB per
batch) to avoid Lambda limits
● S3 Map state + parallel Lambda
downloads each batch, zips, uploads
● Email sent to user with all ZIP URLs
after processing
● No server to maintain - purely
event-driven!
Our Serverless Solution
Key Takeaways
● Faster development, lower costs, and beer
performance — without sacrificing intelligence
● You can build production-grade smart systems with
surprisingly few moving parts
● AI integration doesn’t have to be complex
● Serverless architecture allows you to scale
eortlessly, with no infra management
● Event-driven design is powerful for decoupling
workflows and reacting to changes in real time
Why It Matters
What We Learned
“
“Moments captured. Faces remembered.
Powered by AI, delivered by Serverless!
“
THANK
YOU!
Srushith Repakula
Head of Engineering, KonfHub
AWS Serverless Hero

More Related Content

PDF
imgproxy is amazing
PPTX
UNIT III_Cloud APIs for CV_unit III power point
PDF
Building and scaling a B2D service, the bootstrap way
PDF
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
PDF
The Event Driven Future Powered by Serverless
PDF
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
PDF
Machine Learning Use Case - Agriculture
ZIP
Rails in the Cloud
imgproxy is amazing
UNIT III_Cloud APIs for CV_unit III power point
Building and scaling a B2D service, the bootstrap way
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
The Event Driven Future Powered by Serverless
[AWS DC Meetup] Not Your Father’s WebApp: The Cloud-Native Architecture of im...
Machine Learning Use Case - Agriculture
Rails in the Cloud

Similar to Building an AI-Powered Photo Gallery with Serverless and Event-Driven Magic! (10)

PDF
[IO Extended KL] On-Device AI: Is It Time to Go All-In, or Do We Still Need t...
PDF
Exploring Cloud Computing with Amazon Web Services (AWS)
PPTX
Custom vision
PDF
Building real time image classifiers for mobile apps with azure custom vision
PDF
Azure Cognitive Services - Custom Vision
PDF
Design Day Workshop
PDF
Easily find your conference pictures using the power of the cloud @ Devoxx BE...
PDF
Easily find your conference pictures using the power of the cloud
PDF
AWS Summit Berlin 2017
PDF
Optimize Images for SEO WordCamp Sacramento
[IO Extended KL] On-Device AI: Is It Time to Go All-In, or Do We Still Need t...
Exploring Cloud Computing with Amazon Web Services (AWS)
Custom vision
Building real time image classifiers for mobile apps with azure custom vision
Azure Cognitive Services - Custom Vision
Design Day Workshop
Easily find your conference pictures using the power of the cloud @ Devoxx BE...
Easily find your conference pictures using the power of the cloud
AWS Summit Berlin 2017
Optimize Images for SEO WordCamp Sacramento
Ad

More from Srushith Repakula (17)

PDF
How we scaled to 80K users by doing nothing!.pdf
PDF
Lessons Learned from Building a Serverless Notifications System.pdf
PDF
Serverless - Your Gateway to the Cloud!
PDF
Experiences in Architecting & Implementing Platforms using Serverless.pdf
PDF
Serverless: Beyond Lambda Functions (V2)
PDF
Getting Started with Amazon EventBridge
PDF
CICD in the World of Serverless
PDF
Real Time Serverless Polling App
PPTX
Serverless Workshop - Tomato Restaurant Rating App
PPTX
Become Thanos of the LambdaLand: Wield all the Infinity Stones
PPTX
Serverless by Examples and Case Studies
PPTX
Lambda land: Running a serverless ticketing platform for less than $2 a month
PDF
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
PPTX
Chatbots with Serverless
PPTX
Keep Calm and Code Python - Build Cool Stuff Uing Python
PPTX
Serverless: Why is it hot and What is it not?
PPTX
Scheduled Retweets Using AWS Lambda
How we scaled to 80K users by doing nothing!.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
Serverless - Your Gateway to the Cloud!
Experiences in Architecting & Implementing Platforms using Serverless.pdf
Serverless: Beyond Lambda Functions (V2)
Getting Started with Amazon EventBridge
CICD in the World of Serverless
Real Time Serverless Polling App
Serverless Workshop - Tomato Restaurant Rating App
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Serverless by Examples and Case Studies
Lambda land: Running a serverless ticketing platform for less than $2 a month
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
Chatbots with Serverless
Keep Calm and Code Python - Build Cool Stuff Uing Python
Serverless: Why is it hot and What is it not?
Scheduled Retweets Using AWS Lambda
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Mobile App Security Testing_ A Comprehensive Guide.pdf

Building an AI-Powered Photo Gallery with Serverless and Event-Driven Magic!

  • 1. Building an AI-Powered Photo Gallery with Serverless and Event-Driven Magic Srushith Repakula
  • 2. Who am I? Head of Engineering, KonfHub AWS Serverless Hero Organiser of AWS User Group Tirupati Co-organiser of Serverless Group
  • 3. 01. What Are We Trying to Build? 02. How Did We Build It - The Architecture? 03. Under the Hood: The AI Sorcery 04. Optimisation & Performance 05. Scalability & Privacy 06. The Download Challenge 07. Key Takeaways CONTENTS
  • 4. “ What are we trying to build? An intelligent photo gallery that can: ● Automatically compress uploaded images for beer performance ● Detect and index faces using AI (Amazon Rekognition) ● Let users search by face – no manual tagging needed! ● Scale eortlessly without managing any servers
  • 5. How did we build it?
  • 6. Under the Hood: The AI Sorcery Amazon Rekognition
  • 7. “ Amazon Rekognition is an AI service from AWS that makes it easy to analyze images and videos using deep learning - no ML expertise needed!
  • 8. “ ● Label Detection - Identifies objects, scenes, and activities in an image. ● Image Properties - Analyzes brightness, sharpness, and contrast of images. ● Image Moderation - Flags inappropriate or unsafe content in images. ● Facial Analysis - Detects facial aributes like age, gender, and emotions. ● Face Comparison - Compares two faces and returns similarity confidence. ● Face Liveness - Determines if a face in an image is from a live person (anti-spoofing).
  • 9. “ Amazon Rekognition - IndexFace A Rekognition API that detects faces in an image and stores facial features in a face collection for future matching and search
  • 10. “ What’s a Face Collection? ● Think of it as a searchable database of faces ● You create a collection (like a named folder) ● Each face is stored with: ○ A unique FaceId ○ Optional ExternalImageId (e.g., user or image reference) ○ Bounding box & facial landmarks
  • 11.
  • 12. What is happening under the hood? This allows us to: 1. Search across images by uploading another face 2. Retrieve matching photos instantly 3. Do all this with no manual tagging or sorting
  • 13. An API that compares a new input face against faces stored in a collection and returns the most similar matches with confidence scores. Amazon Rekognition - SearchImageByFace
  • 14. ● Define the collection to search within ● Can specify match threshold (e.g., 90% confidence) ● Response includes: ○ FaceId ○ ExternalImageId ○ Similarity score ○ Bounding box Amazon Rekognition - SearchImageByFace
  • 16. On-the-fly Image Compression Uploaded images are compressed using a Lambda function to: ● Reduce image size by up to 80% ● Improve load speed on the gallery view ● Save on bandwidth and storage costs CloudFront for Global Caching Serve all user-facing images via Amazon CloudFront, which: ● Caches compressed images at edge locations ● Reduces latency for global users ● Adds resilience and scalability
  • 17. Instead of mapping face IDs back to the image manually: ● We store the image URLas ExternalImageId when calling IndexFaces ● This gives us a direct reference to the original photo for any face match ● Avoids the need for a separate DB lookup or reverse mapping Smart usage of ExternalImageId
  • 18. ● Using Arm64 as the Lambda instruction set for beer cost savings and performance - 10-15% faster compression times & 20% cost reduction ● Parallel processing of image compression + indexing via SQS → Lambda triggers ● Use S3 transfer acceleration for uploads from the dashboard. Helps with faster uploads, especially when the original images are larger in size ● Seing up S3 lifecycle policy - Automatically transition or delete old objects using S3 lifecycle rules: Other optimisations
  • 20. Built entirely with Serverless services like S3, Lambda, and Rekognition — which scale automatically with no infra provisioning Using SQS decouples processing workloads (compression & indexing), ensuring resilience and elasticity during spikes Each image triggers its own independent processing — no shared bolenecks or thread locks. Delivers compressed images globally with low latency regardless of upload volume. Scalability Serverless by Design Asynchronous & Event-Driven Parallelism in Image Workflows CloudFront Edge Caching
  • 21. Original images uploaded from the dashboard are via signed URLs for beer security Rekognition doesn’t store actual images - only facial metadata. You retain full control of the original image in S3. Maintain separate Rekognition face collections per event, per environment Each Lambda only has scoped-down permissions (ex, no Rekognition write access unless needed) Privacy Signed URLs for S3 Access No PII Stored Beyond Face Features Face Collection Isolation IAM Role Isolation
  • 22. Delivering thousands of high-resolution gallery images isn’t just about downloading files. It’s about doing it eiciently, reliably, and serverlessly! The Download Challenge
  • 23. Delivering thousands of high-resolution gallery images isn’t just about downloading files. It’s about doing it eiciently, reliably, and serverlessly! The problems? ● Users want to download thousands of high-res images ● Large file sizes = risk of Lambda timeouts and memory limits ● Single large ZIPs are slow, unreliable, and hard to manage ● Needs to be serverless, scalable, and user-friendly The Download Challenge
  • 24. ● Step Functions orchestrate the entire flow ● Images batched dynamically (~2GB per batch) to avoid Lambda limits ● S3 Map state + parallel Lambda downloads each batch, zips, uploads ● Email sent to user with all ZIP URLs after processing ● No server to maintain - purely event-driven! Our Serverless Solution
  • 25. Key Takeaways ● Faster development, lower costs, and beer performance — without sacrificing intelligence ● You can build production-grade smart systems with surprisingly few moving parts ● AI integration doesn’t have to be complex ● Serverless architecture allows you to scale eortlessly, with no infra management ● Event-driven design is powerful for decoupling workflows and reacting to changes in real time Why It Matters What We Learned
  • 26. “ “Moments captured. Faces remembered. Powered by AI, delivered by Serverless! “
  • 27. THANK YOU! Srushith Repakula Head of Engineering, KonfHub AWS Serverless Hero