0% found this document useful (0 votes)
8 views20 pages

AIML-Unit 1 Notes-Assignment 1

The document provides an introduction to Artificial Intelligence (AI) and Machine Learning, covering definitions, evolution, and applications in various fields such as healthcare, finance, and autonomous vehicles. It discusses intelligent agents, their structure, types, and the concept of rationality, as well as neural networks, perceptrons, and the backpropagation algorithm. The document emphasizes the importance of AI in automating tasks, data processing, and solving complex problems, while also addressing challenges like data requirements and interpretability.

Uploaded by

Uday Sai
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)
8 views20 pages

AIML-Unit 1 Notes-Assignment 1

The document provides an introduction to Artificial Intelligence (AI) and Machine Learning, covering definitions, evolution, and applications in various fields such as healthcare, finance, and autonomous vehicles. It discusses intelligent agents, their structure, types, and the concept of rationality, as well as neural networks, perceptrons, and the backpropagation algorithm. The document emphasizes the importance of AI in automating tasks, data processing, and solving complex problems, while also addressing challenges like data requirements and interpretability.

Uploaded by

Uday Sai
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/ 20

INTRODUCTION TO ARTIFICIAL INTELLIGENCE & MACHINE LEARNING

UNIT- I
Introduction: Definition of Artificial Intelligence, Evolution, Need, and applications in real world.
Intelligent Agents, Agents and environments; Good Behaviour-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.
================================================================================

Introduction
Artificial Intelligence
John McCarthy the father of Artificial Intelligence described AI as, “The science and engineering of
making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence (AI) is a branch of Science which deals with helping machines find solutions to
complex problems in a more human-like fashion.
 This generally involves borrowing characteristics from human intelligence, and applying them as
algorithms in a computer friendly way.
 A more or less flexible or efficient approach can be taken depending on the requirements
established, which influences how artificial the intelligent behaviour appears.

Evolution of AI
Modern Artificial intelligence (AI) has its origins in the 1950s when scientists like Alan Turing and
Marvin Minsky began to explore the idea of creating machines that could think and learn like
humans.
In the year 1950, Alan Turing, often considered the father of AI, proposed the famous “Turing test”
as a way to measure whether a machine could be considered “intelligent.” The test was simple: if a
human couldn’t tell the difference between a computer and a human, the computer could be
considered intelligent.

• AI was recognised in 1956


In 1956, AI was officially named and began as a research field at the Dartmouth Conference. In the
1970s and 1980s, AI researchers made major advances in areas like expert systems and natural
language processing. But there were still major challenges.

Historical Evolution of Artificial Intelligence


The historical events are summarized in the following table:
Need and Applications of Artificial Intelligence
Artificial Intelligence (AI) is increasingly vital in today's world due to several factors:

1. Automation of Tasks: AI can automate repetitive, mundane tasks that would otherwise require
human intervention, leading to higher efficiency and productivity. This includes tasks in
industries like manufacturing, customer service, and healthcare.
2. Data Processing and Decision Making: AI has the ability to analyse vast amounts of data,
identifying patterns and making predictions much faster and more accurately than humans. This
is crucial in fields like finance, medicine, and research.
3. Complex Problem Solving: AI is essential for solving complex problems that humans cannot
address with traditional methods, such as processing large datasets, real-time decision-making,
and simulating environments for testing theories.
4. Improved User Experience: With AI, products and services can be tailored to individual needs. AI
systems can personalize experiences for users, making them more effective, relevant, and
efficient.
5. Economic Growth: AI is transforming industries, creating new business opportunities, and
contributing to economic growth by enabling businesses to innovate and offer new products or
services.
6. Global Challenges: AI can help address societal and global issues such as climate change,
healthcare access, and poverty by offering innovative solutions for sustainable development.

