0% found this document useful (0 votes)
7 views

PBBML L9

The document covers a lecture on self-driving cars and their integration with AI, focusing on the technology, trends, and ethical dilemmas associated with autonomous vehicles. It discusses the sensors and algorithms used for navigation, the importance of safety and reliability, and the moral challenges faced by self-driving cars. Additionally, it introduces the Pandas library for data manipulation and analysis in Python, highlighting its core data structures and functionalities.

Uploaded by

Ooi Wei Ying
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)
7 views

PBBML L9

The document covers a lecture on self-driving cars and their integration with AI, focusing on the technology, trends, and ethical dilemmas associated with autonomous vehicles. It discusses the sensors and algorithms used for navigation, the importance of safety and reliability, and the moral challenges faced by self-driving cars. Additionally, it introduces the Pandas library for data manipulation and analysis in Python, highlighting its core data structures and functionalities.

Uploaded by

Ooi Wei Ying
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/ 36

Python Based

Basic Machine Learning


Dr. –Ing. Youjin Kim
Video2
인문대학2호관 331
1:00pm ~
Lec 9
• Self-Driving Car & AI
• Mid-Term Code Review
• Pandas Code Practice

11/21 Video Class


12/5 No Class (Self-Study)
12/12 Final Exam
Self-Driving Cars
• An autonomous car is a vehicle capable of sensing its
environment and operating without human involvement
• A human passenger is not required to take control of the vehicle
• It use a combination of sensors, cameras, and AI algorithms to
navigate the roads safely and autonomously.

https://www.synopsys.com/automotive/what-is-autonomous-car.html
Self-Driving Cars Trend
BBC https://youtu.be/aoBthMBVsZc?si=yQkQfUKVxTC8fKZ8

• The latest trend in self-driving cars is the


increasing focus on safety and reliability.
• Companies are developing advanced sensor
technologies, such as LiDAR and radar, to
improve the car's ability to perceive its
surroundings and react to potential hazards.
CARLOS ROSILLO
• Additionally, AI algorithms are being refined
to make more accurate and timely decisions,
even in complex driving scenarios.

https://english.elpais.com/technology/2024-06-18/study-finds-self-driving-cars-are-safer-than-human-driven-vehicles.html
Self-Driving Car Trends
• Another trend is the integration of self-driving cars with other technologies,
such as smart cities and connected infrastructure. This integration can
optimize traffic flow, reduce congestion, and improve overall transportation
efficiency.
• Companies are working to create intuitive and comfortable self-driving
experiences, with features like personalized entertainment systems and
seamless integration with other devices.

https://www.idtechex.com/en/research-report/software-defined-vehicles-connected-cars-and-ai-in-cars-2024-2034-markets-trends-and-forecasts/974
Self-Driving Cars
1. Sensing the Environment:
• LiDAR (Light Detection and Ranging): sensors emit laser beams
that bounce off objects in the environment and return to the car.
By measuring the time it takes for the laser pulses to return, the car
can create a detailed 3D map of its surroundings (The distance,
shape, and movement of objects like other cars, pedestrians, and
obstacles)

https://youtu.be/Zl3YSPilT-w?si=JrVrSDZuw5_xlRQb
https://www.eejournal.com/article/self-driving-cars-what-the-engineers-think/
Self-Driving Cars
1. Sensing the Environment:
• Cameras: Multiple cameras are used to capture visual information
about the road, traffic signs, lane markings, and other vehicles.
These cameras help the car identify objects, recognize traffic signals,
and understand the overall driving context.
• Radar: Radar sensors emit radio waves that bounce off objects and
return to the car. Radar can detect objects even in low visibility
conditions, such as fog or darkness.

https://youtu.be/Zl3YSPilT-w?si=JrVrSDZuw5_xlRQb
https://www.eejournal.com/article/self-driving-cars-what-the-engineers-think/
Self-Driving Cars
2. Data Processing and Decision Making:
• AI Algorithms: The collected data from the sensors is processed by
powerful AI algorithms. These algorithms analyze the data to understand
the environment, identify potential hazards, and make real-time
decisions about how to navigate the road safely.

