235015, 305450 artificial intelligence ปัญญาประดิษฐ์ 3(2-2-5)

81
235015, 305450 Artificial Intelligence ปปปปปปปปปปปปป 3(2-2-5) ปปปปปปปปปป 1 ปปปปปปปปปปปปปปปปปปปปปปปป (Genetic Algorithm)

Upload: oren-ballard

Post on 01-Jan-2016

22 views

Category:

Documents


1 download

DESCRIPTION

235015, 305450 Artificial Intelligence ปัญญาประดิษฐ์ 3(2-2-5). สัปดาห์ที่ 1 ขั้นตอนวิธีเชิงพันธุกรรม (Genetic Algorithm). Outline. 1. Objectives. 2. What is Genetic Algorithm ?. p. 3. Genetic Algorithm Principle. Genetic Algorithm & Application. 4. Objectives. - PowerPoint PPT Presentation

TRANSCRIPT

235015, 305450Artificial Intelligence

ปั�ญญาปัระดิ�ษฐ์�3(2-2-5)

สั ปัดิาห์�ที่�� 1ขั้ �นตอนวิ�ธี�เชิ�งพั นธี�กรรม (Genetic

Algorithm)

Outline

Objectives1

pp2

Genetic Algorithm Principle3

Genetic Algorithm & Application Genetic Algorithm & Application4

What is Genetic Algorithm ?

Objectives

เพั!�อให์#น�สั�ตร$#และเขั้#าใจในกระบวินการที่างพั นธี�กรรมศาสัตร�

เพั!�อให์#น�สั�ตเร�ยนร$#และเขั้#าใจเก��ยวิควิามสั มพั นธี�ขั้องกระบวินการที่างพั นธี�กรรมศาสัตร�ก บงานดิ#านคอมพั�วิเตอร�

เพั!�อให์#น�สั�ตสัามารถปัระย�กต�ใชิ#ขั้องกระบวินการที่างพั นธี�กรรมศาสัตร� เพั!�อแก#ปั�ญห์าโจที่ย�ปัระย�กต�ดิ#านคอมพั�วิเตอร�ไดิ#

Outline

Objectives1

pp2

Genetic Algorithm Principle3

Genetic Algorithm & Application Genetic Algorithm & Application4

What is Genetic Algorithm ?

What is Genetic Algorithm ?

ไที่ย: ห์ล กการและปัระวิ ต�ขั้องปั�ญญาปัระดิ�ษฐ์� ปัร�ภู$ม�สัถานะและการค#นห์า ขั้ �นตอนวิ�ธี�การค#นห์าการแที่นควิามร$#โดิยใชิ#ตรรกะเพัรดิ�เคต วิ�ศวิกรรมควิามร$# โปัรล0อกเบ!�องต#น การปัระมวิลผลภูาษาธีรรมชิาต�เบ!�องต#น การเร�ยนร$#ขั้องเคร!�องจ กร โครงขั้2ายปัระสัาที่เที่�ยม ขั้ �นตอนวิ�ธี�เชิ�งพั นธี�กรรม ห์�2นยนต�

อ งกฤษ: -

Outline

Objectives1

pp2

Genetic Algorithm Principle3

Genetic Algorithm & Application Genetic Algorithm & Application4

What is Genetic Algorithm ?

Genetic Algorithm Process

Overview of object tracking system

TrajectoryTracking

Algorithm

100 frames

Graph of distance100 frames

Input data Tracking Method Output data

3

The trajectory-based ball detection and tracking

Frames Sequence

Input data

BALL SIZE

ESTIMATION

BALL

CANDIDATE

DETECTION

CANDIDATE

TRAJECTORY

GENERATION

TRAJECTORY

PROCESSING

Output data

How to separate the ball ?

(X1,Y1

,D1)

(0,0)

(X2,Y

2,D2)

(X3,Y3

,D3)

(X4,Y

4,D4)(X5,Y5

,D5)(X6,Y6

,D6)

14

1 2 10

1 2 10

Ball Candidates Representation

15

Initial Population

…...21 11 1 1 1 2 1 1

21 3 4 5 6 100999897

…...21 21 1 1 1 1 2 1

21 3 4 5 6 100999897

…...11 11 1 2 1 2 1 2

21 3 4 5 6 100999897

…...11 11 1 1 2 1 1 1

21 3 4 5 6 100999897

.

.

.

1

2

3

40

.

.

.

Frame No.

Euclidian Distance

Reference Frame Data

Fitness Value Evaluation

Where = Euclidean Distance

= X-Coordinate

= Y-Coordinate

2 2

1 1( ) ( )

E i i i id x x y y

Ed

xy

Fitness value estimation

min( )j 1

nF Dsp

Where = Fitness value per point or frame

= Distance between frame

= Number of population

= Number of frame

Fp

1, 2, 3,...,40i 1, 2, 3,..., 100j

