AI on cloud, AI on AWS

AI: Leveraging AWS and GCP AI Services

Introduction

Artificial Intelligence (AI) has emerged as a transformative force, revolutionizing industries and shaping the way we approach problem-solving and innovation. Cloud service providers like Amazon Web Services (AWS) and Google Cloud Platform (GCP) have made AI accessible to businesses of all sizes, empowering them with advanced AI technologies to drive growth and efficiency. In this comprehensive guide, we will explore the diverse AI services offered by both AWS and GCP, discuss their potential applications, and understand how businesses can seamlessly integrate these powerful tools with their backend systems and APIs.

AI Services Offered by AWS

  1. Amazon Rekognition: Advanced Image and Video Analysis

Amazon Rekognition, a flagship AI service from AWS, enables businesses to analyze images and videos using cutting-edge computer vision algorithms. With features like facial recognition, object detection, and scene understanding, Rekognition finds applications in various industries. E-commerce companies can utilize it for product tagging and personalized recommendations, while security systems can enhance surveillance with real-time face recognition.

  1. Amazon Polly: Natural Text-to-Speech Conversion

Amazon Polly empowers businesses with the capability to convert written text into lifelike speech in multiple languages. Audiobook creation, language translation, and voice-enabled applications are just a few examples of Polly’s versatile applications, enhancing accessibility and user engagement.

  1. Amazon Lex: Building Intelligent Conversational Interfaces

Amazon Lex simplifies the development of interactive chatbots and conversational interfaces that offer personalized customer experiences. Leveraging natural language understanding (NLU) capabilities, Lex engages users with human-like interactions, enhancing customer support and satisfaction.

  1. Amazon Comprehend: Extracting Insights from Unstructured Text

Amazon Comprehend harnesses the power of Natural Language Processing (NLP) to extract valuable insights from vast amounts of unstructured text. Businesses can perform sentiment analysis, entity recognition, language detection, and topic modeling, thereby understanding customer feedback, market trends, and brand sentiment.

  1. Amazon SageMaker: Simplifying Machine Learning Workflows

Amazon SageMaker offers a fully-managed environment for building, training, and deploying machine learning models. This service streamlines the process of developing intelligent applications, allowing data scientists and developers to efficiently collaborate.

  1. Amazon Forecast: Predicting Future Trends with Machine Learning

Amazon Forecast enables businesses to make data-driven decisions by predicting future trends and demands. Leveraging AI and machine learning, this service optimizes inventory management, sales forecasting, and resource allocation.

  1. Amazon Personalize: Delivering Tailored Recommendations

Amazon Personalize enables businesses to offer personalized product and content recommendations based on user behavior and historical data. This personalization enhances customer engagement, satisfaction, and conversion rates.

AI Services Offered by GCP

  1. Cloud Vision API: Powerful Image Analysis

Google Cloud’s Vision API allows businesses to integrate AI-powered image analysis capabilities into their applications. With features like label detection, face detection, and OCR (optical character recognition), Vision API finds use in e-commerce, healthcare, and content management industries.

  1. Text-to-Speech API: Natural Language Processing

The Text-to-Speech API from GCP converts written text into natural-sounding speech, offering multilingual support and a range of voice options. Applications include voice-enabled applications, language translation, and accessibility features for visually impaired users.

  1. Dialogflow: Building Conversational Interfaces

Dialogflow enables businesses to create chatbots and conversational interfaces with NLU capabilities. The platform supports multiple messaging platforms, making it suitable for various use cases, including customer support and virtual assistants.

  1. Natural Language API: Understanding Textual Data

Google Cloud’s Natural Language API provides sentiment analysis, entity recognition, and syntax analysis to gain insights from unstructured text. Businesses can use it for customer feedback analysis, content classification, and trend monitoring.

  1. AI Platform: Scalable Machine Learning

GCP’s AI Platform offers a scalable infrastructure for machine learning model development and deployment. Data scientists and developers can collaborate effectively to build intelligent applications.

  1. Cloud AI Platform Notebooks: Collaborative Data Science

The AI Platform Notebooks facilitate collaborative data science, providing a managed Jupyter Notebook environment for data exploration, model development, and visualization.

Conclusion

