10
1 1 Jerzy KORCZAK email :[email protected] [email protected] http:// www.korczak-leliwa.pl Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych Inteligencja obliczniowaAG i sieci neuronowe Platforma SUMO Projekt 2 3 Pojęcie Sztucznej Inteligencji Russell S.J., Norvig P., (2009) : Artificial Intelligence : A Modern Approach, Prentice Hall. Winston H.P., Horn, B.K.P. (1992): Artificial Intelligence, Addison-Wesley, 3rd Ed. Artificial Intelligence is the study of the computations that make it possilible to perceive, reason, and act [P.Winston] - the engineering goal of AI is to solve real-world problems - the scientific goal : models of KR, theory of reasoning,... Intelligent systems: auto-adaptation ability to improve the quality of actions through gaining new experiences ability to adjust work parameters depending on the effects ability to solve tasks ability to improve learning strategies 4 5/57 Test of intelligence: is it possible? A real-life Turing test: An interviewer (sitting in a separate room) asks a series of questions that are randomly directed to either a computer or a person. Based on the answers, the interviewer must distinguish which of the two has answered the question. If the interviewer is not able to distinguish between them, then the computer is intelligent. Loebner Price ($100,000) vs M. Minsky Chess: “Deep Blue vs G.Kasparow 3.5 : 2.5- 10 120 possible games - 200 M anlayzed positions per second - opening book & extended book2016 Deep Learning-based defeats a Go world champion 6 Kilka problemów Traveler Salesman Problem (TSP) Given a number of cities and the costs of travelling from any city to any other city, what is the cheapest round-trip route that visits each city exactly once and then returns to the starting city? Willia m Rowan Hamilton

Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

1

1

Jerzy KORCZAKemail :[email protected]

[email protected]

http://www.korczak-leliwa.pl

Sztuczna inteligencja

w logistyce

Wrocław, 2019

Plan

Pojęcie Sztucznej Inteligencji

Kilka problemów algorytmicznych

Inteligencja obliczniowa– AG i sieci neuronowe

Platforma – SUMO

Projekt

2

3

Pojęcie Sztucznej Inteligencji

Russell S.J., Norvig P., (2009) : Artificial Intelligence : A Modern Approach, Prentice Hall.

Winston H.P., Horn, B.K.P. (1992): Artificial Intelligence, Addison-Wesley, 3rd Ed.

Artificial Intelligence is … the study of the computations that make itpossilible to perceive, reason, and act [P.Winston]

- the engineering goal of AI is to solve real-world problems

- the scientific goal : models of KR, theory of reasoning,...

Intelligent systems: auto-adaptation

• ability to improve the quality of actions through gaining new experiences

• ability to adjust work parameters depending on the effects

• ability to solve tasks• ability to improve learning strategies

4

5/57

Test of intelligence: is it possible?

A real-life Turing test: An interviewer (sitting in a separate room) asks a

series of questions that are randomly directed to either a computer or aperson. Based on the answers, the interviewer must distinguish which of

the two has answered the question. If the interviewer is not able to

distinguish between them, then the computer is intelligent.

Loebner Price ($100,000) … vs M. Minsky

Chess: “Deep Blue vs G.Kasparow 3.5 : 2.5”

- 10120 possible games

- 200 M anlayzed positions per second

- “opening book & extended book”

2016 – Deep Learning-based defeats a Go world champion

6

Kilka problemów

Traveler Salesman Problem (TSP)

Given a number of cities and the costs of

travelling from any city to any other city,

what is the cheapest round-trip route that

visits each city exactly once and then

returns to the starting city?

William Rowan Hamilton

Page 2: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

2

Miary odległości – dystans euklidesowy

7

Metryka Manhattan

8

Odległość Czebyszewa

9

S(x,y) = max|xi - yi|

Simple TSP

10

43

21 Node 1 2 3 4

1 0 5 2 4

2 5 0 3 2

3 2 3 0 6

4 4 2 6 0

Cost matrix (distances)

Goal: find out a path with minimum cost

5

2

6

3

3

2

Initially, T(1,{2,3,4}) = min of

