SlideShare a Scribd company logo
1 of 57
Download to read offline
CERTIFICATE
This is to certify that Lenox Fernandes, Smeet Gohil, Lavesh Lalwani, Jerish
Rayan are the bonafide students of St. Francis Institute of Technology, Mumbai.
They have successfully carried out the project titled “Deploying Deep Learning
Algorithm On AWS Cloud Platform” in partial fulfilment of the requirement of B.
E. Degree in Electronics and Telecommunication Engineering of Mumbai University
during the academic year 2021-2022. The work has not been presented elsewhere
for the award of any other degree or diploma prior to this.
————————
(Mr. Ramjee Yadav)
————————– ————————
(Dr. Gautam Shah) (Dr. Sincy George)
EXTC HOD Principal
Project Report Approval for B.E.
This project entitled ‘Deploying Deep Learning Algorithm On AWS
Cloud Platform’ by Lenox Fernandes, Smeet Gohil, Lavesh Lalwani,
Jerish Rayan is approved for the degree of Bachelor of Engineering in Electronics
and Telecommunication from University of Mumbai.
Examiners
1. - - - - - - - - - - - - - - - - - -
2. - - - - - - - - - - - - - - - - - -
Date:
Place:
ACKNOWLEDGEMENT
We are thankful to a number of individuals who have contributed towards our
final year project and without their help; it would not have been possible. Firstly,
we offer our sincere thanks to our project guide, Mr. Ramjee Yadav for his
constant and timely help and guidance throughout our preparation.
We are grateful to all project co-ordinators for their valuable inputs to our
project. We are also grateful to the college authorities and the entire faculty for
their support in providing us with the facilities required throughout this semester.
We are also highly grateful to Dr. Gautam A. Shah, Head of Department
(EXTC), Principal, Dr. Sincy George, and Director Bro. Jose Thuruthiyil for
providing the facilities, a conducive environment and encouragement.
Signatures of all the students in the group
(Lenox Fernandes)
(Smeet Gohil)
(Lavesh Lalwani)
(Jerish Rayan)
iii
Declaration
We declare that this written submission represents our ideas in our own words and
where others’ ideas or words have been included; we have adequately cited and
referenced the original sources. We also declare that we have adhered to all
principles of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in this submission. We
understand that any violation of the above will be cause for disciplinary action by
the Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when
needed.
Signatures of all the students in the group
(Lenox Fernandes)
(Smeet Gohil)
(Lavesh Lalwani)
(Jerish Rayan)
iv
Abstract
Deploying deep learning algorithms on hardware platforms is difficult as it requires
lots of computational power, it becomes tedious, expensive, and contains very few
options for remote access. An organized cloud architecture can mitigate these
factors and provide a cost-effective, automatically scalable (up or down), and
elastic real-time on-demand AI solution. In this project, we propose an architecture
which consists of cloud services that help us to host the deep learning algorithm
and get the output predictions in real-time. These predictions are based on human
activity and are displayed on the website. The website is used to feed input videos
to the model; the website is also deployed on the cloud platform to increase the
overall performance, security, cost-effective and provides easy maintenance.
v
Contents
Acknowledgement iii
Declaration iv
Abstract v
List of Figures vii
List of Abbreviations ix
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Organization of Project Report . . . . . . . . . . . . . . . . . . . . 2
2 Literature Survey 3
2.1 Cloud Computing- Infrastructure as Service - Amazon EC2 [1] . . . 3
2.2 AWS whitepaper - 5g for AWS [2] . . . . . . . . . . . . . . . . . . . 5
2.3 Build automatic analysis of body language to gauge attention and
engagement using Amazon Kinesis Video Streams and Amazon AI
Services [4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1 Working of the Cloud Architecture: . . . . . . . . . . . . . . 6
2.3.2 Kinesis Video Streams ingestion . . . . . . . . . . . . . . . . 7
2.3.3 Streaming from a browser webcam . . . . . . . . . . . . . . 7
2.3.4 Amazon Rekognition Video - Stream processor . . . . . . . . 7
2.3.5 Motion Analytics . . . . . . . . . . . . . . . . . . . . . . . . 8
vi
2.3.6 Visualizing the metrics . . . . . . . . . . . . . . . . . . . . . 8
3 Study of AWS, React and Node.js 9
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 AWS Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1 EC2 Instance . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.2 Amazon S3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.3 AWS Lambda . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.4 Amazon Route 53 . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.5 AWS Key Management Service . . . . . . . . . . . . . . . . 16
3.2.6 AWS CloudWatch [5] . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Development and deploying for the website . . . . . . . . . . . . . . 18
4 Software and Hardware Support 23
4.1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.1 For Web Development . . . . . . . . . . . . . . . . . . . . . 23
4.1.2 AWS Services . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 Why a browser app? . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.3 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Implementation of Cloud Architecture 29
5.1 Implementation of proposed Cloud Architecture . . . . . . . . . . . 29
5.2 Website Development . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.3 Create an Amazon EC2 Instance and S3 Bucket . . . . . . . . . . . 33
5.4 Deploying the Website and Deep Learning Algorithm on EC2 instance 36
5.5 Configure the AWS services . . . . . . . . . . . . . . . . . . . . . . 37
5.6 Run the deployed algorithm in Amazon EC2 Instance . . . . . . . . 39
6 Simulation, Results and Discussion 40
6.1 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7 Conclusion 44
7.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
vii
List of Figures
2.1 AWS Global Physical Infrastructure[1] . . . . . . . . . . . . . . . . 4
2.2 AWS IAM[2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Serverless System Architecture[4] . . . . . . . . . . . . . . . . . . . 6
2.4 Video streaming through webcam[4] . . . . . . . . . . . . . . . . . . 7
3.1 AWS Services [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 EC2 instance and EBS (Elastic Block Store)[5] . . . . . . . . . . . . 11
3.3 Auto scaling of Amazon EC2 instance[5] . . . . . . . . . . . . . . . 12
3.4 S3 Storage [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5 Working of AWS Lambda [5] . . . . . . . . . . . . . . . . . . . . . . 14
3.6 AWS Route 53 [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.7 AWS Key Management Service [5] . . . . . . . . . . . . . . . . . . . 16
3.8 EC2 monitoring through AWS CloudWatch [5] . . . . . . . . . . . . 17
3.9 Designing a webpage using Figma [8] . . . . . . . . . . . . . . . . . 19
3.10 MVC Architecture [12] . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.11 React Components [9] . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.12 Node.Js used to connect the website to the Server [10] . . . . . . . . 22
4.1 Amazon EC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 Amazon API Gateway . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Amazon Route 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.4 Amazon DynamoDB . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.5 Amazon S3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.6 Amazon Identity and Access Management [5] . . . . . . . . . . . . . 26
4.7 Cloud watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.8 Amazon CloudFront . . . . . . . . . . . . . . . . . . . . . . . . . . 27
viii
5.1 Proposed Cloud Architecture . . . . . . . . . . . . . . . . . . . . . 30
5.2 Figma design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.3 Implementing Figma design on localhost. . . . . . . . . . . . . . . . 32
5.4 Region selection for EC2 . . . . . . . . . . . . . . . . . . . . . . . . 33
5.5 selecting EBS storage in EC2 . . . . . . . . . . . . . . . . . . . . . 33
5.6 Creating security Key for EC2 . . . . . . . . . . . . . . . . . . . . . 34
5.7 Create the S3 bucket . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.8 Creating name for S3 . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.9 Allowing public access . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.10 Deploying code on EC2 instance . . . . . . . . . . . . . . . . . . . . 37
5.11 Configuring the s3 Bucket . . . . . . . . . . . . . . . . . . . . . . . 37
5.12 Creating IAM role to connect EC2 instance and s3 . . . . . . . . . 38
5.13 Access EC2 instance using Boto3 command . . . . . . . . . . . . . 38
5.14 Website hosted on domain . . . . . . . . . . . . . . . . . . . . . . . 39
5.15 Running express Server on AWS . . . . . . . . . . . . . . . . . . . . 39
6.1 Website Deployed on EC2 . . . . . . . . . . . . . . . . . . . . . . . 40
6.2 Screenshot of running EC2 . . . . . . . . . . . . . . . . . . . . . . 41
6.3 Screenshot of S3 storage . . . . . . . . . . . . . . . . . . . . . . . . 42
6.4 CloudWatch Dashboard . . . . . . . . . . . . . . . . . . . . . . . . 42
ix
Chapter 1
Introduction
1.1 Motivation
As Artificial Intelligence needs lots of computational power to give us the desired
output, we decided to use the cloud to manage and run the machine learning
models. AWS Cloud infrastructures support environmental proactivity, powering
virtual services rather than physical products and hardware. AWS also provides us
many features like Intuitive and Easy-to-Use, Cost-effective, High Functionality
and Scalability, Dynamic and Flexible Operations, Trustworthy and it is highly
secure. It allows one of us to remotely access from anywhere with an Internet
connection.
1.2 Problem Statement
In the world of AI and machine learning processing data quickly and efficiently is
the trend so we need a platform that can analyze expressions in real-time and could
be accessed easily but offline servers are tedious, expensive, and contain very few
options for remote access.
1
1.3 Methodology
Our project starts with a website that is deployed on an EC2 instance (Elastic
Compute Cloud), it is the computational capacity in the Amazon Web Services
(AWS) Cloud. For the website, we have used the javascript framework REACT
for the frontend and Node.js which is a JavaScript runtime built on Chrome’s V8
JavaScript engine. The site developed will be providing the input video to the model
that is being hosted on the AWS EC2 instance. For the DL mode to process the
video frames we are using the EC2 instance to provide better processing power. The
deep learning model will process that video in the second EC2 instance and give
us the analyzed predictions. These predicted values are sent back to the first EC2
instance where the website is hosted, to display the output on the website.
1.4 Organization of Project Report
This project report is organized as follows:
Chapter 2 Literature Survey
Chapter 3 Study of AWS, React and Node.js
Chapter 4 Software and Hardware Support
Chapter 5 Implementation of Cloud Architecture
Chapter 6 Simulation, Results and Discussion
Chapter 7 Conclusion and Future Scope
2
Chapter 2
Literature Survey
A literature review is an overview of the previously published works on a specific
topic. In this section we have listed three major research papers/blogs which have
provided us with the existing knowledge on the topic of creating a cloud
architecture, along with some deployment of ML Algorithms such as Human
activity recognition, face detection and recognition and emotion recognition.
2.1 Cloud Computing- Infrastructure as Service
- Amazon EC2 [1]
Infrastructure as a Service (IaaS) is the delivery of hardware (server, storage and
network), and associated software (operating systems virtualization technology, file
system), as a service. It is an evolution of traditional hosting that does not require
any long term commitment and allows users to provision resources on demand.
Unlike PaaS services, the IaaS provider does very little management other than
keep the data center operational and users must deploy and manage the software
services themselves just the way they would in their own data center. Amazon
Web Services Elastic Compute Cloud (EC2) and Secure Storage Service (S3) are
examples of IaaS offerings. Amazon Elastic Compute Cloud (Amazon EC2) is a
web service that provides resizable compute capacity in the cloud. It is designed to
make web-scale computing easier for developers. Amazon EC2’s simple web service
interface allows you to obtain and configure capacity with minimal friction. It
3
Figure 2.1: AWS Global Physical Infrastructure[1]
provides you with complete control of your computing resources and lets you run on
Amazon’s proven computing environment. Amazon EC2 reduces the time required
to obtain and boot new server instances to minutes, allowing you to quickly scale
capacity, both up and down, as your computing requirements change.
• Amazon Elastic Block Store
• Auto Scaling
• High Performance Computing (HPC) Clusters
• Amazon Cloud Watch
4
2.2 AWS whitepaper - 5g for AWS [2]
Infrastructure deployment includes all the prerequisites for the network function to
be successfully deployed and configured.
Some of the components created as part of this phase are:
• Networking - VPC, public and private subnets, routes, load balancers
• Compute - Kubernetes ( Vmware Tanzu , Amazon EKS, or AWS Outposts),
Amazon EC2 instances primary and worker nodes, auto scaling group
• Storage - Amazon EFS, Amazon EBS, Amazon S3 bucket
• Security - IAM roles , security groups
• Pipeline - CodePipeline, CodeBuild
• Observability - CloudWatch, Prometheus, FluentD
Security
• Artifacts integrity - The artifacts used across the pipeline are encrypted
whether at rest (using AWS managed keys) or transit (using SSL/TLS).
• IAM users and roles - The permissions provided to the users or resources are
based on the principle of least privilege. There should be a cross-IAM role
trust relationship that may need to be configured if you are operating across
resources in different services. For example, AWS CodeBuild needs permission
to run commands on an Amazon EKS cluster.
Figure 2.2: AWS IAM[2]
5
2.3 Build automatic analysis of body language
to gauge attention and engagement using
Amazon Kinesis Video Streams and Amazon
AI Services [4]
We’ve provided a web application and accompanying serverless architecture for
streaming a webcam feed from a browser to Amazon Kinesis Video Streams and
Amazon Rekognition Video. Body motion metrics can then be visualized in a web
app with minimal delay. This may apply to a range of business use cases, such as
quickly estimating engagement and enjoyment of movies, ads, TV shows, video
games, political campaigns, speeches, online courses; or classroom teaching.
2.3.1 Working of the Cloud Architecture:
System Architecture
Figure 2.3: Serverless System Architecture[4]
6
2.3.2 Kinesis Video Streams ingestion
A client video-stream-producing web app allows users to 1) upload pre-recorded
video and/or 2) live stream their webcam feed to Amazon Kinesis Video Streams.
This webcam streaming functionality is backed by the WebRTC getUserMedia API,
and is supported on all major browsers and platforms, with the exception of iOS
mobile.
2.3.3 Streaming from a browser webcam
The following is a side-by-side illustration of webcam streaming to the Amazon
Kinesis Video Streams console. The lag between the live webcam app feed (left)
and the time these frames are played back on the Kinesis Video Streams console
(right) is about 5 seconds.
Figure 2.4: Video streaming through webcam[4]
2.3.4 Amazon Rekognition Video - Stream processor
The next step is to automatically detect people in the full-speed video, and track
their motions in real time. We feed the Kinesis Video Stream as input to Amazon
Rekognition Video (the AWS new video-capable version of the Amazon Rekognition
deep-learning toolset to track objects and people in images), using a Rekognition
Stream Processor.
7
2.3.5 Motion Analytics
When new records appear in this raw data stream, our Motion Analytics algorithm
(implemented as an AWS Lambda function) is triggered. It computes interesting
derived metrics on faces in successive video frames, such as rotational/translational
motion velocities, which can be used as features to gauge attention and engagement.
These processed metrics are then published to another Kinesis Data Stream, for
consumption by downstream applications and web dashboards.
2.3.6 Visualizing the metrics
For this project, we provide a dashboard app (in the same interface as the video
streaming app) that consumes body motion metrics directly from the processed
Kinesis Data Stream and renders them in near real-time as streaming chart
visualizations. Of course, you can consider fronting the processed data stream
with an Amazon API Gateway endpoint (as illustrated in the system architecture
diagram) to allow multiple clients and downstream applications to consume the
processed metrics scalably.
8
Chapter 3
Study of AWS, React and Node.js
3.1 Introduction
In today’s highly competitive business environments, Enterprises have been
striving to reduce the amount of capital and time in acquisition and maintenance
of computational resources. The emergence of cloud computing is rapidly changing
this ownership-based approach to a subscription-oriented approach in which
everything-from computing power to computing infrastructure, applications,
business processes to personal collaboration- is delivered as a service wherever and
whenever required. Web hosting is the business of providing server space, web
services, and file maintenance for websites controlled by companies or individuals
that do not have their own web servers. The advancement in Web technology has
made it feasible for any user to access the requisite information on the internet.
Cloud hosting is about hosting customer applications using well monitored virtual
servers in the cloud without any physical space limitation and resource usage
limit. In cloud hosting, the resources required for maintaining the customer web
applications are spread across a number of servers and are rendered as per need
basis. Here we discuss cloud computing and the deployment strategy of two tier
web based applications on the cloud. The machine learning algorithm helps to
analyze and process the video for the website and deliver all forms of content. For
this we are using AWS services like EC2 instances, AWS Lambda, AWS Dynamo
DB, AWS S3 bucket, API Gateway, AWS Route 53. The processed output would
then be stored in the database so it can be easily accessible in the future. For the
9
development of the website, we have used React JS for the frontend and Node.JS
for the Backend. The database used here is DynamoDB and S3 bucket.
3.2 AWS Services
Figure 3.1: AWS Services [5]
Amazon Web Services offers a broad set of Global Cloud-based products including
Compute, Storage, Databases, Analytics, Networking, Mobile, Developer Tools,
Management Tools, IoT, Security, and Enterprise Applications
10
3.2.1 EC2 Instance
Figure 3.2: EC2 instance and EBS (Elastic Block Store)[5]
Cloud computing is the on-demand delivery of IT resources over the Internet with
pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data
centers and servers, you can access technology services, such as computing power.
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing
capacity in the Amazon Web Services (AWS) Cloud. Using Amazon EC2
eliminates your need to invest in hardware upfront, so you can develop and deploy
applications faster. You can use Amazon EC2 to launch as many or as few virtual
servers as you need, configure security and networking, and manage storage.
Amazon EC2 enables you to scale up or down to handle changes in requirements
or spikes in popularity, reducing your need to forecast traffic.
Elastic Block Store (EBS) offers persistent storage for Amazon EC2 instances.
Amazon EBS volumes provide off-instance storage that persists independently
from the life of an instance. Amazon EBS volumes are highly available, highly
reliable volumes that can be leveraged as an Amazon EC2 instance’s boot
11
partition or attached to a running Amazon EC2 instance as a standard block
device. When used as a boot 4 partition, Amazon EC2 instances can be stopped
and subsequently restarted, enabling you to only pay for the storage resources
used while maintaining your Instance’s state. Amazon EBS volumes offer Greatly
improved durability over local Amazon EC2 instance stores, as Amazon EBS
volumes are automatically replicated on the backend (in a single Availability
Zone).
Figure 3.3: Auto scaling of Amazon EC2 instance[5]
Amazon EC2 Auto Scaling allows you to automatically scale your Amazon
EC2 capacity up or down according to the conditions you define. With EC2 Auto
Scaling, you can ensure that the number of Amazon EC2 instances you’re using
scales up seamlessly during demand spikes to maintain performance and scales
down automatically during demand lulls to minimize costs. EC2 Auto Scaling is
particularly well suited for applications that experience hourly, daily, or weekly
variability in usage. EC2 Auto Scaling is enabled by Amazon CloudWatch and
available at no additional charge beyond Amazon CloudWatch fees.
12
3.2.2 Amazon S3
Figure 3.4: S3 Storage [5]
Amazon Simple Storage Service (Amazon S3) is an object storage service that
offers industry-leading Scalability, data availability, Security, and Performance.
This means customers of all sizes and industries can use it to store and protect
any amount of data for a range of use cases, such as data lakes, websites, mobile
applications, backup and restore, archive, enterprise applications, IoT devices, and
big data analytics. Amazon S3 provides easy-to-use management features so you
can organize your data and configure finely-tuned access controls to meet your
specific business, organizational, and compliance requirements. How S3 works:
Amazon S3 is an object storage service that stores data as objects within buckets.
An object is a file and any metadata that describes the file. A bucket is a
container for objects. To store your data in Amazon S3, you first create a bucket
and specify a bucket name and AWS Region. Then, you upload your data to that
bucket as objects in Amazon S3. Each object has a key (or key name), which is
the unique identifier for the object within the bucket. S3 provides features that
you can configure to support your specific use case. For example, you can use S3
Versioning to keep multiple versions of an object in the same bucket, which allows
you to restore objects that are accidentally deleted or overwritten. Buckets and
the objects in them are private and can be accessed only if you explicitly grant
access permissions. You can use bucket policies, AWS Identity and Access
Management (IAM) policies, access control lists (ACLs), and S3 Access Points to
manage access. Amazon S3 offers a range of storage classes designed for different
use cases. For example, you can store mission-critical production data in S3
Standard for frequent access, save costs by storing infrequently accessed data in S3
Standard-IA or S3 One Zone-IA, and archive data at the lowest costs in S3 Glacier
13
and S3 Glacier Deep Archive. To transform data and trigger workflows to
automate a variety of other processing activities at scale, you can use the following
features.
3.2.3 AWS Lambda
Figure 3.5: Working of AWS Lambda [5]
Lambda is a compute service that lets you run code without provisioning or
managing servers. Lambda runs your code on a high-availability compute
infrastructure and performs all of the administration of the compute resources,
including server and operating system maintenance, capacity provisioning and
automatic scaling, code monitoring and logging. With Lambda, you can run code
for virtually any type of application or backend service.
You organize your code into Lambda functions. Lambda runs your function only
when needed and scales automatically, from a few requests per day to thousands
per second. You pay only for the compute time that you consume-there is no
charge when your code is not running.
You can invoke your Lambda functions using the Lambda API, or Lambda can
run your functions in response to events from other AWS services.
You can run JavaScript code with Node.js in AWS Lambda. Lambda provides
14
runtime for Node.js that run your code to process events. Your code runs in an
environment that includes the AWS SDK for JavaScript, with credentials from an
AWS Identity and Access Management (IAM) role that you manage.
3.2.4 Amazon Route 53
Figure 3.6: AWS Route 53 [5]
Amazon Route 53 is a highly available and scalable Cloud Domain Name System
(DNS) web service. It is designed to give developers and businesses an extremely
reliable and cost-effective way to route end users to Internet applications by
translating names like www.example.com into the numeric IP addresses like
192.0.2.1 that computers use to connect to each other. Amazon Route 53 is fully
compliant with IPv6 as well. Amazon Route 53 effectively connects user requests
to infrastructure running in AWS - such as Amazon EC2 instances, Elastic Load
Balancing load balancers, or Amazon S3 buckets - and can also be used to route
users to infrastructure outside of AWS. You can use Amazon Route 53 to configure
DNS health checks, then continuously monitor your applications’ ability to recover
from failures and control application recovery with Route 53 Application Recovery
Controller.
15
3.2.5 AWS Key Management Service
Figure 3.7: AWS Key Management Service [5]
Server-side encryption is the encryption of data at its destination by the
application or service that receives it. AWS Key Management Service (AWS
KMS) is a service that combines secure, highly available hardware and software to
provide a key management system scaled for the cloud. Amazon S3 uses AWS
KMS keys to encrypt your Amazon S3 objects. AWS KMS encrypts only the
object data. Any object metadata is not encrypted.
If you use KMS keys, you can use AWS KMS through the AWS Management
Console or the AWS KMS APIs to do the following:
1. Centrally create KMS keys
2. Define the policies that control how KMS keys can be used
3. Audit their usage to prove that they are being used correctly
The security controls in AWS KMS can help you meet encryption-related
compliance requirements. You can use these KMS keys to protect your data in
Amazon S3 buckets. When you use SSE-KMS encryption with an S3 bucket, the
AWS KMS keys must be in the same Region as the bucket.
16
3.2.6 AWS CloudWatch [5]
Figure 3.8: EC2 monitoring through AWS CloudWatch [5]
CloudWatch enables real-time monitoring of AWS resources such as Amazon
Elastic Compute Cloud (EC2) instances, Amazon Elastic Block Store (EBS)
volumes, Elastic Load Balancing and Amazon Relational Database Service (RDS)
instances. The application automatically collects and provides metrics for CPU
utilization, latency and request counts. Users can also stipulate additional metrics
to be monitored, such as memory usage, transaction volumes or error rates. Users
can access CloudWatch functions through an application programming interface
(API), command-line tools, one of the AWS software development kits or the AWS
Management Console. The CloudWatch interface provides current statistics that
users can view in graph format. Users can set notification alarms to be sent when
something being monitored surpasses a specified threshold. The app can also
detect and shut down unused or underused EC2 instances.
17
3.3 Development and deploying for the website
With the technological advancement in the 21st-century, everybody wants to
experience the best technology without spending too much of their time and
exhausting their busy brains. The same goes for surfing the websites or
mobile applications as well where the quick and efficient the website or the
mobile application responds, the successful outcomes it obtains. In short, it
is about consumers nowadays! And, when it comes to the mobile application
or website user satisfaction, most technology firms turn towards the
applications User Interface (UI) and User Experience Design (UX). However,
most of the time people confuse between the terms UI and UX. Therefore,
we are here to decode the concept of UI and UX design
What is UI?
The abbreviation UI stands for the user interface. It is the way through
which users interact with the mobile application. The user interface includes
all the controls, buttons, blocks, and elements of the app. The primary
objective of the user interface is to provide easy, enjoyable, and effective
interaction between the user and the app. The process of developing UI
includes selecting a color, corporate identity, and the latest design principles.
What is UX?
The abbreviation UX stands for user experience. The idea of UX is to
provide the best experience for the user with ease of usage and the feel on
how the user gets an impact on establishing your business value. Creating a
UX includes defining the way a product operates and meets the requirements
of the users. UX must be clear, comfortable, User-friendly and should work
in the direction to turn your users into loyal customers.
Importance of UX/UX in Mobile Apps
For a developer, it is essential to know the importance of UI/UX in the
mobile app. You can create an app with great functionality but if you fail to
18
focus on the designing part, it may lead to the downfall of your app. It is
mandatory to have the right balance between the functionality and UI/UX
of the app in order to make it a successful one. Below are a few pointers to
highlight the importance of UI/UX Design in Mobile apps.
Figure 3.9: Designing a webpage using Figma [8]
Figma is a vector graphics editor and prototyping tool which is primarily
web-based, with additional offline features enabled by desktop applications
for macOS and Windows. The Figma Mirror companion apps for Android
and iOS allow viewing Figma prototypes in real-time on mobile devices. The
feature set of Figma focuses on use in user interface and user experience
design, with an emphasis on real-time collaboration.
19
Implementing the Design using React JS and Node.JS.
React JS
Figure 3.10: MVC Architecture [12]
React is a JavaScript library created for building fast and interactive user
interfaces for web and mobile applications. It is an open-source,
component-based, front-end library responsible only for the application’s
view layer. In Model View Controller (MVC) 9 architecture, the view layer is
responsible for how the app looks and feels. React was created by Jordan
Walke, a software engineer at Facebook. Let’s take a look at an Instagram
webpage example, entirely built using React, to get a better understanding
of how React works. As the illustration shows, React divides the UI into
multiple components, which makes the code easier to debug. This way, each
component has its property and function.
20
Figure 3.11: React Components [9]
Let’s take a look at an Instagram webpage example, entirely built using React,
to get a better understanding of how React works. As the illustration shows,
React divides the UI into multiple components, which makes the code easier
to debug. This way, each component has its property and function.
Now that we know what React is let’s move on and see why React is the
most popular front-end library for web application development.
• Node.JS
Node.js is a server-side platform built on Google Chrome’s JavaScript
Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its
latest version is v0.10.36. The definition of Node.js as supplied by its official
documentation is as follows - Node.js is a platform built on Chrome’s
JavaScript runtime for easily building fast and scalable network applications.
Node.js uses an event-driven, non-blocking I/O model that makes it
lightweight and efficient, perfect for data-intensive real-time applications that
run across distributed devices. 11 Node.js is an open-source, cross-platform
runtime environment for developing server-side and networking applications.
21
Node.js applications are written in JavaScript and can be run within the
Node.js runtime on OS X, Microsoft Windows, and Linux. Node.js also
provides a rich library of various JavaScript modules which simplifies the
development of web applications using Node.js to a great extent.
Figure 3.12: Node.Js used to connect the website to the Server [10]
This is in contrast to today’s more common concurrency model, in which OS
threads are employed. Thread-based networking is relatively inefficient and
very difficult to use. Furthermore, users of Node.js are free from worries of
dead-locking the process, since there are no locks. Almost no function in
Node.js directly performs I/O, so the process never blocks except when the
I/O is performed using synchronous methods of the Node.js standard library.
Because nothing blocks, scalable systems are very reasonable to develop in
Node.js.
22
Chapter 4
Software and Hardware Support
4.1 Software
4.1.1 For Web Development
• Visual Studio code
Visual Studio Code is an Integrated Development Environment (IDE) made
by Microsoft for Windows, Linux and macOS. Features include support for
debugging, syntax highlighting, intelligent code completion, snippets, code
refactoring, and embedded Git. Users can change the theme, keyboard
shortcuts, preferences, and install extensions that add additional
functionality.
• React JS
React is the most popular front-end JavaScript library in the field of web
development. It is used by large, established companies and newly-minted
startups alike (Netflix, Airbnb, Instagram, and the New York Times, to name
a few). React brings many advantages to the table, making it a better choice
than other frameworks like Angular.js.
• Node.JS
Node.js is a server-side platform built on Google Chrome’s JavaScript
Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its
latest version is v0.10.36. The definition of Node.js as supplied by its official
documentation is as follows - Node.js is a platform built on Chrome’s
23
JavaScript runtime for easily building fast and scalable network applications.
Node.js uses an event-driven, non-blocking I/O model that 14 makes it
lightweight and efficient, perfect for data-intensive real-time applications
that run across distributed devices.
4.1.2 AWS Services
• EC2 Instance
Figure 4.1: Amazon EC2
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that
provides secure, resizable compute capacity in the cloud. It is designed to
make web-scale computing easier for developers.
• API Gateway
Figure 4.2: Amazon API Gateway
Amazon API Gateway is a fully managed service that makes it easy for
developers to create, publish, maintain, monitor, and secure APIs at any
scale. With a few clicks in the AWS Management Console, you can create an
API that acts as a ’front door’ front door for applications to access data,
business logic, or functionality from your back-end services, such as
workloads running on Amazon EC2, code running on AWS Lambda, or any
web application. Amazon API Gateway handles all the tasks involved in
accepting and processing up to hundreds of thousands of concurrent API
24
calls, including traffic management, authorization and access control,
monitoring, and API version management.
• AWS Route 53
Figure 4.3: Amazon Route 53
AWS Identity and Access Management (IAM) is a web service that helps you
securely control access to AWS resources. You use IAM to control who is
authenticated (signed in) and authorized (has permissions) to use resources.
• AWS DynamoDB
Figure 4.4: Amazon DynamoDB
Amazon DynamoDB is a key-value and document database that delivers
single-digit millisecond performance at any scale. It’s a fully managed,
multiregion, multimaster database with built-in security, backup and restore,
and in-memory caching for internet-scale applications. DynamoDB can
handle more than 10 trillion requests per day and support peaks of more
than 20 million requests per second.
25
• Amazon S3
Figure 4.5: Amazon S3
Amazon Simple Storage Service (Amazon S3) is an object storage service
that offers industry-leading scalability, data availability, security, and
performance. This means customers of all sizes and industries can use it to
store and protect any amount of data for a range of use cases, such as
websites, mobile applications, backup and restore, archive, enterprise
applications, IoT devices, and big data analytics. Amazon S3 provides
easy-to-use management features so you can organize your data and
configure finely-tuned access controls to meet your specific business,
organizational, and compliance requirements.
• AWS Identity and Access Management (IAM)
Figure 4.6: Amazon Identity and Access Management [5]
AWS Identity and Access Management (IAM) is a web service that helps you
securely control access to AWS resources. You use IAM to control who is
authenticated (signed in) and authorized (has permissions) to use resources.
An IAM role is a set of permissions that define what actions are allowed and
denied by an entity in the AWS console. It is similar to a user in that it
can be accessed by any type of entity (an individual or AWS service). Role
permissions are temporary credentials.
26
• CloudWatch
Figure 4.7: Cloud watch
CloudWatch provides you with data and actionable insights to monitor your
applications, respond to system-wide performance changes, optimize resource
utilization, and get a unified view of operational health. CloudWatch collects
monitoring and operational data in the form of logs, metrics, and events,
providing you with a unified view of AWS resources, applications, and services
that run on AWS and on-premises servers.
• Amazon CloudFront
Figure 4.8: Amazon CloudFront
Amazon CloudFront is a fast content delivery network (CDN) service that
securely delivers data, videos, applications, and APIs to customers globally
with low latency, high transfer speeds, all within a developer-friendly
environment. CloudFront is integrated with AWS - both physical locations
that are directly connected to the AWS global infrastructure, as well as other
AWS services. CloudFront works seamlessly with services including AWS
Shield for DDoS mitigation, Amazon S3, Elastic Load Balancing or Amazon
EC2 as origins for your applications, and Lambda@Edge to run custom code
closer to customers’ users and to customize the user experience.
27
4.2 Why a browser app?
Of course, it is also possible to stream video from IoT devices such as AWS
DeepLens, or build a custom mobile app using the Kinesis Video Streams
Producer SDK for Android, but a simple cross-platform web app that can be
launched in any browser is much more universally accessible. When static video or
buffered webcam frames are uploaded by the web app, an AWS Lambda function,
serving as a cloud proxy layer to Kinesis Video Streams, converts them to
streamable media fragments. These media fragments are then put into a Kinesis
Video Stream. Note that since a Kinesis Video Streams Producer SDK is currently
not available for JavaScript/web browser, we explored several workarounds aimed
at mimicking streaming functionality in the AWS Cloud, and ultimately opted to
pursue a fully serverless solution.
4.3 Hardware
• Computer/laptop
To test the websites
• Integrated Webcam
A webcam is a video camera that feeds or streams an image or video in real
time to or through a computer network, such as the Internet. Webcams are
typically small cameras that sit on a desk, attach to a user’s monitor, or are
built into the hardware. Webcams can be used during a video chat session
involving two or more people, with conversations that include live audio and
video.
28
Chapter 5
Implementation of Cloud
Architecture
5.1 Implementation of proposed Cloud
Architecture
• In the proposed Architecture, here we have used two EC2 instances. One
EC2 for hosting the website and the other EC2 for hosting the Deep Learning
model.
• The flow starts with the pc/webcam, where video frames for our application
will be recorded and sent to the server for further processing.
• A particular domain name is provided by the Route 53.
• To access the website from anywhere around the globe, Cloudfront is used.
• Here the server and the frontend are connected with the help of API gateway.
and the route 53 is the service from where we get our domain name.
• AWS Web Application Firewall gives you control over which traffic to allow
or block to your web application.
29
Figure 5.1: Proposed Cloud Architecture
• API gateway is used to connect web application with the EC2 instance.
• The video is then send to the server , here the model is deployed, before that
30
the video is converted into frames by the data segment, here all the frames
are been processed and further the lambda is used to trigger the code, that
plots the mathematical figures such ,as percentage of each expression and body
language on that person which is further viewed on the web site.
• Alongside the 1st EC2 instance have used Dynamodb for storage: for login
and other authentication.
• Here we use an S3 bucket : to store the video frames and processed output.
• Here another API gateway is used.
• This API helps in getting the accurate output to the user and is displayed on
their device.
• For securing sensitive data we use key management system for encryption of
data and for overall observation and monitoring the infrastructure we used
cloud watch, CloudWatch monitors data in the form of logs, metrics, and
events.
5.2 Website Development
• Created a design using Figma Software. As shown in the figure 5.2
Figure 5.2: Figma design
31
• Installed node package manager for React and Node.js.
• Create a React Application using the below command:
npx create-react-app <appname>
• Start with the web page according to the design and add additional
functionalities.
• Run the React Application on localhost using the command:
npm start
• After the complete implementation of the design and full functionality of the
application, build the application. Using command:
npm run build
• Create an express server to host the built application, this is called the backend
part of the application and is done in Node.js
• Run the server on the localhost using the command:
node <filename.js>
we can the output for the above step in the figure 5.2 the website is visible on the
browser at the localhost
Figure 5.3: Implementing Figma design on localhost.
32
5.3 Create an Amazon EC2 Instance and S3
Bucket
• Select AWS Region where you want to create the instance.
Figure 5.4: Region selection for EC2
• Launch the instance by choosing a particular server, we have used a windows
server.
• Add EBS storage to the instance.
Figure 5.5: selecting EBS storage in EC2
• Create the key pair and download it. This is a the private key provided by the
AWS, we need the first decrypt the key and use it to login into the instance.
33
Figure 5.6: Creating security Key for EC2
We have created two EC2 Instances, one to host the website and another one
to host the model. This will reduce the overall load on a particular server
and increase the rate of performance.Both the EC2 instances used the same
specifications which are as follow:
1. Instance type- t2.micro
2. Number of CPU - 1
3. RAM (GiB) - 1
4. Storage - EBS volume is General Purpose (SSD) of
5. Volume size 30 GiB
6. Processor - Intel AVX
• now create an Amazon S3 bucket
• Under Storage and Content Delivery, choose S3 to open the Amazon S3
console.
34
Figure 5.7: Create the S3 bucket
• From the Amazon S3 console dashboard, choose Create Bucket.
Figure 5.8: Creating name for S3
• In Create a Bucket, type a bucket name in Bucket Name.
• The bucket name you choose must be globally unique across all existing bucket
names in Amazon S3 (that is, across all AWS customers). In Region, choose
Mumbai.
35
Figure 5.9: Allowing public access
• Choose to Create. Place name and uncheck ”Block all public access” since we
are creating a bucket to upload video. Then click “Create bucket†at the
bottom.
• When Amazon S3 successfully creates your bucket, the console displays your
empty bucket in the Buckets pane.
5.4 Deploying the Website and Deep Learning
Algorithm on EC2 instance
• Add the required dependencies to run the server and model on the respective
EC2 Instance.
• As shown in the figure, deploy the code for the website as well as for the
model. In window’s instance, we just need to copy or grab and drop the folder
or the file that are required to deploy the website.
36
Figure 5.10: Deploying code on EC2 instance
5.5 Configure the AWS services
• Configure the S3 service, so that we can upload the video from the website
created. For this we need to set the bucket policy in the permissions section
of the s3 storage.
Figure 5.11: Configuring the s3 Bucket
• Connect the EC2 instance and S3 by creating an IAM role. This allows the
ec2 instance to fully access the s3 bucket.
37
Figure 5.12: Creating IAM role to connect EC2 instance and s3
• Configure the EC2 instance to fetch the video from the S3. For this, we have
used Boto3 which is the Python SDK for AWS. Boto3 can be used to directly
interact with AWS resources from Python scripts.
Figure 5.13: Access EC2 instance using Boto3 command
• Create a domain on which the website can be hosted. This is done using
Route 53, it is basically a Domain Name Server which provides a domain
name for a particular IP address. As shown in the figure 5.4, the url of the
website is nebtics.live:8000. 8000 is the port number of the server.
38
Figure 5.14: Website hosted on domain
• Configure AWS CloudWatch to monitor the overall performance of the EC2
Instance.
5.6 Run the deployed algorithm in Amazon EC2
Instance
• Login /Connect to your instance
• Start both the express servers on shown in Figure 5.9
• The website server fetches the output predictions from the model server and
provides it to the frontend website
Figure 5.15: Running express Server on AWS
39
Chapter 6
Simulation, Results and
Discussion
6.1 Simulation
1) Website
Figure 6.1: Website Deployed on EC2
This is the front-end website created in React Js and Node.Js. On the left
hand side of the web application, the video frames are captured from the webcam
from the PC/Laptop or from the mobile phone. Then the recorded video is sent to
the S3 storage and from there to EC2 instance for processing. Once the video is
processed the website fetches the data from the server and displays the output
40
predictions on the right hand side section.
2) EC2
Figure 6.2: Screenshot of running EC2
The EC2 instance for the model is launched, Figure. 6.2 is the screenshot of the
EC2 instance For the model to run we need to install some dependencies. Then
the model is uploaded to the EC2 and we created a python file to call the model
For analyses of video, the video needs to be fetched from S3, and to access the S3
we used boto3 commands. The video is then processed and the output predictions
from the console are converted to JSON file format for hosting on the website. An
express server is created on the local host for prediction to display on site.
41
3) S3
Figure 6.3: Screenshot of S3 storage
The figure 6.3 is the Screenshot of the S3 bucket, which is used as storage in AWS.
The video frame which is recorded or uploaded on the website is sent and stored in
S3. The second EC2 which runs the model fetches the latest video stored in the S3
using boto3 commands.
4) Cloudwatch
Figure 6.4: CloudWatch Dashboard
Above figure is the screenshot of Cloudwatch, which is a service of AWS used to
monitor the services. We are using Cloudwatch to monitor the performance of both
the EC2’s To implement the connection between EC2 and Cloudwatch, you must
attach the CloudWatchAgentServerRole IAM role to the EC2 Instance to be able
42
to run the CloudWatch agent on the instance. This role enables the CloudWatch
agent to perform actions on the instance. This image shows the dashboard of the
CloudWatch and the elements we are monitoring are CPU utilization to see the
load on EC2. We are monitoring networking in and out of EC2s and the number of
objects in S3 storage. We can also set an alarm for the malfunctioning of EC2s.
43
Chapter 7
Conclusion
7.1 Conclusion
We proposed a cloud architecture through which we deployed deep learning
algorithms. The output of the algorithms is displayed on the website in real-time
with a delay of about 10 sec. The website is easily accessible through laptops/pcs
and mobile phones. We have used CloudWatch to monitor and maintain the cloud
infrastructure.Overall, the Cloud platform acts as a test bench where Algorithms
and other computational techniques can be tested and optimized. The web
application developed by us, provide human activity recognition and their
emotions.
44
7.2 Future Scope
• Optimization: The current website has a delay of around 10 sec to predict
the output. This occurs because the whole video is first sent to the EC2 and
processed. If we send the video in small segments like frames the delay can
be reduced.
• Automation: The current cloud architecture is not fully automated. The
deployment of a new model or application takes time. If it is automated by
using a service like cloudformation or terraform, which is an infrastructure
automation platform provided by AWS, then any new models can be deployed
on the cloud with some clicks. This will make this more user-friendly and even
faster.
• Security: You can add login/signup to the webpage to provide authentication
of users. You can prevent DDoS attacks by using AWS security services like
AWS Shield and AWS Firewall. To prevent the AWS Account service like
GuardDuty provides security to the AWS account as the consists of many
confidential information, pricing, configured services attacker.
45
References
[1] Kulkarni, G., Sutar, R. Gambhir, J., 2012. Cloud Computing- Infrastructure
as Service - Amazon EC2. International Journal of Engineering Research and
Applications
[2] https://docs.aws.amazon.com/whitepapers/latest/cicd_for_5g_
networks_on_aws
[3] N. Mangla, J. Singh and M. Singh, "Improving performance of web applications
using cloud resources," Proceedings of 3rd International Conference on
Reliability, Infocom Technologies and Optimization, 2014
[4] https://aws.amazon.com/blogs/machine-learning/building-
automatic-analysis-of-body-language-to-gauge-attention-and
-engagement-using-amazon-kinesis-video-streams-and -amazon-ai-services/
[5] https://www.amazonaws.cn/en/products/
[6] https://www.simplilearn.com/tutorials/reactjs-tutorial/what-is-reactjs
[7] https://docs.aws.amazon.com/whitepapers/latest/aws-overview
/aws-overview.pdf
[8] https://www.figma.com/
[9] https://reactjs.org/docs/getting-started.html
[10] https://nodejs.org/en/
[11] https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
GettingStartedNodeJs.01. html
46
[12] https://docs.aws.amazon.com/whitepapers/latest/aws-overview
/aws-overview.pdf
[13] https://danielmiessler.com/study/mvc/
47

