Leveraging AWS Serverless, Amazon Bedrock and Generative AI for Textile Pattern Search

dhavaln 175 views 23 slides May 28, 2024
Slide 1
Slide 1 of 23
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23

About This Presentation

I recently presented at the AWS Summit Bangaluru 2024 on the Amazon Bedrock and Image Pattern Analysis using Claude 3 Haiku model.


Slide Content

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
BENGALURU | MAY 15-16 2024

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Leveraging AWS Serverless,
Amazon Bedrock and Generative AI
for Textile Pattern Search
Dhaval Nagar
Founder, APPGAMBiT
AWS HERO

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
•Textile and Pattern Design
•Current Search Process and Problems
•Generative AI for Image Analysis
•Amazon Bedrock and AWS Serverless
•Solution Overview
•Quick Demo
•Summary

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Textile and Design
•Pattern designs are at the core of Textile industry
•New designs needed as trend changes every few months
•Use previous designs for reference and inspiration
Multi-Color FloralMulti-Color, Multi-ObjectMulti-Color, Animals

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Current Design Search
•Designs are stored into local NAS (Network-attached) storage system
•NAS is directly accessible to designers and other team members
•Naturally follows the file-system based folder structure to store all the
designs
•Searching through designs is manual process - either based not the
timestamp, customer/project folder, or simple file search

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Problems
•Difficult to find designs based on specific attributes like pattern type,
colors, and other features
•Low-tech utilisation so difficult to build and maintain in-house software
services
•Cost Sensitive (Aware) Industry

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How Generative AI Can Help!

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Image Analysis with Vision Models
•Latest LLM Models from OpenAI, Anthropic, and Gemini has significant
vision capabilities.
•We can ask and extract specific properties from images.
•Easy to combine Image analysis with other capabilities like formatted
output and reasonings.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Image Analysis with Claude 3

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Bedrock and AWS Serverless
•Amazon Bedrock is a fully-managed service to use latest foundation
models.
•Easy to use API interface to build LLM-based applications in secure and
private environment.
•Supports other features like custom models, model customisation, RAG,
Agents, and Guardrails.
•It’s Serverless, so we only pay for the APIs that we use.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Bedrock and AWS Serverless
•We used Claude 3 Haiku as it has best price and performance for our
use case.
•Instead of using the full-scale images, we use down-sampling to extract
1024h * 1024w portion of images for analysis.
•Attributes are stored in Aurora Serverless V1, as we scale back
database to Zero when not used.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Image Down-sampling
Expected Input Tokens =
(width px * height px)/750
We used  sharp npm library to
extract sample regions from
pattern files.
This process runs on local
GPU-based machine.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cost Calculation
•Using LLM Models at scale can be very expensive, especially if you do not optimise
your tokens properly.
•We used 1024 * 1024 down-sample images and kept our processing cost low per
image.
•Claude 3 Haiku is priced at $0.00025 Per 1000 Input tokens and $0.00125 for 1000
Output tokens

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Quick Demo

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Summary
•We already processed 5000+ designs.
•Identified 300+ unique patterns.
•The overall solution is low-cost and low-ops.
•We are planning to process close to 20,000 designs.
•(In-Progress) Local Image pre-processing using Ollama and LLaVA

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Other Use cases

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Coffee Analysis

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Complex Document Scan

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Regional Language Document Scan

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resources
Original Blog Post Claude 3 Models

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
Please complete the session
survey in the mobile app
Thank you
Dhaval Nagar
@dhavaln
linkedin.com/in/dhavaln

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build beyond
skillbuilder.aws
Redeem your free 7-day
trial of AWS Skill Builder