Research Report -...

62
Research Report Meteor: An Intelligent Approach Diploma Thesis in Computer Science Thomas Rawyler [email protected] Benjamin M¨ uller [email protected] July 12, 2007 Version 1.0 Customer: Armagh Observatory, Northern Ireland Project Supervisors: Bernhard Anrig, Rolf Haenni Projectmanagement-Coach: Frank Helbling Website: http://projects.ti.bfh.ch/meteor

Transcript of Research Report -...

Page 1: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Research Report

Meteor: An Intelligent Approach

Diploma Thesis in Computer Science

Thomas Rawyler

[email protected]

Benjamin Muller

[email protected]

July 12, 2007

Version 1.0

Customer: Armagh Observatory, Northern Ireland

Project Supervisors: Bernhard Anrig, Rolf Haenni

Projectmanagement-Coach: Frank Helbling

Website: http://projects.ti.bfh.ch/meteor

Page 2: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Copyright c© 2007 by Thomas Rawyler and Benjamin Mueller

Permission is granted to copy, distribute and/or modify this document under the terms

of the GNU Free Documentation License, Version 1.2 or any later version published by

the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no

Back-Cover Texts. A copy of the license is included in the appendix entitled “GNU Free

Documentation License”.

This documentation has been typeset by LATEX.

Version Description

0.1 Created document structure

1.0 Release

Page 3: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Abstract

The Armagh Observatory of Northern Ireland maintains three standard surveillance cam-

eras on the roof of the observatory. These are used to record meteors when they enter

the Earth’s atmosphere and leave an ionisation trail, commonly known as a falling star.

Unfortunately, many other events are recorded by the cameras, such as swarms of birds,

airplanes, thunderstorms, cosmic rays and many more. The goal of the project is to classify

the recorded movies automatically by using concepts of artificial intelligence, e.g. artificial

neuronal networks or Bayesian classifiers.

Page 4: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

iv Meteor: An Intelligent Approach

Page 5: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Contents

Contents v

List of Figures vii

List of Tables viii

1 Introduction 1

1.1 Research and Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.1.1 Research Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Video Analysis 3

2.1 Movie Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Movie Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.3 Loading Movies into Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.4 Movie Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4.1 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4.2 Cleansing the Movie . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4.3 Object Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.5 Feature Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.5.1 The Size Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.5.2 The Speed Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.5.3 The Brightness Feature . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.5.4 The Direction Feature . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.5.5 The Shape Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.5.6 The Duration Feature . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.5.7 The Number of Moving Objects Feature . . . . . . . . . . . . . . . . 16

3 Classification 17

3.1 Weka Datamining Software . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1.1 Data Pre-Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.1.2 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.2 Naıve Bayesian Classifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2.1 Mathematical Treatment . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2.2 Building a classifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2.3 Continuous Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Meteor: An Intelligent Approach v

Page 6: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Contents

3.2.4 Naıve Credal Classifiers . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.3 Artificial Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.3.1 Basic Architecture of Artificial Neural Networks . . . . . . . . . . . 25

3.3.2 Backpropagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.3.3 Normalisation of the Data . . . . . . . . . . . . . . . . . . . . . . . . 30

4 Classification Tests 31

4.1 Computing the Feature Vectors . . . . . . . . . . . . . . . . . . . . . . . . . 31

4.1.1 Collecting the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.1.2 Examples of the collected data in different file formats . . . . . . . . 32

4.2 Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.2.1 Analysis of Our Test Data . . . . . . . . . . . . . . . . . . . . . . . . 34

4.3 Classification Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.3.1 Bayesian Classifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.3.2 Artificial Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . 35

5 Diploma Thesis 37

5.1 Video Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.1.1 De-noising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.1.2 Binarisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.1.3 Preselection of Bad Movies . . . . . . . . . . . . . . . . . . . . . . . 37

5.1.4 Implementation of New Features . . . . . . . . . . . . . . . . . . . . 37

5.2 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.2.1 Exploratory Data Analysis . . . . . . . . . . . . . . . . . . . . . . . 38

5.2.2 Normalisation of the Feature Vectors . . . . . . . . . . . . . . . . . . 38

5.2.3 Discretisation of the Feature Vectors . . . . . . . . . . . . . . . . . . 38

6 Final Statements 39

6.1 Thomas Rawyler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6.2 Benjamin Muller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

A Illustrations of the meteor cameras 43

B GNU Free Documentation License 44

Glossary 52

Bibliography 54

vi Meteor: An Intelligent Approach

Page 7: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

List of Figures

1.0.1 The Observatory of Armagh . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2.3.1 Conversion via mplayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4.1 Original Image from the Camera . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4.2 Averaging Through Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4.3 The Background Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.4.4 The Original with the Background Removed . . . . . . . . . . . . . . . . . . 6

2.4.5 Denoised Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.4.6 The Trace Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.4.7 Binarised Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.4.8 An Example of a Structuring Element . . . . . . . . . . . . . . . . . . . . . 10

2.4.9 Opened Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.5.1 The Average Size of an Object . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.5.2 The Average Brightness of an Object . . . . . . . . . . . . . . . . . . . . . . 14

2.5.3 The Direction (Straightness) of an Object . . . . . . . . . . . . . . . . . . . 15

2.5.4 Straight Path (Deviation: 3.3685) . . . . . . . . . . . . . . . . . . . . . . . . 15

2.5.5 Curved Path (Deviation: 121.4808) . . . . . . . . . . . . . . . . . . . . . . . 16

3.1.1 Weka After Start up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.1.2 Sample Data in the ARFF-Format . . . . . . . . . . . . . . . . . . . . . . . 19

3.1.3 Weka’s Data Pre-Processing Tool . . . . . . . . . . . . . . . . . . . . . . . . 20

3.1.4 Classification with Weka . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.1.5 Typical Output of a Classification-Run . . . . . . . . . . . . . . . . . . . . . 21

3.3.1 Sigmoid Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4.1.1 CSV file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.1.2 ARFF file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.1.3 FANN file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.2.1 Distribution of the Testdata in the Feature Space . . . . . . . . . . . . . . . 35

A.0.1Meteor cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

A.0.2Inside a meteor camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

A.0.3Meteor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Meteor: An Intelligent Approach vii

Page 8: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

List of Tables

2.2.1 Movie Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

4.1.1 Data File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

viii Meteor: An Intelligent Approach

Page 9: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 1

Introduction

After Benjamin Muller had been to Armagh in Northern Ireland in summer 2006 for a

international student exchange, the important first contact has been established. Both of

us have been looking for a project related to artificial intelligence in spring 2007. The idea

came up to contact Armagh and ask the Observatory for an AI project possibility. The

answer: “It would be nice, if an intelligent program would classify our recorded movies

automatically.” This was an interesting proposal, so we answered the call. In March 2007,

we travelled to Armagh and finally accepted the assignment of intelligent meteor movie

classification.

Figure 1.0.1: The Observatory of Armagh

Meteor: An Intelligent Approach 1

Page 10: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 1 Introduction

1.1 Research and Prototypes

1.1.1 Research Goals

Within the research phase, which has been the content of our semester project, we wanted

to achieve a development status, that forms the basis of the later implementation during

the diploma thesis. The primary target of the research is to get usable prototypes for each

of the two aspects of our whole work, that is “Video Analysis” and “Classification”. The

goals are listed below:

Video Analysis

Define a useful feature vector for each movie

Extract some of the features specified from a movie

Classification

Study different types of classification methods

Attempt to classify the movies

Reflect upon the gathered features about their reliability

2 Meteor: An Intelligent Approach

Page 11: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Mathematics is the queen of the

sciences.

Carl Friedrich Gauss

Chapter 2

Video Analysis

First of all, we had to define which software suits best for our release video analysis that

relies on motion detection and pattern recognition. We decided to use Matlab because

we both have been familiar with this application. Matlab is indeed adequate for image

processing related functions.

2.1 Movie Source

The cameras are being controlled by the third-party software UfoCapture1. This software

observes the frames recorded by the cameras and whenever a brightness changes by a

defined value and in a defined period of time UfoCapture starts to record the movie until

the event is over. The software keeps some frames in a buffer so that when an event occurs

the movie is not stored as of the beginning of the even instead some previous frames are

stored as well. With the given configuration the event is recorded at frame 36.

2.2 Movie Properties

At the bottom of the release video analysis, are the movies which have to be loaded into

the Matlab environment. The properties of the movie are listed in table 2.2. The trigger

event is recorded around frame 36 by UfoCapture.

Size 640x480Duration 50-200 framesFrame rate 30 fpsColour format YUV

Table 2.2.1: Movie Properties

2.3 Loading Movies into Matlab

Matlab does not support compressed movies under UNIX. Therefore, the movies have to

be converted into an uncompressed format. We are using the software mplayer which

1UfoCapture of Sonotaco http://sonotaco.com/e_index.html

3

Page 12: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

can export a movie into images and deinterlace them by using the command shown in

code listing 2.3.1. This command extracts each frame of the input movie and stores it

as a JPEG-file, in addition it performs a deinterlacing, since our movies are recorded

as interlaced movies. To simplify the development, we wrote a Matlab function which

encapsulates the mplayer command and returns a sequence of images. TODO: explain

interlacing /deinterlacing

mplayer -vf pp=md -vo jpeg ../ movies/meteor/NWCAM/M20060829_010939 .avi

Figure 2.3.1: Conversion via mplayer

2.4 Movie Processing

The theoretical material is heavily based on the scripts from the courses Image Processing

and Computer Vision of Prof. Roger Cattin2 [3] and [2].

2.4.1 Preparation

After loading the movie into Matlab as described in section 2.3 “Loading Movies into

Matlab”, the movie has to be converted to greyscale for further processing. Greyscale

is in our case not a loss of quality because the movie is almost colourless. For image

processing operations it is definitely an advantage to perform on greyscale image data.