More Related Content

Similar to Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf

Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...bupbechanhgmail
 
Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)Kunal Ashar
 
Patterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusPatterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusBlue Atoll Consulting
 
Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Banking at Ho Chi Minh city
 
Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Banking at Ho Chi Minh city
 
Google app engine
Google app engineGoogle app engine
Google app engineSuraj Mehta
 
Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Banking at Ho Chi Minh city
 
digital marketing training in bangalore
digital marketing training in bangaloredigital marketing training in bangalore
digital marketing training in bangaloreVenus Tech Inc.
 
Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Banking at Ho Chi Minh city
 
Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Banking at Ho Chi Minh city
 
Ref arch for ve sg248155
Ref arch for ve sg248155Ref arch for ve sg248155
Ref arch for ve sg248155Accenture
 
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...Eduardo Nuno
 
ScrumDesk API Getting Started
ScrumDesk API  Getting StartedScrumDesk API  Getting Started
ScrumDesk API Getting StartedScrumDesk
 

Similar to Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf (20)

Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
Extending sap solutions to the mobile enterprise with ibm mobile first platfo...
 
IBM Streams - Redbook
IBM Streams - RedbookIBM Streams - Redbook
IBM Streams - Redbook
 
Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)Patterns: Implementing an SOA using an enterprise service bus (ESB)
Patterns: Implementing an SOA using an enterprise service bus (ESB)
 
Patterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service BusPatterns: Implementing an SOA Using an Enterprise Service Bus
Patterns: Implementing an SOA Using an Enterprise Service Bus
 
document
documentdocument
document
 
IBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and ConfigurationIBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and Configuration
 
Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...
 
Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...Deployment guide series ibm tivoli composite application manager for web sphe...
Deployment guide series ibm tivoli composite application manager for web sphe...
 
Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188
 
Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188Deployment guide series ibm tivoli monitoring 6.1 sg247188
Deployment guide series ibm tivoli monitoring 6.1 sg247188
 
Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951
 
WenFei2022.pdf
WenFei2022.pdfWenFei2022.pdf
WenFei2022.pdf
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140
 
digital marketing training in bangalore
digital marketing training in bangaloredigital marketing training in bangalore
digital marketing training in bangalore
 
Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...
 
Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...Large scale implementation of ibm tivoli composite application manager for we...
Large scale implementation of ibm tivoli composite application manager for we...
 
Ref arch for ve sg248155
Ref arch for ve sg248155Ref arch for ve sg248155
Ref arch for ve sg248155
 
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
 
ScrumDesk API Getting Started
ScrumDesk API  Getting StartedScrumDesk API  Getting Started
ScrumDesk API Getting Started
 

Recently uploaded

UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 

Recently uploaded (20)

UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 

Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf

  • 1.
  • 2. CERTIFICATE This is to certify that Lenox Fernandes, Smeet Gohil, Lavesh Lalwani, Jerish Rayan are the bonafide students of St. Francis Institute of Technology, Mumbai. They have successfully carried out the project titled “Deploying Deep Learning Algorithm On AWS Cloud Platform” in partial fulfilment of the requirement of B. E. Degree in Electronics and Telecommunication Engineering of Mumbai University during the academic year 2021-2022. The work has not been presented elsewhere for the award of any other degree or diploma prior to this. ———————— (Mr. Ramjee Yadav) ————————– ———————— (Dr. Gautam Shah) (Dr. Sincy George) EXTC HOD Principal
  • 3. Project Report Approval for B.E. This project entitled ‘Deploying Deep Learning Algorithm On AWS Cloud Platform’ by Lenox Fernandes, Smeet Gohil, Lavesh Lalwani, Jerish Rayan is approved for the degree of Bachelor of Engineering in Electronics and Telecommunication from University of Mumbai. Examiners 1. - - - - - - - - - - - - - - - - - - 2. - - - - - - - - - - - - - - - - - - Date: Place:
  • 4. ACKNOWLEDGEMENT We are thankful to a number of individuals who have contributed towards our final year project and without their help; it would not have been possible. Firstly, we offer our sincere thanks to our project guide, Mr. Ramjee Yadav for his constant and timely help and guidance throughout our preparation. We are grateful to all project co-ordinators for their valuable inputs to our project. We are also grateful to the college authorities and the entire faculty for their support in providing us with the facilities required throughout this semester. We are also highly grateful to Dr. Gautam A. Shah, Head of Department (EXTC), Principal, Dr. Sincy George, and Director Bro. Jose Thuruthiyil for providing the facilities, a conducive environment and encouragement. Signatures of all the students in the group (Lenox Fernandes) (Smeet Gohil) (Lavesh Lalwani) (Jerish Rayan) iii
  • 5. Declaration We declare that this written submission represents our ideas in our own words and where others’ ideas or words have been included; we have adequately cited and referenced the original sources. We also declare that we have adhered to all principles of academic honesty and integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in this submission. We understand that any violation of the above will be cause for disciplinary action by the Institute and can also evoke penal action from the sources which have thus not been properly cited or from whom proper permission has not been taken when needed. Signatures of all the students in the group (Lenox Fernandes) (Smeet Gohil) (Lavesh Lalwani) (Jerish Rayan) iv
  • 6. Abstract Deploying deep learning algorithms on hardware platforms is difficult as it requires lots of computational power, it becomes tedious, expensive, and contains very few options for remote access. An organized cloud architecture can mitigate these factors and provide a cost-effective, automatically scalable (up or down), and elastic real-time on-demand AI solution. In this project, we propose an architecture which consists of cloud services that help us to host the deep learning algorithm and get the output predictions in real-time. These predictions are based on human activity and are displayed on the website. The website is used to feed input videos to the model; the website is also deployed on the cloud platform to increase the overall performance, security, cost-effective and provides easy maintenance. v
  • 7. Contents Acknowledgement iii Declaration iv Abstract v List of Figures vii List of Abbreviations ix 1 Introduction 1 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Organization of Project Report . . . . . . . . . . . . . . . . . . . . 2 2 Literature Survey 3 2.1 Cloud Computing- Infrastructure as Service - Amazon EC2 [1] . . . 3 2.2 AWS whitepaper - 5g for AWS [2] . . . . . . . . . . . . . . . . . . . 5 2.3 Build automatic analysis of body language to gauge attention and engagement using Amazon Kinesis Video Streams and Amazon AI Services [4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3.1 Working of the Cloud Architecture: . . . . . . . . . . . . . . 6 2.3.2 Kinesis Video Streams ingestion . . . . . . . . . . . . . . . . 7 2.3.3 Streaming from a browser webcam . . . . . . . . . . . . . . 7 2.3.4 Amazon Rekognition Video - Stream processor . . . . . . . . 7 2.3.5 Motion Analytics . . . . . . . . . . . . . . . . . . . . . . . . 8 vi
  • 8. 2.3.6 Visualizing the metrics . . . . . . . . . . . . . . . . . . . . . 8 3 Study of AWS, React and Node.js 9 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 AWS Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2.1 EC2 Instance . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2.2 Amazon S3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.3 AWS Lambda . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.2.4 Amazon Route 53 . . . . . . . . . . . . . . . . . . . . . . . 15 3.2.5 AWS Key Management Service . . . . . . . . . . . . . . . . 16 3.2.6 AWS CloudWatch [5] . . . . . . . . . . . . . . . . . . . . . . 17 3.3 Development and deploying for the website . . . . . . . . . . . . . . 18 4 Software and Hardware Support 23 4.1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.1.1 For Web Development . . . . . . . . . . . . . . . . . . . . . 23 4.1.2 AWS Services . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2 Why a browser app? . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.3 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5 Implementation of Cloud Architecture 29 5.1 Implementation of proposed Cloud Architecture . . . . . . . . . . . 29 5.2 Website Development . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.3 Create an Amazon EC2 Instance and S3 Bucket . . . . . . . . . . . 33 5.4 Deploying the Website and Deep Learning Algorithm on EC2 instance 36 5.5 Configure the AWS services . . . . . . . . . . . . . . . . . . . . . . 37 5.6 Run the deployed algorithm in Amazon EC2 Instance . . . . . . . . 39 6 Simulation, Results and Discussion 40 6.1 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 7 Conclusion 44 7.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 7.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 vii
  • 9. List of Figures 2.1 AWS Global Physical Infrastructure[1] . . . . . . . . . . . . . . . . 4 2.2 AWS IAM[2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.3 Serverless System Architecture[4] . . . . . . . . . . . . . . . . . . . 6 2.4 Video streaming through webcam[4] . . . . . . . . . . . . . . . . . . 7 3.1 AWS Services [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2 EC2 instance and EBS (Elastic Block Store)[5] . . . . . . . . . . . . 11 3.3 Auto scaling of Amazon EC2 instance[5] . . . . . . . . . . . . . . . 12 3.4 S3 Storage [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.5 Working of AWS Lambda [5] . . . . . . . . . . . . . . . . . . . . . . 14 3.6 AWS Route 53 [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.7 AWS Key Management Service [5] . . . . . . . . . . . . . . . . . . . 16 3.8 EC2 monitoring through AWS CloudWatch [5] . . . . . . . . . . . . 17 3.9 Designing a webpage using Figma [8] . . . . . . . . . . . . . . . . . 19 3.10 MVC Architecture [12] . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.11 React Components [9] . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.12 Node.Js used to connect the website to the Server [10] . . . . . . . . 22 4.1 Amazon EC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2 Amazon API Gateway . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 Amazon Route 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.4 Amazon DynamoDB . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.5 Amazon S3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.6 Amazon Identity and Access Management [5] . . . . . . . . . . . . . 26 4.7 Cloud watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.8 Amazon CloudFront . . . . . . . . . . . . . . . . . . . . . . . . . . 27 viii
  • 10. 5.1 Proposed Cloud Architecture . . . . . . . . . . . . . . . . . . . . . 30 5.2 Figma design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.3 Implementing Figma design on localhost. . . . . . . . . . . . . . . . 32 5.4 Region selection for EC2 . . . . . . . . . . . . . . . . . . . . . . . . 33 5.5 selecting EBS storage in EC2 . . . . . . . . . . . . . . . . . . . . . 33 5.6 Creating security Key for EC2 . . . . . . . . . . . . . . . . . . . . . 34 5.7 Create the S3 bucket . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.8 Creating name for S3 . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.9 Allowing public access . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.10 Deploying code on EC2 instance . . . . . . . . . . . . . . . . . . . . 37 5.11 Configuring the s3 Bucket . . . . . . . . . . . . . . . . . . . . . . . 37 5.12 Creating IAM role to connect EC2 instance and s3 . . . . . . . . . 38 5.13 Access EC2 instance using Boto3 command . . . . . . . . . . . . . 38 5.14 Website hosted on domain . . . . . . . . . . . . . . . . . . . . . . . 39 5.15 Running express Server on AWS . . . . . . . . . . . . . . . . . . . . 39 6.1 Website Deployed on EC2 . . . . . . . . . . . . . . . . . . . . . . . 40 6.2 Screenshot of running EC2 . . . . . . . . . . . . . . . . . . . . . . 41 6.3 Screenshot of S3 storage . . . . . . . . . . . . . . . . . . . . . . . . 42 6.4 CloudWatch Dashboard . . . . . . . . . . . . . . . . . . . . . . . . 42 ix
  • 11. Chapter 1 Introduction 1.1 Motivation As Artificial Intelligence needs lots of computational power to give us the desired output, we decided to use the cloud to manage and run the machine learning models. AWS Cloud infrastructures support environmental proactivity, powering virtual services rather than physical products and hardware. AWS also provides us many features like Intuitive and Easy-to-Use, Cost-effective, High Functionality and Scalability, Dynamic and Flexible Operations, Trustworthy and it is highly secure. It allows one of us to remotely access from anywhere with an Internet connection. 1.2 Problem Statement In the world of AI and machine learning processing data quickly and efficiently is the trend so we need a platform that can analyze expressions in real-time and could be accessed easily but offline servers are tedious, expensive, and contain very few options for remote access. 1
  • 12. 1.3 Methodology Our project starts with a website that is deployed on an EC2 instance (Elastic Compute Cloud), it is the computational capacity in the Amazon Web Services (AWS) Cloud. For the website, we have used the javascript framework REACT for the frontend and Node.js which is a JavaScript runtime built on Chrome’s V8 JavaScript engine. The site developed will be providing the input video to the model that is being hosted on the AWS EC2 instance. For the DL mode to process the video frames we are using the EC2 instance to provide better processing power. The deep learning model will process that video in the second EC2 instance and give us the analyzed predictions. These predicted values are sent back to the first EC2 instance where the website is hosted, to display the output on the website. 1.4 Organization of Project Report This project report is organized as follows: Chapter 2 Literature Survey Chapter 3 Study of AWS, React and Node.js Chapter 4 Software and Hardware Support Chapter 5 Implementation of Cloud Architecture Chapter 6 Simulation, Results and Discussion Chapter 7 Conclusion and Future Scope 2
  • 13. Chapter 2 Literature Survey A literature review is an overview of the previously published works on a specific topic. In this section we have listed three major research papers/blogs which have provided us with the existing knowledge on the topic of creating a cloud architecture, along with some deployment of ML Algorithms such as Human activity recognition, face detection and recognition and emotion recognition. 2.1 Cloud Computing- Infrastructure as Service - Amazon EC2 [1] Infrastructure as a Service (IaaS) is the delivery of hardware (server, storage and network), and associated software (operating systems virtualization technology, file system), as a service. It is an evolution of traditional hosting that does not require any long term commitment and allows users to provision resources on demand. Unlike PaaS services, the IaaS provider does very little management other than keep the data center operational and users must deploy and manage the software services themselves just the way they would in their own data center. Amazon Web Services Elastic Compute Cloud (EC2) and Secure Storage Service (S3) are examples of IaaS offerings. Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It 3
  • 14. Figure 2.1: AWS Global Physical Infrastructure[1] provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. • Amazon Elastic Block Store • Auto Scaling • High Performance Computing (HPC) Clusters • Amazon Cloud Watch 4
  • 15. 2.2 AWS whitepaper - 5g for AWS [2] Infrastructure deployment includes all the prerequisites for the network function to be successfully deployed and configured. Some of the components created as part of this phase are: • Networking - VPC, public and private subnets, routes, load balancers • Compute - Kubernetes ( Vmware Tanzu , Amazon EKS, or AWS Outposts), Amazon EC2 instances primary and worker nodes, auto scaling group • Storage - Amazon EFS, Amazon EBS, Amazon S3 bucket • Security - IAM roles , security groups • Pipeline - CodePipeline, CodeBuild • Observability - CloudWatch, Prometheus, FluentD Security • Artifacts integrity - The artifacts used across the pipeline are encrypted whether at rest (using AWS managed keys) or transit (using SSL/TLS). • IAM users and roles - The permissions provided to the users or resources are based on the principle of least privilege. There should be a cross-IAM role trust relationship that may need to be configured if you are operating across resources in different services. For example, AWS CodeBuild needs permission to run commands on an Amazon EKS cluster. Figure 2.2: AWS IAM[2] 5
  • 16. 2.3 Build automatic analysis of body language to gauge attention and engagement using Amazon Kinesis Video Streams and Amazon AI Services [4] We’ve provided a web application and accompanying serverless architecture for streaming a webcam feed from a browser to Amazon Kinesis Video Streams and Amazon Rekognition Video. Body motion metrics can then be visualized in a web app with minimal delay. This may apply to a range of business use cases, such as quickly estimating engagement and enjoyment of movies, ads, TV shows, video games, political campaigns, speeches, online courses; or classroom teaching. 2.3.1 Working of the Cloud Architecture: System Architecture Figure 2.3: Serverless System Architecture[4] 6
  • 17. 2.3.2 Kinesis Video Streams ingestion A client video-stream-producing web app allows users to 1) upload pre-recorded video and/or 2) live stream their webcam feed to Amazon Kinesis Video Streams. This webcam streaming functionality is backed by the WebRTC getUserMedia API, and is supported on all major browsers and platforms, with the exception of iOS mobile. 2.3.3 Streaming from a browser webcam The following is a side-by-side illustration of webcam streaming to the Amazon Kinesis Video Streams console. The lag between the live webcam app feed (left) and the time these frames are played back on the Kinesis Video Streams console (right) is about 5 seconds. Figure 2.4: Video streaming through webcam[4] 2.3.4 Amazon Rekognition Video - Stream processor The next step is to automatically detect people in the full-speed video, and track their motions in real time. We feed the Kinesis Video Stream as input to Amazon Rekognition Video (the AWS new video-capable version of the Amazon Rekognition deep-learning toolset to track objects and people in images), using a Rekognition Stream Processor. 7
  • 18. 2.3.5 Motion Analytics When new records appear in this raw data stream, our Motion Analytics algorithm (implemented as an AWS Lambda function) is triggered. It computes interesting derived metrics on faces in successive video frames, such as rotational/translational motion velocities, which can be used as features to gauge attention and engagement. These processed metrics are then published to another Kinesis Data Stream, for consumption by downstream applications and web dashboards. 2.3.6 Visualizing the metrics For this project, we provide a dashboard app (in the same interface as the video streaming app) that consumes body motion metrics directly from the processed Kinesis Data Stream and renders them in near real-time as streaming chart visualizations. Of course, you can consider fronting the processed data stream with an Amazon API Gateway endpoint (as illustrated in the system architecture diagram) to allow multiple clients and downstream applications to consume the processed metrics scalably. 8
  • 19. Chapter 3 Study of AWS, React and Node.js 3.1 Introduction In today’s highly competitive business environments, Enterprises have been striving to reduce the amount of capital and time in acquisition and maintenance of computational resources. The emergence of cloud computing is rapidly changing this ownership-based approach to a subscription-oriented approach in which everything-from computing power to computing infrastructure, applications, business processes to personal collaboration- is delivered as a service wherever and whenever required. Web hosting is the business of providing server space, web services, and file maintenance for websites controlled by companies or individuals that do not have their own web servers. The advancement in Web technology has made it feasible for any user to access the requisite information on the internet. Cloud hosting is about hosting customer applications using well monitored virtual servers in the cloud without any physical space limitation and resource usage limit. In cloud hosting, the resources required for maintaining the customer web applications are spread across a number of servers and are rendered as per need basis. Here we discuss cloud computing and the deployment strategy of two tier web based applications on the cloud. The machine learning algorithm helps to analyze and process the video for the website and deliver all forms of content. For this we are using AWS services like EC2 instances, AWS Lambda, AWS Dynamo DB, AWS S3 bucket, API Gateway, AWS Route 53. The processed output would then be stored in the database so it can be easily accessible in the future. For the 9
  • 20. development of the website, we have used React JS for the frontend and Node.JS for the Backend. The database used here is DynamoDB and S3 bucket. 3.2 AWS Services Figure 3.1: AWS Services [5] Amazon Web Services offers a broad set of Global Cloud-based products including Compute, Storage, Databases, Analytics, Networking, Mobile, Developer Tools, Management Tools, IoT, Security, and Enterprise Applications 10
  • 21. 3.2.1 EC2 Instance Figure 3.2: EC2 instance and EBS (Elastic Block Store)[5] Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power. Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) Cloud. Using Amazon EC2 eliminates your need to invest in hardware upfront, so you can develop and deploy applications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic. Elastic Block Store (EBS) offers persistent storage for Amazon EC2 instances. Amazon EBS volumes provide off-instance storage that persists independently from the life of an instance. Amazon EBS volumes are highly available, highly reliable volumes that can be leveraged as an Amazon EC2 instance’s boot 11
  • 22. partition or attached to a running Amazon EC2 instance as a standard block device. When used as a boot 4 partition, Amazon EC2 instances can be stopped and subsequently restarted, enabling you to only pay for the storage resources used while maintaining your Instance’s state. Amazon EBS volumes offer Greatly improved durability over local Amazon EC2 instance stores, as Amazon EBS volumes are automatically replicated on the backend (in a single Availability Zone). Figure 3.3: Auto scaling of Amazon EC2 instance[5] Amazon EC2 Auto Scaling allows you to automatically scale your Amazon EC2 capacity up or down according to the conditions you define. With EC2 Auto Scaling, you can ensure that the number of Amazon EC2 instances you’re using scales up seamlessly during demand spikes to maintain performance and scales down automatically during demand lulls to minimize costs. EC2 Auto Scaling is particularly well suited for applications that experience hourly, daily, or weekly variability in usage. EC2 Auto Scaling is enabled by Amazon CloudWatch and available at no additional charge beyond Amazon CloudWatch fees. 12
  • 23. 3.2.2 Amazon S3 Figure 3.4: S3 Storage [5] Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading Scalability, data availability, Security, and Performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. How S3 works: Amazon S3 is an object storage service that stores data as objects within buckets. An object is a file and any metadata that describes the file. A bucket is a container for objects. To store your data in Amazon S3, you first create a bucket and specify a bucket name and AWS Region. Then, you upload your data to that bucket as objects in Amazon S3. Each object has a key (or key name), which is the unique identifier for the object within the bucket. S3 provides features that you can configure to support your specific use case. For example, you can use S3 Versioning to keep multiple versions of an object in the same bucket, which allows you to restore objects that are accidentally deleted or overwritten. Buckets and the objects in them are private and can be accessed only if you explicitly grant access permissions. You can use bucket policies, AWS Identity and Access Management (IAM) policies, access control lists (ACLs), and S3 Access Points to manage access. Amazon S3 offers a range of storage classes designed for different use cases. For example, you can store mission-critical production data in S3 Standard for frequent access, save costs by storing infrequently accessed data in S3 Standard-IA or S3 One Zone-IA, and archive data at the lowest costs in S3 Glacier 13
  • 24. and S3 Glacier Deep Archive. To transform data and trigger workflows to automate a variety of other processing activities at scale, you can use the following features. 3.2.3 AWS Lambda Figure 3.5: Working of AWS Lambda [5] Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service. You organize your code into Lambda functions. Lambda runs your function only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time that you consume-there is no charge when your code is not running. You can invoke your Lambda functions using the Lambda API, or Lambda can run your functions in response to events from other AWS services. You can run JavaScript code with Node.js in AWS Lambda. Lambda provides 14
  • 25. runtime for Node.js that run your code to process events. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management (IAM) role that you manage. 3.2.4 Amazon Route 53 Figure 3.6: AWS Route 53 [5] Amazon Route 53 is a highly available and scalable Cloud Domain Name System (DNS) web service. It is designed to give developers and businesses an extremely reliable and cost-effective way to route end users to Internet applications by translating names like www.example.com into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other. Amazon Route 53 is fully compliant with IPv6 as well. Amazon Route 53 effectively connects user requests to infrastructure running in AWS - such as Amazon EC2 instances, Elastic Load Balancing load balancers, or Amazon S3 buckets - and can also be used to route users to infrastructure outside of AWS. You can use Amazon Route 53 to configure DNS health checks, then continuously monitor your applications’ ability to recover from failures and control application recovery with Route 53 Application Recovery Controller. 15
  • 26. 3.2.5 AWS Key Management Service Figure 3.7: AWS Key Management Service [5] Server-side encryption is the encryption of data at its destination by the application or service that receives it. AWS Key Management Service (AWS KMS) is a service that combines secure, highly available hardware and software to provide a key management system scaled for the cloud. Amazon S3 uses AWS KMS keys to encrypt your Amazon S3 objects. AWS KMS encrypts only the object data. Any object metadata is not encrypted. If you use KMS keys, you can use AWS KMS through the AWS Management Console or the AWS KMS APIs to do the following: 1. Centrally create KMS keys 2. Define the policies that control how KMS keys can be used 3. Audit their usage to prove that they are being used correctly The security controls in AWS KMS can help you meet encryption-related compliance requirements. You can use these KMS keys to protect your data in Amazon S3 buckets. When you use SSE-KMS encryption with an S3 bucket, the AWS KMS keys must be in the same Region as the bucket. 16
  • 27. 3.2.6 AWS CloudWatch [5] Figure 3.8: EC2 monitoring through AWS CloudWatch [5] CloudWatch enables real-time monitoring of AWS resources such as Amazon Elastic Compute Cloud (EC2) instances, Amazon Elastic Block Store (EBS) volumes, Elastic Load Balancing and Amazon Relational Database Service (RDS) instances. The application automatically collects and provides metrics for CPU utilization, latency and request counts. Users can also stipulate additional metrics to be monitored, such as memory usage, transaction volumes or error rates. Users can access CloudWatch functions through an application programming interface (API), command-line tools, one of the AWS software development kits or the AWS Management Console. The CloudWatch interface provides current statistics that users can view in graph format. Users can set notification alarms to be sent when something being monitored surpasses a specified threshold. The app can also detect and shut down unused or underused EC2 instances. 17
  • 28. 3.3 Development and deploying for the website With the technological advancement in the 21st-century, everybody wants to experience the best technology without spending too much of their time and exhausting their busy brains. The same goes for surfing the websites or mobile applications as well where the quick and efficient the website or the mobile application responds, the successful outcomes it obtains. In short, it is about consumers nowadays! And, when it comes to the mobile application or website user satisfaction, most technology firms turn towards the applications User Interface (UI) and User Experience Design (UX). However, most of the time people confuse between the terms UI and UX. Therefore, we are here to decode the concept of UI and UX design What is UI? The abbreviation UI stands for the user interface. It is the way through which users interact with the mobile application. The user interface includes all the controls, buttons, blocks, and elements of the app. The primary objective of the user interface is to provide easy, enjoyable, and effective interaction between the user and the app. The process of developing UI includes selecting a color, corporate identity, and the latest design principles. What is UX? The abbreviation UX stands for user experience. The idea of UX is to provide the best experience for the user with ease of usage and the feel on how the user gets an impact on establishing your business value. Creating a UX includes defining the way a product operates and meets the requirements of the users. UX must be clear, comfortable, User-friendly and should work in the direction to turn your users into loyal customers. Importance of UX/UX in Mobile Apps For a developer, it is essential to know the importance of UI/UX in the mobile app. You can create an app with great functionality but if you fail to 18
  • 29. focus on the designing part, it may lead to the downfall of your app. It is mandatory to have the right balance between the functionality and UI/UX of the app in order to make it a successful one. Below are a few pointers to highlight the importance of UI/UX Design in Mobile apps. Figure 3.9: Designing a webpage using Figma [8] Figma is a vector graphics editor and prototyping tool which is primarily web-based, with additional offline features enabled by desktop applications for macOS and Windows. The Figma Mirror companion apps for Android and iOS allow viewing Figma prototypes in real-time on mobile devices. The feature set of Figma focuses on use in user interface and user experience design, with an emphasis on real-time collaboration. 19
  • 30. Implementing the Design using React JS and Node.JS. React JS Figure 3.10: MVC Architecture [12] React is a JavaScript library created for building fast and interactive user interfaces for web and mobile applications. It is an open-source, component-based, front-end library responsible only for the application’s view layer. In Model View Controller (MVC) 9 architecture, the view layer is responsible for how the app looks and feels. React was created by Jordan Walke, a software engineer at Facebook. Let’s take a look at an Instagram webpage example, entirely built using React, to get a better understanding of how React works. As the illustration shows, React divides the UI into multiple components, which makes the code easier to debug. This way, each component has its property and function. 20
  • 31. Figure 3.11: React Components [9] Let’s take a look at an Instagram webpage example, entirely built using React, to get a better understanding of how React works. As the illustration shows, React divides the UI into multiple components, which makes the code easier to debug. This way, each component has its property and function. Now that we know what React is let’s move on and see why React is the most popular front-end library for web application development. • Node.JS Node.js is a server-side platform built on Google Chrome’s JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows - Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. 11 Node.js is an open-source, cross-platform runtime environment for developing server-side and networking applications. 21
  • 32. Node.js applications are written in JavaScript and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux. Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent. Figure 3.12: Node.Js used to connect the website to the Server [10] This is in contrast to today’s more common concurrency model, in which OS threads are employed. Thread-based networking is relatively inefficient and very difficult to use. Furthermore, users of Node.js are free from worries of dead-locking the process, since there are no locks. Almost no function in Node.js directly performs I/O, so the process never blocks except when the I/O is performed using synchronous methods of the Node.js standard library. Because nothing blocks, scalable systems are very reasonable to develop in Node.js. 22
  • 33. Chapter 4 Software and Hardware Support 4.1 Software 4.1.1 For Web Development • Visual Studio code Visual Studio Code is an Integrated Development Environment (IDE) made by Microsoft for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Users can change the theme, keyboard shortcuts, preferences, and install extensions that add additional functionality. • React JS React is the most popular front-end JavaScript library in the field of web development. It is used by large, established companies and newly-minted startups alike (Netflix, Airbnb, Instagram, and the New York Times, to name a few). React brings many advantages to the table, making it a better choice than other frameworks like Angular.js. • Node.JS Node.js is a server-side platform built on Google Chrome’s JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows - Node.js is a platform built on Chrome’s 23
  • 34. JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that 14 makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. 4.1.2 AWS Services • EC2 Instance Figure 4.1: Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. • API Gateway Figure 4.2: Amazon API Gateway Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a ’front door’ front door for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon EC2, code running on AWS Lambda, or any web application. Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API 24
  • 35. calls, including traffic management, authorization and access control, monitoring, and API version management. • AWS Route 53 Figure 4.3: Amazon Route 53 AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources. • AWS DynamoDB Figure 4.4: Amazon DynamoDB Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It’s a fully managed, multiregion, multimaster database with built-in security, backup and restore, and in-memory caching for internet-scale applications. DynamoDB can handle more than 10 trillion requests per day and support peaks of more than 20 million requests per second. 25
  • 36. • Amazon S3 Figure 4.5: Amazon S3 Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. • AWS Identity and Access Management (IAM) Figure 4.6: Amazon Identity and Access Management [5] AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources. An IAM role is a set of permissions that define what actions are allowed and denied by an entity in the AWS console. It is similar to a user in that it can be accessed by any type of entity (an individual or AWS service). Role permissions are temporary credentials. 26
  • 37. • CloudWatch Figure 4.7: Cloud watch CloudWatch provides you with data and actionable insights to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing you with a unified view of AWS resources, applications, and services that run on AWS and on-premises servers. • Amazon CloudFront Figure 4.8: Amazon CloudFront Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment. CloudFront is integrated with AWS - both physical locations that are directly connected to the AWS global infrastructure, as well as other AWS services. CloudFront works seamlessly with services including AWS Shield for DDoS mitigation, Amazon S3, Elastic Load Balancing or Amazon EC2 as origins for your applications, and Lambda@Edge to run custom code closer to customers’ users and to customize the user experience. 27
  • 38. 4.2 Why a browser app? Of course, it is also possible to stream video from IoT devices such as AWS DeepLens, or build a custom mobile app using the Kinesis Video Streams Producer SDK for Android, but a simple cross-platform web app that can be launched in any browser is much more universally accessible. When static video or buffered webcam frames are uploaded by the web app, an AWS Lambda function, serving as a cloud proxy layer to Kinesis Video Streams, converts them to streamable media fragments. These media fragments are then put into a Kinesis Video Stream. Note that since a Kinesis Video Streams Producer SDK is currently not available for JavaScript/web browser, we explored several workarounds aimed at mimicking streaming functionality in the AWS Cloud, and ultimately opted to pursue a fully serverless solution. 4.3 Hardware • Computer/laptop To test the websites • Integrated Webcam A webcam is a video camera that feeds or streams an image or video in real time to or through a computer network, such as the Internet. Webcams are typically small cameras that sit on a desk, attach to a user’s monitor, or are built into the hardware. Webcams can be used during a video chat session involving two or more people, with conversations that include live audio and video. 28
  • 39. Chapter 5 Implementation of Cloud Architecture 5.1 Implementation of proposed Cloud Architecture • In the proposed Architecture, here we have used two EC2 instances. One EC2 for hosting the website and the other EC2 for hosting the Deep Learning model. • The flow starts with the pc/webcam, where video frames for our application will be recorded and sent to the server for further processing. • A particular domain name is provided by the Route 53. • To access the website from anywhere around the globe, Cloudfront is used. • Here the server and the frontend are connected with the help of API gateway. and the route 53 is the service from where we get our domain name. • AWS Web Application Firewall gives you control over which traffic to allow or block to your web application. 29
  • 40. Figure 5.1: Proposed Cloud Architecture • API gateway is used to connect web application with the EC2 instance. • The video is then send to the server , here the model is deployed, before that 30
  • 41. the video is converted into frames by the data segment, here all the frames are been processed and further the lambda is used to trigger the code, that plots the mathematical figures such ,as percentage of each expression and body language on that person which is further viewed on the web site. • Alongside the 1st EC2 instance have used Dynamodb for storage: for login and other authentication. • Here we use an S3 bucket : to store the video frames and processed output. • Here another API gateway is used. • This API helps in getting the accurate output to the user and is displayed on their device. • For securing sensitive data we use key management system for encryption of data and for overall observation and monitoring the infrastructure we used cloud watch, CloudWatch monitors data in the form of logs, metrics, and events. 5.2 Website Development • Created a design using Figma Software. As shown in the figure 5.2 Figure 5.2: Figma design 31
  • 42. • Installed node package manager for React and Node.js. • Create a React Application using the below command: npx create-react-app <appname> • Start with the web page according to the design and add additional functionalities. • Run the React Application on localhost using the command: npm start • After the complete implementation of the design and full functionality of the application, build the application. Using command: npm run build • Create an express server to host the built application, this is called the backend part of the application and is done in Node.js • Run the server on the localhost using the command: node <filename.js> we can the output for the above step in the figure 5.2 the website is visible on the browser at the localhost Figure 5.3: Implementing Figma design on localhost. 32
  • 43. 5.3 Create an Amazon EC2 Instance and S3 Bucket • Select AWS Region where you want to create the instance. Figure 5.4: Region selection for EC2 • Launch the instance by choosing a particular server, we have used a windows server. • Add EBS storage to the instance. Figure 5.5: selecting EBS storage in EC2 • Create the key pair and download it. This is a the private key provided by the AWS, we need the first decrypt the key and use it to login into the instance. 33
  • 44. Figure 5.6: Creating security Key for EC2 We have created two EC2 Instances, one to host the website and another one to host the model. This will reduce the overall load on a particular server and increase the rate of performance.Both the EC2 instances used the same specifications which are as follow: 1. Instance type- t2.micro 2. Number of CPU - 1 3. RAM (GiB) - 1 4. Storage - EBS volume is General Purpose (SSD) of 5. Volume size 30 GiB 6. Processor - Intel AVX • now create an Amazon S3 bucket • Under Storage and Content Delivery, choose S3 to open the Amazon S3 console. 34
  • 45. Figure 5.7: Create the S3 bucket • From the Amazon S3 console dashboard, choose Create Bucket. Figure 5.8: Creating name for S3 • In Create a Bucket, type a bucket name in Bucket Name. • The bucket name you choose must be globally unique across all existing bucket names in Amazon S3 (that is, across all AWS customers). In Region, choose Mumbai. 35
  • 46. Figure 5.9: Allowing public access • Choose to Create. Place name and uncheck ”Block all public access” since we are creating a bucket to upload video. Then click “Create bucket†at the bottom. • When Amazon S3 successfully creates your bucket, the console displays your empty bucket in the Buckets pane. 5.4 Deploying the Website and Deep Learning Algorithm on EC2 instance • Add the required dependencies to run the server and model on the respective EC2 Instance. • As shown in the figure, deploy the code for the website as well as for the model. In window’s instance, we just need to copy or grab and drop the folder or the file that are required to deploy the website. 36
  • 47. Figure 5.10: Deploying code on EC2 instance 5.5 Configure the AWS services • Configure the S3 service, so that we can upload the video from the website created. For this we need to set the bucket policy in the permissions section of the s3 storage. Figure 5.11: Configuring the s3 Bucket • Connect the EC2 instance and S3 by creating an IAM role. This allows the ec2 instance to fully access the s3 bucket. 37
  • 48. Figure 5.12: Creating IAM role to connect EC2 instance and s3 • Configure the EC2 instance to fetch the video from the S3. For this, we have used Boto3 which is the Python SDK for AWS. Boto3 can be used to directly interact with AWS resources from Python scripts. Figure 5.13: Access EC2 instance using Boto3 command • Create a domain on which the website can be hosted. This is done using Route 53, it is basically a Domain Name Server which provides a domain name for a particular IP address. As shown in the figure 5.4, the url of the website is nebtics.live:8000. 8000 is the port number of the server. 38
  • 49. Figure 5.14: Website hosted on domain • Configure AWS CloudWatch to monitor the overall performance of the EC2 Instance. 5.6 Run the deployed algorithm in Amazon EC2 Instance • Login /Connect to your instance • Start both the express servers on shown in Figure 5.9 • The website server fetches the output predictions from the model server and provides it to the frontend website Figure 5.15: Running express Server on AWS 39
  • 50. Chapter 6 Simulation, Results and Discussion 6.1 Simulation 1) Website Figure 6.1: Website Deployed on EC2 This is the front-end website created in React Js and Node.Js. On the left hand side of the web application, the video frames are captured from the webcam from the PC/Laptop or from the mobile phone. Then the recorded video is sent to the S3 storage and from there to EC2 instance for processing. Once the video is processed the website fetches the data from the server and displays the output 40
  • 51. predictions on the right hand side section. 2) EC2 Figure 6.2: Screenshot of running EC2 The EC2 instance for the model is launched, Figure. 6.2 is the screenshot of the EC2 instance For the model to run we need to install some dependencies. Then the model is uploaded to the EC2 and we created a python file to call the model For analyses of video, the video needs to be fetched from S3, and to access the S3 we used boto3 commands. The video is then processed and the output predictions from the console are converted to JSON file format for hosting on the website. An express server is created on the local host for prediction to display on site. 41
  • 52. 3) S3 Figure 6.3: Screenshot of S3 storage The figure 6.3 is the Screenshot of the S3 bucket, which is used as storage in AWS. The video frame which is recorded or uploaded on the website is sent and stored in S3. The second EC2 which runs the model fetches the latest video stored in the S3 using boto3 commands. 4) Cloudwatch Figure 6.4: CloudWatch Dashboard Above figure is the screenshot of Cloudwatch, which is a service of AWS used to monitor the services. We are using Cloudwatch to monitor the performance of both the EC2’s To implement the connection between EC2 and Cloudwatch, you must attach the CloudWatchAgentServerRole IAM role to the EC2 Instance to be able 42
  • 53. to run the CloudWatch agent on the instance. This role enables the CloudWatch agent to perform actions on the instance. This image shows the dashboard of the CloudWatch and the elements we are monitoring are CPU utilization to see the load on EC2. We are monitoring networking in and out of EC2s and the number of objects in S3 storage. We can also set an alarm for the malfunctioning of EC2s. 43
  • 54. Chapter 7 Conclusion 7.1 Conclusion We proposed a cloud architecture through which we deployed deep learning algorithms. The output of the algorithms is displayed on the website in real-time with a delay of about 10 sec. The website is easily accessible through laptops/pcs and mobile phones. We have used CloudWatch to monitor and maintain the cloud infrastructure.Overall, the Cloud platform acts as a test bench where Algorithms and other computational techniques can be tested and optimized. The web application developed by us, provide human activity recognition and their emotions. 44
  • 55. 7.2 Future Scope • Optimization: The current website has a delay of around 10 sec to predict the output. This occurs because the whole video is first sent to the EC2 and processed. If we send the video in small segments like frames the delay can be reduced. • Automation: The current cloud architecture is not fully automated. The deployment of a new model or application takes time. If it is automated by using a service like cloudformation or terraform, which is an infrastructure automation platform provided by AWS, then any new models can be deployed on the cloud with some clicks. This will make this more user-friendly and even faster. • Security: You can add login/signup to the webpage to provide authentication of users. You can prevent DDoS attacks by using AWS security services like AWS Shield and AWS Firewall. To prevent the AWS Account service like GuardDuty provides security to the AWS account as the consists of many confidential information, pricing, configured services attacker. 45
  • 56. References [1] Kulkarni, G., Sutar, R. Gambhir, J., 2012. Cloud Computing- Infrastructure as Service - Amazon EC2. International Journal of Engineering Research and Applications [2] https://docs.aws.amazon.com/whitepapers/latest/cicd_for_5g_ networks_on_aws [3] N. Mangla, J. Singh and M. Singh, "Improving performance of web applications using cloud resources," Proceedings of 3rd International Conference on Reliability, Infocom Technologies and Optimization, 2014 [4] https://aws.amazon.com/blogs/machine-learning/building- automatic-analysis-of-body-language-to-gauge-attention-and -engagement-using-amazon-kinesis-video-streams-and -amazon-ai-services/ [5] https://www.amazonaws.cn/en/products/ [6] https://www.simplilearn.com/tutorials/reactjs-tutorial/what-is-reactjs [7] https://docs.aws.amazon.com/whitepapers/latest/aws-overview /aws-overview.pdf [8] https://www.figma.com/ [9] https://reactjs.org/docs/getting-started.html [10] https://nodejs.org/en/ [11] https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ GettingStartedNodeJs.01. html 46