https://neptune.ai/blog/self-driving-cars-with-convolutional-neural-networks-cnn
Self-Driving Cars
2. Data Processing and Decision Making:
• Mapping and Localization: The car uses high-definition maps and GPS
to determine its precise location and orientation on the road. This
information is crucial for planning routes, identifying intersections, and
understanding traffic patterns.
• Object Detection and Tracking: AI algorithms are used to detect and
track objects in the environment, such as other cars, pedestrians, and
cyclists. This helps the car anticipate their movements and take
appropriate actions to avoid collisions.

https://www.youtube.com/watch?v=Zl3YSPilT-w
Self-Driving Cars
3. Vehicle Control:
• Actuators: Once the AI algorithms have made a decision, they send
commands to the vehicle's actuators, such as the steering wheel,
brakes, and accelerator. These actuators control the car's movement,
ensuring it follows the planned path and responds to changing
conditions.

https://neptune.ai/blog/self-driving-cars-with-convolutional-neural-networks-cnn
https://www.youtube.com/watch?v=Zl3YSPilT-w
Self-Deriving Car Ethical Issues
• https://youtu.be/ixIoDYVfKA0

https://www.technologyreview.com/2018/10/24/139313/a-global-ethics-study-aims-to-help-ai-solve-the-self-driving-trolley-problem/
5 Moral dilemmas that self-deriving cars face today

1. Predetermined Decisions Over Random Decisions in All Cases


• Self-driving cars are programmed using algorithms.
• So, they are to follow set rules or patterns in all cases.
• Random accidents caused by humans are more justified than the
predetermined death of a human or animal
• Who is responsible for the death(s) caused? self-driving car
manufacturer? software programmer? car itself?
https://www.forbes.com/sites/naveenjoshi/2022/08/05/5-moral-dilemmas-that-self-driving-cars-face-today/
5 Moral dilemmas that self-deriving cars face today
2. Giving Control to the Driver
• Tesla requires the driver to keep their hands on the steering and be
attentive, even when the vehicle is running in fully autonomous
mode.
• To hand over the control to the driver at the last instant?
• the ethics of self-driving cars but also about the ethics of the driver?
5 Moral dilemmas that self-deriving cars face today
3. Rightful Deciders of the Ethics of Self-Driving Cars
• The ethics of self-driving cars are determined by the engineers who work on the
car’s technology
• What they deem right or wrong determines how the car will act in certain
situations like accidents.
• Who is the right person or organization to decide the ethics of self-driving cars.
Is it the engineers who worked on the car technology? Is it the government of the
country where the vehicle will be driven?
• No one is the right owner to decide
the ethics of self-driving cases
https://www.forbes.com/sites/naveenjoshi/2022/08/05/5-moral-dilemmas-that-self-driving-cars-face-today/
5 Moral dilemmas that self-deriving cars face today
4. Program the Car to Make an Impartial Decision
• The best way for a self-driving car is to make an impartial decision in case of
accidents
• NOT discriminate between humans based on age, gender, or other parameters.
Make a decision that causes the least impact.
• Germany has become the first country to adopt such rules It has prioritized
human lives above all other factors.
5 Moral dilemmas that self-deriving cars face today
5. The Hacking Dilemma
• A risk of a cyber criminal hacking into the car’s system to gain
access to sensitive data or to carry out a misdeed.
• What if the autonomous car is hacked by a cybercriminal and
commanded to carry out an accident to implicate the driver? who is
responsible for the accident and loss of lives?
for
loop

i=1, 2, 3, 4, 5, 6, 7

else:
If :
False
i%3==0? print( i )

True
If : False
i%2==0?

True

pass
for
loop

i=1, 2, 3, 4, 5, 6, 7

else:
If : False
i%3==0? print( i )

True

False
If :
i%2==0?

True
continue

print( i )
for
loop

i=1, 2, 3, 4, 5, 6, 7
If you print 3, don’t use if & else structure

If : False
i%3==0?

True

False
If :
i%2==0?

True
continue
print( i )

print( i )
Make the flow chart of this algorithm
By Yourself
Pass vs Continue
for Loop

for Loop

commandment
commandment

Condition 1
commandment1

If True
commandment 1
condition1
Condition 2
commandment2
False

commandment3

If True
commandment 2
condition2

False

commandment 3

Print(“\n”)
Pass vs Continue
for Loop

for Loop
commandment
commandment

Condition 1
commandment1

If True
commandment 1
condition1
Condition 2
Continue
False
commandment2

commandment3
If True
commandment 2
condition2

False

commandment 3

Print(“\n”)
Pass vs Continue
for Loop

for Loop
commandment
commandment

Condition 1
commandment1

If True
commandment 1
condition1
Condition 2
Continue
False
commandment2

commandment3
If True
commandment 2
condition2

False

commandment 3

Print(“\n”)
Practice with new code example!
Fill the blank parts of the algorithm
Pandas
• Pandas is an open-source Python library that is widely used for
data manipulation and analysis, especially in data science and
machine learning.
• It provides data structures and functions designed to work with
structured data, like data tables or time series, making it easier to
clean, transform, and analyze data efficiently.
Pandas
Core Data Structures
• Series: A one-dimensional labeled array that can
hold any data type (integers, strings, floats, etc.).
It is essentially a single column of data, with an
index for each value.
• DataFrame: A two-dimensional labeled data
structure, similar to a table in a database or an Excel
spreadsheet. It has rows and columns, making it
ideal for handling datasets.
Pandas
Data Loading
• Pandas has built-in functions to read data from various formats,
such as CSV, Excel, SQL databases, JSON, and more.
• For example, pd.read_csv("file.csv") loads a CSV file into a
DataFrame, making it straightforward to work with external
datasets.
df.dtypes
• It returns the data types of each column in a
DataFrame. It helps you understand the type
of data stored in each column, which is
crucial for data cleaning and analysis.
• Common data types you might see include:
• int64 for integer values,
• float64 for decimal numbers,
• object for strings or mixed data,
• datetime64 for date and time data,
• bool for Boolean values.
df.info()
• It provides a concise summary of a DataFrame.
It gives important details about the structure and
contents of the DataFrame
• Index and Columns: DataFrame’s index type, the
number of entries, and the names of each column.
• Non-Null Counts: For each column, it shows how
many non-null (non-missing) values are present,
which helps in assessing if there’s any missing data.
• Data Types: The data type of each column (e.g., int64,
float64, object, etc.) is displayed, allowing you to
understand what kind of data each column holds.
• Memory Usage: It shows the memory usage of the
DataFrame, which is helpful when working with large
datasets.
df.describe()
• It a summary of statistical measures for numerical
columns in a DataFrame. It is helpful for quickly
gaining insights into the distribution and central
tendencies of your data.
• When df.describe is used with numerical columns,
it typically returns
• Count: The number of non-null values in each column.
• Mean: The average value of each column.
• Standard Deviation (std): Measures how spread out the values are from
the mean.
• Minimum (min): The smallest value in each column.
• 25% (1st Quartile): The value below which 25% of the data falls.
• 50% (Median or 2nd Quartile): The middle value, dividing the data in half.
• 75% (3rd Quartile): The value below which 75% of the data falls.
• Maximum (max): The largest value in each column.
df.[‘column name’].mode()
• It is used to find the most frequent value(s) in a
specific column of a DataFrame.
• Here's a breakdown of what each part does:
• df: Refers to the DataFrame you’re working with.
• ['column name']: Specifies the particular column within the
DataFrame you want to analyze (replace column name with
the actual name of your column).
• .mode(): A method that calculates the mode, or most
frequently occurring value(s) in the column.
df.loc[df['population']>=1000]
• It is used to filter rows in a DataFrame based on a condition.
• Here's a breakdown of what each part does:
• df: Refers to the DataFrame you’re working with.
• ['population']: Specifies the column in the DataFrame, in this case, population.
• df['population'] >= 1000: This creates a boolean mask (a series of True or False values)
where each row is True if the value in the population column is greater than or equal to 1000
and False otherwise.
• df.loc[ ... ]: The loc method is used to select rows (or columns) by label or condition.
Here, it selects all rows where the condition inside (i.e., df['population'] >= 1000) is True.
Pandas
Data Manipulation and Cleaning
• Filtering and Selecting Data: You can filter data based on
conditions, select specific columns, or retrieve rows that meet
particular criteria.
• Handling Missing Data: Functions like dropna() and fillna() allow
you to handle missing data by removing or replacing it with default
values.
• Sorting and Ranking: Pandas provides functions like sort_values()
to sort data by specific columns.
• Transforming Data: Using methods like apply(), you can apply
custom functions to modify data within your DataFrame.
Pandas
Data Aggregation and Grouping
• You can use the groupby() function to group data by one or more
columns and apply aggregation functions like sum(), mean(),
count(), etc., which is helpful for summarizing data by categories.

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