{(1,2) + T(2, {3,4}) = 5 + 8 = 13{(1,3) + T(3, {2,4,}) =

{(1,4) + T(4, {2,3,}) =

Simple TSP

11

43

21 Node 1 2 3 4

1 0 5 2 4

2 5 0 3 2

3 2 3 0 6

4 4 2 6 0

Cost matrix (distances)5

2

6

4

3

2

T(1,{2,3,4}) = min of

{(1,2) + T(2, {3,4}) = 5 + 8 = 13{(1,3) + T(3, {2,4}) = 2 + 5 = 7

{(1,4) + T(4, {2,3}) = 4 + 5 = 9

Simple TSP

12

43

21 Node 1 2 3 4

1 0 5 2 4

2 5 0 3 2

3 2 3 0 6

4 4 2 6 0

Cost matrix (distances)

Solution:

5

2

6

4

3

2

Minimum distance is 11 (path 1 3 2 4 1)

What about the time and space complexity?

Page 3: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

3

Brute Force search (exhaustive search)

… it consists systematically enumerating all possible

candidates for the solution and checking whether satisfies the

problem’s statement

13/57

BranchBound

14

… explores branches of this tree, which represent subsets

of the solution set. Before enumerating the candidate solutions of a branch, the branch is checked against upper

and lower estimated bounds on the optimal solution

Dijkstra's algorithm (Shortest Path First)

15

… allows to calculate the

shortest path between one node and every

other node in the graph.

16

Algorithm A* : 8-puzzleGoal: minimise the cost f(n)

f(n) = d(cost from start to n) + d(the cheapest cost from n to the goal) = g(n) + h(n)

Under-estimation h(n)

n h(n) <= h*(n) with h*(n) = real cost

1 4

2 5

7

3 6

8

2

4 8

3 5 6

1 7

2

4 8

3 5 6

1

7

8

2

4

3 5 6

1 7 2

4 8

3

5

6

1 7 2

4 8

3 5 6

1 7

1+5=6 1+6=7 1+4=5 1+5=6

2

4 8

3

5

6

1 7 2

4 8

3

5

6

1 7

2+3=5 2+5=7

SolutionStart

17

Find the path from Wrocław to Warsaw

Easy!

18

TSP with 8 cities using current IT solutions

Google maps application

Page 4: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

4

19

also easy! But what

about the path Gdańsk ->Warsaw?

Find a path from Wrocław to Warsaw and Gdańsk

20

21

What happens if we add another cities to travel?

22

Example with 8 cities:

{Szczecin, Gdańsk, Białystok, Poznań, Warszawa, Wrocław, Kraków, Lublin}

How many

paths possible?

23/57

City 1 City 2 Distance Time Toll Route

Wrocław Gdańsk 450 5h45

Wrocław Kraków 330 4h15

Wrocław Lublin 470 5h30

Wrocław Poznań 170 2h30

Wrocław Szczecin 380 4h30

Wrocław Białystok 530 5h30

Wrocław Warszawa 350 3h30

Poznań Białystok 500 5h15

Poznań Gdansk 330 3h50

Poznań Kraków 460 5h00

Poznań Lublin 470 5h30

Poznań Szczecin 260 2h45

Poznań Warszawa 310 3h15

Szczecin Białystok 750 7h50

Try to solve the problem with the following data:

Complete the

table using

Google maps

Other approaches

Various branch-and-bound algorithms, which can be

used to process TSPs containing 40–60 cities.

Progressive improvement algorithms which use

techniques reminiscent of linear programming. Works well for up to 200 cities.

Implementations of branch-and-bound and problem-specific cut generation (branch-and-cut); this is the

method of choice for solving large instances. The current

record: 85,900 cities

Computational intelligence: GA, ant colony,…

24

Page 5: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

5

25

Heuristics

Heuristics ( hill climbing, local methods)

Attempt to maximize a target function f(x,y)

by application of an operator R that moves

from (xn-1

,yn-1

) to (xn,y

n) in a way that

f(xn,y

n) > f(x

n-1,y

n-1)

Two classes of operators:

1) gradient descent f

2) evaluation of f in environment

of (xn-1

,yn-1

)

Evolution-based methods

?

GA: Representation

Goal: represent the solution of the problem in a

computer-based form

Most important part of a GA

Two similar solutions should have similar

representations

26

27

Evolution-based approach: search space

28

Genetic algorithms

Genetic programming

Learning classifiers

Evolutionary strategies

… evolutionary algorithms are based on the

mechanics of natural selction and genetics.

Ch. DARWIN « On the Origin of Species by Means of Natural Selection », 1859

« surivival of the fittest »

Approaches in Artificial Evolution

Example of GA: Representation

List of cities to visit:

1) London 3) Vigo 5) Beijing 7) Tokyo