2.4.2 Cleansing the Movie

The surveillance cameras have to operate under difficult circumstances. The sensitivity

has to be very high due to the fact that they have to operate in complete darkness to record

the sometimes very faint meteors. The sensitivity is so height, that one can even see the

star constellations, which is important for the astronomical analysis of the meteor-videos.

Because of these reasons we had to apply different image cleansing and enhancement

methods. These include operations such as noise removal, contrast enhancement and

thresholding for image binarisation, that is distinguish objects of interest from background.

To get to the final analysable result, the operations described in the following sections are

performed on the movie sequentially. Figure 2.4.1 shows a frame in its original state as

it comes out of the cameras. Please note that for all the example images the colour is

inverted in order to improve the visibility. The big black spot is actually the moon, which

we are trying to remove.

2Head of the Computer Perception Group and lecturer in the courses Image Processing and Computer

Vision at the Bern University of Applied Sciences

4 Meteor: An Intelligent Approach

Page 13: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Figure 2.4.1: Original Image from the Camera

2.4.2.1 Calculate Background

The background is being extracted by adding every single frame of the movie together and

dividing the result by the number of frames. Visually spoken to calculate the background

we calculated the average of each pixel through time as depicted in figure 2.4.2.

Figure 2.4.2: Averaging Through Time

This will build up an image which consists of objects that have not been moving fast

enough. Due to the fact, that the background is in particular a mean value of all frames, it

can be subtracted from every image to remove objects like the moon. Figure 2.4.3 shows

the calculated background of the movie and figure 2.4.4 shows the original frame where

the background has been removed. Notice that there is still something of the moon left

but this will be purged with further processing.

2.4.2.2 Remove Noise

One source of noise are the CCD- or CMOS-chip in the cameras. More exactly, it occurs

during the amplification process of the chip-readout by the camera’s electronic. As it

depends on the input signal, it is denoted multiplicative noise. Another source of noise,

the so-called additive noise as it does not depend on the input signal, can have various

Meteor: An Intelligent Approach 5

Page 14: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

Figure 2.4.3: The Background Image

Figure 2.4.4: The Original with the Background Removed

causes which occur usually during image transmission, such as atmospheric events or man-

made events.

During the semester project we tried different approaches. These are:

• Gaussian Filter

• Fourier Transform filtering

• Wiener Filter

Gaussian Filter As mentioned before, the movies are of unsatisfiable quality. A well

known and promising method is to apply a Gaussian filter that smooths the image and

therefore removes high frequencies in images. The filtering requires a Gaussian kernel

and a source image. The Gaussian kernel comprises elements determined by a Gaussian

function.

The following formulae show how a Gaussian kernel is being created:

G(i, j) =e−(i2+j2)

2σ2 (2.1)

G(i, j) =1

2πσ2e−

(i2+j2)

2σ2 (2.2)

6 Meteor: An Intelligent Approach

Page 15: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

The standard deviation σ is proportional to the size of the neighbourhood on which the

Gaussian filter operates. The resulting Gaussian kernel is:

G(1, 1) G(1, 2) · · · G(1, j)

G(2, 1) G(2, 2) · · · ......

.... . .

...

G(i, 1) · · · · · · G(i, j)

(2.3)

With the created Gaussian kernel, the pixel values of the smoothed image are calculated.

The kernel is being seated with its centre on the source pixel and the resulting values are

computed as shown in the following formula.

S(x, y) =

wW∑

i=−wW

wH∑

j=−wH

G(i, j) ∗ I(x + i, y + j)

/D + B (2.4)

Where S is the smoothed image, G the Gaussian kernel and I the source image. D is the

division factor and B is the bias value. Such a filter gives the image a blurred appearance

if the width of the mask is high, and has the effect of smearing out the value of a single

pixel over an area of the image.

Fourier Transform De-noising (and other filtering) can also be done in frequency space as

the noise generally has a high frequency compared with the actual objects (high frequency

here means the spatial changement of the noise).

Based on the concept of the frequency of noise, one could use the fourier transform and

a low-pass filter to filter the high frequent noise. The discrete fourier transform (DFT)

and the inverse DFT is given by

X[k] =N−1∑

n=0

x[n]e−2πi

Nkn k = 0, 1, . . . , N − 1 (2.5)

x[n] =1

N

N−1∑

k=0

X[k]e−2πi

Nkn n = 0, 1, . . . , N − 1 (2.6)

The 2-D Discrete Fourier Transform [see ? ] used in image analysis can be used to

filter the images in frequencies space. After computing the 2-D DFT a low-pass filter can

be applied which masks out all high frequencies as they represent the noise. After this

operation the image has to be restored by performing the inverse 2-D DFT.

Wiener Filter Analysing the movies, we can see that the noise is not distributed uni-

formly. There are certain regions which are covered with higher density of noise than

others. This noise density discrepancy is caused by the camera’s image sensor, which re-

acts differently to dark and bright regions. Hence, an adaptive noise removal filter suggests

itself. In our case, we can use the Wiener filter without its point spread function (PSF),

Meteor: An Intelligent Approach 7

Page 16: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

because we only have to remove noise. We made some tests with the Wiener method in

Matlab. Thus the results have been satisfying, we consider to implement the Wiener filter

during the diploma thesis. The following formulae show, how the Wiener filter works pixel

wise.

µ =1

NM

kx,ky∈K

i(kx, ky) (2.7)

σ2 =1

NM

kx,ky∈K

i2(kx, ky) − µ2 (2.8)

w(kx, ky) =µ +σ2 − ν2

σ2(i(kx, ky) − µ) (2.9)

Where K is the N -by-M local neighbourhood of each pixel i in the image I. The local

mean µ and the variance σ are used to calculate the resulting image W . The noise variance

ν2 is the average of all the local estimated variances.

Figure 2.4.5 shows the denoising of the image. The effect is not clearly visible as the

image has been smoothed during the deinterlace process by mplayer. In the diploma thesis

this has to be done prior to the deinterlacing.

Figure 2.4.5: Denoised Image

2.4.3 Object Detection

2.4.3.1 Detect Moving Objects

A marvellous method to extract moving objects is to subtract the previous image from

the current one which leaves only changed pixel values. These can mostly be assumed to

be part of a moving object.

Dn(i, j) = In(i, j) − In−1(i, j) (2.10)

Where Dn is the nth difference image, constructed of the current image In subtracted by

the precedent image In−1.

8 Meteor: An Intelligent Approach

Page 17: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

2.4.3.2 Binarise the Movie

The movie is now ready for binarisation. To binarise the movie, a thresholding is performed

on each image. It is recommended to apply as first operation a contrast stretch which

stretches the histogram of an image to the full range.

v =

αu : 0 ≤ u < a

β(u − a) + va : a ≤ u < b

γ(u − b) + vb : b ≤ u < G − 1

(2.11)

Where a and b are the points, where the slope is adjusted and the parameters va and vb

are the values of there points in the output image and α, β, γ give the steepness of the

slope-parts.

The automatic contrast stretch is given by the following formula:

v =(u − kmin)(G − 1)

kmax − kmin(2.12)

After the contrast stretching, the threshold is set to cutoff background pixel values and

merge them to the binary value zero and objects are being kept alive resulting in the

binary value one.

B(x, y) =

