Module 1 - Introduction to AI and OpenVINO
Module 1 - Introduction to AI and OpenVINO
Powered by oneAPI
Intel® Distribution of OpenVINO™ toolkit
Performance varies by use, configuration, and other factors. Learn more at intel.com/PerformanceIndex .
Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available
updates. See backup for configuration details. No product or component can be absolutely secure.
Your costs and results may vary.
Intel® technologies may require enabled hardware, software, or service activation.
Intel® optimizations, for Intel® compilers or other products, may not optimize to the same degree for non-Intel products.
Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy.
Results have been estimated or simulated.
Intel is committed to respecting human rights and avoiding complicity in human rights abuses.
See Intel’s Global Human Rights Principles. Intel® products and software are intended only to be used in
applications that do not cause or contribute to a violation of an internationally recognized human right.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.
Other names and brands may be claimed as the property of others.
3
Module 1
4
Table of Contents
5
Module 1: Learning Objective
▪ Learn about the history and fundamentals of artificial intelligence
▪ Understand and compare Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning
(DL) techniques.
▪ Recognize the various applications of artificial intelligence in the industry, as well as their economic
impact.
▪ Discover the workflow for developing Deep Learning applications.
▪ Gain insight into the critical factors to consider when selecting an AI compute platform.
▪ Investigate the Intel® AI Ecosystem and learn about its features.
▪ Discover the OpenVINO™ toolkit and see how it works.
▪ Learn about Intel® DevCloud for Edge Workloads, including its motivations and capabilities.
▪ Become acquainted with the numerous sample applications, demos, and resources available on
Intel® DevCloud for Edge Workloads.
▪ Discover the processes required for designing and prototyping applications on Intel® DevCloud for
Edge Workloads.
6
Module 1: Learning Outcomes
7
Module 1: Key Questions Addressed
8
What is Artificial Intelligence
9
History of Artificial Intelligence
10
Machine Learning
11
Deep Learning
• Subset of Machine Learning techniques,
involving complex models called Deep Neural ARTIFICIAL INTELLIGENCE
Networks (DNN).
• The algorithm is able to discover features
from the data on its own using “neural
networks.”
• Deep Learning involves a deep neural network
MACHINE LEARNING
that has many layers of artificial neurons.
• Neurons are the basic unit of a neural network.
They are interconnected using “weights” that
represent the strength of connections
between neurons. DEEP
LEARNING
12
Breakthroughs in Deep Learning
Machines able to meet or exceed human image and speech recognition
Error
15% 15%
8% 8%
Human Human
0% 0%
2010 Present 2000 Present
13
Machine Learning vs. Deep Learning
Machine Learning Deep Learning
A class of statistical methods that uses parameters from known A type of Machine Learning that has received increasing focus
existing data and then predicts outcomes on similar new data. in the last several years.
Traditionally, relies on a prescribed set of “features” that are The algorithm doesn’t need to be told about the important
considered important within the dataset. features –able to discover features from data on its own using a
“Neural Network.”
Feature Engineering –the process of building features into a Involves a “Deep” Neural Network (DNN) that has many layers
Machine Learning algorithm (labor - intensive process). of artificial neurons. Artificial neurons in a DNN are
interconnected.
-Strength of connection between neurons is represented
by a number called “Weight”. The process of determining
weights is called “training”.
-Avoids Feature Engineering –shift
fromhowtoengineerthebestfeaturestohowtoguidemodel
stowardsdiscoveringthebestfeatures.
-Neural Network can learn features directly from the data,
given a sufficient datasize and optimal architecture.
14
Discussion Points
15
AI is changing industries
Empower Create Transform stores Enable homes Drive network Efficient and
truly intelligent thrilling and inventory that see, hear, and operational robust traffic
Industry 4.0 experiences and respond efficiency systems
16
AI use cases exist across every industry, and some of the
most prevalent today include:
Generative AI Image & video generation, Code generation, Text generation
Tabular & Time Series Data Applications Financial Analysis, Spam Filters, Smart Wireless Network
Routing, Monitoring, and Predictive Maintenance of Machines
in the Manufacturing domain, etc.
17
Why deep learning
There is tremendous opportunity in the global growth in
chipset revenue driven by AI inference
Inference TAM by Chipset
$40,000
$35,000
$30,000
$51.9B $25,000
$20,000
Driven by
by 2025 AI inference
$15,000
$10,000
$5,000
$0
2020 2025
18
Factors that Led to the Rise of Deep Learning
19
Deep Learning Development Cycle
20
Discussion Points
▪ How Artificial Intelligence is helping in changing the world that we live in?
▪ How are organizations using AI to create dynamic solutions across industries?
▪ How can AI impact our society, and the society of the future?
▪ What are some of the challenges faced at each stage of Deep Learning development cycle?
▪ What are some of the key things that you should consider before pushing Deep Learning
models to production?
21
AI compute considerations
How do you determine the right computing for your AI needs?
ASIC/
1 FPGA/
Utilization
GPU
2 3 CPU
Scale
22
Factors to be Considered
While selecting AI Compute Platforms
▪ It starts by taking a cross-section of the environment to determine the breakdown of AI and other workloads.
▪ Figure out the use case requirements. These may include factors like: Throughput, accuracy, response time,
cost, size, power, data size, security, manageability, reliability, etc.
23
Challenges in Deep Learning
Development and deployment challenges in deep learning
24
Discussion Points
▪ What are some other challenges that you might face in the above
example?
▪ Why is it harder to maintain a multi-hardware platform?
▪ What are some ways to overcome the challenges of working with various
hardware platforms?
▪ Why is it essential to optimize your hardware and software stack in
conjunction with each other?
▪ Why it’s important to choose the right compute platform for your
application?
25
Object Detection + Intel® Xeon®: Compelling SW+HW
AI Inference Performance Increases Over Time
Improvements mean exponential performance increase
4116 1st Gen Intel® Xeon® 4216 2nd Gen Intel® Xeon® 4216R 2nd Gen Intel® Xeon® 4316 3rd Gen Intel® Xeon® 4316 3rd Gen Intel® Xeon®
Scalable processor with FP32 Scalable processor with Scalable processor with Scalable processor with Scalable processor with
Intel® Deep Learning Boost Intel® Deep Learning Boost Intel® Deep Learning Boost Intel® Deep Learning Boost
(INT8 VNNI) (INT8 VNNI) (INT8 VNNI) (INT8 VNNI)
3.9x
2.9x 3.6x 3x
2.8x
2.2x 2.2x
2.1x 1.7x
2x 1.9x 1.8x 1.7x 1.6x
1.7x
The above is preliminary performance data based on preproduction components. For more complete information about
performance and benchmark results, visit intel.com/benchmarks. See backup for configuration details.
27
OpenVINO™ Toolkit Overview
Fast, accurate results with high-performance, deep learning inference
1 MODEL
Convert and
optimize models,
and deploy across 2 OPTIMIZE Optimized Performance
and environments,
on-premises and
on-device, in the
browser or in
the cloud 3 DEPLOY
Powered by oneAPI
The productive, smart path to freedom for accelerated computing from the economic and technical burdens of proprietary
alternatives.
28
Why Intel® Distribution of OpenVINO™ toolkit
Across key industries
▪ Generative AI trained to speed up text, image, and video creation
Creative
Help rapidly generate creative content for ▪ Develop software code to speed product development
story telling, marketing, and more. ▪ Automate personalized responses in more authentic tones
29
OpenVINO™ Toolkit Developer Journey
1 MODEL 2 OPTIMIZE 3 DEPLOY
OpenVINO™ Runtime
Read, load, infer Common Python, C and C++ APIs that abstracts low-level
programming for each device below
IR Data OpenVINO format (intermediate
representation file) (.pb, .tflite, .onnx,)
30
1 MODEL 2 OPTIMIZE 3 DEPLOY
Model selection
Leverage the expansive variety of open-source pre-trained models from the following model zoos
31
1 2 3
Developer journey BUILD OPTIMIZE DEPLOY
Gesture
recognition
Object Machine
recognition translation
Text
Object recognition
300+
detection
Question
Semantic answering
pretrained and
segmentation Compressed
models
Human pose
estimation optimized models
Action
recognition
Image Text
processing detection Image
Instance retrieval
segmentation
Text
spotting
32
1 2 3
Developer journey BUILD OPTIMIZE DEPLOY
Model Optimizer
• A Python-based tool to import trained models
and convert them to intermediate
representation (IR)
• Optimizes for performance or space with Read, load, infer
conservative topology transformations
OpenVINO format
Trained model Model Optimizer
• Hardware-agnostic optimizations IR data
(intermediate representation)
(.xml, .bin)
Note: Except for ONNX (.onnx model formats), all models have to be
converted to an IR format to use as input to the inference engine.
33
1 2 3
Developer journey BUILD OPTIMIZE DEPLOY
NEW Bootstrap
Optimize network size before retraining NAS – Discover
higher-performance
Bootstrap NAS ‒ Load alternative
models models automatically
The NNCF reduces neural network sizes for
faster training cycles and more-compact Bootstrap NAS uses machine learning to
models for deep learning inference. Quantization-aware discover alternative, higher-performing
training
models optimized for Intel® hardware.
Mixed-precision
quantization
35
1 2 3
Developer Journey BUILD OPTIMIZE DEPLOY
36
1 2 3
Developer journey BUILD OPTIMIZE DEPLOY
Runtime
• High-level C, C++, and Python inference runtime API
• Interface is implemented as dynamically loaded plugins for each
hardware type
• Delivers superior performance for each type without requiring users to
implement and maintain multiple code pathways
37
1 2 3
Developer Journey BUILD OPTIMIZE DEPLOY
EDGE TO CLOUD
38
Developer journey
Applications
Inference engine
runtime
OpenVINO™ Runtime
Intel®
GNA
(IP)
39
Additional Tools and Add-ons
Streamlined development experience and ease of use
40
Case Studies
Use cases and successful implementations powered by the Intel® Distribution of OpenVINO™ Toolkit
Provides restaurateurs Unlocks the power of Develops the COVID- Empowers retailers Delivers smart Utilizes AI enabled Enables streamlined
the insights and machine vision and AI Net convolutional with an intelligent shelf operating platform with video monitoring and and scalable edge cloud
automation services to improve neural network (CNN) monitoring system for Intel technology for event detection. computing.
needed to meet manufacturing architecture to help real-time, actionable venues and events. Read the brief Read the brief
the challenges of processes with defect clinicians rapidly and insights. Read the brief
increased online detection. accurately detect Read the brief
ordering and labor Read the brief COVID-19
shortages. in patients.
Read the brief Read the case study
41
GitHub Jupyter Notebooks
Valuable tutorials for computer vision and natural language processing
▪ Basic introduction to
▪ End-to-end training to deployment
OpenVINO's Python API Tensorflow
<Hello World/> Hello World ▪ Inference on a mobilenetv3 image Training
workflow starting with TensorFlow’s
Flowers classification demo
classification model
42
Discussion Points
43
Module 1
System Requirements
44
System Requirements
Developer Platforms
• Processors
▪ 6th to 13th generation Intel® Core™ processors
▪ 1st to 4th generation Intel® Xeon® Scalable processors
▪ Intel Atom® Processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2)
▪ Integrated Graphics
▪ Intel® HD Graphics
▪ Intel® UHD Graphics
▪ Intel® Iris® Pro Graphics
▪ Intel® Iris® Xe Graphics
▪ Intel® Iris® Xe MAX Graphics
▪ Discrete Graphics
▪ Intel® Data GPU Flex Series Center (formerly code named Arctic Sound)
▪ Intel® Arc ™ GPU (formerly code named DG2)
45
System Requirements
Target Platforms
Discrete Graphics
▪ Intel® Data GPU Flex Series Center (formerly code named
Arctic Sound)
▪ Intel® Arc ™ GPU (formerly code named DG2)
VPU* ▪
Processing Unit (VPU)
Intel® Neural Compute Stick 2
▪ Intel® GNA
GNA
*VPU supported in OpenVINO™ toolkit version 2022.3 LTS and before only
46
Module 1
Installation Methods
47
Choose how you install
48
Github Install via PIP
https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide
49
Module 1
50
What is in the Open Model Zoo Repository?
51
How to obtain OpenVINO™ IR Models
Public
Model Downloader Model Converter
Open Model Zoo 300+ open Pre-trained Models
sourced and optimized
Tool: Tool:
pretrained models available
omz_downloader omz_converter
Tensorflow* Model
Tensorflow Lite* Optimizer Intermediate Representation
PyTorch* (.xml + .bin)
Keras*
Tool: mo
ONNX*
PaddlePaddle*
Kaldi*
MXNET*
Caffe*
52
Types of Models
53
Object Detection and Recognition
54
Reidentification Models
Precise tracking of objects in a video is a common application of Computer Vision (for example, for
people counting). It is often complicated by a set of events that can be described as a "relatively long
absence of an object". For example, it can be caused by occlusion or out-of-frame movement. In such
cases, it is better to recognize the object as "seen before" regardless of its current position in an
image or the amount of time passed since last known position.
55
Semantic Segmentation Models
56
Instance Segmentation Models
57
Human Pose Estimation Models
Human pose estimation task is to predict a
pose: body skeleton, which consists of key
points and connections between them, for
every person in an input image or video. Key
points are body joints, i.e. ears, eyes, nose,
shoulders, knees, etc. There are two major
groups of such methods: top-down and
bottom-up.
58
Text Detection and Recognition
59
Natural Language Processing Models
For example, you can use a fine-tuned Are the meanings of these two sentences similar?
HuggingFace BERT PyTorch*model trained
on the Microsoft Research Paraphrase The company said it would check all ofits million-
Corpus (MRPC) to build a model that plus domestic workers to ensure they were legally
compares the meaning of sentences. employed.
The example is in the OpenVINO™
Notebooks on Github*: It has also said it would review all ofits domestic
https://github.com/openvinotoolkit/openvi employees more than 1 million to ensure they have
no_notebooks/tree/main/notebooks/105- legal status.
language-quantize-bert
The same meaning: yes
60
Live Action Recognition with OpenVINO™
61
Image Processing Models
Single Image Super Resolution
62
Model Downloader Usage
The model downloader allows the developer to easily fetch both publicly available models and Intel
provided models. It conveniently free developers from constant searching for the online locations of
models.
This will download all models. The --all option can be replaced with other filter options to
download only a subset of models. See the “Shared options” section.
63
Model Converter Usage
omz_converter–all
This will convert all models into the OpenVINO™ IR format. Models that were originally in that
format are ignored. Models in PyTorch* format will be converted in ONNX* format first.
The—all option can be replaced with other filter options to convert only a subset of models.
See the “Shared options” section.
This command will convert a specific model in the download_dir to a specific format in the output_dir
64
Model Quantizer Usage
Quantization is using lower-bit representations than higher bits for a given real-valued number. For
example, you can represent a continuous real number such as a 32-bit (or, 4 bytes) floating-point
number with a discrete number such as an 8-bit (or, 1 byte) integer number.
In this way, users will get a much smaller sized model, with the benefit of improved inference speed .
Before you run the model quantizer, you must prepare a directory with the datasets required for the
quantization process. This directory will be referred to as <DATASET_DIR> below.
omz_quantizer--name {model}--dataset_dir<DATASET_DIR>
65
OpenVINO™Notebooks -104-model-tools
https://github.com/openvinotoolkit/openvino_notebooks/
tree/main/notebooks/104-model-tools
66
Module 1
67
Intel® DevCloud for the Edge Workloads
A Development Sandbox for Developers, Researchers, Faculty, Students and Startups
With the Intel® DevCloud for the Edge users can: How It Works
▪ Prototype on the latest hardware and software to
future proof the solution
▪ Benchmark the customized AI application
▪ Run AI applications from anywhere in the world
▪ Reduce development time and cost
68
Sample Applications by vertical
Safety Industrial
▪ Safety Gear Detection ▪ Weld Porosity
▪ Restricted Zone Notifier ▪ Low Power Object Detection
▪ Intruder Detection
Retail General
▪ Benchmark
▪ Store Traffic Monitor
▪ Time Series Analysis
▪ Store Aisle Monitor
▪ Noise Suppression
▪ Shopper Gaze Monitor
▪ Neural Network Compression Framework
69
Discussion Points
▪ What is the development environment provided by Intel® DevCloud for Edge Workloads?
▪ What are some of the features of Intel DevCloud for Edge that are useful for remote teams?
▪ Why is it necessary to generate your application's output in addition to benchmarking its performance?
70
Summary
▪ We learned about the concepts and applications of artificial intelligence in this module.
▪ We discussed Deep Learning, the motivation behind its use, and the various challenges that
developers face during the development phase.
▪ We also looked at various tools in the Intel® AI Ecosystem and learned about the
OpenVINO™ toolkit.
▪ Additionally, we explored and learned about Intel® DevCloud for Edge Workloads, as well as
how to create Deep Learning applications seamlessly.
71
Next Steps
72
Module 1
Hands-on Lab
73
Lab 1: Open Model Zoo
▪ This lab demonstrates how to download models from Open Model Zoo, which are validated
with OpenVINO™ toolkit.
▪ In this lab you will be using Intel® DevCloud for Edge Workloads which is a remote
development environment, which is designed to help you develop, test and run your
workloads for free on a cluster of the latest Intel® hardware and software.
74
Assignment 1.1
▪ Download a pretrained model from the Open Model Zoo and obtain
model information.
▪ You must accomplish the tasks listed below for this assignment.
1. Download the models listed below.
▪ handwritten-english-recognition-0001
▪ yolo-v4-tf
2. After downloading the model, use Model Information Dumper to view the
model's information.
75
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and
brands may be claimed as the property of others.
System Configuration
1) Memory is installed such that all primary memory slots are populated.
2) Testing by Intel as of September 9, 2020.
77
Compounding effect of hardware and software configuration
See the compounding effect
78