Applications of AI:
1. Healthcare: AI is used for diagnosing diseases, personalized treatment plans, drug discovery,
medical imaging analysis, and even robotic surgery. It enhances the accuracy and efficiency of
healthcare services.
2. Finance: In the financial sector, AI applications include fraud detection, algorithmic trading, risk
management, and customer support chatbots. It enhances decision-making and operational
efficiency.
3. Autonomous Vehicles: Self-driving cars and drones use AI for navigation, decision-making, and
real-time environmental analysis, potentially revolutionizing transportation and logistics.
4. Natural Language Processing (NLP): AI powers language translation, chatbots, virtual assistants
(like Siri, Alexa, and Google Assistant), and sentiment analysis, making communication more
efficient and accessible.
5. Retail and E-commerce: AI is used for customer behaviour analysis, inventory management,
recommendation systems, and personalized marketing, improving customer engagement and
sales.
6. Manufacturing and Industry 4.0: AI is used for predictive maintenance, quality control, supply
chain optimization, and process automation, improving productivity and reducing costs in
manufacturing.
7. Security and Surveillance: AI systems are used in facial recognition, anomaly detection, cyber
security threat identification, and monitoring to enhance security.
8. Entertainment: AI is used in content recommendations (like Netflix or Spotify), video game AI,
and even in generating music or art.
9. Education: AI-based tools can personalize learning, assess student performance, automate
administrative tasks, and create interactive learning environments.

AI is not just a technology of the future; it is transforming industries today, making operations
smarter and more efficient. Its widespread adoption holds the potential to solve some of the world’s
most pressing challenges, driving innovation and economic growth.

Intelligent Agents
An agent is anything that can be viewed as perceiving its environment through sensors and acting
upon that environment through actuators and the agent and how it interacts with the environment
is shown in the following figure. In other words,
 A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to the
sensors, and other organs such as hands, legs, mouth, for effectors.
 A robotic agent replaces cameras and infrared range finders for the sensors, and various motors
and actuators for effectors.
 A software agent has encoded bit strings as its programs and actions.
Agent and the environment

Agent Terminology
 Performance Measure of Agent − It is the criteria, which determines how successful an agent is.
 Behaviour of Agent − It is the action that agent performs after any given sequence of percepts.
 Percept − It is agent’s perceptual inputs at a given instance.
 Percept Sequence − It is the history of all that an agent has perceived till date.
 Agent Function − It is a map from the precept sequence to an action.

Rationality
Rationality is nothing but status of being reasonable, sensible, and having good sense of judgment.
Rationality is concerned with expected actions and results depending upon what the agent has
perceived. Performing actions with the aim of obtaining useful information is an important part of
rationality.

Ideal Rational Agent


An ideal rational agent is the one, which is capable of doing expected actions to maximize its
performance measure, on the basis of −
o Its percept sequence
o Its built-in knowledge base
Rationality of an agent depends on the following −
o The performance measures, which determine the degree of success.
o Agent’s Percept Sequence till now.
o The agent’s prior knowledge about the environment.
o The actions that the agent can carry out.
The Nature of Environments
Task environments, which are essentially the “problems” to which rational agents are the
“solutions.” In general, the task environments are known as PEAS (Performance, Environment,
Actuators, Sensors). PEAS description of the task environment for an automated taxi is given in the
following table, as an example.

Properties of Environment
The environment has multi-fold properties as mentioned below:
 Discrete / Continuous − If there are a limited number of distinct, clearly defined, states of the
environment, the environment is discrete (For example, chess); otherwise. it is continuous (For
example, driving).
 Observable / Partially Observable − If it is possible to determine the complete state of the
environment at each time point from the percepts it is observable; otherwise, it is only partially
observable.
 Static / Dynamic − If the environment does not change while an agent is acting, then it is static;
otherwise, it is dynamic.
 Single agent / Multiple agents − The environment may contain other agents which may be of
the same or different kind as that of the agent.
 Accessible / Inaccessible − If the agent’s sensory apparatus can have access to the complete
state of the environment, then the environment is accessible to that agent.
 Deterministic / Non-deterministic − If the next state of the environment is completely
determined by the current state and the actions of the agent, then the environment is
deterministic; otherwise, it is non-deterministic.
 Episodic / Non-episodic − In an episodic environment, each episode consists of the agent