{

1 : I(x, y) > threshold

0 : I(x, y) < threshold(2.13)

Where B is the binary pixel value resulting from thresholding the greyscale image I.

Further processing and attribute extraction is explained in section 2.5 “Feature Vector”.

Binarisation Implementation As we have always been looking for a better binarisation,

we received helpful input from Mr. Cattin. We analysed the images of the movies and

he proposed that we could get better results by applying contrast stretching first and

then use the hysteresis threshold method. After testing this method for binarisation, we

realised, that it provides very pleasing results. Therefore, we are going to implement the

binarisation with hysteresis threshold during the diploma thesis.

The following description shows, how the hysteresis threshold is being applied:

The algorithm uses two thresholds, Thigh and Tlow and an image I as input.

• A pixel I(x, y) is called strong, if I(x, y) ≥ Thigh.

• A pixel I(x, y) is called weak, if I(x, y) < Tlow.

• The remaining pixels are candidate pixels.

The algorithm scans the image row by row, until a strong pixel at (x, y) is found. Then,

the function trace is called, which is explained with the pseudo code described in the

listing 2.4.6. The result of the binarisation process can be seen in figure 2.4.7. As it can

Meteor: An Intelligent Approach 9

Page 18: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

trace(x,y)

{

create a queue ’q’ of positions

enqueue (x,y) in ’q’

while ’q’ is not empty {

pop position (xq ,yq) from ’q’

if (xq ,yq) is inside image AND pixel (xq ,yq) is strong OR candidate AND

the result(xq ,yq) is not yet marked as object {

mark result(xq ,yq) as object pixel

enqueue all 8-connected neighbours of (xq ,yq) in ’q’

}

}

}

Figure 2.4.6: The Trace Function

be seen clearly is that, there are still many speckles left which disturb the image. This is

corrected in the next step.

Figure 2.4.7: Binarised Image

2.4.3.3 Opening the Binarised Image

As previously mentioned, the now binary image is still disturbed by small pixels. Now the

morphological operators can be applied to remove these disturbing pixels. Morphological

operators take a binary image A and a so called structuring element B as their inputs.

The structuring element is a binary pattern like shown in figure 2.4.8.

0 1 0

1 1 1

0 1 0

Figure 2.4.8: An Example of a Structuring Element

Dilation For each background pixel (input pixel) in the image, the structuring element

is superimposed with its origin coinciding with the input pixel. If at least one “1” pixel

10 Meteor: An Intelligent Approach

Page 19: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

of the structuring element coincides with a foreground pixel in the input image, the input

pixel is set to the foreground value “1”. Otherwise it is left at the background value “0”.

The mathematical definition of the dilation X ⊕ B is

• Suppose that X is the set of Euclidean coordinates corresponding to the input binary

image, and that B is the set of coordinates for the structuring element.

• Let Bx denote the translation of B so, that its origin is at x.

• Then the dilation of X by B is simply the set of all points X, such that the inter-

section of Bx with X is non-empty.

or

X ⊕ B = {p ∈ ǫ2 : p = x + b, x ∈ X and b ∈ B}

The effect of the dilation is to enlarge the boundaries of objects while holes within these

become smaller.

Erosion For each foreground pixel (input pixel) in the image, the structuring element is

superimposed with its origin coinciding with the input pixel. If for every “1” pixel in the

structuring element, the underlying pixel is a foreground pixel, the input pixel is left with

its value. Otherwise it is set to the background value.

The mathematical definition of the erosion X ⊖ B is

• Suppose that X is the set of Euclidean coordinates corresponding to the input binary

image, and that B is the set of coordinates for the structuring element.

• Let Bx denote the translation of B so, that its origin is at x.

• Then the erosion of X by B is simply the set of all points x, such that Bx is a subset

of X.

or

X ⊖ B = {p ∈ ǫ2 : p + b ∈ X for every b ∈ B}

The effect of the erosion is to erode (remove) away the boundaries of an object while

holes within these become larger.

Opening The opening operator has the effect that it leaves all object where the structur-

ing element has a similar shape and removes all other objects. It is a sequence of applying

first an erosion and then, to reestablish the shape of the object, a dilation is being applied.

Therefore, the definition of the opening X ◦ B is

X ◦ B = (X ⊖ B) ⊕ B

Meteor: An Intelligent Approach 11

Page 20: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

Closing The closing operator has the same effect as the opening operator with the dif-

ference that it considers the background pixels instead of the object pixels. Therefore the

definition of the closing X • B is

X • B = (X ⊕ B) ⊖ B

Opening the Binarised Image The result of opening the previously binarised image can

be seen in figure 2.4.9.

Figure 2.4.9: Opened Image

2.5 Feature Vector

The feature vector is used in the classification process and should containt the inherent

features that different moving objects posses. The feature vector is defined for all objects

not only for the meteors. The goal is to have features that divide the feature space as

good as possible into meteor and non-meteors. The definition of the feature vector is based

mostly on the way a human would determine the class. We determined a feature vector

which consists of the following seven attributes of each moving object:

1. Size (done in semester project)

2. Speed

3. Brightness (done in semester project)

4. Direction (done in semester project)

5. Shape

6. Duration

7. Number of moving Objects

12 Meteor: An Intelligent Approach

Page 21: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

As you can see, three features are being extracted by our semester project image analysis

prototype. The individual feature extraction method implemented and a possible solution

for the remaining features is explained later in this section. Now that the images have

been binarised, we are able to extract properties of the objects found during the cleansing

process. To optimise the complexity in time of the whole process, the feature vector values

are being calculated within the same loop as the images are being cleansed and binarised.

A problem arises if there are two objects identified by the video analysis. This is known

as the correspondence problem.

Correspondence Problem The correspondence problem denotes the problem to identify

in two subsequent frames which objects belong to each other. In a concrete case, when

there are three moving objects visible in a movie, the problem is to track each object

individually such that the features can be computed accurately.

2.5.1 The Size Feature

The size feature stands for the average area of a binary object. We have to consider the

area of an object in function of the time it appears on the movie. The average area is

being calculated as shown with the pseudo code in figure 2.5.1. We calculate the average

size of an object, because sometimes a meteor splits up into pieces and grows during the

recording.

average area = 0

object frames = 0

for each frame in binarised movie {

if the frame is not empty {

increment object frames by 1

for each pixel in frame {

if pixel has value 1 then {

increment average area by 1

}

}

}

}

average area = average area / object frames

Figure 2.5.1: The Average Size of an Object

2.5.2 The Speed Feature

The speed of an object can be calculated by taking the first and the last frame on which

it is visible and calculate the distance in pixels that the object has covered. Since the

frame rate is given, we can deduce the speed as pixels per second. Another, more detailed,

approach is to include every frame the object appears and save the centroid of the object.

With the calculated centroids, we could be able to derive a speed function that is dependent

on time and the positions of the centroids, f(x, y, t) : N × N × R −→ R, where x and y

Meteor: An Intelligent Approach 13

Page 22: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

represent the coordinates of a centroid and t is the time in seconds. This approach allows

us to see, if the object is accelerating as well. For an exact calculation, we have to keep in

mind, that we have to solve the correspondence problem, if more than one object appears

on a movie or frame.

2.5.3 The Brightness Feature

Like the calculation of the average size of an object, the brightness is more significant, if

it is being averaged over the frames an object appears. Besides the binarised image data,

the original frames with the brightness values are required to perform this operation. The

binarised images serve as masks, which can be applied on the original greyscale images.

This is the pseudo code in figure 2.5.2, that explains how the average brightness is being

calculated. The pseudo code explains just how it is being calculated generally. In our

implementation, where this operation has to be performed on-the-fly, it looks a little

different. As mentioned before, the correspondence problem would have to be solved, to

receive a distinct value for each appearing object in a movie.

average brightness = 0

object frames = 0

for each frame in binarised movie {

if the frame is not empty {

current brightness = 0

increment object frames by 1

mask the same frame of the original image with the current binarised

frame

for each pixel in masked frame that is not 0 {

current brightness += value of the masked pixel

increment number of object pixels by 1

}

average brightness = current brightness / number of object pixels

}

}

average brightness = average brightness / object frames

Figure 2.5.2: The Average Brightness of an Object

2.5.4 The Direction Feature

The direction of an object means, how straight the movement is or, in other words, if the

object changes its direction during the recording. The pseudo code listed in figure 2.5.3,

should clearly show, how the so-called straightness is being calculated. The resulting

straightness is being calculated with the found object centroids, minimising the following

formula:

S =n

i=1

(yi − f(xi,~a))2 (2.14)

14 Meteor: An Intelligent Approach

Page 23: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Where ~a is a vector containing the parameters for the given model and (xi, yi) are the

locations of the found centroids. In our case the function is linear as we are assuming

that the reentry path of a meteor is a straight line, so the parameter vector ~a is given by

~a =< a, b > for the function f(x) = ax+b. This method was first described by Gauss3 and

is called method of least-squares. The straightness is close to zero for a straight movement

and huge for a curved one.

create an empty list of centroids

for each frame in binarised movie {

if the frame is not empty {

calculate the centroid of the object

append the centroid to the list of centroids

}

}

if the list of centroids is not empty {

fit a linear function into the points of the list with least -squares

method

calculate the mean squared error

straightness = mean squared error

} else {

no object appeared

}

Figure 2.5.3: The Direction (Straightness) of an Object

Figures 2.5.4 and 2.5.5 show an artificial example of the computation of the straightness.

2.5.5 The Shape Feature

The shape can be simplified to the eccentricity of an object, because a meteor normally

has the form of a circle. Therefore, this feature could show differences between low flying

birds and small round objects.

3Carl Friedrich Gauss (1777 - 1855), German mathematician

Figure 2.5.4: Straight Path (Deviation: 3.3685)

Meteor: An Intelligent Approach 15

Page 24: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 2 Video Analysis

Figure 2.5.5: Curved Path (Deviation: 121.4808)

2.5.6 The Duration Feature

The duration of an objects appearance on a movie can be easily derived from the first

and the last frame of appearance. The only problem is, like in other feature calculation

methods, that multiple objects could affect the duration. The duration feature should

eliminate slow objects like satellites. This feature could collaborate with the speed feature

and therefore be dropped unimplemented in the beginning of the diploma thesis.

2.5.7 The Number of Moving Objects Feature

As we have seen, sometimes a flock of birds is recorded or in very rare cases, two meteors

appear on one movie. We can say with reasonable certainty, that the probability of having

two or especially more meteors on one recording is rather small. Hence, this feature could

be useful where other features fail to provide information.

16 Meteor: An Intelligent Approach

Page 25: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Logic (and therefore probability as a

branch of logic) is not concerned with

what men do believe, but what they

ought to believe, if they are to believe

correctly

John Venn

Chapter 3

Classification

Classification is a statistical procedure to place individual items into different groups based

on several characteristics inherent in the items and on a set of training items previously

labelled to be part of a specific group.

Formally, the classification process can be described as following:

Given a training data (x1, y1), . . . , (xn, yn) produce a classifier c : X −→ Y which maps

an item x ∈ X to its group y ∈ Y .In the following treatment of classifiers an item is

sometimes denoted as a feature-vector or example.

There exists a variety of classification methods:

• Linear classifiers (Naıve Bayes Classifier, (Multi Layer) Perceptron,. . . )

• Decision trees

• Neural networks

• Bayesian networks

For the scope of the semester project and the diploma thesis we studied the following

two classification methods:

• Naıve Bayesian Classifiers

• Artificial Neuronal Networks

Classifiers should not be confused with the clustering-techniques such as the k-means

clusterer. Clustering tries to partition the data set into sub sets (clusters), such that the

data in each subset share common attributes. Anyway, clustering can be useful to estimate

the usefulness of the specified features, for example if clustering finds completely different

clusters than there should be, the defined characteristics (features) are not well chosen.

3.1 Weka Datamining Software

Weka [see 8] is a collection of machine learning algorithms for data mining, being developed

by Eibe Frank, Mark Hall and Len Trigg from the University of Waikato, New Zealand.

It can be used directly from own Java code by an API or by using the Commandline-

17

Page 26: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

and Graphical-User-Interface respectively. Weka contains tools for data pre-processing,

classification, clustering and visualisation of arbitrary data.

Weka was an integral part of our semester project because it is – after some training –

easy to use and useful in testing different classification algorithms.

Figure 3.1.1 shows Weka after starting up.

Figure 3.1.1: Weka After Start up

3.1.1 Data Pre-Processing

To use Weka, the data has to be in a format readable by Weka. There exist several

possibilities including plain ASCII files and connections to databases using SQL over

JDBC.

If plain ASCII files are used, they should be in the ARFF1 format, defined by the

designers of Weka. Figure 3.1.2 shows an example of our data in the ARFF-Format. After

converting the data to the ARFF-Format, it is loadable by Weka. The pre-process tool

shows some summary about the loaded data including statistical data like minima and

maxima of a selected attribute, its standard deviation and mean values. Figure 3.1.3 shows

the pre-processing tool.

3.1.2 Classification

After a successfull import of the data into Weka, the classification process can start. The

classification tools can be found under the “Classify” tab. There are many classifiers

implemented in Weka which can be chosen by clicking the “Choose” button. To configure

the classifier (if possible) a right click on the textfield, right next to the “Choose” button,

1Find a complete description under http://weka.sourceforge.net/wekadoc/index.php/en:ARFF_(3.5.1)

18 Meteor: An Intelligent Approach

Page 27: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

@relation meteor

@attribute brightness real

@attribute area real

@attribute straightness real

@attribute type {meteor , nonmeteor}

@data

109.020000 ,375.250000 ,0.000000 , nonmeteor

113.790000 ,33.583000 ,1.075600 , meteor

88.476000 ,27.516000 ,0.668370 , meteor

91.047000 ,56.025000 ,0.604100 , meteor

100.950000 ,222.120000 ,0.000000 , nonmeteor

120.090000 ,90.812000 ,6.015400 , nonmeteor

103.490000 ,53.250000 ,0.000000 , meteor

106.660000 ,47.938000 ,0.000000 , meteor

...

Figure 3.1.2: Sample Data in the ARFF-Format

offers a configuration dialogue.

To test a previously trained classifier, Weka provides different options:

Use training set Weka will use the same data set used for training the classifier.

Supplied test set Use an additional test set to test the classifier.

Cross-validation Perform n-fold cross-validation.

Percentage split Train on a percentage of the data and use the remainder for testing the

classifier.

It is important to select an attribute which defines the class of an example. Weka uses

then this to measure the performance of the classification process.

A click on the “Start” button starts the classification run and outputs the results.

Figure 3.1.4 shows the classification tool and figure 3.1.5 shows a typical output of the

classification run using the Percentage split test-method.

Meteor: An Intelligent Approach 19

Page 28: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

Figure 3.1.3: Weka’s Data Pre-Processing Tool

Figure 3.1.4: Classification with Weka

20 Meteor: An Intelligent Approach

Page 29: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

=== Run information ===

Scheme: weka.classifiers.bayes.NaiveBayes

Relation: meteor

Instances: 631

Attributes: 4

brightness

area

straightness

type

Test mode: split 66% train , remainder test

=== Classifier model (full training set) ===

Naive Bayes Classifier

Class meteor: Prior probability = 0.51

brightness: Normal Distribution. Mean = 119.0929 StandardDev = 24.3942

WeightSum = 323 Precision = 0.2897288961038961

area: Normal Distribution. Mean = 62.7855 StandardDev = 74.6361 WeightSum

= 323 Precision = 9.345489443378119

straightness: Normal Distribution. Mean = 7.0391 StandardDev = 32.5333

WeightSum = 323 Precision = 10.525994694960213

Class nonmeteor: Prior probability = 0.49

brightness: Normal Distribution. Mean = 131.901 StandardDev = 30.785

WeightSum = 308 Precision = 0.2897288961038961

area: Normal Distribution. Mean = 205.9345 StandardDev = 423.2666

WeightSum = 308 Precision = 9.345489443378119

straightness: Normal Distribution. Mean = 109.8053 StandardDev = 387.1419

WeightSum = 308 Precision = 10.525994694960213

Time taken to build model: 0.01 seconds

=== Evaluation on test split ===

=== Summary ===

Correctly Classified Instances 144 66.9767 %

Incorrectly Classified Instances 71 33.0233 %

Kappa statistic 0.2996

Mean absolute error 0.3303

Root mean squared error 0.5458

Relative absolute error 66.0396 %

Root relative squared error 109.1275 %

Total Number of Instances 215

=== Detailed Accuracy By Class ===

TP Rate FP Rate Precision Recall F-Measure ROC Area Class

0.991 0.707 0.622 0.991 0.764 0.818 meteor

0.293 0.009 0.967 0.293 0.45 0.818 nonmeteor

=== Confusion Matrix ===

a b <-- classified as

115 1 | a = meteor

70 29 | b = nonmeteor

Figure 3.1.5: Typical Output of a Classification-Run

Meteor: An Intelligent Approach 21

Page 30: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

3.2 Naıve Bayesian Classifiers

Bayesian classifiers are based on the theorem of Bayes2. The Naıve Bayesian Classifier

(NBC) applies the theorem of Bayes with the assumption that the values of the features

of each dataset are independent. In practise, this assumption is almost always violated

but studies have shown that naıve Bayesian learning is extremely effective in practise [see

4].

3.2.1 Mathematical Treatment

The following mathematical description is based on the article of Charles Elkan on the

Naıve Bayesian Classifier [see 6].

The probability model for a classifier is

P (C|F1, . . . , Fn) = P (C|F1 ∧ . . . ∧ Fn) (3.1)

where C is the class variable and F1, . . . , Fn are the feature variables.

Using a concrete example with feature values f1, . . . fn and the (manually) assigned class

c the formula 3.1 would be written as

P (C = c|F1 = f1, . . . , Fn = fn) (3.2)

Given the feature values f1, . . . fn on optimal prediction is class c such that equation 3.2

is maximal.

If the number of features or the number of valid values of a feature becomes large

this model is not feasible in terms of computation time and space, as it involves large

probability tables which grow exponentially with the number of features.

Bayes’ theorem is a result of the probability theory which relates the conditional- and

a-priori-probabilities. A-priori-probabilities are the probability of an event A which is not

connected to any other event (it is independent) written as P (A). Conditional-probabilities

are the probability of an event A given the occurrence of another event B written as

P (A|B).

Bayes’ theorem is defined for two random variables A, B as

P (A|B) =P (A) · P (B|A)

P (B)(3.3)

Using Bayes’ theorem, the formula 3.1 equals to

P (C|F1 = f1, . . . , Fn = fn) =P (C = c) · P (F1 = f1, . . . , Fn = fn|C = c)

P (F1 = f1, . . . , Fn = fn)(3.4)

P (C = c) is called the background probability or base rate and can be computed directly

2Thomas Bayes (1702 – 1761) British mathematician and Presbyterian minister

22 Meteor: An Intelligent Approach

Page 31: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

from the training data without big effort. The denominator P (F1 = f1, . . . , Fn = fn) is

for each class C the same and is therefore not relevant for the decision.

The real work (i.e. the learning process) is reduced to the estimation of

P (F1 = f1, . . . , Fn = fn|C = c) (3.5)

based on training examples. Using the product rule P (A, B) = P (B|A) · P (B) this prob-

ability can be written as (for the sake of readability we forswear in the following the use

of a concrete example)

P (F1|F2, . . . , Fn, C) · P (F2, . . . , Fn|C) (3.6)

By using a recursive approach the second factor of equation 3.6 can be rewritten as

P (F2|F3, . . . , Fn, C) · P (F3, . . . , Fn|C) (3.7)

until every factor has been rewritten as in equation 3.7. Generally this can be written as

P (F1, . . . , Fn, C) · . . . · P (Fn−1, Fn, C) · P (Fn, C) (3.8)

Now the assumption that for a feature Fi its outcome is independent of the outcome of

all other Fj given a class C. To put that into a formula we assume that

P (F1|F2, . . . , Fn, C) = P (F1|C) (3.9)

for every Fi. Using this assumption and the recursively separated formula in equation 3.9

equation 3.5 becomes

P (F1|C) · P (F2|C) · . . . · P (Fn|C) (3.10)

P (F1 = f1, . . . , Fn = fn|C = c) =n

i=1

P (Fi|C = c) (3.11)

Each factor of formula 3.11 can be calculated from the training data as follows

P (Fi = fi|C = c) =count(Fi = fi, C = c)

count(C = c)(3.12)

Now putting formula 3.4 and 3.11 together results in

P (C = c|F1 = f1, . . . , Fn = fn) =1

Z· P (C = c) ·

n∏

i=1

P (Fi = fi|C = c) (3.13)

where1

Z= P (F1 = f1, . . . , Fn = fn) is a normalising factor and does not depend on the

class C. It just ensures that the values of the probabilities are between 0 and 1.

Meteor: An Intelligent Approach 23

Page 32: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

3.2.2 Building a classifier

So far we just introduced the Naıve Bayes probability Model. To build an actual classifier

one has to combine the model with a decision rule. The decision rule determines which

hypothesis (e.g. to which class an example belongs) to pick.

The most common approach doing this, is to take the most probable class assignment of

all classes c1, . . . , cm. Equation 3.14 shows the corresponding classifier function classify

classify(f1, . . . , fn) = argmaxc

(

P (C = c) ·n

i=1

P (Fi = fi|C = c)

)

(3.14)

This method is known as the Maximum A Posterior or MAP decision rule.

We have to mention here is that we simply ignored the normalising factor Z. To get the

correct probabilities, one has to normalise the results, such that the sum over all classes

equals to one.

C∑

i=1

P (C = ci|F1 = f1, . . . , Fn = fn) = 1 (3.15)

3.2.3 Continuous Features

If the features are numerical (as opposed to a number of fix values) they have to be

discretisised or quantisised. The simplest approach to do this, is to divide the range of

the feature into a fixed number of equal-width bins. Experiments have shown that more

complex quantisation methods offer negligible benefits [see 5].

Another approach to make useable continuous features, is to assume a certain probability

distribution (such as the normal distribution). The Probability that a feature occurs in

the training set given a class is then

P (F1 = f1|C = c) = g(x; µc, σc) , where (3.16)

g(x; µ, σ) =1√2πσ

e−

(x − µ)2

2σ2 (3.17)

The parameters µc (mean) and σc (standard deviation) have to be estimated for each

class and continuous feature. There exist different procedures to do this, one of them, the

Maximum-Likelihood [see 1].

3.2.4 Naıve Credal Classifiers

The Naıve Bayesian Classifier maps an example (consisting of a feature vector) to one

class. The Naıve Credal Classifier maps an instance of a feature vector to a set of classes.

The Naıve Bayesian Classifier is a special case of a credal classifier which only outputs

singletons.

24 Meteor: An Intelligent Approach

Page 33: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

When imprecision is in the data (e.g. missing-data of rare-events) a naıve credal classifier

(NCC) takes this into account when computing the membership to a set of classes all of

which are candidates to be the correct class. This imprecision can be viewed as that the

values specify an interval instead of one exact value. The value of membership in the

possible output classes can be used as a measure how good the classification was, where

the NBC would output a class even if the classification was poor.

Credal classification is strongly related to the theory of imprecise probabilities which is an

expansion of standard probability theory. The NBC classifies a feature vector (f1, . . . , fn)

by computing the probability P (c|f1, . . . , fn) for each class c ∈ C and compares them

to select the class with the highest probability. With NCC these probabilities are getting

intervals, as the feature vector contains already intervals and special procedures to compare

these intervals are needed, as with intervals there exists (possibly) no total ordering for

which the max function can be used. In most cases they provide only a partial ordering.

See the work of Marco Zaffalon [9] for more information.

3.3 Artificial Neural Networks

Artificial Neural Networks (ANN) or just Neural Networks (NN) are a connected group

of artificial neurons using a mathematical model for information processing. ANNs are

used in many fields where the analysis of data is too difficult or too complex for a human.

ANNs are adaptive systems which change their structure based on the information that

“flows” through them.

3.3.1 Basic Architecture of Artificial Neural Networks

3.3.1.1 Artificial Neurons

An artificial neuron is an abstraction of the biological neuron found in any biologic life

form. The artificial neuron receives one or more inputs and applies a potential function

(e.g. summation) on these inputs. Before the actual summation is performed, the inputs

are weighted and then the sum is passed through a transfer function which is in most

cases non-linear.

Mathematically the output of an artificial neuron k with n inputs x1 . . . xn and their

weights wk1 . . . wkn can be described by the following formula

yk = ϕ

(

n∑

i=0

wkixi

)

(3.18)

where yk is the output of the artificial neuron k and ϕ is the transfer function. The output

of one artificial neuron is the input for an artificial neuron on the next layer or it is the

output of the whole artificial neural network if it is in the last layer.

Meteor: An Intelligent Approach 25

Page 34: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

−6 −4 −2 0 2 4 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

x

y

Figure 3.3.1: Sigmoid Function

3.3.1.2 Types of Transfer Functions

Step Function The simplest transfer function is a binary step function which applies a

threshold to the weights sum of the potential function

y =

{

1 : if v > θ

0 : otherwise

Linear Combination The output of the neuron is the weighted sum of the input values

computed by the potential function adding a bias term b

y = v + b

Sigmoid Some architectures of ANNs require a transfer function which is differentiable

(such as the backpropagation algorithm described in chapter 3.3.2). The sigmoid function

is such a function providing a similar curve as a step function but with a smooth shape.

The sigmoid function is described the mathematical formula

y =1

1 + e−v

The resulting curve looks as in figure 3.3.1.

3.3.2 Backpropagation

3.3.2.1 Abstract Algorithm

1. Initialisation of the weights to random values near zero

2. Choose a training example

26 Meteor: An Intelligent Approach

Page 35: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

3. Compute the forward step, i.e. compute the output of the neural netwok

4. Compare output demanded from the training example with the output received in

step 3. Result is the error δ of the output layer. Compute ∆w for the output layer

5. Backpropagate the error in the previous layer and calculate δ of each layer. Compute

∆w for every layer

6. Update of all weights wt+1 = wt + ∆w

7. If error above desired maximal error go to step 2

3.3.2.2 Learning Algorithm

This mathematical treatment of the Backpropagation Learning-Algorithm is mainly based

on the script of Dr. Lorenz Muller [see 7]. Given a set of training examples P with input

vectors ~xp and corresponding output vectors ~zp the error with the actually used weights

W is defined as

E(W) =1

2

P∑

p=1

(~zp − ~yp)2

=1

2

P∑

p=1

(~zp − f(~vp))2

=1

2

P∑

p=1

(~zp − f(W ~xp))2

~vp is the potential of each neuron. Usually a summation is used

v = W~x − ~θ

or

vi = ~wi~x − θ

or

vi =

h∑

j=1

wijyj

f(x) denotes the transfer function (or activation function). The Backpropagation algo-

rithm is based on derivations. Therefore the transfer function has to be differentiable. The

sigmoid function is a common transfer function because its derivation is easy to calculate

f(~x) =1

1 + e−~x

f ′(~x) = f(~x)(1 − f(~x))

Meteor: An Intelligent Approach 27

Page 36: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

3.3.2.3 One-Layer Neural Networks

The weight adjustions in a one-layer neural networks can be computed using the gradient

descent procedure which tries to find the lowest point in the error “landscape” (in the

two-dimensional case) by moving in the opposite direction of the gradient at the actual

point. Using the definition of the error function of formula 3.19, this can be written

formally as

∆wij = −η∇E(W) = −η∂E(W)

∂wij= −η

1

2

P∑

p=1

(~zp − f(g( ~xp)))2

∂wij(3.19)

= −η

1

2

P∑

p=1

(~zp − f(W ~xp)))2

∂wij(3.20)

= −ηP

p=1

∂E

∂yip

∂yip

∂vip

∂vip

∂wij(3.21)

= ηP

p=1

(zip − f(vip))f′(vip)xip (3.22)

= ηP

p=1

(zip − f(vip))yip(1 − yip)xip (3.23)

δip = (zip − f(vip))f′(vip) (3.24)

Indexes:

j = 1 . . . h Input neurons

i = 1 . . .m Output neurons

wij Weight between input neuron j and output neuron i

p = 1 . . . P Training examples

Using the sigmoid transfer function and using it in formula 3.23

∆wij = −η

~zp

P∑

p=1

(zip − f(vip))f′(vip)xip

(3.25)

3.3.2.4 Multi-Layer Neural Networks

The results gained in the previous section can be extended to multi-layer neural networks

(or Multi-Layer Perceptrons).

28 Meteor: An Intelligent Approach

Page 37: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

To do this we rewrite the formula 3.19 to use in a two-layer neural network

E(W[1],W[2]) =1

2

P∑

p=1

(

~zp −~

y[2]p

)2

=1

2

P∑

p=1

m∑

i=1

(

zip − f(

v[2]ip

))2

=1

2

P∑

p=1

m∑

i=1

zip − f

h∑

j=1

w[2]ij f

(

v[1]ip

)

2

=1

2

P∑

p=1

m∑

i=1

zip − f

h∑

j=1

w[2]ij f

(

n∑

k=1

w[1]jkxkp

)

2

To calculate the weights adjustments of an arbitrary layer, you have to derive the error-

function by the corresponding weight-matrix. For the output-layer the formula is

E(w[2]ij ) =

1

2

P∑

p=1

m∑

i=1

zip − f

h∑

j=1

w[2]ij f

(

w[2]ij y

[1]ip

)

2

∆w[2]ij = −η∇E = −η

∂E

∂w[2]ij

= −ηP

p=1

∂E

∂y[2]ip

∂y[2]ip

∂v[2]ip

∂v[2]ip

∂w[2]ij

= ηP

p=1

(zip − y[2]ip )f ′(v

[2]ip )y

[1]jp

= ηP

p=1

δ[2]ip y

[1]jp

δ[2]ip = (zip − y

[2]ip )f ′(v

[2]ip )

Meteor: An Intelligent Approach 29

Page 38: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 3 Classification

For the second layer in a two-layer neural networks the formula is

E(w[1]jk ) =

1

2

P∑

p=1

m∑

i=1

zip − f

h∑

j=1

w[2]ij f

(

n∑

k=1

w[1]jkxkp

)

2

∆w[1]jk = −η∇E = −η

∂E

∂w[1]jk

= −ηP

p=1

∂E

∂y[2]ip

∂y[2]ip

∂v[2]ip

∂v[2]ip

∂y[1]ip

∂y[1]ip

∂v[1]ip

∂v[1]ip

∂w[1]jk

= ηP

p=1

(zip − y[2]ip )f ′(v

[2]ip )w

[2]ij f ′(v

[1]jp )xkp

= ηP

p=1

δ[1]ip xkp

δ[1]ip = f ′(v

[1]ip )

m∑

i=1

δ[2]ip w

[2]]ij

