0% found this document useful (0 votes)
4 views

001 ML Introduction W1L2

The document discusses the concepts of Artificial Intelligence (AI) and Machine Learning (ML), highlighting their differences and applications. It explains how ML algorithms learn from data and experience, while AI aims to emulate human-like intelligence. Additionally, it addresses challenges such as explainability, fairness, and the digital divide in access to technology.

Uploaded by

Ali Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

001 ML Introduction W1L2

The document discusses the concepts of Artificial Intelligence (AI) and Machine Learning (ML), highlighting their differences and applications. It explains how ML algorithms learn from data and experience, while AI aims to emulate human-like intelligence. Additionally, it addresses challenges such as explainability, fairness, and the digital divide in access to technology.

Uploaded by

Ali Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Machine Learning

Agha Ali Raza


2
The Wonderful World of Artificial
Intelligence
AI and
Machine
Learning

Machines that can learn from data and their own experience?
AI Around Us
Boston Dynamics
Evolution
Sophia
Ameca
AI Around Us: No need to look so far
away!
Machines as mechanical helpers
Machines as Intellectual helpers

13
But how is AI different from traditional
Computer Science?
Traditional Problems

Play an audio/video file


Display a text file on screen
Perform a mathematical operation on numbers
Sort an array of numbers
Search for a number in a list of numbers

Data
Output

Program
New Frontiers

A computer program is said to learn from experience E


with respect to some class of tasks T and performance
measure P if its performance at tasks in T, as measured
by P, improves with experience E. (Tom Mitchell) A
computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P if its performance at tasks in T, as measured
by P, improves with experience E. (Tom Mitchell) A
computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P if its performance at tasks in T, as measured
by P, improves with experience E. (Tom Mitchell)
A computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P if its performance at tasks in T, as measured
by P, improves with experience E. (Tom Mitchell) A
computer program is said to learn from experience E
with respect to some class of tasks

Tumor? Y/N Price? What was said? Summarize text

Data

Output
Program
Machine Learning
➢ $150,000

Y Y N Y
➢ $190,000

N N Y Y
➢ $350,000

Y N N Y
➢ $550,000

➢ $90,000
Traditional CS
Data

Output

Program

Machine Learning

Data

Program

Output
Machine Learning Pipeline

Machine Learning Traditional CS

Data
Output Correct Answer
Data

Program
Output

Training Testing Evaluation


Machine Learning: Definition
A computer program A is said to learn from experience E with
respect to some class of tasks T and performance measure P if
its performance at tasks in T, as measured by P, improves with
experience E. (Tom Mitchell, 1997)

Informally: Algorithms that improve on some task with


experience.

Moral: Don’t get bogged down with tech lingo!


What’s the difference between AI and
ML?
Artificial Intelligence vs
Machine Learning
▪ The Historical Perspective: The AI Winter
▪ Unrealistic expectations

▪ AI: Make the machine more like a human


• Give the machine a lot of world knowledge AI
• A logical decision-making frame-work

▪ ML: Make a better machine – not necessarily emulating a human


• Based on Statistics and Optimization
• Learn from labelled data
ML
So, what has changed recently?
What’s the buzz all about?
A language model assigns probabilities to sentences
using data

𝑊 𝑃(𝑊)

Large Language Models


Chatbots and Conversational Agents
Reinforcement Learning from Human Feedback (RLHF)
Semantic Spaces – where words, images, and sounds
co-exist
At the heart of every intelligent machine
is a …. Classifier!
So, what’s a Classifier?
● Well, a Classifier… Classifies!

● A classifier classifies its inputs into a set of classes


○ When the classes are predefined, we call it “Supervised Machine Learning”
■ In this case we need to tell the classifier what the classes are and provide some
examples
CATS DOGS ?

○ When the classes are not predefined, we call it “Unsupervised Machine Learning”
■ In this case the classifier just clusters the inputs into a bunch of classes without
naming them.
Classifiers

CAT!

Is this a cat or a dog?


{Cat, Dog}

NO!

Should I hire this person?


{Yes, No}
Classifiers

cat

{cat, dog}

happy
{happy, sad, angry,
surprised, neutral,
other}

empty

