AWS Optics

Keerthi
3 min readFeb 9, 2022

Image Recognition with AWS Rekognition

We in this 21st century with social distancing are so contented with e-living through digital devices, we use text messages for birthday wishes, video calls to our loved ones, freeze our special moments with pictures, smart pay with online payment apps. As a result we have data & data everywhere.

Src: dribbble

In order to make use of this data and get insights from this we need to go through the sad steps of complete data science pipeline & keep training the model for months to see 0.00001 accuracy (I know i have gone through it myself )

So in this blog, I have explored the AWS Rekognition cloud based Software as a Service computer vision platform to build a cool Image analysis software AWS-optics to perform the following operations:

  1. Label_detection: Image classification that adds labels to the image
  2. Text_detection: Extracts text from image
  3. Safe_search_detection: Detect if the content is adult, racism, spoofed, violence, or medical.

AWS Setup:

AWS(Amazon Web Services) provides on-demand cloud computing platforms and APIs it has an initial 12 month period Free-tier account to explore more of it services. AWS Rekognition is one of the services and we can access it via the free-tier account.

Step 1: Set up an AWS account and create an IAM user.

Step 2: Set up the AWS CLI and AWS SDKs.

We are using the boto3 package, AWS python SDK package, which talks to AWS. We need to configure boto3 with authentication credentials for our AWS account (Refer the docs).

Task 1: Label detection

We are using detect_labels method to identify the labels in the given image along with their confidence scores.

Sample Image (Src: Google images)
lighthouse : 98.4629
rock : 79.2097
sea : 75.061
Labels detected : 3

Task 2: Text detection

We are using detect_text method to extract the text in the given image along with their confidence scores.

Sample Image (Src: Image by author)
Feb 10,2022 : : 74.39%
1 : 67.18%
Medium post AWS optics : 99.13%
2 : 79.08%
Read "the Unfnished " : 73.20%
3 : 97.78%
Resume rocket boys : 98.97%
4 : 97.34%
Fix build 4312 : 91.75%
5 : 93.68%
Play some tunes : 94.25%
6 : 85.87%
ceean wpboard : 54.73%
7 : 95.21%
Yoga : 83.55%
REDMI NOTE 9 : 98.33%
AI QUAD CAMERA : 98.30%

Task 3: Safe search detection

We are using detect_moderation_labels method to detect the inappropriate content(if any) in the image given along with their confidence scores.

Sample Image (Src:iStock)
Graphic Violence Or Gore : 98.432900261239
Violence : 98.87590026855469

Labels detected: 2

The complete code base for AWS Optic can be found in my repo.

Thank you for reading. Please let me know about any suggestions or clarifications in comments.

Resources:

https://docs.aws.amazon.com/rekognition/latest/dg/what-is.html

--

--