Artificial Intelligence

Unit 2: Advanced Concepts of Modeling in AI - AI, ML, DL, Machine Learning Models & Neural Networks

Class 10 · Artificial Intelligence

Unit 2: Advanced Concepts of Modeling in AI

Building an Artificial Intelligence project requires working with models or algorithms. These models may be designed from scratch or adapted from pre-existing models. Before understanding different modeling techniques, it is important to understand the relationship between Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL).

In This Unit

  • AI, Machine Learning and Deep Learning
  • Common terminologies used with data
  • Rule-Based and Learning-Based Models
  • Supervised, Unsupervised and Reinforcement Learning
  • Classification and Regression
  • Clustering and Association
  • Artificial Neural Networks
  • How AI makes a decision using Inputs, Weights and Bias

2.1 Revisiting AI, ML and DL

The relationship between AI, ML and DL can be understood using an umbrella approach.

AI is the broad umbrella → ML is a subset of AI → DL is a subset of ML.

1. Artificial Intelligence (AI)

Artificial Intelligence (AI) is the umbrella terminology referring to any technique that enables computers to mimic human intelligence.

An artificially intelligent machine works on data and algorithms fed to it to produce a desired output.

2. Machine Learning (ML)

Machine Learning (ML) is a subset of Artificial Intelligence that enables machines to improve at tasks through experience.

ML models learn from new data and use that experience to improve their future performance, taking into account mistakes and exceptions.

Examples:

  • Anomaly detection in heart-rate monitors
  • Object classification in photographs

3. Deep Learning (DL)

Deep Learning (DL) is a subset of Machine Learning and represents a more advanced approach to learning from large amounts of data.

It enables software to train itself using vast amounts of data and multiple machine learning algorithms working together, often using Artificial Neural Networks (ANN).

Examples:

  • Identifying a bird from pixels
  • Recognizing handwritten digits

AI vs ML vs DL

Concept Meaning Relationship Example
AI Enables computers to mimic human intelligence. Broadest concept Intelligent decision-making system
ML Enables machines to improve through experience and data. Subset of AI Spam detection
DL Uses large amounts of data and multiple algorithms, often through neural networks. Subset of ML Handwritten digit recognition
Remember: Every Deep Learning system is a Machine Learning system, and every Machine Learning system belongs to the broader field of Artificial Intelligence.

Common Terminologies Used with Data

AI models become intelligent based on the data with which they are trained. The following terms are commonly used while working with data.

Term Meaning Example
Data Information in any form, such as a table containing information about different items. Student marks, attendance, names
Features Columns or characteristics that describe data points. Colour, weight, height
Labels Tags or meanings attached to data according to the problem being solved. Fruit type such as Apple or Mango
Labeled Data Data that has a tag or label attached to it. Email marked as Spam
Unlabeled Data Raw data without tags or labels. Images without identified categories
Training Data Set A collection of examples given to a model so that it can learn patterns. Solved examples given to a student before an examination
Testing Data Set Data used to test the accuracy and performance of a trained model. New questions given in a class test

Student-Friendly Example

Suppose we have data about fruits:

Colour Weight Fruit Type
Red 150 g Apple
Yellow 120 g Banana

Here, Colour and Weight are features, while Fruit Type is the label.

Competency-Based Questions

Q1. Srishti is learning about machines that perform tasks using vast amounts of data and neural networks. Which term refers to this specific approach?

  1. Machine Learning
  2. Deep Learning
  3. Data Science
  4. Rule-Based AI

Answer: b) Deep Learning

Q2. Assertion and Reasoning

Assertion (A): The training data set is always larger compared to the testing data set.

Reason (R): A model needs a significant amount of data to analyze patterns and learn effectively before it can be tested on unseen data.

  1. Both A and R are true and R is the correct explanation.
  2. Both A and R are true but R is not the correct explanation.
  3. A is true but R is false.
  4. A is false but R is true.

Answer: a)

Q3. Application Task: You have a dataset of 1,000 images of stray dogs. You do not know their breeds or colours, so you feed them into an AI model to find patterns and groups.

Q: What do we call the images in this raw form?

Answer: Unlabeled Data

Q: Which AI domain is most likely being used if the system identifies these dogs from pixels?

Answer: Computer Vision


2.2 Modelling

AI Modelling refers to the process of developing algorithms or models that can be trained to produce intelligent outputs.

Generally, there are two primary approaches for building AI models:

1. Rule-Based Approach

2. Learning-Based Approach

1. Rule-Based Approach

In a Rule-Based Approach, relationships or patterns in the data are defined by the developer.

The machine follows specific instructions or rules provided by the programmer.

How It Works

The machine is provided with data + rules. It then reacts according to those predefined rules to produce the desired output.

Example

A website FAQ chatbot may contain the rule:

IF message contains "track order"
THEN provide order tracking information.

Major Drawback

Rule-based learning is static. Once the rules are defined, the model does not automatically learn from changes in the data or user feedback.

If the machine receives data that differs from the predefined rules, it may fail to produce the correct output.

2. Learning-Based Approach

A Learning-Based Approach enables a computer to learn how to perform a task by looking at examples or receiving feedback, similar to how humans learn from experience.

How It Works

Instead of explicitly programming every rule, the machine is provided with data and desired outputs. It identifies patterns and develops its own rules or algorithm to connect inputs with outputs.

Adaptability

Learning-based models are adaptive. When data changes, the model can modify itself to handle new patterns and exceptions.

Examples

  • Unlabeled Data: A model receives 1,000 random images of stray dogs and identifies groups based on features such as colour, size and fur style.
  • Labeled Data: A spam filter learns patterns that distinguish spam emails from legitimate emails.

Rule-Based vs Learning-Based Approach

Feature Rule-Based Approach Learning-Based Approach
Logic Defined By Developer / Human Machine / Self-learned
Input Data + Rules Data + Output
Flexibility Static Adaptive
Ability to Handle New Patterns Limited Can adapt to new data
Example FAQ Chatbot Spam Filter / Image Clustering

Competency-Based Questions

Q1. A teacher uses a rule-based program to grade essays based on specific keywords. When students use new expressions not included in the rules, the program gives incorrect grades. What is the reason?

  1. Not enough training essays.
  2. The rule-based approach is static and cannot adapt.
  3. The essays were too long.
  4. The program was not tested.

Answer: b) The rule-based approach is static and cannot adapt.

Q2. Assertion and Reasoning

Assertion (A): Machine learning is considered an extension of the rule-based approach.

Reason (R): A rule-based model only does what it has been taught once, whereas machine learning allows the machine to adapt to changes in data.

  1. Both A and R are true and R is the correct explanation.
  2. Both A and R are true but R is not the correct explanation.
  3. A is true but R is false.
  4. Both A and R are false.

Answer: a)

Q3. Application Task: You want to build a model that recommends music to students. You have a massive database of what they listen to, but the songs are not labeled as "happy" or "sad."

Q: Which approach should you use?

Answer: Learning-Based Approach, because the data is unlabeled and the machine needs to discover patterns such as grouping similar songs.


Categories of Machine Learning-Based Models

Learning-based approaches include Machine Learning and Deep Learning. Machine Learning models are generally divided into three primary categories:

  1. Supervised Learning
  2. Unsupervised Learning
  3. Reinforcement Learning

1. Supervised Learning

Supervised Learning works with a labeled dataset. The machine learns from examples where the correct output is already known.

It is similar to a teacher providing solved examples to a student and then asking the student to solve new questions.

Goal: Determine relationships through training.

Examples:

  • Identifying a coin based on its weight
  • Email spam filtering
  • Identifying a person in a tagged photograph

2. Unsupervised Learning

Unsupervised Learning works with an unlabeled dataset. The machine discovers patterns, relationships and trends without predefined labels.

Goal: Discover hidden patterns within data.

Examples:

  • Grouping supermarket customers according to purchase behaviour
  • Content recommendations
  • Identifying suspicious transaction patterns

3. Reinforcement Learning

Reinforcement Learning enables a computer to make a series of decisions to maximize a reward for a task.

The machine learns through trial and error. Correct actions receive positive feedback, while incorrect actions receive negative feedback.

Examples:

  • Self-driving cars learning to park
  • Humanoid robots learning to walk
  • AI agents learning to play games

Comparison of Machine Learning Models

Feature Supervised Learning Unsupervised Learning Reinforcement Learning
Data Type Labeled Data Unlabeled Data No pre-existing data required
Primary Goal Determine relationships Discover new patterns Maximize rewards
Learning Path With guidance Without guidance Trial and error
Nature Guided learning Pattern discovery Highly adaptive
Quick Memory Trick:
Supervised = Teacher
Unsupervised = Discover
Reinforcement = Reward

Case Study: The "New Species" Researcher

A researcher has a dataset of 1,000 images of various animals and birds but has no labels for them. The researcher wants the machine to find patterns and group them.

Q: Which learning model should be used?

Answer: Unsupervised Learning.

Reason: The dataset is unlabeled. The machine identifies features such as wings, fur or size and groups the data according to similarities.

Competency-Based Questions

Q1. Which type of machine learning uses an agent that learns from rewards and penalties while playing a game?

  1. Supervised Learning
  2. Unsupervised Learning
  3. Reinforcement Learning
  4. Deep Learning

Answer: c) Reinforcement Learning

Q2. Assertion and Reasoning

Assertion (A): Unsupervised Learning is a type of learning without guidance.