2) Venice 4) Singapore 6) Phoenix 8) Victoria

CityList1 (3 5 7 2 1 6 4 8)

CityList2 (2 5 7 6 8 1 3 4)

An “individual”

or “solution”

A “gene”

29

GA: Initialization

Goal: generate a random population of individuals

First pool of solutions (“primordial soup”) given by

the GA

30

Page 6: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

6

Genetic operation: Two-point crossover

In two-point crossover, two routes are picked randomly from

the parent chromosomes. The cities in the two routes are swapped between the parents. The results in two children

carrying some genetic information from both parents.

Example:

Parents:

CityList1 (3 5 7 2 1 6 4 8)

CityList2 (2 5 7 6 8 1 3 4)Children

CityList3 ( 3 5 7 6 1 2 4 8)

CityList4 ( 2 5 7 2 8 6 3 4)

31

Crossover points

GA: Initialization

London 3) Vigo 5) Beijing 7 ) Tokyo

2) Venice 4) Singapore 6) Phoenix 8) Victoria

CityList1 (3 5 7 2 1 6 4 8)

Many solutions of this

kind are created!!

CityList1 (3 5 7 2 1 6 4 8)CityList2 (2 5 4 1 8 6 7 3)...CityList100 (6 8 1 2 5 7 4 3)

32

GA: Evaluation

Goal: gives a score (or fitness) to the solutions

Second most important part of a GA

Fitness = how good is a solution

In our application: length of the pathFitness(CityList1 ) = 71.537 km

Goal: MINIMIZE IT!!

33/57

GA: Selection of parents Goal: select the parents to build the next generation

Based on elitism, roulette wheel, ...

Individual f(x) Fitness

(3 5 7 2 1 6 4 8) 71.537 km 0.16

(4 3 7 1 2 6 5 8) 30.532 km 0.21

(5 6 1 4 2 8 3 7) 95.262 km 0.13

(7 5 3 2 1 4 8 6) 155.650 km 0.06

(7 1 8 2 3 5 4 6) 28.508 km 0.21

(2 5 4 8 7 6 3 1) 19.417 km 0.23

Sum: 400 906 km 1

We select randomly

parents, lowest fitness will

be prefered

0.16%

0.21%

0.13%

0.06%

0.21%

0.23%

34

GA: Crossover of parents Goal: exploit knowledge in both parents

Exchange genetic material from both parents

Typical on binary strings: one point crossover

On ordered list: OX1 operator

Parent 1 (3 5 7 2 1 6 4 8)

Parent 2 (1 6 7 4 8 3 5 2)

Child 1 (5 2 7 4 8 3 1 6)

Child 2 (4 8 7 2 1 6 3 5)

We exchange a part, then the

remaining is filled by omitting

the existing values

(3 5 7 2 1 6 4 8)

(1 6 7 4 8 3 5 2)

35

GA: Mutation of parents Goal: explore new search space

Modify randomly one gene

Parent (3 5 7 2 1 6 4 8)

Child (3 5 6 2 1 7 4 8)

Mutations are random: we do

NOT care about results!!

36

Page 7: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

7

GA: Final solution

After many, many generations, we

finally found a good solution!!

Fitness(CityList1015 ) = 37.797 km

37

Ant Colony Optimisation (ACS)

Large number of virtual ant agents

Virtual pheromone deposits on the edgeFind edges with max pheromone depos

38

Alternate solutions are too slow or overly complicated

Need an exploratory tool to examine new approaches

Problem is similar to one that has already been

successfully solved by using a GA

Want to hybridize with an existing solution

Benefits of the GA technology meet key problem

requirements

When to use a GA?

39 40

Traffic simulation

http://http://www.traffic-simulation.de/

ALVINN

Autonomous driving at 70 mph on a public highway

Camera image

30x32 pixelsas inputs

30 outputsfor steering 30x32 weights

into one out offour hiddenunit

4 hiddenunits

41 42

Concept of neural network

….A neural network is an interconnected assembly of