perceiving and then acting.

Structure of agents
Agent’s structure can be viewed as –
 Agent = Architecture + Agent Program
 Architecture = the machinery that an agent executes on.
 Agent Program = an implementation of an agent function.

Types of agents
1) Simple Reflex Agents
2) Model Based Reflex Agents
3) Goal Based Agents
4) Utility Based Agents
1. Simple Reflex Agents
 They choose actions only based on the current percept as shown in following figure.
 They are rational only if a correct decision is made only on the basis of current precept.
 Their environment is completely observable.
 Condition-Action Rule − It is a rule that maps a state (condition) to an action.

2. Model Based Reflex Agents


 They use a model of the world to choose their actions as shown in following figure.
 They maintain an internal state.
 Model − knowledge about “how the things happen in the world”.
 Internal State − It is a representation of unobserved aspects of current state depending on
percept history.
 Updating the state requires the information about −
• How the world evolves.
• How the agent’s actions affect the world.

3. Goal Based Agents


 They choose their actions in order to achieve goals as shown in following figure.
 Goal-based approach is more flexible than reflex agent since the knowledge supporting a
decision is explicitly modeled, thereby allowing for modifications.
 Goal − It is the description of desirable situations.

4. Utility Based Agents


 They choose actions based on a preference (utility) for each state and shown in following figure.
Goals are inadequate when −
 There are conflicting goals, out of which only few can be achieved.
 Goals have some uncertainty of being achieved and you need to weigh likelihood of success against the
importance of a goal.

Turing Test
 Success of an intelligent behavior of a system can be measured with Turing Test as shown in
following figure.
• Two persons and a machine to be evaluated participate in the test.
• Out of the two persons, one plays the role of the tester. Each of them sits in different
rooms.
• The tester is unaware of who is machine and who is a human.
• He interrogates the questions by typing and sending them to both intelligences, to which
he receives typed responses.
 Allan Turing, in 1950, considered the question of whether a machine could actually make to
think.
 Turing test measures the performance of an ‘intelligent’ machine.

Neural network representation


 The term "Artificial neural network (ANN)" refers to a biologically inspired sub-field of artificial
intelligence modeled after the brain.
 Artificial neural network is usually a computational network based on biological neural networks
that construct the structure of the human brain.
 Similar to a human brain has neurons interconnected to each other, artificial neural networks
also have neurons that are linked to each other in various layers of the networks.
 These neurons are known as nodes.
 The typical ANN is shown in the following figure,

An Artificial Neural Network in the field of Artificial intelligence where it attempts to mimic the
network of neurons makes up a human brain so that computers will have an option to understand
things and make decisions in a human-like manner.

Challenges and limitations of neural networks


1.Data and computation
 One of the main challenges of neural networks and deep learning is the need for large amounts
of data and computational resources.
 Neural networks learn from data by adjusting their parameters to minimize a loss function,
which measures how well they fit the data.
2. Interpretability and Explainability
 Another challenge of neural networks is the lack of interpretability and Explainability of their
outputs and decisions.
 Neural networks are often considered as black boxes, as it is hard to understand how they
process the input data and what features they learn and use.

3. Robustness and security


 A related challenge of neural networks is the lack of robustness and security against adversarial
attacks and noise.
 Neural networks are vulnerable to subtle perturbations or modifications of the input data, which
can cause them to produce incorrect or misleading outputs.

4. Generalization and transfer


 A final challenge of neural networks is the difficulty of generalizing and transferring their
knowledge and skills to new or different domains or tasks.
 Neural networks tend to over-fit the data they are trained on, which means they perform well
on the training data but poorly on unseen or novel data.

Perceptron
 A Perceptron is an algorithm for supervised learning of binary classifiers.
 This algorithm enables neurons to learn and processes elements in the training set one at a time.
 The basic components of a perceptron are:
• Input Layer: The input layer consists of one or more input neurons, which receive input
signals from the external world or from other layers of the neural network.
• Weights: Each input neuron is associated with a weight, which represents the strength of
the connection between the input neuron and the output neuron.
• Bias: A bias term is added to the input layer to provide the perceptron with additional
flexibility in modeling complex patterns in the input data.
• Activation Function: The activation function determines the output of the perceptron based
on the weighted sum of the inputs and the bias term. Common activation functions used in
perceptrons include the step function, sigmoid function, and ReLU function.
• Output: The output of the perceptron is a single binary value, either 0 or 1, which indicates
the class or category to which the input data belongs.
• Training Algorithm: The perceptron is typically trained using a supervised learning algorithm
such as the perceptron learning algorithm or back propagation. During training, the weights
and biases of the perceptron are adjusted to minimize the error between the predicted
output and the true output for a given set of training examples.

Overall, the perceptron is a simple yet powerful algorithm that can be used to perform binary
classification tasks and has paved the way for more complex neural networks used in deep learning
today.

Types of Perceptrons:
Single layer: Single layer perceptron as shown in following figure can learn only linearly separable
patterns.
Step 1: Multiply all input values with corresponding weight values and then add to calculate
the weighted sum. The following is the mathematical expression of it:

Σwi*xi = x1*w1 + x2*w2 + x3*w3+……...x4*w4


Add a term called bias ‘b’ to this weighted sum to improve the model’s performance.

Step 2: An activation function is applied with the above-mentioned weighted sum giving us
an output either in binary form or a continuous value as follows:
Y=f(Σwi*xi + b)
Where, x1, x2, x3… are the inputs, w1,w2,w3… are the weights, b denotes bias.

Multi-layer: Multilayer perceptrons as shown in figure, can learn about two or more layers having a
greater processing power and differ widely in design. It is important to note that while single-layer
neural networks were useful early in the evolution of AI, the vast majority of networks used today
have a multi-layer model.

Gradient Descent and Delta Rule


 A set of data points are said to be linearly separable if the data can be divided into two
classes using a straight line.
 If the data is not divided into two classes using a straight line, such data points are said to be
called non-linearly separable data.

Perceptron rule works for linearly separable Data and Delta rule works for non-linearly separable
data
If the training examples are not linearly separable, the delta rule converges toward a best-fit
approximation to the target concept. The key idea behind the delta rule is to use gradient descent to
search the hypothesis space of possible weight vectors to find the weights that best fit the training
examples. This rule is important because gradient descent provides the basis for the
BACKPROPAGATION algorithm, which can learn networks with many interconnected units.

The delta training rule is best understood by, a linear unit for which the output o is given by

To define the Error the formula is

where D is the set of training examples, ‘td’ is the target output for training example ‘d’, and od is
the output of the linear unit for training example ‘d’.
This vector derivative is called the gradient of Error (E) with respect to weight (w), written as,

The gradient specifies the direction of steepest increase of E, the training rule for gradient descent is

Back Propagation Algorithm

The Backpropagation Algorithm is a supervised learning technique used in artificial neural networks
(ANNs) to minimize the error in the model’s predictions by adjusting the weights of the network. It is
a fundamental method for training neural networks, particularly in deep learning.

Key Concepts:
1. Neural Network Structure:
o A neural network consists of layers: an input layer, one or more hidden layers, and an
output layer.
o Each layer contains nodes (neurons) that are connected by weights, which influence the
strength of the signal passed from one neuron to another.
2. Forward Propagation:
o Input data is passed through the network (from input to output layer), where each
neuron applies a weight to the incoming signal and uses an activation function (like
sigmoid or ReLU) to produce output.
3. Error Calculation:
o After the forward propagation, the network’s output is compared with the actual target
values. The difference between the predicted output and the true output is called the
error or loss.
o A loss function, such as Mean Squared Error (MSE) or Cross-Entropy Loss, calculates the
error.
4. Back propagation Process:
o The key idea behind back propagation is to propagate this error backward through the
network to update the weights.
o This is done by applying the chain rule of calculus, which helps compute the gradient of
the error with respect to each weight in the network.
o Gradients indicate how much each weight contributed to the error, and they guide the
adjustment of weights to minimize the error.
5. Weight Update (Gradient Descent):
o Once the gradients are computed, the weights are updated using an optimization
technique, such as Gradient Descent. The weight update formula is:
Wnew=Wold−η(∂W/∂E)
where η is the learning rate, and (∂E/∂W) is the gradient of the error with respect to the
weight.
o This process is repeated iteratively across multiple training examples (or epochs) until
the error is minimized, and the model's performance improves.