Reason (R): Unsupervised learning models work on unlabeled datasets where the machine must identify hidden patterns on its own.

  1. Both A and R are true and R is the correct explanation.
  2. Both A and R are true but R is not the correct explanation.
  3. A is true but R is false.
  4. Both A and R are false.

Answer: a)

Q3. Short Answer: How is Reinforcement Learning different from Supervised and Unsupervised Learning?

Answer: Reinforcement Learning uses a reward mechanism and learns through trial and error. It is useful in complex or unforeseen environments where there may not be sufficient pre-existing data or knowledge.


Sub-Categories of Supervised Learning

Supervised Learning has two primary sub-categories:

Classification and Regression

1. Classification Model

A Classification Model is used when data is divided into distinct categories or classes.

The model learns from historical labeled data and assigns a new input to one of the predefined groups.

Goal: Predict a label or category.

Examples:

  • Student grading: Grade A, Grade B or Grade C
  • Email: Spam or Inbox
  • Loan eligibility: Yes or No
  • Weather: Hot or Cold

2. Regression Model

A Regression Model predicts a specific numerical value. Instead of placing data into categories, it estimates a numerical output.

Goal: Predict a quantity or continuous numerical value.

Examples:

  • House price prediction
  • Salary estimation
  • Used car price prediction
  • Exact temperature prediction

Classification vs Regression

Feature Classification Regression
Output Type Discrete / Categorical Continuous / Numerical
Goal Sort into groups Predict a numerical value
Example Spam / Not Spam ₹4,50,000

School Example: Sports Day Trial

Task Model Reason
Decide whether a student is Selected or Not Selected Classification Output consists of categories.
Predict the exact 100m sprint time, e.g. 12.4 seconds Regression Output is a numerical value.

Case Study: School Canteen AI

A student is building two AI models for the school canteen.

  • Model A: Predicts whether the canteen will run out of samosas today — Yes/No.
  • Model B: Predicts exactly how many plates of pasta will be sold — e.g. 54 plates.

Answer:

  • Model A → Classification
  • Model B → Regression

If the model predicts whether the weather will be Rainy, Sunny or Cloudy, it is also a Classification task because the outputs are categories.

Competency-Based Questions

Q1. Which algorithmic model would you use when you have to predict a continuous-valued output, such as predicting the price of a used car?

  1. Clustering
  2. Classification
  3. Regression
  4. Association

Answer: c) Regression

Q2. Assertion and Reasoning

Assertion (A): Predicting whether a customer is eligible for a bank loan is a Regression task.

Reason (R): Regression models work on continuous data and predict numerical outcomes.

  1. Both A and R are true and R is the correct explanation.
  2. Both A and R are true but R is not the correct explanation.
  3. A is false but R is true.
  4. Both A and R are false.

Answer: c)

Explanation: Loan eligibility is a Classification task because the output is a discrete value such as Yes or No.

Q3. Short Answer: Differentiate between the datasets used in Classification and Regression models.

Answer: Classification models work with discrete data where data points are assigned to specific categories or labels. Regression models predict continuous numerical values within a range.


Sub-Categories of Unsupervised Learning

Unsupervised Learning works on unlabeled datasets. Two important sub-categories are:

1. Clustering   |   2. Association

1. Clustering Model

Clustering is the process of dividing data points into different groups or clusters based on the similarity of their characteristics.

The model identifies patterns in unknown data and groups similar objects together.

Classification vs Clustering

Classification Clustering
Supervised Learning Unsupervised Learning
Uses labeled data Uses unlabeled data
Assigns data to predefined classes Discovers groups based on similarity
Classes are already known Groups are discovered by the model

Examples:

  • Grouping animal and bird images
  • Music recommendations based on similarity
  • Customer segmentation

2. Association Model

Association is an unsupervised learning method used to find interesting relationships or dependencies between variables in a large database.

It analyzes historical patterns to determine the probability of one event or item occurring based on another.

Example: Market Basket Analysis

A supermarket analyzes purchase patterns and discovers that customers who buy bread often also buy butter.

Therefore, when a customer buys bread, the system may recommend butter.

Clustering vs Association

Feature Clustering Association
Primary Goal Divide data into groups based on similarity. Find relationships between variables.
Action Groups items that are similar. Finds items that frequently occur together.
Example Grouping users according to interests. Identifying products commonly purchased together.

Case Study: Music Discovery

A music application creates a Daily Mix by grouping similar songs based on musical features such as tempo and intensity. It also suggests merchandise that other fans commonly purchase together.

Q1: Which model creates the Daily Mix?

Answer: Clustering Model

Q2: Which model suggests merchandise commonly purchased together?

Answer: Association Model

Competency-Based Questions

Q1. Which algorithmic model would you use if you want to organize unlabeled input data into groups based on features?

  1. Classification
  2. Regression
  3. Clustering
  4. Association