AWS and GCP offer a comprehensive suite of AI services that enable businesses to harness the power of AI for enhanced growth and efficiency. By leveraging services like Rekognition, Polly, Lex, Comprehend, SageMaker, Forecast, Personalize from AWS, or alternatives like Vision API, Text-to-Speech API, Dialogflow, Natural Language API, AI Platform, Cloud AI Platform Notebooks from GCP, organizations can gain valuable insights, optimize operations, and deliver personalized experiences to their customers.

Integrating these AI services with backend systems and APIs is achievable through the use of respective SDKs and APIs, making it easier for businesses to embrace AI and unlock its full potential.

In the upcoming blogs we will discuss about Azure and each service in detail.

7f5f3571716e84ffac1646fc9b52d86b

Azure Cognitive Search

Azure Cognitive Search is a cloud-based search service that developers and organizations can use to add powerful search capabilities to their applications. It enables users to quickly and easily create a search experience that can be tailored to their specific needs, whether it be searching through documents, websites, or other types of content.

One of the key features of Azure Cognitive Search is its ability to create QnA pipelines, which are designed to help users find answers to their questions quickly and efficiently. This is particularly useful in scenarios where users may have a large number of questions and need to find answers in a timely manner.

QnA pipelines work by processing incoming queries and matching them to the appropriate answers from a knowledge base. Developers and organizations can use Azure Cognitive Search to create and manage their knowledge base, which can include documents, FAQs, articles, and other types of content.

To get started with QnA pipelines, developers and organizations must first create a knowledge base using the Azure Cognitive Search portal. This involves uploading content to the search service and then configuring the indexing and query settings.

Once the knowledge base has been created, developers can use the Azure Cognitive Search API to query the knowledge base and retrieve answers to users’ questions. The API provides a range of features for customizing the search experience, such as filtering, sorting, and faceting, which can help users find the answers they need quickly and easily.

In addition to QnA pipelines, Azure Cognitive Search can also be used for a range of other search scenarios, such as e-commerce product searches, news and article searches, and location-based searches.

Overall, Azure Cognitive Search is a powerful search service that can help developers and organizations create intelligent search experiences for their users. With its QnA pipeline capabilities, it provides an efficient and effective way to find answers to users’ questions, making it a valuable tool for a range of industries and applications.

artificial data generation

Artificial data generation USE CASES

Artificial data generation using AI is becoming increasingly popular across various industries. This technology uses deep learning algorithms to create synthetic data that can be used for training machine learning models. By generating artificial data, companies can create larger datasets that are more diverse, which can ultimately lead to better model performance. In this article, we will explore how different industries are using artificial data generation using AI.

  1. Healthcare Industry: The healthcare industry is one of the most data-intensive industries in the world, with vast amounts of patient data being generated every day. However, this data is often highly sensitive and subject to strict privacy regulations. Artificial data generation using AI can help healthcare providers generate synthetic data that can be used for training machine learning models without compromising patient privacy. This can enable more accurate diagnoses, better treatment plans, and improved patient outcomes.
  2. Financial Industry: The financial industry generates large amounts of transactional data, which is used to detect fraud, build risk models, and develop trading strategies. However, this data is often limited in scope and does not reflect real-world scenarios. Artificial data generation using AI can help financial institutions generate synthetic data that is more diverse, allowing them to build more accurate and robust models.
  3. Retail Industry: The retail industry is highly competitive, with companies constantly looking for ways to improve their marketing strategies and customer experience. Artificial data generation using AI can help retailers generate synthetic data that can be used to test different marketing strategies and improve customer targeting. This can lead to more effective marketing campaigns and increased sales.
  4. Manufacturing Industry: The manufacturing industry is another data-intensive industry, with vast amounts of sensor data being generated from machines and production lines. Artificial data generation using AI can help manufacturers generate synthetic data that can be used to train machine learning models to detect faults and predict maintenance requirements. This can help manufacturers improve product quality, reduce downtime, and increase efficiency.
  5. Automotive Industry: The automotive industry is also using artificial data generation using AI to improve the safety and performance of vehicles. By generating synthetic data, automotive manufacturers can train machine learning models to detect and avoid hazards on the road, such as other vehicles, pedestrians, and obstacles. This can help reduce accidents and save lives.

In conclusion, artificial data generation using AI is becoming increasingly popular across various industries, as companies seek to improve their machine learning models and gain a competitive edge. By generating synthetic data, companies can create larger datasets that are more diverse, allowing them to build more accurate and robust models. As the technology continues to evolve, we can expect to see even more applications for artificial data generation using AI in the future.

