Description
Goal: The purpose of this individual assignment is to learn how to use the Amazon AWS cloud platform and how
to develop an AWS application that uses existing cloud services.
Specifically, you will learn: (1) how to create
VMs (EC2 instances) in the cloud; (2) how to use cloud storage (S3) in your applications; (3) how to
communicate between VMs using a queue service (SQS); (4) how to program distributed applications in Java on
Linux VMs in the cloud; and (5) how to use a machine learning service (AWS Rekognition) in the cloud.
Description: You must build an image recognition pipeline in AWS, using two EC2 instances, S3, SQS, and
Rekognition. The assignment must be done in Java on Amazon Linux VMs. For the rest of the description, you
should refer to the figure below:
You must create 2 EC2 instances (EC2 A and B in the figure), with Amazon Linux AMI, that will work in
parallel. Each instance will run a Java application. Instance A will read 10 images from an S3 bucket that we
created (unr-cs442) and perform object detection in the images.
When a car is detected using Rekognition, with
confidence higher than 90%, the index of that image (e.g., 2.jpg) is stored in SQS. Instance B reads indexes of
images from SQS as soon as these indexes become available in the queue, and performs text recognition on these
images (i.e., downloads them from S3 one by one and uses Rekognition for text recognition). Note that the two
instances work in parallel: for example, instance A is processing image 3, while instance B is processing image 1
that was recognized as a car by instance A.
When instance A terminates its image processing, it adds index -1 to
the queue to signal to instance B that no more indexes will come. When instance B finishes, it prints to a file, in
S3 Bucket
EC2 B
Text Extraction
AWS Rekognition
EC2 A
Car Recognition
Retrieve images
Retrieve images
that are found
in SQS
Object Detection Text Detection
SQS Message Queue
Push the name of
images with car
Retrieve
names
Output to file with
name of images
along with extracted
text
its associated EBS, the indexes of the images that have both cars and text and prints the actual text in each image
next to its index.
Additional Information:
1. EC2 Management
• You should use the same .pem key for both instances.
• You must configure the Security Group well to prevent any attacks. In the Security Group tab, there is a
column called “Source” which tells from which IP address this instance can be accessed: you should
select “MYIP” from the drop box. You should open just three ports: SSH, HTTP, HTTPS.
• For this assignment, the free tier instances are more than enough (this will incur no cost).
• If you don’t use free-tier instances, be sure to terminate your instances after finishing your jobs.
Otherwise, you will be charged for every hour of running your instances.
2. Programmer’s keys
– To code with AWS SDKs, you need a pair of keys (access-id, secret-key) which is provided by AWS and
will be created uniquely for your account. These credentials work for all AWS programming services
which you intend to connect through AWS SDKs. Therefore, the same credentials can be used for
Rekognition, SQS, and S3.
– Here are some websites to get started using Rekognition service and SQS:
SQS Example: https://github.com/awsdocs/aws-doc-sdkexamples/blob/master/javav2/example_code/sqs/src/main/java/com/example/sqs/SQSExample.java
Rekognition Example: https://github.com/awsdocs/aws-doc-sdkexamples/tree/master/javav2/example_code/rekognition/src/main/java/com/example/rekognition
o
Submission: You will submit in Canvas, under Programming Assignment 1, the following files:
– The Java code of your two applications, for car recognition and for text recognition (which includes all
the communication code with the other services).
– A README file that describes step-by-step how-to set-up the cloud environment and run the application.
– You will be required to show a short demo to me.
Grading:
– Code for car recognition – 30 points
– Code for text recognition – 30 points
– Code for communication with S3, SQS, Rekognition – 40 points