Answer: c) Clustering

Q2. Assertion and Reasoning

Assertion (A): Clustering is considered an unsupervised learning task.

Reason (R): It involves assigning an input image one label from a fixed set of predefined categories.

  1. Both A and R are true and R is the correct explanation.
  2. Both A and R are true but R is not the correct explanation.
  3. A is true but R is false.
  4. Both A and R are false.

Answer: c)

Explanation: The Assertion is true, but the Reason describes Classification, not Clustering. Clustering works with unlabeled data and discovers groups based on similarities.

Q3. Application Task: A grocery store wants to understand which products are commonly bought together to improve its shelf arrangement.

Answer: Association Model


2.3 Neural Networks

Artificial Neural Networks (ANNs) are advanced machine learning systems designed to process large and complex datasets efficiently.

What is a Neural Network?

A Neural Network is a system of organized machine learning algorithms loosely modeled on how neurons in the human brain behave.

Its primary purpose is to solve problems involving large and complex datasets, such as image recognition and handwriting identification.

Key Advantage

Neural networks can automatically extract useful features from data without requiring a human programmer to explicitly define every feature.

Architecture of a Neural Network

A neural network is divided into multiple layers. Each layer contains several blocks called nodes. Each node acts as a small processing unit.

Layer Function
Input Layer Acquires data and feeds it into the system. No processing occurs here.
Hidden Layer(s) Performs processing and computation. There may be multiple hidden layers.
Output Layer Provides the final result to the user.

Learning Process of a Neural Network

  1. The network receives input data.
  2. It produces an output.
  3. The output is compared with the desired output.
  4. The error is identified.
  5. The network adjusts its internal weights.
  6. The process is repeated until the network learns to produce an appropriate output.
Neural Network Learning: Trial → Output → Error → Adjust Weights → Try Again

Applications of Neural Networks

  • Facial recognition
  • Customer support chatbots
  • Price prediction
  • Handwriting recognition
  • Image recognition

How Does AI Make a Decision?

A simplified model called a Perceptron can be used to understand how an AI system arrives at a decision.

Decision-making involves four important components:

  1. Inputs
  2. Weights
  3. Bias
  4. Calculation and Threshold

1. Inputs

Inputs are the different pieces of information considered by the AI.

For example, while deciding whether to go to a park, the inputs may include:

  • Is it sunny?
  • Do I have an umbrella?

2. Weights

Each input is assigned a numerical weight representing its importance.

Different inputs can have different weights depending on their importance during decision-making.

3. Bias

Bias (B) is an additional value added to the calculation. It can represent a preference or cautiousness in the decision.

4. Calculation

Inputs are converted into numerical values, such as:

  • 1 = Yes
  • 0 = No

The machine then performs a mathematical calculation:

y = Σ (weight × input) + bias

5. Threshold Comparison

The calculated value is compared with a threshold.

Condition Decision
Output is higher than the threshold Yes
Output is lower than the threshold No

Simple Example

Suppose an AI has to decide whether a student should participate in an outdoor activity. It considers factors such as weather and availability of an umbrella.

Component Meaning
Input Weather condition, umbrella availability
Weight Importance assigned to each input
Bias Additional value influencing the decision
Calculation Weighted sum of inputs plus bias
Threshold Value against which the final result is compared
Output Final decision
Key Point: Different AI models may make different decisions for the same situation because their internal weights and biases may be different.

Quick Revision: Unit 2 at a Glance

Topic Key Point
AI Broad field of making computers mimic human intelligence.
ML Subset of AI that learns from experience and data.
DL Subset of ML using large amounts of data and often neural networks.
Feature Characteristic or column describing data.
Label Tag or known output associated with data.
Rule-Based Uses predefined rules created by humans.
Learning-Based Learns patterns from data and can adapt.
Supervised Learning Uses labeled data.
Unsupervised Learning Uses unlabeled data.
Reinforcement Learning Learns through rewards, penalties and trial-and-error.
Classification Predicts categories.
Regression Predicts numerical values.
Clustering Groups similar unlabeled data.
Association Finds relationships between items or variables.
Neural Network Layered system of nodes inspired by biological neurons.
Perceptron Simplified model used to understand AI decision-making.
Weight Represents the importance of an input.
Bias Additional value influencing the calculation.

Exam Memory Map

AI → Umbrella

ML → Learns from Data

DL → Neural Networks + Large Data

Supervised → Labeled Data → Classification / Regression

Unsupervised → Unlabeled Data → Clustering / Association

Reinforcement → Reward + Trial and Error

Classification → Category

Regression → Numerical Value

Clustering → Similar Groups

Association → Items That Go Together

Neural Network → Input → Hidden → Output

AI Decision → Inputs × Weights + Bias → Threshold → Output