AI & ML
M4-R5.1 · Chapter 5: Security and Future of IoT Ecosystem · 15 min read
Artificial Intelligence & Machine Learning
Artificial Intelligence (AI)
1.1 What is Artificial Intelligence?
Artificial Intelligence (AI) is a branch of computer science that deals with the creation of intelligent machines that can think, learn, reason, and solve problems like humans. The term 'Artificial Intelligence' was coined by John McCarthy in 1956.
In simple terms, AI makes machines smart enough to perform tasks that normally require human intelligence.
Real-Life Analogy
Think of AI like a very smart student. Just as a student reads books, learns from teachers, remembers facts, and applies knowledge to answer questions — AI does the same using data, algorithms, and computing power.
Real-Life Examples of AI
- Google Search — understands your query and gives relevant results
- Siri / Google Assistant — understands voice commands and responds intelligently
- Netflix / YouTube — recommends videos based on your watch history
- Face Unlock on smartphones — recognises your face to unlock
- Spam Filter in Gmail — identifies and filters junk emails automatically
- Self-driving cars (Tesla) — drive without human input
- Medical diagnosis — AI detects diseases from X-rays and MRI scans
1.2 Goals of AI
- To create systems that can think and reason like humans
- To build machines that can learn from experience
- To automate repetitive and complex tasks
- To make machines understand natural language (speech and text)
- To solve complex problems efficiently
1.3 History of AI — Key Milestones
|
Year |
Event |
|
1943 |
Warren McCulloch & Walter Pitts — First mathematical model of a neuron |
|
1950 |
Alan Turing proposed the 'Turing Test' to measure machine intelligence |
|
1956 |
John McCarthy coined the term 'Artificial Intelligence' |
|
1966 |
First chatbot ELIZA created at MIT |
|
1997 |
IBM's Deep Blue defeated world chess champion Garry Kasparov |
|
2011 |
IBM Watson won Jeopardy! quiz show |
|
2016 |
Google DeepMind's AlphaGo defeated world Go champion |
|
2022 |
ChatGPT by OpenAI launched — conversational AI for the masses |
2. Categories of Artificial Intelligence
AI can be categorised in two major ways:
- Based on Capabilities (Narrow AI, General AI, Super AI)
- Based on Functionality (Reactive, Limited Memory, Theory of Mind, Self-Aware)
2.1 Based on Capabilities
A) Narrow AI (Weak AI)
Definition: AI that is designed to perform one specific task only. It cannot do anything beyond its programmed purpose.
Also called: Weak AI or Applied AI
Current Status: This is the ONLY type of AI that exists today in practical use
Real-Life Examples:
-
- Google Translate — only translates language, cannot write poetry or drive a car
- Chess-playing AI — only plays chess, nothing else
- Face recognition in phones — only identifies faces
- Music recommendation on Spotify — only recommends songs
Analogy: Like a specialist doctor who is expert in only one field (e.g., a cardiologist treats only heart problems).
B) General AI (Strong AI / AGI)
Definition: AI that can perform any intellectual task that a human can do. It can think, reason, learn, and apply knowledge across multiple domains.
Also called: Strong AI or Artificial General Intelligence (AGI)
Current Status: Does NOT exist yet — it is still a theoretical concept under research
Future Examples (imagined):
-
- A robot that can cook food, drive a car, write code, compose music, and solve math — all by itself
Analogy: Like a genius human who can do everything — doctor, engineer, artist, and teacher.
C) Super AI (Artificial Superintelligence)
Definition: AI that surpasses human intelligence in every possible way — including creativity, wisdom, social skills, and general problem-solving.
Current Status: Purely theoretical — does not exist. Often discussed in science fiction.
Examples (fiction): HAL 9000 from the movie '2001: A Space Odyssey', Skynet from 'Terminator'
Analogy: Imagine a being that is to humans as humans are to ants — vastly more intelligent and capable.
2.2 Comparison Table — Based on Capabilities
|
Feature |
Narrow AI |
General AI |
Super AI |
|
Capability |
Single task only |
Any human task |
Beyond humans |
|
Exists Today? |
Yes |
No (theoretical) |
No (theoretical) |
|
Intelligence Level |
Task-specific |
Human-level |
Superhuman |
|
Example |
Siri, Alexa |
Imagined robots |
Sci-fi AI only |
|
Risk Level |
Low |
Medium |
High (hypothetical) |
2.3 Based on Functionality (Arend Hintze's Classification)
Type 1 — Reactive Machines
Description: The simplest form of AI. Has no memory. Reacts only to the current situation. Cannot use past experiences to make decisions.
Example: IBM Deep Blue (chess computer) — analyses the current board position and plays the best move but remembers nothing from previous games.
Analogy: Like a calculator — it gives the answer based on current input only, forgets everything after.
Type 2 — Limited Memory AI
Description: Can use past data/experiences for a short period to make better decisions. Most modern AI falls under this type.
Examples: Self-driving cars (remember traffic data for a few minutes), ChatGPT (uses conversation history within a session), Virtual assistants like Alexa.
Analogy: Like a taxi driver who remembers the recent traffic jams and takes a different route.
Type 3 — Theory of Mind AI
Description: AI that can understand human emotions, beliefs, desires, and intentions. Can interact socially like humans.
Current Status: Under research. Does not fully exist yet.
Analogy: Like a psychologist who understands what another person feels and responds accordingly.
Type 4 — Self-Aware AI
Description: AI that has its own consciousness, feelings, and self-awareness. Knows that it exists.
Current Status: Purely theoretical. Does not exist.
Analogy: Like a robot that wakes up and knows 'I am a robot. I exist. I have goals.'
3. Machine Learning (ML)
3.1 What is Machine Learning?
Machine Learning is a subset of Artificial Intelligence. It is a technique that allows computers to learn from data and improve their performance over time — WITHOUT being explicitly programmed for every task.
In traditional programming, we write specific rules for the computer. In ML, the computer FINDS the rules by itself by studying patterns in data.
Key Difference: Traditional Programming vs Machine Learning
|
Aspect |
Traditional Programming |
Machine Learning |
|
Input |
Data + Rules (written by programmer) |
Data + Output (examples) |
|
Output |
Output / Answer |
Rules / Model (learned automatically) |
|
Who decides rules? |
Human programmer |
Algorithm (computer) |
|
Example |
If temp > 100, print 'Hot' |
Show 1000 weather records, computer learns patterns |
Simple Analogy for Machine Learning
Think of teaching a child to identify fruits. You don't give the child a rulebook that says 'Apple = red, round, has a stem.' Instead, you show the child hundreds of apples. Over time, the child recognises apples on their own — even ones they've never seen before. Machine Learning works the same way!
3.2 How Does Machine Learning Work?
- Step 1 — Collect Data: Gather large amounts of relevant data (e.g., thousands of images of cats and dogs)
- Step 2 — Prepare Data: Clean and organise the data (remove errors, handle missing values)
- Step 3 — Choose Algorithm: Select the right ML algorithm for the task
- Step 4 — Train the Model: Feed the data into the algorithm; it learns patterns
- Step 5 — Test & Evaluate: Check how accurately the model performs on new data
- Step 6 — Deploy: Use the trained model to make real predictions or decisions
3.3 Key Terminology in ML
|
Term |
Meaning |
|
Dataset |
A collection of data used to train/test a model |
|
Features |
Input variables used for prediction (e.g., age, height, income) |
|
Label / Target |
The output we want to predict (e.g., disease: yes/no) |
|
Model |
The mathematical function/pattern learned by the algorithm from data |
|
Training |
The process of feeding data to the algorithm so it can learn |
|
Testing |
Checking model performance on unseen data |
|
Accuracy |
% of correct predictions made by the model |
|
Overfitting |
Model performs too well on training data but poorly on new data |
|
Underfitting |
Model is too simple — performs poorly even on training data |
4. Types of Machine Learning
Machine Learning is broadly classified into four types:
- Supervised Learning
- Unsupervised Learning
- Semi-Supervised Learning
- Reinforcement Learning
4.1 Supervised Learning
Definition: The algorithm is trained on labelled data — meaning each input has a corresponding correct output. The model learns to map inputs to outputs and can then predict outputs for new inputs.
Key Idea: The computer learns under supervision (guidance) — like a student studying with an answer key.
Real-Life Analogy
Imagine you are preparing for an exam and you have a textbook WITH answers at the back. You study the questions and match them with the answers. Next time you see a similar question, you can answer it correctly. Supervised Learning works exactly like this!
How It Works
- You provide the model with input data AND correct labels
- The model learns the relationship between input and output
- When given new (unlabelled) data, it predicts the correct output
4.2 Unsupervised Learning
Definition: The algorithm is trained on UNLABELLED data. There is no correct answer provided. The model must find hidden patterns, structures, or groups in the data on its own.
Key Idea: The computer learns without supervision — like a student with only a textbook but no answer key.
Real-Life Analogy
Imagine you walk into a room full of fruits that nobody has labelled. You start grouping them yourself — this pile looks like yellow ones, these are round ones, these are small ones. You find patterns without being told the categories. That is Unsupervised Learning!
4.3 Semi-Supervised Learning
Definition: A combination of Supervised and Unsupervised Learning. Uses a SMALL amount of labelled data and a LARGE amount of unlabelled data. This is useful when labelling data is expensive or time-consuming.
Key Idea: Learn from a few examples + many unanswered examples.
Real-Life Analogy
Imagine a classroom where only 5 students have answer books, but there are 100 students. The 5 students with answers guide the rest. The whole class learns together using a mix of guided and self-directed study. That is Semi-Supervised Learning!
Real-Life Examples
- Google Photos — you label a few photos of a person; the system finds all other photos of that person
- Medical Imaging — only a few X-rays are labelled by doctors; model learns from both
- Web Content Classification — only some websites are manually classified; model learns the rest
- Speech Recognition — limited transcribed audio + large amount of raw audio
4.4 Reinforcement Learning (RL)
Definition: An agent learns to make decisions by interacting with an environment. It receives rewards for correct actions and penalties for wrong actions. The goal is to maximise the total reward over time.
Key Components:
-
- Agent — the learner / decision maker (e.g., a robot)
- Environment — the world the agent interacts with
- State — the current situation of the agent
- Action — what the agent does
- Reward — feedback: positive (reward) or negative (penalty)
- Policy — the strategy the agent follows to get maximum reward
Real-Life Analogy
Think of training a puppy. When the puppy sits on command, you give it a treat (reward). When it misbehaves, you say 'No' (penalty). Over time, the puppy learns which actions earn treats. Reinforcement Learning works exactly this way — the AI learns by trial and error!
Real-Life Examples
- Video Games — AI learns to play and win games (AlphaGo, OpenAI Five for Dota 2)
- Self-Driving Cars — learns to navigate roads by trial and error in simulation
- Robotics — robot learns to walk, pick objects
- Recommendation Systems — learns what content keeps users engaged longer
- Stock Trading Bots — learns to buy/sell to maximise profit
- ChatGPT Training — uses Reinforcement Learning from Human Feedback (RLHF)
5. Differences Between AI, ML, and Types of ML
5.1 AI vs Machine Learning
|
Point of Difference |
Artificial Intelligence |
Machine Learning |
|
Definition |
Simulating human intelligence in machines |
Subset of AI — learning from data automatically |
|
Scope |
Broader field (includes ML, Robotics, NLP, etc.) |
Narrower — focuses only on learning from data |
|
Goal |
Make machines smart in general |
Make machines improve with experience |
|
Approach |
Rule-based + learning-based |
Primarily data-driven |
|
Dependency |
AI does not require ML always |
ML always requires AI principles |
|
Example |
Siri (overall AI system) |
Siri's speech recognition engine (ML model) |
|
Analogy |
The human brain as a whole |
The ability to learn new skills |