2 21 1( ) ( )s j j j jD x x y y

sD

46

Select the Best Population

…...21 11 1 1 1 2 1 1

21 3 4 5 6 100999897

…...21 21 1 1 1 1 2 1

21 3 4 5 6 100999897

…...11 11 1 2 1 2 1 2

21 3 4 5 6 100999897

…...11 11 1 1 2 1 1 1

21 3 4 5 6 100999897

.

.

.

1

2

3

40

.

.

.

Frame No.

Euclidian DistanceBest Population 8 Chromosome

Crossover operator

Possible cross point

1 1 4

4 1 5 1 6 7

5 6 1

Random 20 Chromosome for Crossing Over

Mutation operator

Random 8 Mutation Chromosome

Random operator

4 New Random Chromosome

Replace all Offspring in New Generation

…...21 11 1 1 1 2 1 1

21 3 4 5 6 100999897

…...21 21 1 1 1 1 2 1

21 3 4 5 6 100999897

…...11 11 1 2 1 2 1 2

21 3 4 5 6 100999897

…...11 11 1 1 2 1 1 1

21 3 4 5 6 100999897

.

.

.

1

2

3

40

.

.

.

Frame No.

Euclidian Distance8 + 20 + 8 + 4 = 40 ?

Outline

Objectives1

pp2

Genetic Algorithm Principle3

Genetic Algorithm & Application Genetic Algorithm & Application4

What is Genetic Algorithm ?

Overview of object tracking system

TrajectoryTracking

Algorithm

100 frames

Graph of distance100 frames

Input data Tracking Method Output data

3

How to classify ball from the other objects?

10

Filtering process

The ball candidate objects can be detected by 4 Boolean Function of sieve processes, there are:

Color range filter ->(H, S, V)

Line filter

Shape filter

Size filter

11

What is the candidate objects?

Where = Boolean Function of Candidate Objects

= Boolean Function of All Objects in Frame

( ) { , , , }O F O O O OW L S Zi i i i

( ) { } { }O F O O O O Ob W L S Zi i i i i

( )O Fbi

( )O F

12

Ball candidates representation

Where = Candidate Objects in Frame

= X-Coordinate

= Y-Coordinate

= Distance

( ) ( , , )C O X Y Di b i i ii

( )C Oi bi

X

Y

D

13

(X1,Y1

,D1)

(0,0)

(X2,Y

2,D2)

(X3,Y3

,D3)

(X4,Y

4,D4)(X5,Y5

,D5)(X6,Y6

,D6)

14

1 2 10

1 2 10

Input candidates before plot graph

15

Best ball trajectory verificationD

ista

nce

Frame No.

1 2 3 4 5 6 7 8

16

Results of segmentation & filtering

17

Position of strength line in frame

Index X-positio

n

Y-positio

n

Distance

Area

1 110.7778 69.44444 129.3669 9

2 186.0909 70.36364 197.6612 11

3 225.3636 72.31818 235.4258 44

4 240.2727 156.8182 285.5359 11

5 436.8276 232 493.2613 29

18

After Background Subtraction

19

20

Euclidean distance tracking

Dis

tanc

e

Timek-1 k k+1

dE1

Shortest = dE2

Current NextPast

dE2

dE3

21

Example of skeleton trajectory

22

Kalman Filter -> Temp position

23

Miss frame identification

Kalman Filter -> Temp position

24

Kalman filter system

1 1,k k k k k x F x w k k k k y H x v

25

Kalman Filter Process

Dis

tanc

e

Timek-1 k k+1

Prediction

Correction by ROI

Current FuturePast

dE1 > Thd

dE2 > Thd

26

Example disadvantage of Kalman Filter

“ROI” CUT FOR FINDING SUITABLE OBJECT

27

ROI area specification

50 pixel

ROI

28

Temp Position-> Kalman Filter

ROI segmentation

The propose of ROI segmentation is finding the candidate ball objects in the interesting area by objective function, that compost of 6 parameters there are:

• 3 o f color parameters (H, S, V) ->Color improvement

• Distance parameter -> Distance normalization

• Shape parameter-> Major and minor axis ratio

• Area parameter -> Average area of previous ball

29

Statistical Dissimilarity Measurement

Where = Statistic dissimilarity measurement

= Mean of interesting object

= Mean of data set

= Variance of interesting object

= Variance of data set

1 2

1 2

| |2Md

Md

121

230

Statistical Similarity

Where = Probabilistic value that transfer from

statistic similarity measurement

= Statistic dissimilarity measurement

1

1s

M

dd

Md

Sd

31

An objective function

w1 = weight of distance

w2= weight for Hue

w3 = weight for Saturation

w4 = weight for Intensity

w5 = weight for Shape of the object

w6 = weight for Area of the object

6( ) 1 2 3 4 5NiP O D D D D D DH S V SP Ai i i i ii i