c75d1c5a85d5badb836cb900a0dff8cd

The Fault In “GPT-3”. IS IT A HYPE?

IS GPT-3 A HYPE? WHAT MEDIA SAYS AND IS IT IMPORTANT FOR INTERVIEWS?

If you are familiar with the concept of attention and transformers , you must have come across the word “GPT” . Be it the earlier models like GPT-1 and GPT-2 or the recently released GPT-3.

GPTs are decoder only stacks (generative -pre trained models) developed by OPEN AI

Ever since GPT-3 was released platforms like twitter were flooded with posts that glorified the model and what it can do . The posts were written in a manner which would make any layman person perceive it as some sort of magic . Funny claims like “this is the end of software engineering” were made .

GPT-3 in fact is a milestone in NLP as it showed performance like never before . But one needs to understand the limitations and the reasons for such performance . Finally one can see that GPT-3 is far away from being labelled as “near to human intelligence”.

CHANGES FROM GPT-2 AND GPT -1

below you can see the architecture of GPT-1 model (one transformer decoder) .

Further enhancements by varying layers and parameters led to GPT-2

ref: https://jalammar.github.io/illustrated-gpt2/

GPT-3 is structurally similar to what GPT-2 is. The main advancements are the result of an extremely large number of parameters that were used in training the model . Also the computing resources that were used were way more than any “normal ” research group can afford .

GPT-2 VS GPT-3 PARAMETERS COMPARISION

MODEL NUMBER OF PARAMETERSnumber of layersbatch size
GPT-21.5 B48512
GPT-3 SMALL125M120.5 M
GPT-3 MEDIUM350M240.5 M
GPT-3 LARGE760 M240.5M
GPT -3 6.7 B6.7 B322 M
GPT-3 13B13.0 B402 M
GPT -3 175B OR ” GPT-3″175.0 B963.2 M
. All models (gpt-3) were trained for a total of 300 billion tokens. DATA SET: COMMON CRAWL

MAJORITY OF THE PERFORMANCE BENEFITS CAN BE SEEN COMING FROM THE ENORMOUSLY HUGE NUMBER OF PARAMETERS .

IS IT SCALABLE ?

Well if you are thinking to train a gpt-3 model from scratch , you might need to think twice . Even for OPEN AI , the cost of training GPT-3 was close to $4.6 million . And at present computing costs training gpt 4 r gpt 8 might be too expensive even for such huge organizations .

THE NEGATIVE BIAS

Given GPT-3 was trained on common crawl data of the internet , the model was prone to “learn ” social bias against woman , black people and the hate comments that is present in abundance on the internet. Its not surprising these days to find two people cussing and fighting over any social media platform ,sad.

ALWAYS RIGHT?

GPT-3 fails tasks which are very problem specific. You can expect it to understand and answer common daily life questions( even then there is no guarantee of cent percent accuracy. ) but it cant answer very specific medical case questions . Also there is no “fact checking mechanism ” that can ensure that the output is not not only semantically correct but is also correct as a matter of fact.

GPT FOR VISION ?

Direct implementation of transformers isn’t feasible considering the dimensionality of an image and train time complexity of a transformer . Even for people/organizations with huge computation power its overwhelming.

A RECENTLY PUBLISHED PAPER ” AN IMAGE IS WORTH 16*16 WORDS” HAS SHOWN TO USE TRANSFORMERS FOR CV TASKS . DO CHECK OUT THIS LINK:

ACCESS RIGHTS

. At the moment, not everyone can get access to it. OpenAI wants to ensure that no one misuses it. This certainly has raised some questions in the AI community and is debatable .

WHERE CAN YOU SEE A DEMO? CHECK THIS OUT !

MEDIA HYPE?

YES!!! any model till now is just miles away from achieving general intelligence . Even the research team of GPT-3 has clearly asked the media to not create a “FAKE BUZZ” and that even though this is a milestone for sure but it is not general intelligence and can make errors .

FOR INTERVIEWS?

Given the access rights, the fact that you cannot train it , and even if you can it just would be a library implimentation like BERT , its expected only to know the theoretical part if you mention it in your resume.

😛