Generally the weights adjustment in an arbitrary layer is

∆w[l]jk = −η

∂E

∂w[l]jk

= η

p∑

p=1

δ[l]jpy

[l−1]kp

δ[l]jp =

{

(zjp − y[L]jp )f ′(v

[L]jp ) : output-layer

f ′(v[l]jp

∑hl+1

i=1 δ[l+1]ip w

[l+1]ij : otherwise

where l = 1 . . . L is the index of the layers starting from the input-layer and y[0]kp ≡ xkp

3.3.2.5 Learning-Strategy

Epoch-Learning When using an epoch-learning approach, a learning-step (adjustment

of the weights) is performed after p training examples are processed.

∆w[l]jk = η

p∑

p=1

δ[l]jpy

[l−1]kp

Pattern-Learning Pattern-learning performs a learning-step (adjustment of the weights)

after each training example has been processed.

∆w[l]jk = ηδ

[l]jpy

[l−1]kp

3.3.3 Normalisation of the Data

30 Meteor: An Intelligent Approach

Page 39: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

11:15, restate my assumptions: 1.

Mathematics is the language of nature.

2. Everything around us can be

represented and understood through

numbers. 3. If you graph these

numbers, patterns emerge. Therefore:

There are patterns everywhere in

nature.

Maximilian Cohen, π (Movie)

Chapter 4

Classification Tests

From our visit at the Armagh Observatory we brought around 130 gigabytes of movies

back. The movies consist of all recorded meteor-movies since the programme started and

many other movies which contained interesting (or beautiful) features. The available class

distinctions are the following

• Meteor

• Airplane

• Biological

• Satellite

• Weather

– Clouds

– Lightning

– Moon

• Unknown

These classes are represented as directories on the filesystem. In each class-directory, there

are three additional directories containing the movies of each camera:

• NWCAM

• SECAM

• BANGORCAM

In the semester project we focused on the two classes Meteor and Non-Meteor.

4.1 Computing the Feature Vectors

Before one can start the classification, the data must be in a format readable by the

classification methods. In our case, this is the Feature Vector of each movie. As explained

detailed in the section 2.5 “Feature Vector” it consists of numerical values for each feature

31

Page 40: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 4 Classification Tests

of each movie. In addition to train the classifier, the actual class of each movie has to be

known.

The movies from our visit in Armagh were already classified (manually by the as-

tronomers). Therefore, we could write a matlab function which takes every movie, com-

putes its feature vector and based on the precedent classification, it determines to which

class the feature vector belongs.

This function writes the feature-vector (including the class) to a CSV-file at the same

location and the same filename (with the “.dat” extension) as the movie file. This function

also puts an image of frame 36 (where the software UfoCapture recognised an event) and

the image of the movement pattern to the same location.

4.1.1 Collecting the data

As the data is distributed over many directories and subdirectories, we needed a script

which collects all the data and stores it in one big data file. In addition, it is necessary to

be able to convert the collected data into different file formats. The three main important

file formats and in which software they are used are listed in table 4.1.1.

File format Software

CSV MatlabARFF WekaFANN Fast Artificial Neural Network library1

Table 4.1.1: Data File Formats

4.1.2 Examples of the collected data in different file formats

CSV CSV is a general purpose file format which uses commas (,) as delimiter for the

values of each record and a newline as a delimiter of the records. The columns of our files

are the following:

1. class (1 = meteor, 0 = non-meteor)

2. brightness

3. area

4. straightness

Figure 4.1.1 shows an excerpt of a dataset of our project in the CSV file format.

ARFF ARFF is the standard file format for Weka, as explained deeply in section 3.1.1

“Pre-processing” . See also the wiki of the Weka software about the ARFF format. Figure

4.1.2 shows an excerpt of a dataset of our project in the ARFF file format.

1Fast Artificial Neural Network Library http://leenissen.dk/fann/

32 Meteor: An Intelligent Approach

Page 41: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

1 ,100.16 ,25.0 ,0.0

1 ,137.52 ,96.312 ,2.1531

1 ,109.49 ,37.966 ,48.958

0 ,91.319 ,69.375 ,0.0

1 ,95.14 ,58.071 ,2.5581

0 ,115.66 ,227.5 ,1.086e-12

0 ,135.67 ,151.06 ,5.0842e-13

0 ,162.14 ,716.62 ,2.5993e-13

1 ,123.82 ,46.518 ,0.79829

0 ,162.75 ,973.25 ,0.0

0 ,168.15 ,34.25 ,0.0

1 ,136.74 ,63.812 ,1.2932

0 ,85.415 ,72.458 ,225.22

Figure 4.1.1: CSV file format

@relation meteor

@attribute brightness real

@attribute area real

@attribute straightness real

@attribute type {meteor , nonmeteor}

@data

89.359000 ,68.250000 ,30.819000 , nonmeteor

96.032000 ,33.475000 ,2.031200 , meteor

107.850000 ,69.500000 ,1.395800 , meteor

113.790000 ,33.583000 ,1.075600 , meteor

152.530000 ,71.312000 ,0.000000 , nonmeteor

127.190000 ,28.562000 ,0.000000 , nonmeteor

88.560000 ,25.000000 ,0.000000 , meteor

134.100000 ,281.940000 ,4.954900 , nonmeteor

Figure 4.1.2: ARFF file format

FANN The Fast Artificial Neural Network Library (FANN) is a free open source neural

network library, which implements multilayer artificial neural networks in C with support

for both fully connected and sparsely connected networks. It implements among others

the backpropagation algorithm.

FANN uses an own data format which is used to train and test a network. The first line

contains the header which denotes the amount of data sets in this file and how many input

and output neurons the network has. Each dataset is represented as two lines in the file.

The first line contains the the input vector and the second line contains the output vector

associated with this input vector (training). Figure 4.1.3 shows an excerpt of a dataset of

our project in the FANN file format.

Meteor: An Intelligent Approach 33

Page 42: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 4 Classification Tests

631 3 2

115.010000 38.641000 24.544000

1 0

78.722000 147.750000 0.000000

0 1

58.695000 28.333000 51.935000

0 1

119.070000 65.062000 2.609100

1 0

93.327000 59.167000 3.367200

1 0

114.080000 64.375000 0.000000

0 1

135.260000 68.375000 0.000000

0 1

150.200000 79.562000 5.954300

0 1

158.950000 215.440000 0.000000

Figure 4.1.3: FANN file format

4.2 Exploratory Data Analysis

The Exploratory Data Analysis (EDA) is an approach for data analysis using a variety of

techniques, including especially graphical approaches to visualise the data to the human

perception. EDA tries not to test given hypotheses like in statistics, it is rather used to

gain an idea which hypotheses could be matching which can then be tested with statistical

instruments. The objectives of EDA are:

• Suggest hypotheses about the causes of observed phenomena

• Assess assumptions on which statistical inference will be based

• Support the selection of appropriate statistical tools and techniques

• Provide a basis for further data collection through surveys or experiments

4.2.1 Analysis of Our Test Data

Unfortunately, we were not aware of the importance of the previously explained ex-

ploratory data analysis and started directly with testing several classification methods

and then realised that they do not work as we hoped.

After these unsuccessful tests, we started to analyse our test data. We plotted the

feature vector of each movie into the feature space with the help of a so called scatter

plot which represents each vector as a point in space. Since we have only 3 features the

complete information can be represented in a three dimensional cube. We plotted the

unnormalised data and therefore, the values represent the actual values in the feature

vectors. Since the ranges of the values are very big we plotted the vectors in logarithmic

scale (all three spatial dimensions).

34 Meteor: An Intelligent Approach

Page 43: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Figure 4.2.1: Distribution of the Testdata in the Feature Space

The result can be seen in figure 4.2.1. The causes for this distribution can be found

during the video analysis in special at the binarisation stage. Another source are the

features which are not the best ones. Especially the brightness and area seem to be

correlated.

4.3 Classification Results

To test our data we used among others Weka to test the different classification methods on

our data. As we have seen in the previous section our data does not seem to be classifyable.

The results of the two classification methods are depicted in the next sections.

4.3.1 Bayesian Classifiers

With the naıve Bayesian classifiers we obtained a relatively high amount of missclassified

feature vectors of around thirty percent. As a positive point should be mentioned that

the false negative rate is lower than the false positive rate.

4.3.2 Artificial Neural Networks

With artificial neural networks we got roughly the same results as with the naıve Bayesian

classifiers.

Meteor: An Intelligent Approach 35

Page 44: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

36 Meteor: An Intelligent Approach

Page 45: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Proof by waving hands !

Bernhard AnrigChapter 5

Diploma Thesis

In this chapter we summarise the most important lessons learned during the semester

project.

5.1 Video Analysis

5.1.1 De-noising

In the actual state the movies are deinterlaced by the software mplayer prior to our

actual video analysis. As consequence the noise on the movies get smoothed by the

deinterlacing process and therefore our denoise has not much effect. In the diploma thesis

the deinterlacing should be done after the denoising of the movies.

5.1.2 Binarisation

As mentioned at several points the method used to binarise the frames have to be improved.

At the moment we are using a static threshold value to binarise every frame in every movie.

In the diploma thesis this should be done by a more dynamic method.

5.1.3 Preselection of Bad Movies

If the video analysis cannot detect any moving object – caused by different problems

(meteor too faint, meteor too small, too much noise, . . . ) – it should stop processing and

give a human the control over the classification of the movie.

5.1.4 Implementation of New Features

As the classification stands or falls with the quality of the features the main approach to

improve the classification is to implement new features.

5.2 Classification

As a general direction we tend to Naıve Bayesian Classifiers as they seem to be easier to

maintain as opposed to artificial neural networks. Especially if more features are getting

implemented the whole architecture of artificial neural networks have to be renewed.

37

Page 46: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 5 Diploma Thesis

5.2.1 Exploratory Data Analysis

We learned the concept of Exploratory Data Analysis nearly at the end of our semester

project. As this is a powerful technique to estimate the performance of the video analysis

and feature extraction process it should be done more extensively during the diploma

thesis.

5.2.2 Normalisation of the Feature Vectors

The data for the artificial neural networks have to be normalised (i.e. the range of each

feature is between zero and one).

5.2.3 Discretisation of the Feature Vectors

If working with numeric features (or continuous) the values have to be made useable by

the Bayesian classifiers. This can be done in two ways: by splitting up the whole range in

a specified amount of bins or to presume a gaussian probability distribution of the data.

38 Meteor: An Intelligent Approach

Page 47: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

42

The Hitchhiker’s Guide to the Galaxy

Chapter 6

Final Statements

6.1 Thomas Rawyler

For me it was clear to work on a diploma thesis that has something to do with artificial

intelligence. The fact, that we had such a great opportunity to combine image processing

with artificial intelligence and furthermore, operate in the domain of astronomy, which

has been a hobby of mine since the fourth grade, has been my major motivation for the

whole project time. Starting the project with a journey to Armagh and getting in touch

with the astronomers has been an honour and a valuable experience. It has been a dream

to be involved in a project, that is suited in science.

In the beginning of the project management related documents, I had difficulties to

start and see the advantages of such documents. After a few hours in the dark, I found

my way and could write down what I thought that had to be said. After completing these

documents, I realised their usability, although I have to say that we spent much time on

project management matter.

Starting with image processing, I had my doubts applying the previously learnt methods

in practise. Even though, I have learnt a lot in theory in the lecture of Mr. Cattin, I felt a

little uncertain in the beginning. But against my expectations, I was surprised, how apace

we stepped forward in video analysis. Matlab has become one of my favourite applications

for scientific use, as it has been very helpful shaping a working prototype. I really enjoyed

the work that had to be done in video analysis in full.

I was anxious to start with the research of the relatively unknown classification domain.

Certainly, there was much to read, but for all that, it was informative and very inter-

esting. I enjoyed testing the different classifiers of the Weka framework. Furthermore,

I could utilise artificial neural networks in practise for the first time and I experienced

that there is a bunch of knowledge, required for working with neural networks. Especially

in preprocessing the data which is being fed to the network. I have learnt a lot about

classification and I could take out important knowledge for future work with different

classification methods. Artificial intelligence can yet be powerful, but it has to be taken

with a pinch of salt.

Regrettably, the focus on the semester project has been afflicted by the fact, that the

semester has been very turbulent. I was involved in numerous projects and it is in my

39

Page 48: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Chapter 6 Final Statements

nature, I try to participate in projects with a great ambition. Unfortunately my ambition

had to be shared among all the projects. I am looking forward to the eight weeks of

focused work on the diploma thesis, where I can participate with my heart and soul. I

augur success in our diploma thesis, since the two of us are hard-working and ambitious.

6.2 Benjamin Muller

My motivation for this project was from the beginning very high because of two aspects.

The topic of the project belongs to astronomy – in my opinion the most thrilling topic

in science. The other reason is the collaboration with the Armagh Observatory where I

spent six wonderful weeks last summer during an internship. When the question arose to

choose a topic for the semester project and the diploma thesis, for me it was clear to take

Armagh Observatory into consideration for an eventual project idea.

The project started with an exciting visit to Northern Ireland where we had a wonderful

time – of course not only during the work but also enjoying the wonderful landscapes

and pubs. Afterwards the hard part of writing the documents required by the project

management started. I look back to this part with different feelings. On one hand it was

good that we had to write what the project is about and how we are trying to do it, by

this we and the project tutors good a better understanding of the project. On the other

hand it was hard to spend so much time on writing documents instead of developing code

and working on the project.

One of my big surprises was Matlab which we used very much in the release video

analysis. I never thought that I would start to like it, despite the fact that it is not

opensource software. It is very comfortable to do image processing in Matlab and like

this, we were able to perform the video analysis really swiftly.

I was looking forward to the classification part of our project. I liked especially the

literature research were I learnt new methods and techniques used in machine learning and

data mining applications. For me it is fundamental to know how an algorithm works inside.

It is mostly not necessary to know the whole mathematical background to understand an

algorithm. But especially for the design of the architecture, it is important to have deeper

knowledge of the algorithm than just to read its manual.

One of my personal set backs was the actual implementation and test of the classification

methods. For me, the results were first disappointing but after the analysis of the test data

they could be explained which is very important for the learning process. We should have

done the analysis of the test data in the beginning of the release classification but then

we were just too eager to get things working. If we would have noticed it earlier, we could

have downloaded better test data and implement probably better feature computations.

The choice of eXtreme Programming (XP) was in my opinion the only really applicable

choice. Especially Hermes is too constraining for a research project as it requires to specify

the whole project in advance. The principles of XP encourages a free form of developing,

communication and research. Using a Wiki and a Subversion-Repository as a central

40 Meteor: An Intelligent Approach

Page 49: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

control and knowledge system transformed these principles into practise.

It was a hard semester with many projects in other courses besides the semester project.

I am glad that the semester got enough time, such that we could elaborate pleasing results.

I am looking forward to the time between this semester project and the start of the diploma

thesis, when I can get new power for the start of the diploma thesis, which implies eight

weeks full-time work on this exciting project.

Meteor: An Intelligent Approach 41

Page 50: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

42 Meteor: An Intelligent Approach

Page 51: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Appendix A

Illustrations of the meteor cameras

Figure A.0.1: Meteor cameras

Figure A.0.2: Inside a meteor camera Figure A.0.3: Meteor

Meteor: An Intelligent Approach 43

Page 52: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Appendix B

GNU Free Documentation License

Version 1.2, November 2002

Copyright c© 2000,2001,2002 Free Software Foundation, Inc.

51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Everyone is permitted to copy and distribute verbatim copies of this license document,

but changing it is not allowed.

Preamble

The purpose of this License is to make a manual, textbook, or other functional and useful

document “free” in the sense of freedom: to assure everyone the effective freedom to copy

and redistribute it, with or without modifying it, either commercially or noncommercially.

Secondarily, this License preserves for the author and publisher a way to get credit for

their work, while not being considered responsible for modifications made by others.

This License is a kind of “copyleft”, which means that derivative works of the document

must themselves be free in the same sense. It complements the GNU General Public

License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free

software needs free documentation: a free program should come with manuals providing

the same freedoms that the software does. But this License is not limited to software

manuals; it can be used for any textual work, regardless of subject matter or whether it

is published as a printed book. We recommend this License principally for works whose

purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice

placed by the copyright holder saying it can be distributed under the terms of this License.

Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that

work under the conditions stated herein. The “Document”, below, refers to any such

manual or work. Any member of the public is a licensee, and is addressed as “you”. You

44 Meteor: An Intelligent Approach

Page 53: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

accept the license if you copy, modify or distribute the work in a way requiring permission

under copyright law.

A “Modified Version” of the Document means any work containing the Document

or a portion of it, either copied verbatim, or with modifications and/or translated into

another language.

A “Secondary Section” is a named appendix or a front-matter section of the Doc-

ument that deals exclusively with the relationship of the publishers or authors of the

Document to the Document’s overall subject (or to related matters) and contains nothing

that could fall directly within that overall subject. (Thus, if the Document is in part a

textbook of mathematics, a Secondary Section may not explain any mathematics.) The

relationship could be a matter of historical connection with the subject or with related

matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The “Invariant Sections” are certain Secondary Sections whose titles are designated,

as being those of Invariant Sections, in the notice that says that the Document is released

under this License. If a section does not fit the above definition of Secondary then it

is not allowed to be designated as Invariant. The Document may contain zero Invariant

Sections. If the Document does not identify any Invariant Sections then there are none.

The “Cover Texts” are certain short passages of text that are listed, as Front-Cover

Texts or Back-Cover Texts, in the notice that says that the Document is released under

this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may

be at most 25 words.

A “Transparent” copy of the Document means a machine-readable copy, represented

in a format whose specification is available to the general public, that is suitable for re-

vising the document straightforwardly with generic text editors or (for images composed

of pixels) generic paint programs or (for drawings) some widely available drawing editor,

and that is suitable for input to text formatters or for automatic translation to a variety

of formats suitable for input to text formatters. A copy made in an otherwise Transparent

file format whose markup, or absence of markup, has been arranged to thwart or dis-

courage subsequent modification by readers is not Transparent. An image format is not

Transparent if used for any substantial amount of text. A copy that is not “Transparent”

is called “Opaque”.

Examples of suitable formats for Transparent copies include plain ASCII without markup,

Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD,

and standard-conforming simple HTML, PostScript or PDF designed for human modifi-

cation. Examples of transparent image formats include PNG, XCF and JPG. Opaque

formats include proprietary formats that can be read and edited only by proprietary word

processors, SGML or XML for which the DTD and/or processing tools are not generally

available, and the machine-generated HTML, PostScript or PDF produced by some word

processors for output purposes only.

The “Title Page” means, for a printed book, the title page itself, plus such following

pages as are needed to hold, legibly, the material this License requires to appear in the

Meteor: An Intelligent Approach 45

Page 54: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Appendix B GNU Free Documentation License

title page. For works in formats which do not have any title page as such, “Title Page”

means the text near the most prominent appearance of the work’s title, preceding the

beginning of the body of the text.

A section “Entitled XYZ” means a named subunit of the Document whose title ei-

ther is precisely XYZ or contains XYZ in parentheses following text that translates XYZ

in another language. (Here XYZ stands for a specific section name mentioned below,

such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To

“Preserve the Title” of such a section when you modify the Document means that it

remains a section “Entitled XYZ” according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that

this License applies to the Document. These Warranty Disclaimers are considered to be

included by reference in this License, but only as regards disclaiming warranties: any other

implication that these Warranty Disclaimers may have is void and has no effect on the

meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or

noncommercially, provided that this License, the copyright notices, and the license notice

saying this License applies to the Document are reproduced in all copies, and that you

add no other conditions whatsoever to those of this License. You may not use technical

measures to obstruct or control the reading or further copying of the copies you make

or distribute. However, you may accept compensation in exchange for copies. If you

distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly

display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers)

of the Document, numbering more than 100, and the Document’s license notice requires

Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all

these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the

back cover. Both covers must also clearly and legibly identify you as the publisher of

these copies. The front cover must present the full title with all words of the title equally

prominent and visible. You may add other material on the covers in addition. Copying

with changes limited to the covers, as long as they preserve the title of the Document and

satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put

the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest

onto adjacent pages.

46 Meteor: An Intelligent Approach

Page 55: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

If you publish or distribute Opaque copies of the Document numbering more than 100,

you must either include a machine-readable Transparent copy along with each Opaque

copy, or state in or with each Opaque copy a computer-network location from which

the general network-using public has access to download using public-standard network

protocols a complete Transparent copy of the Document, free of added material. If you use

the latter option, you must take reasonably prudent steps, when you begin distribution of

Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible

at the stated location until at least one year after the last time you distribute an Opaque

copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well

before redistributing any large number of copies, to give them a chance to provide you

with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions

of sections 2 and 3 above, provided that you release the Modified Version under precisely

this License, with the Modified Version filling the role of the Document, thus licensing

distribution and modification of the Modified Version to whoever possesses a copy of it.

In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct from that of the

Document, and from those of previous versions (which should, if there were any, be

listed in the History section of the Document). You may use the same title as a

previous version if the original publisher of that version gives permission.

B. List on the Title Page, as authors, one or more persons or entities responsible for

authorship of the modifications in the Modified Version, together with at least five

of the principal authors of the Document (all of its principal authors, if it has fewer

than five), unless they release you from this requirement.

C. State on the Title page the name of the publisher of the Modified Version, as the

publisher.

D. Preserve all the copyright notices of the Document.

E. Add an appropriate copyright notice for your modifications adjacent to the other

copyright notices.

F. Include, immediately after the copyright notices, a license notice giving the public

permission to use the Modified Version under the terms of this License, in the form

shown in the Addendum below.

G. Preserve in that license notice the full lists of Invariant Sections and required Cover

Texts given in the Document’s license notice.

Meteor: An Intelligent Approach 47

Page 56: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Appendix B GNU Free Documentation License

H. Include an unaltered copy of this License.

I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item

stating at least the title, year, new authors, and publisher of the Modified Version as

given on the Title Page. If there is no section Entitled “History” in the Document,

create one stating the title, year, authors, and publisher of the Document as given

on its Title Page, then add an item describing the Modified Version as stated in the

previous sentence.

J. Preserve the network location, if any, given in the Document for public access to

a Transparent copy of the Document, and likewise the network locations given in

the Document for previous versions it was based on. These may be placed in the

“History” section. You may omit a network location for a work that was published

at least four years before the Document itself, or if the original publisher of the

version it refers to gives permission.

K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title

of the section, and preserve in the section all the substance and tone of each of the

contributor acknowledgements and/or dedications given therein.

L. Preserve all the Invariant Sections of the Document, unaltered in their text and in

their titles. Section numbers or the equivalent are not considered part of the section

titles.

M. Delete any section Entitled “Endorsements”. Such a section may not be included in

the Modified Version.

N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in

title with any Invariant Section.

O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify as

Secondary Sections and contain no material copied from the Document, you may at your

option designate some or all of these sections as invariant. To do this, add their titles to

the list of Invariant Sections in the Modified Version’s license notice. These titles must be

distinct from any other section titles.

You may add a section Entitled “Endorsements”, provided it contains nothing but

endorsements of your Modified Version by various parties–for example, statements of peer

review or that the text has been approved by an organization as the authoritative definition

of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up

to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified

Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added

by (or through arrangements made by) any one entity. If the Document already includes

48 Meteor: An Intelligent Approach

Page 57: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

a cover text for the same cover, previously added by you or by arrangement made by the

same entity you are acting on behalf of, you may not add another; but you may replace

the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission

to use their names for publicity for or to assert or imply endorsement of any Modified

Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License,

under the terms defined in section 4 above for modified versions, provided that you include

in the combination all of the Invariant Sections of all of the original documents, unmodified,

and list them all as Invariant Sections of your combined work in its license notice, and

that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical

Invariant Sections may be replaced with a single copy. If there are multiple Invariant

Sections with the same name but different contents, make the title of each such section

unique by adding at the end of it, in parentheses, the name of the original author or

publisher of that section if known, or else a unique number. Make the same adjustment

to the section titles in the list of Invariant Sections in the license notice of the combined

work.

In the combination, you must combine any sections Entitled “History” in the various

original documents, forming one section Entitled “History”; likewise combine any sections

Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete

all sections Entitled “Endorsements”.

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released

under this License, and replace the individual copies of this License in the various docu-

ments with a single copy that is included in the collection, provided that you follow the

rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually

under this License, provided you insert a copy of this License into the extracted document,

and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent

documents or works, in or on a volume of a storage or distribution medium, is called an

“aggregate” if the copyright resulting from the compilation is not used to limit the legal

rights of the compilation’s users beyond what the individual works permit. When the

Meteor: An Intelligent Approach 49

Page 58: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Appendix B GNU Free Documentation License

Document is included in an aggregate, this License does not apply to the other works in

the aggregate which are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document,

then if the Document is less than one half of the entire aggregate, the Document’s Cover

Texts may be placed on covers that bracket the Document within the aggregate, or the

electronic equivalent of covers if the Document is in electronic form. Otherwise they must

appear on printed covers that bracket the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of

the Document under the terms of section 4. Replacing Invariant Sections with translations

requires special permission from their copyright holders, but you may include translations

of some or all Invariant Sections in addition to the original versions of these Invariant

Sections. You may include a translation of this License, and all the license notices in

the Document, and any Warranty Disclaimers, provided that you also include the original

English version of this License and the original versions of those notices and disclaimers.

In case of a disagreement between the translation and the original version of this License

or a notice or disclaimer, the original version will prevail.

If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “His-

tory”, the requirement (section 4) to Preserve its Title (section 1) will typically require

changing the actual title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly

provided for under this License. Any other attempt to copy, modify, sublicense or dis-

tribute the Document is void, and will automatically terminate your rights under this

License. However, parties who have received copies, or rights, from you under this License

will not have their licenses terminated so long as such parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free

Documentation License from time to time. Such new versions will be similar in spirit to

the present version, but may differ in detail to address new problems or concerns. See

http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document

specifies that a particular numbered version of this License “or any later version” applies

to it, you have the option of following the terms and conditions either of that specified

version or of any later version that has been published (not as a draft) by the Free Software

Foundation. If the Document does not specify a version number of this License, you may

choose any version ever published (not as a draft) by the Free Software Foundation.

50 Meteor: An Intelligent Approach

Page 59: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in

the document and put the following copyright and license notices just after the title page:

Copyright c© YEAR YOUR NAME. Permission is granted to copy, distribute

and/or modify this document under the terms of the GNU Free Documenta-

tion License, Version 1.2 or any later version published by the Free Software

Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-

Cover Texts. A copy of the license is included in the section entitled “GNU

Free Documentation License”.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the

“with . . . Texts.” line with this:

with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover

Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the

three, merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing

these examples in parallel under your choice of free software license, such as the GNU

General Public License, to permit their use in free software.

Meteor: An Intelligent Approach 51

Page 60: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Glossary

A

API An application programming interface (API) is a source code interface that a

computer system or program library provides to support requests for services

to be made of it by a computer program, page 18

ARFF A data format defined by the authors of Weka, page 18

ASCII (American Standard Code for Information Interchange), is a character en-

coding based on the English alphabet, page 18

C

CSV Comma Separated Values: a data format in which the values are separated

by commas (,) and each line represents a record, page 32

F

False Negatives Condition present + Negative result= False (invalid) Negative, page 35

False Positives Condition absent + Positive result = False Positive, page 35

FANN Fast Artificial Neural Network Library is a free open source neural network

library, which implements multilayer artificial neural networks in C with sup-

port for both fully connected and sparsely connected networks, page 32

FPS Frames Per Second: how many images are contained in one second of the

movie, page 3

I

Interlace Interlace is a technique of improving the picture quality of a video signal on

CRT devices without consuming any extra bandwidth by displaying alter-

nating only the even or odd rows, page 4

J

JPEG JPEG is a commonly used standard method of compression for photographic

images. The name JPEG stands for Joint Photographic Experts Group, the

name of the committee who created the standard, page 4

52 Meteor: An Intelligent Approach

Page 61: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

P

PSF The point spread function (PSF) describes the response of an imaging system

to a point source or point object. The PSF in many coherences can be

thought of as the extended blob in an image that represents an unresolved

object, page 8

W

Weka Weka is a collection of machine learning algorithms for data mining, page 17

Y

YUV The YUV model defines a colour space in terms of one luma and two chromi-

nance components, page 3

Meteor: An Intelligent Approach 53

Page 62: Research Report - meteor-ai.sourceforge.netmeteor-ai.sourceforge.net/.../SemesterProject/Meteor_Research_Report.… · Research Report Meteor: An Intelligent Approach Diploma Thesis

Bibliography

[1] J. Aldrich. R.A. Fisher and the making of maximum likelihood 1912-1922. Statistical

Science, 12(3):162–176, 1997.

[2] R. Cattin. Computer Vision.

[3] R. Cattin. Image Processing.

[4] P. Domingos and M. J. Pazzani. Beyond independence: Conditions for the optimality

of the simple bayesian classifier. In International Conference on Machine Learning,

pages 105–112, 1996.

[5] J. Dougherty, R. Kohavi, and M. Sahami. Supervised and unsupervised discretization

of continuous features. In International Conference on Machine Learning, pages 194–

202, 1995.

[6] C. Elkan. Naive bayesian learning, 1997.

[7] L. Muller. Neuronale Netze, 2006.

[8] I. H. Witten and E. Frank. Data Mining: Practical machine learning tools and

techniques. Morgan Kaufman, 2nd edition edition, 2005.

[9] M. Zaffalon. The naive credal classifier. Journal of Statistical Planning and Inference,

105:5–21, 2002.

54 Meteor: An Intelligent Approach