{empty, full}
Classifiers

“Hospital”

{All words of the language}


Classifiers

Return the best of {all board


positions one black move
from current}

0
x 0
x x
Return the best of {all
positions one x move from
current}
Classifiers: Language Models (LM)

I turned my homework ____

“in”

What is the most probable next word?


{Given all words of the language}

1. I turned my homework in.


2. I turned my homework fish.
3. …
I turned my homework in.

Return the most probable sentence.


FEATURES: The eyes and ears of a
classifier
What does a classifier see?
Eyes: 2
Nose: 1
Nostrils: 2
Ears: 2
● Whatever you want it to see!
Fur Color: Brown and White
○ Features
Feature Eye Color: Green
● Donut vs. Bagel classifier Extractor Background Color: Black
Nose Color: Red

Image colors: Brown, Yellow,


Green, Black, Red,…

○ Features? Color of pixel 0: Black


■ Size – radius, diameter, circumference – cm, mm, inches? Color of Pixel 1: Black
….
Big/small? Color of Pixel 2,000,000: Yellow
■ Weight – units – heavy vs. light
■ Salty: Yes/No
■ Sweet: Yes/No
■ Squishy: Yes/No
■ Tasty: Yes/No
■ Healthy: Yes/No
■ Color: {all possible colors}
■ Cute: Yes/No
○ Features that matter
■ Size
■ Weight
Now YOU are a Classifier!
A night vs. day classifier
● Features?
○ Brightness/Darkness
○ Sun
○ Moon
○ Stars
○ Sky color
○ Animals that come out during the day vs night
A Night vs. Day Classifier
A Night vs. Day Classifier
A Night vs. Day Classifier
How about Unsupervised Learning?
Unsupervised Learning
Goal: To find underlying patterns in the dataset. This process is known as Clustering.

What subpopulations exist in the following images?

40

Important Questions: ● Are these subpopulations cohesive? ● Are they balanced?


● Are there any outliers? ● Is there a hierarchy?
Unsupervised Learning
• Find the underlying structure of the data or
patterns in the data
• Not about prediction
• What subpopulations exist in the data?
• How many? And how big? How cohesive? Outliers?
• Do elements in each subpopulation have
commonalities?
• Is there a hierarchy?

41
Data
Data – Big, Big… Data!
How do we obtain these massive datasets to train our Machine Learning
models?
From real interactions e.g., call centers
Expert annotators e.g., hired teams of annotators
Crowd sourcing
Recaptcha: Tagging:
We tag data for “free” for using “free”
services

XKCD Data Science: https://towardsdatascience.com/12-xkcd-strips-that-show-the-truth-about-ai-e09fbcd00c4c

44
Applications
Speech Technologies
What was said?

Who said it?

Was it Ahmad?

Did they mention credit cards?

Was the speaker male or female?


Rural or Urban?

What is their L1?

What is their height? Speech


defects? Age?

Can we fake this voice? What was the emotional state?


What was the sentiment?
46
Text Technologies
Who wrote it?

Summary of what was written?

Was it plagiarized?

What was the intent?

Was the author male or female?

What is their L1?

What was the author’s literacy


level?

What was the emotional state?


Can we fake this style?
What was the sentiment?

47
Evaluation: Ideal and Practical
The Turing Test
• The "standard interpretation" of the Turing test:
• Player C, the interrogator, tries to determine which player – A or B – is
a computer and which is a human.
• The interrogator is limited to using the responses to written questions to
make the determination.

• https://en.wikipedia.org/wiki/Turing_test
• XKCD Data Science: https://towardsdatascience.com/12-xkcd-strips-that-show-the-truth-about-ai-e09fbcd00c4c
48
ML in Local Languages of Pakistan
Speech Recognition (Speech to Text)
Speech Synthesis (Text to Speech)
Limitations and Challenges
Challenges of ML – Explainability
• A classifier can potentially learn to classify on the basis of
features not desirable for humans
• All dogs wearing a collar in the training data while no cat is wearing it –
ML just learns to separate based on collar
• All horse images have a copyrights notice – ML just learns to recognize
horses based on the copyrights notice

Explainable ML: The results should be understandable by