LINK TO GPT-3 RESEARCH PAPER : https://arxiv.org/pdf/2005.14165.pdf

DEEP LEARNING IN GAMES

DEEP LEARNING IN GAMES 2

HOW TO TRAIN AN AI TO DRIVE A CAR IN GAMES LIKE NFS , GTA USING DEEP LEARNING IN GAMES (TENSORFLOW AND PYTHON)

DEEP LEARNING IN GAMES: What better than an Aston Martin driving through the streets on its own . In this article we see how you can train a supervised neural network which learns how to drive using a convolutional neural network . You can train cars in games like GTA , NFS , to learn to drive . I would advice using the the maps where the road is clear in terms of lanes . I have provided the github link for the code you will need . The article is inspired by a model trained by sentdex( a youtube channel with python and AI content) . Remember the AI we train here is supervised and not reinforcement learning . YOU NEED TO HAVE KNOWLEDGE OF THE FOLLOWING IN ORDER TO TRAIN SUCH A MODEL .

  1. open CV for grabbing the screen as data .
  2. capturing the keys as inputs .
  3. creating a neural network that takes captured screen data as input .
  4. training the model and then putting it to test.

THE APPROACH

how do we play such games as a human? OUR EYES CAPTURE THE DATA (THE VISUALS OF THE ROAD AND THE OTHER CARS ) . SENDS IT TO THE BRAIN . THEN OUR BRAIN CONSIDERS THE FOLLOWING FACTS :

  1. POSITION OF OTHER CARS .
  2. THE CURVATURE OF THE ROAD AT THAT POINT .
  3. THE AMOUNT OF DRIFT A CERTAIN CAR PRODUCES ON ACCELERATION .

THE BRAIN PROCESSES THIS INFORMATION AND THEN ON THE EXPERIENCE IT HAS FROM THE PREVIOUS GAMES IT DECIDES WHICH KEY TO PRESS . SENDS THE SIGNAL TO YOUR HAND AND THIS REPEATS THROUGHOUT THE TIME YOU PLAY .

WE DO THE SAME FOR TRAINING A NEURAL NETWORK . WE GRAB THE SCREEN AS VISUAL DATA . THE ACCESS TO THE KEYS SERVE AS HANDS PRESSING THE KEYS . THE CONVOLUTIONAL NET REFERS TO THE BRAIN HERE . LETS LOOK AT EACH STEP IN DETAIL .

HERE IS THE GITHUB LINK to the code .

GRABBING THE SCREEN .

For this you need to have the game running in a windowed mode . this data we grab acts as the training data for your network . While you play the game the python program would have access to the keys you are pressing and hence every frame that is captured would be associated with a key hence making up the training data .

REGION OF INTEREST

When you decide whether you need to slow down , turn left or hit them accelerators there are many factors present on the screen that don’ t matter . Like the colour of the frame , the presence of tall buildings , extra graphics features and so . hence we are interested only in Black and white frames , with just the part of the road visible , we mask the other areas . using grey scale images instead of rgb reduces the amount of data that needs to be processed by eliminating unnecessary details.

PRESSING AND ACCESSING THE KEYS

We provide access to the program to “press ” the keys and also note when a key is being pressed . THE PRESS KEY , GET KEYS AND DIRECT KEYS.py serve the purpose . we define the up , right , left arrows ( w ,d ,a ) which the program will have access to .

BALANCING THE DATA

The data we create while playing has to be biased for pressing the forward “key ” as it is being pressed throughout the drive . the left and right keys are pressed somewhat fewer times . We create a balanced data set that helps to counter this kind of bias . the code file balance_data.py serves this purpose . it will also show the count of the times you pressed the specific key while creating training data.

THE NEURAL NETWORK

Our neural network is a convolutional network that takes the frames and the keys associated as data and creates a model that has 3 outputs , representing the “up ” , “left” and “right ” probability distribution . you will get the model in the github as alexnet . py . nevertheless lets see how our deep learning in games model looks like :

deep learning in games 
machine learning course

TESTING THE MODEL

Open the game in the windowed mode , and run the code. The code captures the screen data and the model predicts the best possible action ( key ) to perform and then the program executes it . this happens repeatedly as long as the program is running !! following is the recording of a neural net playing NFS (an older version) trained on just half an hour of captured data . you can play for 2-3 hours and your model would learn better !!

Game on !!!!