Steps in Back propagation:


1. Initialization: Set random initial weights.
2. Forward Pass: Perform forward propagation to calculate the output.
3. Error Calculation: Calculate the error or loss.
4. Backward Pass: Compute the gradients using back propagation and the chain rule.
5. Weight Update: Update the weights using the gradient descent algorithm.
6. Repeat: Iterate through the process over many epochs until the model converges and the error
is sufficiently low.

Advantages:
 Efficient Learning: Back propagation efficiently adjusts weights and improves the model with
each iteration.
 Widely Used: It is one of the most effective and widely used algorithms for training neural
networks.
 Adaptability: It works for a wide range of network architectures and can be applied to both
shallow and deep neural networks.

Challenges:
 Local Minima: Gradient descent may get stuck in local minima (points where the error is low but
not the lowest possible).
 Vanishing/Exploding Gradients: In deep networks, gradients can become very small (vanishing)
or very large (exploding), causing difficulties in training.
 Computationally Expensive: Training deep networks can require significant computational
resources, especially for large datasets.

Back propagation is a core component of neural network training. By efficiently adjusting the
weights to reduce the error, it enables neural networks to learn from data and make accurate
predictions. Despite its challenges, it remains an essential technique in machine learning and deep
learning applications.

Genetic Algorithm
A Genetic Algorithm (GA) is a search heuristic inspired by Charles Darwin's theory of natural
evolution. It's an optimization technique used to find the best solution among a vast number of
possibilities.

Key Components of GA
1) Population: A set of candidate solutions, represented as chromosomes (strings of genes).
2) Fitness Function: Evaluates the quality of each chromosome, determining its likelihood of
reproduction.
3) Selection: Chooses chromosomes for reproduction based on their fitness.
4) Crossover: Combines genetic information from two parent chromosomes to create offspring.
5) Mutation: Randomly alters genes in a chromosome to introduce new traits.
6) Generations: Iterative process of selection, crossover, and mutation.

How Genetic Algorithms Works


1) Initialization: Create an initial population of chromosomes.
2) Evaluation: Calculate the fitness of each chromosome.
3) Selection: Select chromosomes for reproduction based on fitness.
4) Crossover: Perform crossover to create new offspring.
5) Mutation: Apply mutation to introduce new traits.
6) Replacement: Replace least fit chromosomes with new offspring.
7) Termination: Stop after a specified number of generations or when a satisfactory solution is
found.

The flow chart of Genetic Algorithm is given below:

1. Initialization
The process of a genetic algorithm starts by generating the set of individuals, which is called
population. Here each individual is the solution for the given problem. An individual contains or is
characterized by a set of parameters called Genes.
2. Fitness Assignment
Fitness function is used to determine how fit an individual is? It means the ability of an individual to
compete with other individuals. In every iteration, individuals are evaluated based on their fitness
function. The fitness function provides a fitness score to each individual.
3. Selection
The selection phase involves the selection of individuals for the reproduction of offspring. All the
selected individuals are then arranged in a pair of two to increase reproduction.
4. Reproduction
After the selection process, the creation of a child occurs in the reproduction step. In this step, the
genetic algorithm uses two variation operators that are applied to the parent population. The two
operators involved in the reproduction phase are given below:
1) Crossover: The crossover plays a most significant role in the reproduction phase of the
genetic algorithm. In this process, a crossover point is selected at random within the genes.
Then the crossover operator swaps genetic information of two parents from the current
generation to produce a new individual representing the offspring.