humans
• As opposed to a black-box system

53
Challenges – Fairness in AI
• AI tends to reflect the biases of the society
• Human taggers who mark a recording as misinformation
based on accent or gender
• Court decisions in country that make a rich person’s
acquittal more likely
• Automated standardized testing in the US could yield
unfavorable results for certain demographic groups
• AI plays a deciding role in hiring decisions, with up to 72%
of resumes in the US never being viewed by a human
• Decisions on immigration, bank loans, credit history checks,
criminal profiling

54
Machine Learning in Low-resource settings
• Problems where large data sets and tools are not
available
• Natural Language Processing and Speech
problems for languages of developing regions
• Pakistan has 71 languages
• We barely have speech recognition capabilities for Urdu

Why is this important?

55
The Internet
• The internet has transformed the way people participate in the
information ecology and digital economy
• Social media, online discussion forums, crowdsourcing marketplaces

• The Internet empowers people who enjoy access to it


• Mostly urban, affluent and literate

So, who is left out?

56
Oral and Offline
• 2.9 billion people worldwide are offline
• That is 37% of the world population
o Of these, 96% live in developing countries.
• 10% of the developed world, 43% of the developing world
and 73% of the Least Developed Countries are offline*

• Offline populations
• too poor to afford Internet-enabled devices
• too remote to access the Internet
• too low-literate to navigate the mostly-text-driven Internet

References: International Telecommunication Union (ITU): Facts and Figures 2021: 2.9 billion people still offline, Link,
https://www.itu.int/en/ITU-D/Statistics/Documents/facts/FactsFigures2021.pdf, last accessed Feb 22, 2022
McKinsey (2014), WHO, World Bank, Ethnologue, The World Fact book – CIA, GSMA Mobile Economy, weforum.org

57
Digital Divides
• Gender Divide: More men than women use the Internet.
• The gap is smaller in developed countries and larger in developing countries,
and LDCs (4 out of every 5 women are offline in LDCs).

• Urban-Rural Divide: More urban than rural people use the internet
• Globally, people in urban areas are twice as likely to use the Internet than those
in rural areas (47% vs 13% in LDCs).

• Literacy Divide: The (mostly) text-driven internet is not suitable for:


• The 2.2 billion visually impaired individuals
• Low-literates, oral cultures, native speakers of unwritten languages (47% of all
languages)

References: WHO (link), McKinsey (2014), WHO, World Bank, Ethnologue, The World Fact book – CIA, GSMA Mobile Economy,
ITU, https://itu.foleon.com/itu/measuring-digital-development/gender-gap/
PTA, https://www.pta.gov.pk/en/telecom-indicators

58
Lack of access to Information and Connectivity can be a major impediment
to Development

59
Managing Expectations
• Too optimistic/eager
o AI replacing humans as caring partners, AI replacing creative professions, super-intelligent AI
o AI invasion, robots gaining sentience and self-awareness, technological singularity, terminators!
Managing Expectations
• Too pessimistic/reluctant
o No practical applications of AI, no chances of a positive social impact, AI cannot help with anything
o No expected social harm of the mistakes of AI, no associated risks of integrating AI irresponsibly

• The differences between these extremes have been responsible for the AI
winters

https://www.npr.org/2023/02/09/1155650909/google-chatbot--error-bard-shares
Managing Expectations
• Just right
o AI can aid human efforts and professions, it can transform the industry, improve performance,
precision and accuracy, it can produce meaningful impact on the society
o Real harms that must be mitigated e.g., disruptive influence on the job market, hard to explain
and interpret, biases, the need for fairness and regulation, fail-safes to mitigate potential harms
Responsible AI
Artificial Intelligence should be practiced in a manner that is:
• Explainable/Transparent/Interpretable
• Fair/unbiased
• Ethical
o Disruptive influences
o Privacy and informed consent
• Safe
o For the stakeholders
o From adversarial attacks (the cat-n-mouse game)
• Regulated
• XKCD Data Science: https://towardsdatascience.com/12-xkcd-strips-that-show-the-truth-about-ai-e09fbcd00c4c

64
For more details please visit

http://aghaaliraza.com

Thank you!
65

You might also like