Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

DEVNET-2163

Machine Learning with


Python

Alicia Garcia Sastre – TAC engineer


Cisco Webex Teams

Questions?
Use Cisco Webex Teams (formerly Cisco Spark)
to chat with the speaker after the session

How
1 Find this session in the Cisco Events Mobile App
2 Click “Join the Discussion”
3 Install Webex Teams or go directly to the team space
4 Enter messages/questions in the team space

cs.co/ciscolivebot#DEVNET-2163

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
Agenda
• Machine Learning examples
• What is Machine Learning
• Types of Machine Learning
• Python libraries
• Machine Learning in Networking
• Conclusion

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
Use this space to provide a bit of detail.

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
Chinese police using facial recognition glasses to identify suspects
Police can almost instantly view an individual's personal details, including name, ethnicity, gender
and address.
telegraph.co.uk
DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
BBVA launches facial recognition Shanghai Hongqiao airport
payments introduces automated facial-
recognition check-in
bankingtech.com abc.net.au

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
The guardian
Use this space to provide a bit of detail.

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
The guardian

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
Cisco DNA information

Researchers could
usher in a new era of
3D model (shape)
scientific and medical
progress
Shape = Function

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
If scientists know the shape…
- They can know what it does
- How it might misfold and cause harm
- Replicate them
- Design new ones

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
Use this space to provide a bit of detail.

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Use this space to provide a bit of detail.
Self-driving electric bus propels Swiss town into the future
cnn.com

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Google reCAPTCHA

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
More examples
• Netflix, YouTube, Spotify, • Google ranking results
Amazon recommender systems
• Facebook’s facial recognition
• Speech recognition: Siri, Google
• Many more
Home, Alexa
• IBM Watson

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
What is Machine Learning
Machine learning is a collection of
algorithms to make computers learn from
data and make decisions and predictions
based on what they learnt

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
ML is not a silver bullet
• Dirty, missing data • Hard to convert unstructured
data to mathematical values
• Not enough data
• Hard to find a good model
• Do results make sense?
• Is it bug or expected result?
Incorrect model?
• Data scientists are needed

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
“All models are wrong but some are
useful”
George Box , 1978
g

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Data in Machine Learning
• It is all about data
• Data should be cleaned
• Bad data leads to bad results
• Big data is required to get good results

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
Types of Machine
learning
Types of Machine Learning
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
• Deep Learning

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Supervised Learning
• For each input in the training data set, there will
be an known output associated.

• Classification: assign groups to input data


based on previous data
• Regression: predicts real values based on
previous data

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
Classification example

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
Regression example
• A big number of network engineers filled in a survey with questions
about their skills, experience, number of employees in their
company, region and salary
• Skills, years of experience, information about company, region are
features
• Salary is a label
• A model describing correlation of features to a label is found based
on the survey data
• Now we can predict the salary for a person who didn’t take the
survey

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
Linear Regression Salary vs experience

• The simplest supervised


model
learning algorithm
• Linear relation between Salary
features and labels
• Intuition: find a model so that historical data
an error between all training
labels and predicted labels is
minimal Experience

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Unsupervised Machine Learning
• The input does not have an associated output in the training
set. The algorithms will find relations and structure in the
input.

• Clustering: discovering groups in the data


• Association: finding rules about data

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
Reinforcement Learning
• Based on exploring the world
• Rewards for actions are known
• Start with random actions, record rewards with every action
• Build a policy by preferring actions that lead to higher rewards
• Continue improving the policy with every experience
• Examples: both AlphaGo and OpenAI played with themselves
thousands of times until they learned strategies that are close
to perfect in complex games

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Deep Learning
• State of the art in Machine Learning
• Mostly for supervised learning
• Uses neural networks (the first application: to model human
brain neurons)
• More complex
• Requires more data
• Requires more time to train

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 28
Deep Learning applications
• Speech and image recognition
• Natural language processing
• Machine translation (DeepL)
• Self-driving cars
• Many more

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Machine learning with Python
Main ML libraries:
• Scikit learn
• TensorFlow / PyTorch / Keras
• Apache PySpark

Data management:
• Pandas
• Numpy / SciPy

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Machine learning with
python demo
Machine learning in
networking
The Network. Intuitive. LEARNING
Informed
Cisco DNA Center by Context
Visibility into traffic
and threat patterns
Who, What, When,
Policy Automation Analytics
Where, How

INTENT CONTEXT
Powered Intent-based
by Intent Network Infrastructure
Translate Business Intent
to Network Policy
Automate the management
and provisioning millions of
devices instantly

SECURITY

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
Cisco DNA Center Analytics
Distributed Stream Processing
• Continuous processing, aggregating, correlating and analyzing data in
motion
• Distributed analytics pipeline runtime and programming model
• Real-time or near real-time

Analytics Operations:

Time Series Analysis Complex Event Processing Machine Learning

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Encrypted Traffic Analytics (ETA)

Known
malware traffic

Extract observable Employ machine Known malware


features in the data learning techniques to sessions detected
build detectors in encrypted traffic with
99% accuracy
Known
benign traffic

“Identifying encrypted malware traffic with contextual flow data”


AISec ’16 | Blake Anderson, David McGrew (Cisco Fellow)

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
How it works
Sequence of Packet Threat
Initial Data Packet
Lengths and Times Intelligence Map
Make the most of the Identify the content type through Who’s who of the Internet’s
unencrypted fields the size and timing of packets dark side

C2 message
Data exfiltration

Self-Signed certificate Broad behavioral information about the


servers on the Internet.

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
Malware detection with ETA
Threat
Initial Data Packet
Cloud-based Intelligence Map
machine
learning

Sequence of Packet
Lengths and Times

All three elements reinforce each other inside the analytics engine using them.

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Get Started with Machine Learning
• Machine Learning by Andrew Ng online course – Coursera/Stanford
• Reinforcement Learning course by David Silver
• CS231n Convolutional Neural Networks for Visual Recognition – Stanford

All of them available for free in youtube

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Related sessions
• Machine Learning using only a Browser - DEVWKS-2023
• Building a Machine Learning Pipeline for IoT Data - DEVWKS-2647
• Unlocking the Mystery of Machine Learning and Big Data - BRKIOT-2394
• Many more!

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
Cisco Webex Teams

Questions?
Use Cisco Webex Teams (formerly Cisco Spark)
to chat with the speaker after the session

How
1 Find this session in the Cisco Events Mobile App
2 Click “Join the Discussion”
3 Install Webex Teams or go directly to the team space
4 Enter messages/questions in the team space

cs.co/ciscolivebot#DEVNET-2163

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Complete your online
session survey
• Please complete your Online Session
Survey after each session
• Complete 4 Session Surveys & the Overall
Conference Survey (available from
Thursday) to receive your Cisco Live T-
shirt
• All surveys can be completed via the Cisco
Events Mobile App or the Communication
Stations

Don’t forget: Cisco Live sessions will be available for viewing


on demand after the event at ciscolive.cisco.com

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Continue Your Education

Demos in Meet the Related


Walk-in
the Cisco engineer sessions
self-paced
Showcase labs 1:1
meetings

DEVNET-2163 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Thank you

You might also like