Case Study
Case Study
AI EXPERIMENT 1
Aim: - Study of different applications of AI which provides peas description and task
environment.
Theory:-
We know that there are different types of agents in AI. PEAS System is used to categorize
similar agents together. The PEAS system delivers the performance measure with respect to the
environment, actuators, and sensors of the respective agent. Most of the highest performing
agents are Rational Agents.
Rational Agent: The rational agent considers all possibilities and chooses to perform a highly
efficient action. For example, it chooses the shortest path with low cost for high
efficiency. PEAS stands for a Performance measure, Environment, Actuator, Sensor.
1. Performance Measure: Performance measure is the unit to define the success of an agent.
Performance varies with agents based on their different precepts.
2. Environment: Environment is the surrounding of an agent at every instant. It keeps changing
with time if the agent is set in motion. There are 5 major types of environments:
Fully Observable & Partially Observable
Episodic & Sequential
Static & Dynamic
Discrete & Continuous
Deterministic & Stochastic
3. Actuator: An actuator is a part of the agent that delivers the output of action to the
environment.
4. Sensor: Sensors are the receptive parts of an agent that takes in the input for the agent
.
Performance
Agent Measure Environment Actuator Sensor
The comfortable
trip, Safety, Steering wheel,
Automated Car Maximum Roads, Traffic, Accelerator, Camera, GPS,
Drive Distance Vehicles Brake, Mirror Odometer
Part-picking Percentage of parts Conveyor belt Jointed arms and Camera, joint
robot in correct bins with parts; bins hand angle sensors
camera
proximity
sensors infrared
Soccer player number of parts in joint, angles, sensors
robot correct container team players motors
Safety: Automated system should be able to drive the car safely without
dashing anywhere.
Optimum speed: Automated system should be able to maintain the optimal
speed depending upon the surroundings.
Comfortable journey: Automated system should be able to give a
comfortable journey to the end user i.e. depending upon the road it should
ensure the comfort of the end user.
Maximize profits: Automated system should provide good mileage on
various rows the amount of energy consumed to automate the system should
not be very high etc. such features ensures that the user is benefited with the
automated features of the system and it can be useful for maximizing the
profits.
ii) Environment
Roads: - automated car drivers should be able to drive on any kind of roads ranging
from city to highway.
Traffic conditions: - You will find different set of traffic condition for different
type of roads. Automated systems should be able to drive efficiently in all types of
traffic condition. Sometimes traffic condition are formed because of pedestrians,
animals, etc.
Clients: - Automated cars are created depending on the client’s environment. For
example in some countries you will see left hand drive and in some countries there
is a right hand drive. Every country or state can have different weather condition.
Depending upon such constraints automated car drivers should be designed.
iii) Actuators: - are responsible for performing actions or providing output to an
environment. In case of car driving agent following are the actuators :
1. Steering wheel which can be used to direct a car in desired direction that is
right or left.
2. Accelerator, gear, etc. can be useful to increase or decrease the speed of the
car.
3. Brake is used to stop the car.
4. Light signal, horn can be very useful as indicators for an automated car.
iv) Sensors: - To take input from environment in car driving example cameras, sonar
system, speedometer, GPS, engine sensors, etc. are used as sensors.
Healthy patients: - System should make use of sterilized instruments to ensure the safety
(healthiness) of the patient
Minimize cost: - the automated system results should not be very costly otherwise overall
expenses of the patient may increase, lawsuits. Medical diagnosis system should be legal.
ii) Environment: - patient, doctors, hospital environment.
iii) Sensors: - screen, printer.
iv) Actuators: - keyboard and mouse which is useful to make entry of symptoms, findings,
patient’s answers to given questions. Scanner to scan the reports, camera to click pictures
of patients.
(D)Soccer player robot
i) Performance: - number of goals, speed legal game.
ii) Environment: team players, opponent team players, playing around, goal net.
iii) Sensors: camera, proximity sensors, infrared sensors
iv) Actuators: joint, angles, motors
AI EXPERIMENT 2
Aim: Identify suitable agent architecture for the problem Solving
Theory:
Artificial intelligence is defined as the study of rational agents. A rational agent could be
anything that makes decisions, as a person, firm, machine, or software. It carries out an action
with the best outcome after considering past and current percepts(agent’s perceptual inputs at a
given instance). An AI system is composed of an agent and its environment. The agents act in
their environment. The environment may contain other agents.
Agents can be grouped into five classes based on their degree of perceived intelligence and
capability
Simple reflex agents ignore the rest of the percept history and act only on the basis of
the current percept. Percept history is the history of all that an agent has perceived to date. The
agent function is based on the condition-action rule. A condition-action rule is a rule that maps
a state i.e, condition to an action. If the condition is true, then the action is taken, else not. This
agent function only succeeds when the environment is fully observable.
2. Model-based reflex agents
It works by finding a rule whose condition matches the current situation. A model-based agent
can handle partially observable environments by the use of a model about the world. The
agent has to keep track of the internal state which is adjusted by each percept and that depends
on the percept history.
3. Goal-based agents
These kinds of agents take decisions based on how far they are currently from their goal
(description of desirable situations). Their every action is intended to reduce its distance from
the goal. This allows the agent a way to choose among multiple possibilities, selecting the one
which reaches a goal state. The knowledge that supports its decisions is represented explicitly
and can be modified, which makes these agents more flexible. They usually require search and
planning. The goal-based agent’s behavior can easily be changed.
4. Learning Agent :
A learning agent in AI is the type of agent that can learn from its past experiences or it has
learning capabilities. It starts to act with basic knowledge and then is able to act and adapt
automatically through learning.
5. Utility-based agents
The agents which are developed having their end uses as building blocks are called utility-based
agents. When there are multiple possible alternatives, then to decide which one is best, utility-
based agents are used. They choose actions based on a preference (utility) for each state.
Sometimes achieving the desired goal is not enough. We may look for a quicker, safer, cheaper
trip to reach a destination. Agent happiness should be taken into consideration. Utility describes
how “happy” the agent is. Because of the uncertainty in the world, a utility agent chooses the
action that maximizes the expected utility. A utility function maps a state onto a real number
which describes the associated degree of happiness.
Conclusion: We have studied that how to identify suitable architecture from all types of agents for
problem.
AI EXPERIMENT 3
Aim: Write the program using PROLOG as an AI programming Languages
Theory:
Prolog is a logic programming language. It has important role in artificial intelligence. Unlike
many other programming languages, Prolog is intended primarily as a declarative programming
language. In prolog, logic is expressed as relations (called as Facts and Rules). Core heart of
prolog lies at the logic being applied. Formulation or Computation is carried out by running a
query over these relations.
Prolog stands for programming in logic. In the logic programming paradigm, prolog language is
most widely available. Prolog is a declarative language, which means that a program consists of
data based on the facts and rules (Logical relationship) rather than computing how to find a
solution. A logical relationship describes the relationships which hold for the given application.
Applications of Prolog:
o Specification Language
o Robot Planning
o Natural language understanding
o Machine Learning
o Problem Solving
o Intelligent Database retrieval
o Expert System
o Automated Reasoning
Conclusion: - From this experiment we have study that how PROLOG is used in AI.
Code:-
Output:-
Conclusion: - From this experiment we have study that how PROLOG is used in AI.
AI EXPERIMENT 4
Aim: - Implement any one of the Uninformed search techniques.
Theory: - Uninformed search is a class of general-purpose search algorithms which operates in
brute force-way. Uninformed search algorithms do not have additional information about state or
search space other than how to traverse the tree, so it is also called blind search.
Following are the various types of uninformed search algorithms:
⦁ Breadth-first Search
⦁ Depth-first Search
⦁ Depth-limited Search
⦁ Iterative deepening depth-first search
⦁ Uniform cost search
⦁ Bidirectional Search
Breadth-first Search:
⦁ Breadth-first search is the most common search strategy for traversing a tree or
graph. This algorithm searches breadthwise in a tree or graph, so it is called breadth-first
search.
⦁ BFS algorithm starts searching from the root node of the tree and expands all
successor node at the current level before moving to nodes of next level.
⦁ The breadth-first search algorithm is an example of a general-graph search algorithm.
⦁ Breadth-first search implemented using FIFO queue data
structure. Advantages:
⦁ BFS will provide a solution if any solution exists.
⦁ If there are more than one solutions for a given problem, then BFS will provide
the minimal solution which requires the least number of steps.
Disadvantages:
⦁ It requires lots of memory since each level of the tree must be saved into memory
to expand the next level.
⦁ BFS needs lots of time if the solution is far away from the root
node. Example:
in the following graph, we start traversal from vertex 2. When we come to vertex 0, we look for
all adjacent vertices of it. 2 is also an adjacent vertex of 0. If we don’t mark visited vertices, then
2 will be processed again and it will become a non-terminating process. A Breadth First
Traversal of the following graph is 2, 0, 3, 1.
Conclusion: - In this experiment we are study how many types are there in Uninformed
Search technique & how BFS (Breadth-First-Search) is working in AI.
Code :-
Output: -
AI EXPERIMENT 5
Aim: - Implement any one of the inform search techniques.
Theory:- Informed Search algorithms have information on the goal state which helps in
more efficient searching. This information is obtained by a function that estimates how close
a state is to the goal state. Example: A* algorithm for 8 puzzle problem.
A* Search algorithm is one of the best and popular technique used in path-finding and
graph traversals.
Why A* Search Algorithm?
Informally speaking, A* Search algorithms, unlike other traversal techniques, it has “brains”.
What it means is that it is really a smart algorithm which separates it from the other
conventional algorithms. This fact is cleared in detail in below sections.
And it is also worth mentioning that many games and web-based maps use this algorithm to
find the shortest path very efficiently (approximation).
We have introduced Branch and Bound and discussed the 0/1 Knapsack problem in the
below posts.
Branch and Bound | Set 1 (Introduction with 0/1 Knapsack)
Branch and Bound | Set 2 (Implementation of 0/1 Knapsack)
In this puzzle solution of the 8 puzzle problem is discussed.
Given a 3×3 board with 8 tiles (every tile has one number from 1 to 8) and one empty
space. The objective is to place the numbers on tiles to match the final configuration using
the empty space. We can slide four adjacent (left, right, above, and below) tiles into the
empty space.
For example,
Conclusion:- From this experiment we are study how inform search works and how A* algorithm
working in AI.
Code :-
Output :-
AI EXPERIMENT 6
Aim: - Implement adversarial search using min-max algorithm.
Theory: -
Minimax is a recursive algorithm which is used to choose an optimal move for a
player assuming that the other player is also playing optimally.
It is used in games such as tic-tac-toe, go, chess, Isola, checkers, and many other
two-player games.
Such games are called games of perfect information because it is possible to see
all the possible moves of a particular game.
Let us combine what we have learnt so far about minimax and evaluation function
to write a proper Tic-Tac-Toe AI (Artificial Intelligence) that plays a perfect game.
This AI will consider all possible scenarios and makes the most optimal move.
Finding the Best Move :
We shall be introducing a new function called findBestMove(). This function
evaluates all the available moves using minimax() and then returns the best move
the maximizer can make.
Checking for GameOver state :
To check whether the game is over and to make sure there are no moves left we
use isMovesLeft() function. It is a simple straightforward function which checks
whether a move is available or not and returns true or false respectively.
Making our AI smarter :
One final step is to make our AI a little bit smarter. Even though the following AI
plays perfectly, it might choose to make a move which will result in a slower
victory or a faster loss. Lets take an example and explain it.
Conclusion: - From this experiment we are studied that how min-max algorithm
works for any games in AI.
AI EXPERIMENT 7
Aim:- Implement any one of the Local Search techniques. E.g. Hill Climbing, Simulated
Annealing, Genetic algorithm.
Theory:-
Genetic Algorithms(GAs) are adaptive heuristic search algorithms that belong to the
larger part of evolutionary algorithms. Genetic algorithms are based on the ideas of
natural selection and genetics. These are intelligent exploitation of random search
provided with historical data to direct the search into the region of better performance
in solution space. They are commonly used to generate high-quality solutions for
optimization problems and search problems.
Genetic algorithms simulate the process of natural selection which means those
species who can adapt to changes in their environment are able to survive and
reproduce and go to next generation. In simple words, they simulate “survival of the
fittest” among individual of consecutive generation for solving a problem. Each
generation consist of a population of individuals and each individual represents a
point in search space and possible solution. Each individual is represented as a string
of character/integer/float/bits. This string is analogous to the Chromosome.
Code:
Output:
Conclusion:- In this experiment we have studied genetic algorithm local search techniques.
AI EXPERIMENT 8
Aim: Prove the goal sentence from the following set of statements in FOPL by
applying forward, backward and resolution inference algorithms.
Theory:
Resolution is used, if there are various statements are given, and we need to
prove a conclusion of those statements. Unification is a key concept in proofs
by resolutions. Resolution is a single inference rule which can efficiently
operate on the conjunctive normal form or clausal form.
Conclusion: From this experiment we are studying how resolution works in AI.
AI EXPERIMENT 9
Aim: create a Bayesian network for the given problem statement and draw
inferences from it.
Theory:
Problem:
Conclusion: from this experiment they are study what is Bayesian network in AI
AI EXPERIMENT 10
Aim: Case study of any existing successful AI system. (FACE RECOGNITION)
Theory:
Step 1. A picture of your face is captured from a photo or video. Your face might
appear alone or in a crowd. Your image may show you looking straight ahead or
nearly in profile.
Step 2. Facial recognition software reads the geometry of your face. Key factors
include the distance between your eyes and the distance from forehead to chin. The
software identifies facial landmarks — one system identifies 68 of them — that are
key to distinguishing your face. The result: your facial signature.
Step 3. Your facial signature — a mathematical formula — is compared to a
database of known faces. And consider this: at least million people have images of
their faces in one or more databases.
1) Illumination
Illumination stands for light variations. The slight change in lighting conditions
cause a significant challenge for automated face recognition and can have a
significant impact on its results. If the illumination tends to vary, the same
individual gets captured with the same sensor and with an almost identical facial
expression and pose, the results that emerge may appear quite different.
Illumination changes the face appearance drastically. It has been found that the
difference between two same faces with different illuminations is higher than two
different faces taken under same illumination.
2) Pose
Facial Recognition Systems are highly sensitive to pose variations. The pose of a
face varies when the head movement and viewing angle of the person changes. The
movements of head or differing POV of a camera can invariably cause changes in
face appearance and generate intra‐class variations making automated face
recognition rates drop drastically. It becomes a challenge to identify the real face
when the rotation angle goes higher. It may result in faulty recognition or no
recognition if the database only has the frontal view of the face.
3) Occlusion
Occlusion means blockage, and it occurs when one or other parts of the face are
blocked and whole face is not available as an input image. Occlusion is considered
one of the most critical challenges in face recognition system.
It occurs due to beard, moustache, accessories (goggle, cap, mask, etc.), and it is
prevalent in real-world scenario. The presence of such components makes the
subject diverse and hence making automated face recognition process a tough nut to
crack.
4) Expressions
Face is one of the most crucial biometrics as its unique features play a crucial role
in providing human identity and emotions. Varying situations cause different
moods which result in showing various emotions and eventually change in facial
expressions.
Different expressions of the same individual are another significant factor that
needs to be taken into account. Human expressions are particularly macro-
expressions which are happiness, sadness, anger, disgust, fear, surprise. Micro-
expressions are the one which shows the rapid facial patterns and happen
involuntarily.
Macro and micro expressions find their place on someone’s face due to changes in
one’s emotional state and in the wake of such emotions- which are many- the
efficient recognition becomes difficult.
b) Europe
Belgium and Luxembourg are two of only three governments in the world to
officially oppose the use of facial recognition technology.
“The EU has been a haven for unlawful biometric experimentation and
surveillance.”
China is often cited as a notorious use case of mass surveillance, and the
country has the highest ratio of CCTV cameras to citizens in the world —
one for every 12 people.
By 2023, China will be the single biggest player in the global facial
recognition market. And it’s not just implementing the technology at home–
it’s exporting too!!
d) Africa
While the African continent currently has the lowest concentration of facial
recognition technology in use, this deficit may not last for long.
In other parts of the region, police in the UAE have purchased discreet smart
glasses that can be used to scan crowds, where positive matches show up on
an embedded lens display. Over in Kazakhstan, facial recognition technology
could replace public transportation passes entirely.
f) South America
The majority of facial recognition technology in South America is aimed at
cracking down on crime. In fact, it worked in Brazil to capture
Interpol’s second-most wanted criminal.
Conclusion: Face is the most essential part of the human body, and its unique
features make it even more crucial in identifying humans. Various algorithms and
technologies are used worldwide to make the face recognition process more
accurate and reliable. The applications of this ever-growing technology are also
expanding in healthcare, security, defence, forensic, and transportation, requiring
more accuracy. However, some challenges are ubiquitous while developing face
recognition technology such as pose, occlusion, expressions, ageing, etc, which
have been discussed above in the article.