2) Mutation: The mutation operator inserts random genes in the offspring (new child) to
maintain the diversity in the population. It can be done by flipping some bits in the
chromosomes.
5. Termination
After the reproduction phase, a stopping criterion is applied as a base for termination. The algorithm
terminates after the threshold fitness solution is reached. It will identify the final solution as the best
solution in the population.

Applications of GA
1) Optimization: Scheduling, resource allocation, and portfolio optimization.
2) Machine Learning: Feature selection, clustering, and neural network training.
3) Engineering: Design optimization, structural analysis, and control systems.
4) Finance: Portfolio management, risk analysis, and option pricing.

Advantages of GA
1) Global Optimization: GAs can find global optima in complex search spaces.
2) Robustness: GAs can handle noisy or uncertain data.
3) Flexibility: GAs can be applied to a wide range of problem domains.

Disadvantages of GA
1) Computational Cost: GAs can be computationally expensive.
2) Convergence: GAs may converge to local optima or get stuck in infinite loops.
3) Parameter Tuning: GAs require careful tuning of parameters, such as population size
and mutation rate.

Here's a simple example of applying a Genetic Algorithm (GA) to solve a classic problem:
Problem: Find the Maximum Value of a Function
Suppose we want to find the maximum value of the following function:

f(x) = x^2 + 3x + 4

where x is a real number between -10 and 10.

Genetic Algorithm Steps:

1. Initialize Population
Create an initial population of 10 random chromosomes, each representing a possible solution (x-
value). For simplicity, let's use a binary representation with 10 bits.

| Chromosome | x-value |
| --- | --- |
| 0110101010 | -3.4 |
| 1011011101 | 7.2 |
| ... | ... |

2. Evaluate Fitness
Calculate the fitness of each chromosome by evaluating the function f(x) at the corresponding x-
value.
| Chromosome | x-value | Fitness (f(x)) |
| --- | --- | --- |
| 0110101010 | -3.4 | 12.96 |
| 1011011101 | 7.2 | 64.48 |
| ... | ... | ... |

3. Select Parents
Select the top 2 chromosomes with the highest fitness values as parents for the next generation.

| Parent 1 | x-value | Fitness (f(x)) |


| --- | --- | --- |
| 1011011101 | 7.2 | 64.48 |
| Parent 2 | x-value | Fitness (f(x)) |
| 1101011010 | 5.6 | 58.96 |

4. Crossover
Perform crossover (single-point or multi-point) to create 2 new offspring chromosomes.

| Offspring 1 | x-value |
| --- | --- |
| 1011011010 | 6.8 |
| Offspring 2 | x-value |
| 1101011101 | 6.2 |

5. Mutation
Apply mutation to the offspring chromosomes with a small probability (e.g., 0.01).

| Offspring 1 | x-value |
| --- | --- |
| 1011011010 | 6.8 (no mutation) |
| Offspring 2 | x-value |
| 1101011100 | 6.1 (mutation) |

6. Replace Least Fit Chromosomes


Replace the 2 least fit chromosomes in the population with the new offspring chromosomes.
Repeat steps 2-6 for multiple generations until convergence or a stopping criterion is reached.
Assignment 1
(Submit within a week)

1) Define Artificial Intelligence. Explain the techniques of AI. Also describe the characteristics of
Artificial Intelligence.
2) Give the applications of Artificial Intelligence in real world.
3) Explain the various problem characteristics of AI.
4) What is an AI technique? Give its evolution over years.
5) What do you mean by Artificial Intelligence (AI)? Explain contribution of AI in various fields.
6) What is learning? Explain learning in neural networks.
7) Define neural network. Give its representation.
8) Describe the mathematical model of perceptron with example.
9) Briefly explain about multilayer networks. Compare them with single layer networks.
10) Explain about Intelligent Agents. Give their role in AI.
11) Discuss design issues of artificial neural networks.
12) Explain about back propagation algorithm with an example.
13) What is meant by intelligent agents and give its structure.
14) Explain about Genetic algorithms in detail.
15) Discuss in detail about Multilayer Networks.
16) Explain ANN with a numerical illustration. How do you optimize weights of ANN?
17) Explain the process of genetic algorithm along with a flow chart.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy