Ai Lab Manual

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

38.

Tushar Lad

EXPERIMENT NO 01
Case Study on A.I Application Published in IEEE

Aim: - Case Study on A.I Application (Automated car) Published in IEEE

Theory:-

Abstract:-
Self-driving cars rely on a plethora of algorithms in order to perform safe driving maneuvers. Training
those models is expensive (e.g. hardware cost, storage, energy) and requires continuous updates. This
paper proposes a cloud-based framework for continuous training of self-driving AI models. In addition to
training standalone models, the framework is capable of leveraging pre-trained models in expediting the
training on environment changes (e.g. new driver or new car model). As use-case, this paper focuses on a
driver's behavior while the vehicle's control is being transferred between the driver and the self-driving
AI. A human driver can hand over the control of a vehicle's driving tasks to an automated system, when
that system's confidence level is high enough. Reciprocally, there are situations where that control has to
be handed back to the human driver. This paper proposes a novel real-time system for Driving Not-
Driving (DND) detection, which is able to capture the ability of the driver to re-take control of a vehicle
when the automated driving system transitions from a higher to a lower level of automation (e.g. L3 to L2
vehicle automation). We are using a computer vision-based Driver Monitoring System (DMS) that
captures in real-time head and eye movements. These are captured in the car and transferred to the cloud
where a DND model is trained for a specific driver. The DND classification model is deployed in the
vehicle and predicts if the driver is ready or not to resume control at a given time. The cloud-based
framework proposed in this paper shows an end-to-end cycle of collecting, training and deploying self-
driving AI technology, with the additional features of continuous and transfer learning.

Introduction:-
As the World is progressing, scientists and researchers are struggling to take the human life in more
comfort zone. People around the World are now quite much enthusiastic about the launch of autonomous
cars. The specialty of this car is its ability to perceive its environment using the modern form of AI,
and take decisions without the assistance of any driver. In other words, these cars are equipped with
special sensors, processors and another database which is responsible for the operation of this car and
doesn’t require any driver. It navigates itself following up to the destination point requested by users.
Indeed, it is the big revolution in the field of robotics, which is contributing a lot to make this planet safer
place. On a technical basis, this car is designed based on the various areas of engineering which
includes electrical, mechanical, computer sciences and control engineering etc. Major progression in the
autonomous car has started when the Mercedes Benz has launched the vision guided the car in 1980 after
this invention it has started a huge focus on the areas of GPS system, radar etc. This has also resulted in
the development of the adaptive steer control, power steering and other things that are involved in
the humanitarian assistance as well.

And now the research is going on to introduce the World with the driverless car which could be much
safer, efficient and reliable for the users. Road accidents are one of the major cause of death, as according
to report by Deshpande et al that nearly 3000 people died daily because of road accidents, among which
half of them are not in the car, other than that it has also been reported that if some safety measures are
not taken this will grow up to 2.4 million a year making the 5th largest cause of death in the
World. This number can be greatly reduced by putting autonomous cars into action which are far more
reliable and react swiftly than humans. It will also cause reduction in the traffic congestion, as the
38. Tushar Lad

efficiency of autonomous car makes it reliable in a way of keeping very small gaps between vehicles, and
its outstanding management of speed and time. Following the navigation track without considering any
other distraction makes it friendlier than the conventional cars operated by drivers.

Fully Self-Driving Automation:-


The AI-based specialized cars can perform all of its trip without any occupant, and it is more
considerate for the people who are not able to drive or may be due to other factors unable to cope with
driving. Although engineers are putting lot more effort to make it as accurate as possible, this technology
doesn’t give that performance so that it can be trusted blinded to put it on the road. Google is quite a
confident to commercially launch these cars by the time of 2018. The survey has been done by the Cisco,
the major objective of this survey was to figure out the people’s confidence of adopting these autonomous
cars. They included around 1500 people from 10 different countries having a long-term driving
experience, and they figure out the report which suggested that half of the consumers in the World will
soon trust these autonomous cars.

Philosophy of Autonomous Cars:-


The prime reason for adopting this technology of driverless car goes to the several functionalities
that are not achievable by the humans itself. This AI based car can determine its surrounding
environment with efficiency. There are a number of devices on the market that helps to accomplish that
which specifically includes laser rangefinder, LADAR, RADAR etc. So, this AI-based technology is
relying on number of sensors for performing operation.

Another major functionality of driverless car is its capability of planning the ultimate motion which
makes it far more accurate. It might be complex, but recent advances in this fields have resulted in some
algorithms which have dramatically enhanced its ability. Managing the speed and steering of autonomous
cars are a very important factor for the perfection of motion planning. These cars also use Global
positioning system GPS to determine its location along with the inertial navigation system (INS),
for keeping the position in the continuous record and the position as well, and for that purpose it utilizes
the gyroscopes and accelerometers. When everything is ready for planning, location and navigation, it
uses the concept of vision-based lane analysis i.e. 2D, 3D, straight or twisted. But point to be noted,
the implementation of these cars is only done on the well-organized roads, on the other hand there
requires lot more improvement to make it friendlier to be used on the unstructured roads. Overtaking is
one of the biggest cause of road accidents around the World [15]. One of the major concern of these cars
to adopt the safer procedure to perform overtaking safely, so for that reason there are number of
different sensors and stereo cameras where they detect the car ahead and the distance, linked it to the
speed of the car itself and by performing other perception through sensors it carries out the position to
pass the other car.

Conclusion:-
We successfully prepared the case study on A.I Application of Automated Car published in IEEE papers.
38. Tushar Lad

EXPERIMENT NO 02
Assignments on State space formulation and PEAS representation
for various AI applications

Aim: - Design of Intelligent System Using PEAS.

Theory: -
About PEAS
 PEAS stands for Performance Measure, Environment, Actuator, and Sensors it’s the short form used
for performance issue grouped under Task Environment.
I. Performance Measure: - It is the objective function to judge the performance of the agent.
II. Environment: - It’s the real environment where the agent needs to deliberate the actions.
III. Actuators: - These are the tools, equipment, or organs using which agent performs actions in the
environment. This works as output of the agent.
IV. Sensors: - These are the tools, equipment, or organs using which agent captures the state of the
environment. This works as input of the agent

1.1 Automated Taxi Driver:-

 Performance Measure:
 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.
 Environment:
 Roads: Automated car driver should be able to drive on any kind of a road ranging from city roads to
highway.
 Traffic conditions: You will find different sort of traffic conditions for different type of roads.
 Actuators:
 Steering wheel: used to direct car in desired directions.
 Accelerator, gear: To increase or decrease speed of the car.
 Sensors: To take I/p from environment in car driving example cameras, sonar system etc.

1.2 An Aircraft Auto lander:-

 Performance Measure: Lack of damage to plane, other aircraft or ground structures, lack of injuries to
passengers or ground crew or other innocent observers, cargo remains intact,
fuel economy, lands at correct airport on correct runway, doesn't take too long
 Environment: Lower atmosphere and surface of planet Earth.
 Actuators: Throttle, landing gear, rudders, ailerons, flaps
 Sensors: Cameras, Altimeter, Speedometer, other meters,
38. Tushar Lad

1.3 An Essay Evaluator:-


 Performance Measures: awards scores for quality, penalizes crap, detection of plagiarism,
impartiality,
usefulness of explanation of grading,
 Environment: Software.
 Actuator: None, this can be a pure soft bot.
 Sensors: File reading software, (perhaps even OCR).

1.4 Medical Diagnosis System:-


 Performance measure: Healthy patient, minimize costs, lawsuits
 Environment: Patient, hospital, staff
 Actuators: Screen display (questions, tests, diagnoses, treatments, referrals)
 Sensors: Keyboard (entry of symptoms, findings, patient's answers)

Conclusion: -
Successfully completed the design of Intelligent System using PEAS.
38. Tushar Lad

________________________________________________________________________
________________________________________________________________________

Source Program:

Output:
38. Tushar Lad

Conclusion:______________________________________________________________
________________________________________________________________________

Source Program:

Output:

Conclusion:
38. Tushar Lad

________________________________________________________________________

Source Program:
from collections import deque
class Graph:
# example of adjacency list (or rather map)
# adjacency_list = {
# 'A': [('B', 1), ('C', 3), ('D', 7)],
# 'B': [('D', 5)],
# 'C': [('D', 12)]
#}
def __init__(self, adjacency_list):
self.adjacency_list = adjacency_list
def get_neighbors(self, v):
return self.adjacency_list[v]
# heuristic function with equal values for all nodes
def h(self, n):
H={
'A': 1,
'B': 1,
'C': 1,
'D': 1
}
return H[n]
def a_star_algorithm(self, start_node, stop_node):
# open_list is a list of nodes which have been visited, but who's neighbors
# haven't all been inspected, starts off with the start node
# closed_list is a list of nodes which have been visited
# and who's neighbors have been inspected
open_list = set([start_node])
closed_list = set([])
# g contains current distances from start_node to all other nodes
# the default value (if it's not found in the map) is +infinity
g = {}
g[start_node] = 0
# parents contains an adjacency map of all nodes
parents = {}
parents[start_node] = start_node
while len(open_list) > 0:
n = None
# find a node with the lowest value of f() - evaluation function
for v in open_list:
if n == None or g[v] + self.h(v) < g[n] + self.h(n):
n = v;
if n == None:
print('Path does not exist!')
return None
# if the current node is the stop_node
# then we begin reconstructin the path from it to the start_node
if n == stop_node:
reconst_path = []
38. Tushar Lad

while parents[n] != n:
reconst_path.append(n)
n = parents[n]
reconst_path.append(start_node)
reconst_path.reverse()
print('Path found: {}'.format(reconst_path))
return reconst_path
# for all neighbors of the current node do
for (m, weight) in self.get_neighbors(n):
# if the current node isn't in both open_list and closed_list
# add it to open_list and note n as it's parent
if m not in open_list and m not in closed_list:
open_list.add(m)
parents[m] = n
g[m] = g[n] + weight
# otherwise, check if it's quicker to first visit n, then m
# and if it is, update parent data and g data
# and if the node was in the closed_list, move it to open_list
else:
if g[m] > g[n] + weight:
g[m] = g[n] + weight
parents[m] = n
if m in closed_list:
closed_list.remove(m)
open_list.add(m)
# remove n from the open_list, and add it to closed_list
# because all of his neighbors were inspected
open_list.remove(n)
closed_list.add(n)
print('Path does not exist!')
return None

Output:

Conclusion:

________________________________________________________________________
38. Tushar Lad

________________________________________________________________________
________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
_______________________________________________________

Source Program:
import math
def minimax (curDepth, nodeIndex,
maxTurn, scores,
targetDepth):
# base case : targetDepth reached
if (curDepth == targetDepth):
return scores[nodeIndex]
if (maxTurn):
return max(minimax(curDepth + 1, nodeIndex * 2,
False, scores, targetDepth),
minimax(curDepth + 1, nodeIndex * 2 + 1,
False, scores, targetDepth))
else:
return min(minimax(curDepth + 1, nodeIndex * 2,
True, scores, targetDepth),
minimax(curDepth + 1, nodeIndex * 2 + 1,
True, scores, targetDepth))
# Driver code
scores = [3, 5, 2, 9, 12, 5, 23, 23]
treeDepth = math.log(len(scores), 2)
print("The optimal value is : ", end = "")
print(minimax(0, 0, True, scores, treeDepth))
print("Practical Performed by : Sahil L Nakti, Roll No : 44")

Output:

Conclusion:
38. Tushar Lad

________________________________________________________________________
______________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

Source Program & Output:

Conclusion:
38. Tushar Lad

________________________________________________________________________
________________________________________________________________________
Source Program:

from pybbn.graph.dag import Bbn


from pybbn.graph.edge import Edge, EdgeType
from pybbn.graph.jointree import EvidenceBuilder
from pybbn.graph.node import BbnNode
from pybbn.graph.variable import Variable
from pybbn.pptc.inferencecontroller import InferenceController

print("Pratical Performed By: Sahil L Nakti, Roll No. 44")

a = BbnNode(Variable(0, 'a', ['on','off']), [0.5, 0.5])


b = BbnNode(Variable(1, 'b', ['on','off']), [0.5, 0.5, 0.4, 0.6])
c = BbnNode(Variable(2, 'c', ['on', 'off']), [0.7, 0.3, 0.2, 0.8])
d = BbnNode(Variable(3, 'd', ['on', 'off']), [0.9, 0.1, 0.5, 0.5])
e = BbnNode(Variable(4, 'e', ['on', 'off']), [0.3, 0.7, 0.6, 0.4])
f = BbnNode(Variable(5, 'f', ['on','off']), [0.01, 0.99, 0.11, 0.99, 0.01, 0.99, 0.99, 0.01])
g = BbnNode(Variable(6, 'g', ['on', 'off']), [0.8, 0.2, 0.1, 0.9])
h = BbnNode(Variable(7, 'h', ['on', 'off']), [0.5, 0.95, 0.95, 0.05, 0.95, 0.05, 0.95, 0.05])

bbn=Bbn()\
.add_node(a)\
.add_node(b)\
.add_node(c)\
.add_node(d)\
.add_node(e)\
.add_node(f)\
.add_node(g)\
.add_node(h)\
.add_edge(Edge(a, b, EdgeType.DIRECTED))\
.add_edge(Edge(a, c, EdgeType.DIRECTED))\
.add_edge(Edge(b, d, EdgeType.DIRECTED))\
.add_edge(Edge(c, e, EdgeType.DIRECTED))\
.add_edge(Edge(d, f, EdgeType.DIRECTED))\
.add_edge(Edge(e, f, EdgeType.DIRECTED))\
.add_edge(Edge(c, g, EdgeType.DIRECTED))\
.add_edge(Edge(e, h, EdgeType.DIRECTED))\
.add_edge(Edge(g, h, EdgeType.DIRECTED))

join_tree = InferenceController.apply(bbn)
ev = EvidenceBuilder()\
.with_node(join_tree.get_bbn_node_by_name('a'))\
.with_evidence('on', 1.0)\
38. Tushar Lad

.build()

join_tree.set_observation(ev)
for node in join_tree.get_bbn_nodes():
potential = join_tree.get_bbn_potential(node)
print (node)
print (potential)

Output:

Conclusion:
38. Tushar Lad

________________________________________________________________________
________________________________________________________________________

You might also like