simple processing elements, nodes, whose functionality is loosely based on the animal neuron. The processing

ability of the network is stored in the inter-unit connection

strengths, or weights, obtained by a process of adaptation

to, or learning from, a set of training patterns.” — Gurney

“... a neural network is a system composed of many

simple processing elements operating in parallel whose

function is determined by network structure, connection

strengths, and the processing performed at computing elements or nodes.” — DARPA Neural Network Study

(1988)

Page 8: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

8

Idea of neuron operation

43/57

Deep Neural Network

44

45 46

Tesla’s new AI – Autopilot software

Levels of autonomous driving capability:

1. One function is automated – Electronic Stability Control

2. Multiple functions working together are automated:

automatic emergency braking and lane keeping

3. Cars can drive themselves, but drives are needed to

intervene if necessary

4. Humans are’nt needed at all

5. Cars could go from point A to B with no human

intervention.

47

Demo: https://www.techrepublic.com/article/autonomous-driving-levels-0-to-5-understanding-the-differences/

48

Monitoring of

deliveries

Delivery

executed

Quantitative and

qualitative report

The driver prior

to any action transmits the

status of information on

the progress of work

The system can also

send a message to the customer about

the estimated time of delivery or possible

delays

Re

al-

tim

e info

rmation

Application

Transport coordinator

Client

48

Page 9: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

9

Application

4949

To see

• https://www.youtube.com/watch?v=tlThdr3O5Qo

• https://www.youtube.com/watch?v=rD9PGi8hHvY

• https://www.youtube.com/watch?v=vmw7w97a6LA

• https://www.youtube.com/watch?v=aqrttLPjv1E

50

preceding processes

multimodal logistics-hub

here: airport

CC-Platform for

control & optimization ofmultimodal, fragmented

process chains

consequent processes

Far Perspective

51 52/57

SUMO – Simulation of Urban MObility

SUMO is a free and open traffic simulation

suite, it allows modelling of intermodal traffic systems including road vehicles,

public transport and pedestrians.

Traffic simulations facilitate the evaluation of infrastructure changes as well as policy

changes before implementing them on

the road. Included with SUMO is a wealth of

supporting tools which handle tasks such

as route finding, visualization, network import and emission calculation. SUMO can be enhanced with custom models and provides various APIs

to remotely control the simulation.

dlr.de/ts/sumo

SUMO – features

• Microscopic simulation - vehicles, pedestrians and public

transport are modeled explicitly

• Online interaction – control the simulation with TraCI

• Simulation of multimodal traffic, e.g., vehicles, public

transport and pedestrians

• Time schedules of traffic lights can be imported or

generated automatically by SUMO

• No artificial limitations in network size and number of

simulated vehicles

• Supported import formats: OpenStreetMap, VISUM,

VISSIM, NavTeq

53

Use Cases in Logistics

Intelligent Robotic Sorting

Autonomous guided vehicles (AGVs)

AI-Powered Visual Inspection

Computer Vision Inventory Management & Execution

Conversational Interfaces, voice agents

54

Page 10: Plan Sztuczna inteligencja Pojęcie Sztucznej Inteligencji w logistyce · Sztuczna inteligencja w logistyce Wrocław, 2019 Plan Pojęcie Sztucznej Inteligencji Kilka problemów algorytmicznych

10

55

Seeing, speaking & thinking logistics operations

Advanced Business IT-services, e.g.• Financial accounting, Business-Planning, Controlling

• ERP/ERM / CRM / SRM / PRM• E-Procurement, E-Commerce

Advanced Logistics IT-services, e.g.• Route planning & -optimization

• Tracking & Tracing, Fleet-Management

• Freight-Management, Order-Management

• Warehouse-Management, Supply-Chain-Management

Service Economics Faster, Cheaper, Better… Customization, push to pull processes

Demand for Improved Interoperability!

IT and AI in Logistics and Transport

56

Incentive: Interest in „cheap“ & easy access to:

Enforcement: market pressure / competitiveness

/ customer expectation of:

56

Key AI Predictions for 2020

• More money will pour into AI enterprise

projects than ever before

• A lot of AI projects will fail, in a costly manner.

• The way we interact with machines will

continue to shift towards voice.

• Robots will become more closely involved in

looking after our health and wellbeing.

57