Aiml Unit-1
Aiml Unit-1
UNIT-1
Interduction: Definition of Artificial Intelligence, Evolution, Need, and applications in real
world. Intelligent Agents, Agents and environments; Good Behavior -The concept of rationality
the nature of environments, structure of agents. Neural Networks and Genetic Algorithms;
Neural network representation, problems perceptrons, multilayer networks and back
propagation algorithms, Genetic algorithms
P a g e 1 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 2
5. Facial Recognition
o Example: FaceID on iPhones uses AI to recognize your face and unlock your
phone. Similarly, airports use AI-powered facial recognition to identify
passengers quickly and improve security. AI is also used in social media
platforms like Facebook to automatically tag people in photos.
6. AI in Healthcare
o Example: AI is used to help doctors diagnose diseases. For example, AI systems
can analyze X-rays, MRIs, or CT scans and find patterns that indicate diseases
like cancer or heart disease. AI is also used to help predict a patient’s risk for
certain conditions based on medical data.
7. Smart Home Devices
o Example: Devices like Nest Thermostat use AI to learn your temperature
preferences and adjust accordingly to save energy. Ring Doorbell uses AI for
facial recognition and motion detection, alerting homeowners when someone is
at the door or when motion is detected outside.
8. AI in Finance
o Example: Banks use AI for fraud detection by analyzing transaction patterns
and identifying unusual activity. Robo-advisors, like those offered by
Betterment and Wealthfront, use AI to help manage investment portfolios and
make financial recommendations.
9. Autonomous Drones
o Example: Amazon Prime Air and other companies are using AI-powered
drones to deliver packages. The drones navigate through the air using AI to
avoid obstacles and find the most efficient delivery routes.
10. AI in Retail
• Example: Amazon Go stores use AI to allow customers to shop without going to a
checkout counter. Sensors and cameras track what customers pick up and automatically
charge them when they leave the store.
11. AI in Education
• Example: AI-powered tutoring systems, like Knewton and Socratic, help students
learn by providing personalized learning experiences. AI can track a student's progress
and offer custom lessons based on their strengths and weaknesses.
12. AI in Agriculture
• Example: AI-powered drones and sensors are used to monitor crop health, predict
harvest times, and detect pests. John Deere uses AI in its machinery to optimize
planting, fertilization, and harvesting.
P a g e 2 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 3
13. AI in Sports
• Example: In professional sports, AI is used to track player performance, analyze
strategies, and predict game outcomes. For example, AI can analyze soccer players
movements and help coaches understand how to improve their team’s tactics.
14. AI in Entertainment and Media
• Example: AI is used to create realistic visual effects in movies and TV shows.
Companies like Disney use AI for animation, motion capture, and to generate
computer-generated characters. AI also helps in creating deepfake videos, where an
actor’s face can be swapped with another person’s using AI technology.
P a g e 3 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 4
P a g e 4 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 5
• Voice assistants like Siri, Alexa, and Google Assistant, which use AI to understand
and respond to human speech.
• AI in healthcare, where AI can help doctors diagnose diseases from medical images,
analyze health data, and predict patient outcomes.
Key Idea: Deep Learning has allowed AI to perform complex tasks like recognizing images,
understanding speech, and even making decisions in real-time.
Summary of AI Evolution
• 1950s - 1960s: The idea of AI was born, and early experiments tried to simulate human
thinking.
• 1960s - 1970s: AI grew with rule-based systems, but progress was slow.
• 1970s - 1990s: AI faced a slowdown due to limitations, known as the AI Winter.
• 1990s - 2000s: AI shifted to Machine Learning, allowing computers to learn from data.
• 2010s - Present: AI exploded with Deep Learning, improving tasks like image
recognition and voice processing.
• Future: AI may become even smarter, with the potential for Artificial General
Intelligence (AGI).
The evolution of AI shows how far we've come, from simple ideas to powerful technologies,
and there is still much more to come!
P a g e 5 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 6
3. AI Improves Decision-Making
Why is this important?
Humans can make decisions based on experience, intuition, or available information.
However, AI can make decisions based on large amounts of data much faster than a human
can. This helps people make better, more informed choices.
• AI systems can analyze data and give recommendations that might be too complex
for humans to calculate easily.
P a g e 6 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 7
• AI can also predict outcomes. For example, AI can predict the weather, the stock
market, or even a person's likelihood of developing a health problem.
Example: In business, AI helps companies decide what products to sell, how to price them,
and where to advertise by analyzing past sales data and trends. This can lead to better profits
and smarter strategies.
P a g e 7 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 8
1. Supervised Learning
In supervised learning, the machine is given labeled data to learn from. Labeled data means
that for each piece of data, we already know the correct answer (like knowing that a picture
shows a cat or a dog).
P a g e 9 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 10
How it works:
• You provide the machine with lots of data and the correct answers (labels).
• The machine looks at these examples, learns the patterns, and uses those patterns to
predict the answer for new data.
Example: If you want to teach a computer to identify fruits, you give it lots of pictures of fruits
along with their names (apple, banana, orange, etc.). Over time, the computer learns to
recognize fruits based on the patterns in the images.
Real-life example: Email spam filters: Supervised learning is used to train spam filters. You
give the computer emails that are marked as "spam" or "not spam." The computer learns from
these examples and then can predict whether a new email is spam.
2. Unsupervised Learning
In unsupervised learning, the machine is given unlabeled data, meaning the machine doesn't
know the correct answer. The goal is for the machine to find patterns or group the data on its
own.
How it works:
• You give the machine a large amount of data without any labels or answers.
• The machine looks for patterns and tries to group similar things together.
Example: If you give the machine a collection of pictures without telling it what’s in the
pictures, the machine might group similar pictures together, such as all the images of animals
in one group and all the images of buildings in another.
Real-life example: Customer segmentation: Unsupervised learning is often used in
marketing. A company might have customer data but not know how to categorize them. The
machine can group customers based on their behaviors (like shopping habits or interests) to
help the company target their marketing efforts.
3. Semi-Supervised Learning
This combines labeled and unlabeled data. It’s helpful when labeling data is expensive or
time-consuming.
• Example:
A dataset has 1000 images of cats and dogs, but only 100 are labeled. The model uses
labeled images to learn basic patterns and then applies this knowledge to classify the
unlabeled images.
• Real-Time Example:
o Medical Diagnosis: Doctors may label a few medical images with diseases, and
the model uses these to learn and classify other unlabeled images.
P a g e 10 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 11
4.Reinforcement Learning
In reinforcement learning, the machine learns by trial and error, just like how a child learns
to ride a bicycle. It tries things, makes mistakes, and gets feedback (rewards or punishments),
which helps it improve its actions over time.
How it works:
• The machine is given a goal or task but doesn’t know how to achieve it at first.
• It takes actions and receives feedback (positive or negative) based on how well it did.
• Over time, the machine learns which actions lead to good results (rewards) and which
lead to bad results (punishments).
Example: If you teach a computer to play a game like chess or Go, the machine makes moves,
gets points for good moves, and loses points for bad moves. After playing many games, it learns
the best strategy.
Real-life example: Self-driving cars use reinforcement learning to make decisions. The car
"learns" by driving in different situations (like in traffic or during bad weather) and adjusts its
behavior to improve over time.
driving cars. Machine learning can be divided into three main types: supervised learning,
unsupervised learning, and reinforcement learning, each with different ways of helping
computers learn and solve problems. As machine learning continues to grow, it will play an
even bigger role in shaping the future of technology.
intelligent agent can think ahead, learn from past mistakes, and adjust to changes in the
environment.
• Example: A self-driving car is an intelligent agent. It senses its environment (like other
cars, pedestrians, and traffic signs) and makes decisions (like when to stop or turn) to
drive safely. It can also improve over time by learning from past experiences.
3. What is an Environment?
An Environment is the world or surroundings in which the agent operates. It includes
everything the agent can perceive and interact with. The environment provides the agent with
the information it needs (like pictures, sounds, or data), and the agent uses this to decide what
actions to take.
• Example: The environment for the robot vacuum cleaner is the house it cleans. The
environment for the self-driving car is the road and traffic it drives on.
4. How Do Agents and Environments Interact?
Agents interact with their environments through sensors and actuators.
P a g e 13 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 14
• Sensors allow the agent to observe its environment. For example, a robot vacuum might
have sensors to detect dirt, obstacles, and walls.
• Actuators allow the agent to take actions. For instance, the vacuum might have wheels
that let it move, and brushes that allow it to clean.
The agent’s goal is usually to do something that improves its state in the environment. It
perceives the environment (using sensors), decides what to do based on its goals, and acts on
that decision (using actuators). After the action, it gets new information from the environment,
which it uses to make the next decision.
• Example: If the robot vacuum senses a lot of dirt in one area, it might decide to clean
more in that area. If it detects an obstacle, it may change its direction.
5. Key Characteristics of Intelligent Agents
• Autonomy: An intelligent agent can make its own decisions, without needing human
help.
• Adaptability: It can learn and improve based on experiences.
• Reactivity: It can respond to changes in the environment.
• Goal-Oriented: It works towards achieving specific goals.
Putting It All Together
Let’s use an example to see how all these concepts fit together:
Imagine you have a robot (agent) in your living room (environment). The robot is designed to
clean the floor.
• The robot uses sensors to detect dirt on the floor, obstacles (like furniture), and walls.
• It then uses actuators (wheels and cleaning brushes) to move around and clean the
floor.
• The robot’s goal is to clean the entire floor efficiently.
If the robot is intelligent, it might learn the most efficient paths, or adapt to new challenges,
like cleaning a bigger area or avoiding new obstacles. As it moves around, it perceives its
P a g e 14 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 15
environment (sensing dirt and obstacles) and decides how to act (whether to clean more in one
area or avoid an obstacle). It constantly interacts with the environment, improving its actions
as it learns more.
Summary:
• Agent: A thing that takes actions to achieve a goal.
• Intelligent Agent: An agent that can learn, adapt, and make decisions based on its
experiences.
• Environment: The surroundings where the agent operates and perceives information
from.
• Interaction: The agent senses the environment, makes decisions, and takes actions.
P a g e 15 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 16
The environment refers to everything that an agent interacts with and perceives, and it plays
a crucial role in determining how an agent behaves.
The environment can have different types and complexities depending on how much control
the agent has over it and how predictable or unpredictable the environment is.
Types of Environments:
1. Fully Observable vs. Partially Observable:
o Fully Observable: The agent can see everything in the environment. For
example, in a chess game, the agent (player) can see the entire board.
o Partially Observable: The agent can only see part of the environment. For
example, a self-driving car only perceives what its sensors can detect (it doesn't
know the full surroundings beyond its sensors).
2. Deterministic vs. Stochastic:
o Deterministic: The environment behaves in a predictable way, meaning if the
agent takes the same action in the same state, it will always get the same result.
For example, in a game of chess, the rules are deterministic—if you move a
piece, the next move will follow a set pattern.
o Stochastic: The environment has random elements, and the same action might
lead to different results. For example, in a game of Monopoly, rolling the dice
leads to random movements and outcomes.
3. Static vs. Dynamic:
o Static: The environment does not change while the agent is making decisions.
For example, a board game like chess is static, as nothing changes unless the
player makes a move.
o Dynamic: The environment can change while the agent is deciding or acting.
For example, a self-driving car is in a dynamic environment because traffic,
pedestrians, and road conditions can change rapidly.
4. Discrete vs. Continuous:
o Discrete: The environment is made up of distinct, separate states. For example,
a turn-based game like tic-tac-toe has discrete moves and turns.
o Continuous: The environment involves a continuous flow of states. For
example, a self-driving car operates in a continuous environment, where
movements and sensor data are constantly changing.
Example of Nature of Environment:
• Self-Driving Car: The car operates in a partially observable, dynamic, and stochastic
environment. The car can only see a part of the road and surroundings (like other cars
or pedestrians). The environment is dynamic because things like traffic conditions or
pedestrians can change unexpectedly. The car also faces random events like sudden
changes in weather or road conditions.
P a g e 16 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 17
P a g e 17 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 18
P a g e 18 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 19
P a g e 19 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 20
Example:
• Task: Classifying an email as spam or not spam.
• Input: Features such as the number of times a certain word appears (like “free” or
“offer”).
• Output: 1 (spam) or 0 (not spam), based on the perceptron’s calculation.
Limitation of Perceptrons:
A perceptron can only solve linearly separable problems. This means it can only correctly
classify data that can be divided into two groups by a straight line. If the data is more
complex (like non-linear data), the perceptron won’t work well.
The Backpropagation Algorithm is used to train neural networks. It helps the network learn
from its mistakes by adjusting the weights to minimize errors in predictions. It works by:
1. Forward pass: Data is passed through the network to produce an output.
2. Calculate error: The network compares its output with the correct answer (target) and
calculates the error.
3. Backward pass: The error is sent backward through the network, and the weights are
adjusted.
4. Optimization: The weights are adjusted using a method like gradient descent to
minimize the error and improve predictions.
Example:
Imagine training a neural network to recognize handwritten digits (0-9). Initially, the network
might make many wrong predictions. Using backpropagation, the network adjusts its weights
by comparing predicted results with the correct labels (like 5, 3, etc.), gradually improving its
accuracy.
P a g e 21 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 22
mutation, the algorithm generates new routes, improving them over time, until it finds the best
one.
P a g e 22 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 23
P a g e 23 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 24
• Construct a scenario where a goal-based agent performs better than a reflex agent.
• Analyze the differences between partially observable and fully observable
environments.
• Compare episodic vs. sequential tasks in agent environments.
• Assess the effectiveness of utility-based agents in decision-making processes.
• Propose a framework for designing an agent for a smart home system.
P a g e 24 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 25
5. Structure of Agents
• What are the main components of an agent’s structure?
• Explain the role of sensors and actuators in an AI agent.
• Describe the agent function and agent program.
• Design a simple reflex agent for a basic task like navigating a maze.
• Compare learning agents with simple reflex agents.
• Analyze the need for incorporating memory into an agent’s structure.
• Assess the strengths and weaknesses of model-based agents.
• Develop an agent structure for managing warehouse inventory efficiently.
6. Neural Networks
• Define a perceptron.
• What is backpropagation?
• Explain the need for multilayer networks in solving non-linear problems.
• Describe the vanishing gradient problem in neural networks.
• Construct a simple neural network for classifying basic shapes.
• Solve a linear separable problem using a perceptron.
• Compare the performance of single-layer and multilayer perceptrons.
• Analyze the challenges in training deep neural networks.
• Evaluate the effectiveness of backpropagation in minimizing error.
• Design a neural network for image recognition.
7. Genetic Algorithms
• What is a genetic algorithm?
• Define the terms: population, crossover, mutation, and fitness function.
• Explain how genetic algorithms mimic natural selection.
• Describe the significance of the fitness function in genetic algorithms.
• Apply a genetic algorithm to solve an optimization problem (e.g., traveling salesman).
• Compare genetic algorithms with traditional optimization methods.
P a g e 25 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 26
Integrated/General Questions
1. How can neural networks and genetic algorithms be combined to create intelligent
systems?
2. Compare the role of rational agents and neural networks in AI systems.
3. Propose a real-world application that integrates intelligent agents, neural networks, and
genetic algorithms.
P a g e 26 | 27
ARTIFICIAL INTELLIGENCE & MACHINE LEARNING III-MECHANICAL SEM-II 27
5. Neural Networks
• Question: Explain the working of the backpropagation algorithm in neural networks.
Use an example to illustrate how it adjusts weights to minimize error.
(Focus: Key mechanism behind training neural networks.)
• Question: Discuss the limitations of perceptrons in solving non-linear problems. How
do multilayer networks overcome these limitations?
(Focus: Transition from single-layer to multi-layer architectures.)
6. Genetic Algorithms
• Question: Describe the steps of a genetic algorithm, including population
initialization, selection, crossover, and mutation, with an example.
(Focus: Understanding the process of genetic algorithms.)
• Question: Apply a genetic algorithm to solve an optimization problem like the
traveling salesman problem. Illustrate your approach.
(Focus: Practical implementation of genetic algorithms.)
Integrated Topics
• Question: Compare neural networks and genetic algorithms in solving optimization
and learning problems. Highlight their strengths and limitations.
(Focus: Comparative analysis of the two approaches.)
• Question: Design a hybrid system that combines neural networks and genetic
algorithms for a real-world application. Explain the roles of each component in your
system.
(Focus: Innovation and practical application.)
P a g e 27 | 27