w w w w w w

32

3 objects upon to probability priority

Color improvement by region reduction

(xb,yb)

xb

yb(xc,yc)

(xb,yb)

xb

yb(xc,yc)

33

ROI

Type of an objects in ROI

Type#1

Type#2Type#3

Type#0

Type#4

34

No object & single object in ROIs

No object in ROI segmentation is Type#0

Single object in ROI segmentation is Type#1

0( ) ; ( )k i iCT O CT n O

1( ) ; ( ) 1k i iCT O CT n O

35

Many objects in ROIs

1 12

1 13

1 14

1 1

; ( ) 1 ( , ) ( ) ( )

; ( ) 1 ( , ) ( ) ( )

( ) ;( ( ) 1 ( , ) ( ) ( ) )

( ( ) 1 ( , ) ( ) ( )

a a

a a

a a

a a

i i i d i i

i i i d i i

k i i i i d i i

i i i d i i

CT n O D O O Th A O Th A O Th

CT n O D O O Th A O Th A O Th

CT O CT n O D O O Th A O Th A O Th

n O D O O Th A O Th A O Th

1 1

)

( ( ) 1 ( , ) ( ) ( ) )a ai i i d i in O D O O Th A O Th A O Th

Type#2 Type#3 Type#4

36

Average types values of objects

Where = Object type

= Integer number represent type of object

= Average value type of each object

1( )

( ) ; 0,1,2,3,4

N

ki

CT OiCN k k

N

40, ,CT CT

0,1, 2, 3, 4k

( )CN k

37

Weight of ROI types

ROI type = ?

Type#3 =

Type#4 =

Type#0 =

3

4

0

38

The specification of ROI type

Where = Region of interest segmentation type

4 4

3 3

2 2

1 1

0

;max{ ( )}

;max{ ( )}

;max{ ( )}

;max{ ( )}

;

T

t CN k CT

t CN k CT

R t CN k CT

t CN k CT

t theother case

RT

39

40

Multiple trajectory generationD

ista

nce

Time1 2 3 4 5 6 7 8

Path 1

Path 2

Path 3

41

Genetic Algorithm Process

42

Chromosome representation

a = The number for specific method

c = Index region of frame

e, f = Population number and frame number

b, d = Not use now

43

Initial chromosome or population

…...23 41 1 6 1 2 7 1

21 3 4 5 6 100999897

…...25 21 4 1 6 1 2 4

21 3 4 5 6 100999897

…...31 35 2 2 1 2 1 2

21 3 4 5 6 100999897

…...57 12 5 1 2 3 4 1

21 3 4 5 6 100999897

.

.

.

1

2

3

40

.

.

.

Frame No.

Euclidian Distance

44

Reference frame data index region

45

Fitness value estimation

100* , 50

50* , 50 40

( , ) 30* , 40 31

20* , 31 16

1* ,

D if SsD if Ss

F i j D if SsD if SsD for the other cases

Where = Fitness value per point or frame

= Speed between frame

= Distance between frame

= Number of population

= Number of frame

( , )F i j

S

1, 2, 3,...,40i 1, 2, 3,..., 100j

2 21 1( ) ( )s j j j jD x x y y

sD

46

Fitness value & weight type

Where = Fitness value per point or frame after weight

= Constant weight value

( , )G i j

kt500

3

1, 0004

10, 0000

47

3

4

0

1 2

3

4

0( , ) ( , ) ;

, 0

if t t

if t tG i j F i j k k

t t if t t

the other case

Best trajectory verification

100

1( ) ( , )

jFP i G i j

min{ ( )}BP FP i

Where = Fitness value per path or all trajectory path

= Best path or best trajectory path

( )FP i

BP

48

Best ball trajectory verificationD

ista

nce

Time1 2 3 4 5 6 7 8

Path 1, F1 = 120

Path 2, F2 = 55

Path 3, F3 = 75

49

Kalman FilterD

ista

nce

Time1 2 3 4 5 6 7 8

(1 3)Miss frame 7 Frame

Linear

50

Cubic spline interpolationD

ista

nce

Time1 2 3 4 5 6 7 8

( 3)Miss frame 7 Frame

Curve

51

52

Example result after previous process

53

Case of impulse transience

Direction

Direction Directi

onDirection

Single-point Impulse Transience

Multi-point Impulse Transience

54

Hierarchy adaptive window size technique

8 4

10 4 7

12 7

if T S T

W if T S Tzif S T

Where = Threshold = 7.10205255

= Speed between contiguous frame

= Window size

T

S

zW

55

Example of error before using HAWz

c c1 2 3 4 5 6 7 8

SP FP

c c1 2 3 4 5 6 7 8 9 10

SP FP

c c1 2 3 4 5 6 7 8 9 10 11 12

SP FP

56

Example of refinement result

57

The End

73