10
IJSRD - International Journal for Scientific Research & Development| Vol. 3, Issue 04, 2015 | ISSN (online): 2321-0613 All rights reserved by www.ijsrd.com 1821 Naïve based Moving Object Detection and Classification in Video using Background Subtraction Aseema Mohanty 1 Sanjivani Shantaiya 2 1 Scholar 2 Assistant Professor 1,2 DIMAT, CSVTU, Raipur, India AbstractThe area of real time surveillance is the common interest of researchers nowadays due to advancement in technology and thus the amount of work which can be done in it is still huge. The main objective here was to detect the moving object in a video and then to classify the corresponding incoming frames accordingly if it consists of moving object or not using naïve bayes classifier. This type of classification helps in frame by frame analysis of the video and can be used to give better result for classification. The main focus was on naïve bayes classifier which was successfully implemented on a video. The performance of the methodology is found to be 93.64% accurate and has precision of 93.77% with an error rate of 7.9%. Key words: Moving object detection, background subtraction, frame difference, object classification, naïve bayes classifier, video processing I. INTRODUCTION Nowadays moving object detection has become a very prime area for research due to its use in various computer vision applications. Beside from the vital benefit of being able to differentiate video streams into moving and background content, detecting moving objects provides a purpose of attention for recognition, classification and activity scrutiny making these later steps more effective. Moving object detection is defined as extracting the motion part from a video stream. It handles separation of moving objects from the immobile background scene. To recognize objects of worth in the video sequence and to group together pixels of these objects is termed as Object Detection. Since moving objects are normally the principal source of information, most methods intend on the detection of such objects. A general tactic for object detection is usage of information in an individual frame. However, some object detection methods require usage of the temporal information computed from a succession of frames to diminish the number of false detections [1]. The classification of the pixels in the video stream into either foreground or background is said as detection of the moving objects in the video [2]. Moving object detection is the task of identifying the physical movement of an object in an exceedingly given region or space. Over previous couple of years, moving object detection has received abundant of attraction thanks to its big selection of applications like video surveillance, human motion analysis, automaton navigation, event detection, anomaly detection, video conferencing, traffic analysis and security. Additionally, moving object detection is extremely important and worthwhile analysis topic in field of pc vision and video processing since it forms a crucial step for several complicated processes like video object classification and video tracking activity. Subsequently, identification of actual form of moving object from a given system of video frames becomes relevant. However, task of detecting actual form of object in motion becomes tough thanks to numerous challenges like vigorous scene changes, illumination variations, existence of shadow, camouflage and bootstrapping drawback [3]. The moving object detection is the elementary step for most of the applications based on video processing. Videos are in reality sequel of images, each of which called is a frame, played in fast enough frequency so that human eyes can percept the continuousness of its content. It is evident that all image processing methods can be applied to separate frames. Moreover, the contents of two successive frames are generally closely correlated. An image, generally from a video stream, is distributed into two complementary groups of pixels. The first group include the pixels which correspond to foreground objects while the other and complimentary group include the background pixels. This result which is the detected object is often showed as a binary image or as a mask. It is troublesome to mention an absolute standard regarding what should be recognized as foreground and what should be distinguished as background because this description is rather application specific [4]. Background subtraction is a broadly used methodology for detecting moving objects in videos streams from static cameras. It is the general way of motion detection. It is a process that finds the difference of the current image and the background image to detect the motion region, and it is commonly efficient to deliver data included object information. The keynote of this process lies in the initialization and update of the background image. The efficiency of both will influence the precision of test results [5]. It tries to detect moving regions by subtracting the current image pixel-by-pixel from a reference background image which is composed by averaging images over time in an initialization period. The pixels where the variation is beyond a threshold value are categorized as foreground. Background subtraction is an extensively used technique for detecting moving objects in videos from static cameras. The reasoning behind the method is that of detecting the moving objects from the variance amid the current frame and a reference frame, frequently called the “background image” or “background model”. As a fundamental, the background image must be a description of the scene without moving objects and must be kept frequently updated so as to become accustomed to the unpredictable luminance circumstances and geometry situations [6]. In visual surveillance system, motion detection is that the essential and vital step that classifies the moving foreground object from the background. The segmented moving foreground object is also humans, vehicles, animals, flying birds, moving clouds, leaves of a tree, or the other noise etc. The work of a classification phase within the visual surveillance system, is to classify the moving foreground object into predefined categories like single person, cluster of person, or vehicle, etc. The visual

Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

IJSRD - International Journal for Scientific Research & Development| Vol. 3, Issue 04, 2015 | ISSN (online): 2321-0613

All rights reserved by www.ijsrd.com 1821

Naïve based Moving Object Detection and Classification in Video using

Background Subtraction

Aseema Mohanty1 Sanjivani Shantaiya

2

1Scholar

2Assistant Professor

1,2DIMAT, CSVTU, Raipur, India

Abstract— The area of real time surveillance is the common

interest of researchers nowadays due to advancement in

technology and thus the amount of work which can be done

in it is still huge. The main objective here was to detect the

moving object in a video and then to classify the

corresponding incoming frames accordingly if it consists of

moving object or not using naïve bayes classifier. This type

of classification helps in frame by frame analysis of the

video and can be used to give better result for classification.

The main focus was on naïve bayes classifier which was

successfully implemented on a video. The performance of

the methodology is found to be 93.64% accurate and has

precision of 93.77% with an error rate of 7.9%.

Key words: Moving object detection, background

subtraction, frame difference, object classification, naïve

bayes classifier, video processing

I. INTRODUCTION

Nowadays moving object detection has become a very

prime area for research due to its use in various computer

vision applications. Beside from the vital benefit of being

able to differentiate video streams into moving and

background content, detecting moving objects provides a

purpose of attention for recognition, classification and

activity scrutiny making these later steps more effective.

Moving object detection is defined as extracting the motion

part from a video stream. It handles separation of moving

objects from the immobile background scene. To recognize

objects of worth in the video sequence and to group together

pixels of these objects is termed as Object Detection. Since

moving objects are normally the principal source of

information, most methods intend on the detection of such

objects. A general tactic for object detection is usage of

information in an individual frame. However, some object

detection methods require usage of the temporal information

computed from a succession of frames to diminish the

number of false detections [1]. The classification of the

pixels in the video stream into either foreground or

background is said as detection of the moving objects in the

video [2].

Moving object detection is the task of identifying

the physical movement of an object in an exceedingly given

region or space. Over previous couple of years, moving

object detection has received abundant of attraction thanks

to its big selection of applications like video surveillance,

human motion analysis, automaton navigation, event

detection, anomaly detection, video conferencing, traffic

analysis and security. Additionally, moving object detection

is extremely important and worthwhile analysis topic in

field of pc vision and video processing since it forms a

crucial step for several complicated processes like video

object classification and video tracking activity.

Subsequently, identification of actual form of moving object

from a given system of video frames becomes relevant.

However, task of detecting actual form of object in motion

becomes tough thanks to numerous challenges like vigorous

scene changes, illumination variations, existence of shadow,

camouflage and bootstrapping drawback [3].

The moving object detection is the elementary step

for most of the applications based on video processing.

Videos are in reality sequel of images, each of which called

is a frame, played in fast enough frequency so that human

eyes can percept the continuousness of its content. It is

evident that all image processing methods can be applied to

separate frames. Moreover, the contents of two successive

frames are generally closely correlated. An image, generally

from a video stream, is distributed into two complementary

groups of pixels. The first group include the pixels which

correspond to foreground objects while the other and

complimentary group include the background pixels. This

result which is the detected object is often showed as a

binary image or as a mask. It is troublesome to mention an

absolute standard regarding what should be recognized as

foreground and what should be distinguished as background

because this description is rather application specific [4].

Background subtraction is a broadly used methodology for

detecting moving objects in videos streams from static

cameras. It is the general way of motion detection. It is a

process that finds the difference of the current image and the

background image to detect the motion region, and it is

commonly efficient to deliver data included object

information. The keynote of this process lies in the

initialization and update of the background image. The

efficiency of both will influence the precision of test results

[5]. It tries to detect moving regions by subtracting the

current image pixel-by-pixel from a reference background

image which is composed by averaging images over time in

an initialization period. The pixels where the variation is

beyond a threshold value are categorized as foreground.

Background subtraction is an extensively used technique for

detecting moving objects in videos from static cameras. The

reasoning behind the method is that of detecting the moving

objects from the variance amid the current frame and a

reference frame, frequently called the “background image”

or “background model”. As a fundamental, the background

image must be a description of the scene without moving

objects and must be kept frequently updated so as to become

accustomed to the unpredictable luminance circumstances

and geometry situations [6].

In visual surveillance system, motion detection is

that the essential and vital step that classifies the moving

foreground object from the background. The segmented

moving foreground object is also humans, vehicles, animals,

flying birds, moving clouds, leaves of a tree, or the other

noise etc. The work of a classification phase within the

visual surveillance system, is to classify the moving

foreground object into predefined categories like single

person, cluster of person, or vehicle, etc. The visual

Page 2: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1822

surveillance system is generally used for humans and

vehicles. Once the foreground object fit in to the current

category, the latter task like personal identification, object

chase, and activity scrutiny of the detected foreground

object may be done rather more with efficiency and

precisely. There are two main factors which have an effect

on the presentation of object classification. These are image

illustration and classification.

Classification is the task of generalizing familiar

arrangement to relate to new knowledge. it's the matter of

identifying to that of a group of classes (sub-populations) a

new examination goes on the supply of a preparation set of

information contain notes (or instances) whose class

membership is known [7].

The Naive Bayes algorithmic rule may be a

classification algorithm based on the Bayes rule. A naive

Bayes classifier may be a modest probabilistic classifier

grounded on applying Bayes’ theorem along with strong

(naive) independence conventions. It undertakes that the

occurrence (or absence) of a specific characteristic of a class

is distinct to the existence (or absence) of any other

characteristic, specified the class variable. It’s significantly

suited when the dimensionality of the inputs is high.

Parameter estimation for naive Bayes models makes usage

of the tactic of maximum chance. A bonus of the naïve

Bayes classifier is that it solely needs a little quantity of

training information to estimate the parameters essential for

classification [8].

Bayesian classification offers practical learning

algorithms and previous information and observed

information is combined. Bayesian Classification provides a

helpful viewpoint for considerate and calculating several

learning algorithms. It computes explicit probabilities for

hypothesis and it's robust to noise in input data. A naive

Bayes classifier adopts the principle that the presence or

absence of a particular feature is dissimilar to the presence

or absence of the other feature, given the class variable. For

some varieties of probability models, naive Bayes classifiers

is trained very proficiently in a supervised learning situation.

It additionally referred to as idiots’ Bayes, simple Bayes and

independence Bayes [9].

The remaining portion of this paper is systematized

in several sections. Section II describes about the related

works on this topic, Section III explains the proposed

methodology, while the Section 4 consists of the result,

followed by section V on conclusion and the last section VI

is about future scope of the work.

II. RELATED WORKS

Till now a lots of research and work by various researchers

on the moving object detection, background subtraction,

object classification and naïve bayes based had been done.

This is a very enriching and engaging topic and the result

can be implemented in real time system which makes this

area even more attractive for the researchers and with the

advancement in technology lots of works are being done in

it as well as can be introduced in it.

Alper Yilmaz et al. [1] within the survey paper

have presented an in depth survey of object tracking ways

and conjointly provides a brief review of related topics.

They have divided the tracking ways into three classes based

on the utilization of object representations, namely, ways

establishing point correspondence, ways using primitive

geometric models, and ways using contour evolution. They

have enclosed a brief discussion on widespread object

detection ways and have provided elaborate summaries of

object trackers, together with discussion on the object

depictions, parameter estimation schemes used by the

tracking algorithms and the motion models. Abhishek

Kumar Chauhan and Deep Kumar [10] have represented a

video surveillance scenario with real-time moving object

detection and tracking in their work. The detection of

moving object is very important in several tasks, like video

surveillance and moving object pursuit. The planning of a

video surveillance system is focused on automatic

identification of procedures of interest, particularly on

tracking and classification of moving objects. This survey

paper reviews in short analysis works on object detection

and tracking in videos. Mingyang yang [11] in the paper

provides an improved rule based on Background subtraction

and frame differencing algorithm. It uses surendra

background process to acquire background model and

makes usage of frame differencing procedure to update it,

then mines the moving objects from the combination of

images mined from these two strategies. It is presented

through the result that the tactic will satisfy the preciseness

and accuracy within the video sequences while not touching

the need of real-time.

Geetika [12] within the paper has given a brief

discussion of various classification ways that features

decision trees, K-nearest neighbour classifier, naïve Bayes

classifier and neural network. The paper conjointly

discusses some applications of classification model and at

the end the paper is concluded with the brief observations of

these classification models. It shows Fuzzy illustration of

trees add flexibility in information. The nearest-neighbour

methodology suffers severely from what's referred to as the

“curse of dimensionality”. In decision tree little variations

within the training set, the algorithm mat opt to select an

attribute that isn't truly the best one. Naïve Bayes seems to

fare higher than decision Trees because it shows the

importance of all input attributes just in case of heart disease

prediction. Kirubaraj Ragland and P. Tharcis [13] within the

paper conferred different steps involved in tracking objects

in a video sequence, particularly object detection, object

classification and object pursuit. They surveyed the various

strategies out there for detecting, classifying and tracking

objects in a much elaborated manner. The pros and cons of

every of the strategies are mentioned. Object detection

strategies explained are frame differencing, optical flow and

background subtraction. Then, it shows objects could also

be classified based on shape, motion, colour and texture.

Tracking methods involve point based tracking, kernel

based tracking and silhouette based tracking.

Junyan Peng and Patrick P. K. Chan [14] within the

paper proposes the revised Naive Bayes classifier to combat

the focus attack. For every feature within the Naive bayes

classifier, the extra weight based on the amount of ham and

spam containing the feature is added. The weight reduces

the effect of the main focus attack to the features.

Experimental results show that the projected methodology is

stronger underneath the focus attack. The accuracy on the

attacked samples of the projected methodology is beyond

customary Naive Bayes classifier, particularly when the

Page 3: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1823

degree of attack is massive. Kavitha.A and K.Thulasimani

[15] have worked on object tracking and recognition for real

time videos using naïve Bayes classification. Tracking

methods are categorized on the idea of the object and

motion representations specifically, ways establishing point

correspondence, approaches making usage of primitive

geometric models and procedures using contour evolution.

All these classes need object detection at some point. For

example, the point trackers need detection in each frame,

however geometric region or contours-based trackers

require detection only when the object initial appears within

the scene. Tracking is done based on the detection of the

movable objects, it’s done by Gaussian Mixture Model.

Harris Corner is employed for tracking and the classification

relies on Naive-Bayes Classifier. Naive Bayes provides the

higher classification by its class probability feature.

The motive of this research work is to successfully

implement naïve bayes classifier in video for classifying

each incoming frames into two class one containing the

frames having movable object while the other comprises of

frames without movable object. For this first object is

detected using background subtraction method and then

classification is implemented using naïve bayes classifier.

III. METHODOLOGY

Fig. 1.1: Framework of the Proposed Methodology

The purpose of the proposed methodology is to first detect

moving object from a video and then to classify each

extracted frame into two class from which one comprises of

frames having no moving object while the other comprises

of frames having moving object. The proposed methodology

has two stages namely training and testing as shown in fig.

1.1.

The training process starts with the acquisition of

training video sample and then extracting required frames

from it. In the training phase two types of samples are feed

to the feature extractor each having features very different

from each other so that each belong to different class. The

next step comprises of extracting the features from each of

the extracted frame of the video and then the video sample is

passed to next step where the moving object is detected

from the video using background subtraction method

namely frame difference.

After the moving object is detected that frames

containing only the detected object are made to go through

feature extraction and then all these are features are stored in

training database. Then naïve bayes classifier is trained

according to the inputted features to group the dataset into

the two classes in which one class will have all the features

of the frames with no moving object while the other class

will have all the features of the frames with moving objects.

After this only desirables features are used for classification.

Then in the testing phase the test video is acquired and then

its frames are extracted and then as in training phase the

features of the video are extracted and then the moving

object is detected similarly as in training phase finally the

features are passed into naïve bayes classifier to predict the

result and the output shows the number of frames having

moving object and frames not having moving object in the

train video.

The steps of the proposed methodology comprises as

follows:

1) Video acquisition

2) Pre-processing

3) Moving object detection using background

subtraction

4) Feature extraction from each frame

5) Rank based feature selection

6) Naïve bayes classification

A. Video Acquisition

This step comprises of process of converting the data

produced by a video camera which is obtained in analog

video signal form to digital video. This digital video data

obtained are referred to as video stream or digital video

stream that can be used on computer for further processing

that data.

B. Pre Processing

In this step the acquired data is prepared for processing.

Matlab consists of function VideoReader which is used to

acquire the digital video from the video obtained from a

video camera. Then the read function is used to read each

frame from the video. In the proposed system first 100

frames are extracted from the video and used for analysis

process for the further steps. Then the frames are resized to

fit the system.

Page 4: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1824

C. Moving Object Detection Using Background

Subtraction

After the first 100 frames are extracted from the acquired

video, moving object detection is performed on it to detect

any type of presence of moving object in that particular

frame. The method used for moving object detection is

frame difference which is a type of background subtraction

method. In this step the efforts are done to extract the

foreground from the background so that to find the moving

object in the video. For this we need a background image

from which the corresponding frames are differentiated so

as to find the objects which are actually moving. The benefit

of using frame difference method is that it is simple and less

complex and gives good result for static background.

In this first the background frame is initialized and

then the subsequent frames are subtracted from it and if the

difference is greater than the defined threshold then it is

taken as foreground thus the moving object else it is taken as

background means the non-moving object. To get better

result after each difference the background is updated with

the current frames which then becomes the background

frame for next frame. Its implementation is as

- Calculate the difference amid pixels of the two frames

and match with a defined threshold value.

|frame Ii – frame Ib|

- If the difference is above threshold value take it as

foreground object otherwise as a background.

If |frame Ii – frame Ib| > T

Then Foreground object

Else

Background object

The result of frame difference can be seen in fig 1.2

in which the first image is the background image, the next is

the current frame and then the next image is the grayscale

image of the current frame and finally in the last image is

the detected moving object.

(a) (b)

(c) (d)

Fig. 1.2: Frame difference method (a ) background frame,

(b) current frame, (c) grayscale frame and (d) Detected

moving object

D. Feature Extraction from Each Frame

In this proposed system two times eight features are

extracted from the same video file frames. The motive here

is to extract sixteen features from the frames so as to classify

them accordingly if they contains moving object or not. For

this two training videos are taken in which one contains

moving objects while another does not contains any moving

objects. If the frames contain no moving object than it

belongs to 0 classes else it belongs to 1 class. In total 16

features are extracted for the same input video. First 8

features are extracted before application of background

subtraction and the rest same 8 features are calculated for

the frames obtained after applying the background

subtraction method. As the features of both data will vary

highly due to difference in image properties for frames

having movable object and the one which does not has it.

Each image has unique properties and the difference

between the background image and current frame is

completely different for frames having moving object and

the frames having non movable object. The features which

are extracted are:

1) Edge Difference

For this feature first the edges are detected in the frames

using canny edge detector. After performing this the

connected components are calculated in the obtained image

and then the difference between the result of background

and current image is taken of connected components. As if

there is no moving object in the frame then the difference

will be very low and if there is moving object present in it

then the difference would be very high.

2) Thinning Difference

This is a morphological operation for skeletonizing the

image so as to detect only the edges in the image. It is

applied to binary image and it produces another binary

image as output. After performing the thinning operation the

connected components are calculated in the obtained image

and then the difference between the result of background

and current image is taken of connected components. If this

value is more than are moving objects in the current frame

else not.

3) Histogram Difference

In this first the histogram is computed of the background

frame and the current frame. If Ij is pixel intensity for jth

frame then for all the pixels in the image first bin is done

means the intensities are divided in small intervals and count

gives the values in each bin. Then the maximum value of

count is found and then the difference between counts of

both image are taken. This difference helps to find the

correlation between the histograms of the frames if this

value is low it means the images are similar thus no movable

object is present else a movable object may be present in the

current frame.

4) Mean Difference

The pixels of the image are calculated. This gives an

average value of pixel intensity. Then the difference of

mean is calculated of current frame and background frame.

If this difference is less it means the images are similar and

it does not contains any moving object while if there is huge

difference it means the images are dissimilar it means there

is a moving object is present in that frame.

Page 5: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1825

5) Standard Deviation Difference

This feature calculates the standard deviation of all the

pixels present in the image. If the difference is low it means

the images are more or less identical that means the current

frame does not contains a movable object whereas if its

value is high it may contain a movable object.

6) Mean Squared Error (MSE)

It is used to find the quality of an image. It calculates the

cumulative squared error. The difference between MSE

value of background frame image and current frame image

is taken. If the difference value is very high or infinite than

both the images are dissimilar and a movable object is

present in the current frame image and if the difference

value is low then no moving object is present in it.

7) Peak signal to Noise Ratio (PSNR)

It calculates the peak error i.e. the noise between two

images. The difference between PSNR value of background

frame image and current frame image is taken. If the

difference value is very high or infinite than both the images

are similar so no moving object is present in it and if the

difference value is low than a movable object is present in

the current frame image.

8) Structural Similarity (SSIM) Index

It is used to calculate the similarity amongst two images.

Structural info is the knowledge that the pixels have strong

inter-dependencies specifically when they are spatially

adjacent. If it is nearer to 1 then the images are similar and if

it is nearer to 0 then images are not similar.

9) Algorithm for Feature Extraction

Input: video frames

Output: Extracted features

1) Step 1: Background frameB, current frameCi,

i2

2) Step 2: while i <= End Of File

- Bggrayscale(B), Cggrayscale(Ci)

- Detect edge of Bg and Cg using canny detector

- Beconnected components(Bg), Ceconnected

components(Cg)

- EDIFabs ( Be- Ce)

- Convert Bbbinary(Bg), Cbbinary(Cg)

- Thin(Bb), Thin(Cb)

- Btconnected components(Thin(Bg)),

Ctconnected components(Thin(Cg))

- TDIF abs ( Bt- Ct)

- Bh Imhist(Bg), Ch Imhist(Cg)

- HDIFAbs (max (Bh (count)) - max (Ch (count)))

- MDIFAbs (mean (Bg) - mean (Cg))

- STDDIFAbs (Standard_deviation (Bg)-

Standard_deviation (Cg))

- MSDIFMSE (Bg, Cg)

- PSDIFPSNR (Bg, Cg)

- SDIFSSIM (Bg, Cg)

- BCi

- Ii + 1

3) Step 3: Save all the features in the training database

Fig 1.3 (a) and (b) shows the values for extracted

features for two train class video samples for 10 frames.

(a)

(b)

Fig. 1.3: (a) Extracted features for video having no moving object and (b) Extracted features for video having moving object

Page 6: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1826

E. Rank Based Feature Selection

After the features are extracted, the system is trained and

tested for various input combinations of the extracted

features and the features which gives the best result are

selected finally. An object can contain numerous features

but it is required to choose the most desirable features from

them so as to differentiate well during classification. The

motive of this step is only to get the most optimal result for

classification. For this different combinations of features

which are extracted are tested to get results and then the

features which gives best result are selected while the ones

which fluctuates the result are eliminated. In this ranking of

extracted features are done means features are ranked

according to their effect on classification. The feature giving

best result is ranked first while the one not giving good

result are ranked lower. The purpose of this step is to

discard irrelevant parameters to give the best result.

After the extraction of features for both training

video set difference of the value is calculated as shown in

fig 1.4. From the difference calculated for the extracted

features of both input values it can be seen that some of the

values are zeros. This features thus will have no influence

on deciding the outcome but can fluctuate the result thus

only 12 features from the set of 16 features are selected and

used for object classification using naïve bayes. The features

which are not selected are PSNR and Histogram difference.

Fig. 1.4: Difference of extracted features for both class input videos

F. Naïve Bayes Classification:

The naïve bayes classifier comprises of two stages namely

training and testing. In training the features are feed to the

classifier and the classes to which they belong are

aforementioned. In the testing stage the testing data is

provided to the classifier and it gives the class of the

features given as input. The better the features and their

value the better outcome can be observed. Using the training

features it estimates the probability distribution of that

feature belongs to a particular class. For testing it calculates

the class having largest probability distribution for a feature.

During test data it calculates the probability distribution of

the feature belonging to which class and henceforth gives

the class of the given input data. It assumes class conditional

independence while finding outcome. In this work in total

16 features are extracted from an object out of which only

12 were feasible and 4 were not feasible. Thus the classifier

was trained on its basis and classification was done in two

classes one containing frames with movable object and other

containing frames with non-movable object. The class

having frames with moving object are given outcome 1

while the one not having movable object are given outcome

0. Naïve Bayes classifier predicts X belongs to Class Ci iff

(

) (

) For 1<= j <= m, j <> I (1)

Where (

)

(

)

(2)

- Where (

): Probability of given X

- : Prior probability of hypothesis

- (

): Probability of X given

- : Prior probability of training data X.

With many attributes, the probability of whole

belonging to which class is calculated as:

(

) ∏ (

)

(3)

Which means (

) (

) (

) (

) (4)

IV. RESULTS AND DISCUSSIONS

Fig. 1.5: Comparison of edge difference of frames with

moving object and nonmoving object before background

subtraction

12 features are used for classification and the analysis for

different features for the different class videos are shown in

below graphs. The 12 features for the videos before

application of background subtraction and after application

of background subtraction are studied from figure 1.5 to

Page 7: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1827

figure 1.16. For the proposed work lots of data have been

used some are globally available as specified in [16, 17, 18,

19] while some were recorded by us.

From figure 1.5 and 1.6 it can be concluded that

edge difference among the frames not having moving object

have less edge difference from the background frame as they

have almost similar features while the frames having

moving object differ largely from the background frame in

terms of edge difference.

Fig. 1.6: Comparison of edge difference of frames with

moving object and nonmoving object after background

subtraction

From figure 1.7 and 1.8 it can be concluded that

thinning difference among the frames not having moving

object have less thinning difference from the background

frame as they have almost similar features while the frames

having moving object differ largely from the background

frame in terms of thinning difference.

Fig. 1.7: Comparison of thinning difference of frames with

moving object and nonmoving object before background

subtraction

Fig. 1.8: Comparison of thinning difference of frames with

moving object and nonmoving object after background

subtraction

From figure 1.9 and 1.10 it can be concluded that MSE

among the frames not having moving object and background

frame is less as they have almost similar features while the

frames having moving object differ largely from the

background frame in terms of MSE.

Fig. 1.9: Comparison of MSE of frames with moving object

and nonmoving object before background subtraction

Fig. 1.10: Comparison of MSE of frames with moving

object and nonmoving object after background subtraction

From figure 1.11 and 1.12 it can be concluded that

SSIM index among the frames not having moving object

and background frame is nearly equal to 1 as they have

almost similar features while the frames having moving

object thus differ largely from the background frame in

terms of SSIM index and is not nearly equal to 1.

Fig. 1.11: Comparison of SSIM index of frames with

moving object and nonmoving object before background

subtraction

Page 8: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1828

Fig. 1.12: Comparison of SSIM index of frames with

moving object and nonmoving object after background

subtraction

From figure 1.13 and 1.14 it can be concluded that

standard deviation difference among the frames not having

moving object have less standard deviation difference from

the background frame as they have almost similar features

while the frames having moving object differ largely from

the background frame in terms of standard deviation

difference.

Fig. 1.13: Comparison of standard deviation difference of

frames with moving object and nonmoving object before

background subtraction

Fig. 1.14: Comparison of standard deviation difference of

frames with moving object and nonmoving object after

background subtraction

From figure 1.15 and 1.16 it can be concluded that

mean difference among the frames not having moving

object have less mean difference from the background frame

as they have almost similar features while the frames having

moving object differ largely from the background frame in

terms of mean difference.

Fig. 1.15: Comparison of mean difference of frames with

moving object and nonmoving object before background

subtraction

Fig. 1.16: Comparison of mean difference of frames with

moving object and nonmoving object after background

subtraction

After the analysis the proposed methodology is

evaluated as shown in table 1.1.

Videos Precisio

n %

Accurac

y %

Sensitivit

y %

Specificit

y %

Erro

r

rate

%

Video I 100 95.95 95.95 Indef. 4.04

Video

II 100 97.97 97.97 Indef. 2.02

Video

III 100 100 100 Indef. 0

Video

IV 87.5 89.89 100 65.51 10.10

Video

V 91.35 92.92 100 72 7.07

Video

VI 80 89.89 88.88 100 10.10

Video

VII 97.59 88.89 90 77.77 11.11

Averag

e 93.77 93.64 96.11 78.82 7.9

Table 1.1: Performance metrics of proposed methodology

The total run time of each sample video on which

operation is performed is 20 Sec. The total frames which

were extracted are 100. Finally the total run time of the

proposed methodology starting from loading of video to

Page 9: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1829

classification is on average 15 – 20 minutes. The run time

depends on the quality of the video. If the resolution and

frame per second are less it takes less time but with the

increase in this parameter the running time of the whole

proposed work also increases. The performance of proposed

methodology on the basis of above metrics is given as

93.64% accurate and has precision of 93.77%.

V. CONCLUSION

This research work is based on moving object detection

using background subtraction and then classification of

frame on the basis of them having moving object or not by

using naïve bayes classifier. Firstly for moving object

detection it was observed that frame difference gave an

optimal result in comparison of other background

subtraction techniques as well as it not complex and is also

gives the result very fast. The only drawback in it is it needs

a static background and less illumination and scene changes.

Then the main focus was on naïve bayes classifier which

was successfully implemented on a video. The motive was

to classify the incoming frames from the video into two

class from which one consists of frames with moving

objects while the other contains the frames with no moving

object. The advantages provided by naïve bayes classifier

was the reason it was implemented in the work.

Even though it is a bit time taking the performance

of the methodology is given as 93.64% accurate and has

precision of 93.77% with an error rate of 7.9%.

This work can be applied in many real time

application as now a days video surveillance is a very

common area of interest for researchers and also there is

requirement of surveillance system in today’s era. The

various application included are security surveillance, traffic

monitoring, lane supervision, tracking, video processing,

medical imaging etc.

VI. FUTURE SCOPE

This work can be extended or modified to produce better

results or to perform some other functions. Firstly here

frame difference method is used for moving object detection

which can be replaced by other background subtraction

techniques like Mixture of Gaussian or median filter and the

comparative performance analysis can be done to choose the

better one. Methods like optical flow, segmentation can also

be implemented for moving object detection. Secondly for

classification some other unique properties of an image can

be taken like brightness, entropy, auto correlation,

similarity, pixel quality etc. Also the feature extraction

before application of background subtraction is slow thus

some mechanism could be used to faster the step to get

faster result. It can be used to give better result by removing

noise from the acquired data and also implementing shadow

removal can give much nicer outcome. It can be further

analyzed for multi class classifier and also if number of

moving objects on each frame containing movable objects

can be counted it will give even more benefit.

REFERENCES

[1] Alper Yilmaz, Omar Javed and Mubarak Shah, “Object

Tracking: A Survey” ACM Computing Surveys, Vol.

38, No. 4, Article 13, December 2006.

[2] A.Ramya and Dr. P.Raviraj, “A Survey and

Comparative Analysis of Moving Object Detection and

Tracking”, International Journal of Engineering

Research & Technology, Vol. 2 Issue 10, October –

2013.

[3] Jaya S. Kulchandani and Kruti J. Dangarwala, “Moving

Object Detection: Review of Recent Research Trends”,

Proceedings of IEEE International Conference on

Pervasive Computing (ICPC), -1-4799-6272-

3/15/$31.00(c) 2015.

[4] R. T. Collins et al, “A system for video surveillance and

monitoring: VSAM final report”, Technical report

CMU-RI-TR-00-12, Robotics Institute, Carnegie

Mellon University, May 2000.

[5] Rupali S.Rakibe and Bharati D.Patil, “Background

Subtraction Algorithm Based Human Motion

Detection”, International Journal of Scientific and

Research Publications, Volume 3, Issue 5, May 2013.

[6] M. Piccardi, “Background subtraction techniques: a

review”, in Proceedings IEEE International Conference

Systems, Man, Cybernetics, 2004, pp. 3099–3104.

[7] M.Soundarya, R.Balakrishnan, “Survey on

Classification Techniques in Data mining”,

International Journal of Advanced Research in

Computer and Communication Engineering Vol. 3,

Issue 7, July 2014.

[8] Neha Mehra and Surendra Gupta, “Survey on

Multiclass Classification Methods”, International

Journal of Computer Science and Information

Technologies, Vol. 4 (4), 2013, 572 – 576.

[9] S.Archana and Dr. K.Elangovan, “Survey of

Classification Techniques in Data Mining”,

International Journal of Computer Science and Mobile

Applications, Vol.2 Issue. 2, February- 2014, pg. 65-71.

[10] Abhishek Kumar Chauhan and Prashant Krishan,

“Moving Object Tracking using Gaussian Mixture

Model and Optical Flow”, International Journal of

Advanced Research in Computer Science and Software

Engineering, Volume 3, Issue 4, April 2013.

[11] Mingyang Yang, “Moving Objects Detection Algorithm

in Video Sequence”, 978-1-4799-3903-9/14/$31.00

©2014 IEEE.

[12] Geetika, “A Survey of Classification Methods and its

Applications”, International Journal of Computer

Applications (0975 – 8887) Volume 53– No.17,

September 2012.

[13] Kirubaraj Ragland and P. Tharcis, “A Survey on Object

Detection, Classification and Tracking Methods”,

International Journal of Engineering Research &

Technology (IJERT), Vol. 3 Issue 11, November-2014.

[14] Junyan Peng, Patrick P. K. Chan, “Revised Naive Bayes

Classifier For Combating The Focus Attack In Spam

Filtering”, Proceedings of the 2013 International

Conference on Machine Learning and Cybernetics,

Tianjin, 14-17 July, 2013.

[15] KAVITHA.A and K.THULASIMANI, “Object

Tracking And Recognition For Real Time Videos Using

Naive Bayes Classification”, International Journal of

Computer Science and Mobile Applications, Vol.2

Issue. 1, January- 2014, pg. 63-78.

[16] http://www.openvisor.org R. Vzzani, R. Cucchiara,

"Video Surveillance Online Repository (ViSOR): an

Page 10: Naïve based Moving Object Detection and …The Naive Bayes algorithmic rule may be a classification algorithm based on the Bayes rule. A naive Bayes classifier may be a modest probabilistic

Naïve based Moving Object Detection and Classification in Video using Background Subtraction

(IJSRD/Vol. 3/Issue 04/2015/426)

All rights reserved by www.ijsrd.com 1830

integrated framework" in Multimedia Tools and

Applications, vol. 50, n. 2, Kluwer Academic Press, pp.

359-380, 2010.

[17] http://i21www.ira.uka.de/image_sequences/ Karl-

Wilhelm-Straße: recorded by Klaus Fleischer, Michael

Haag, Frank Heimes, and Sven Noltemeier on

23.07.1997

[18] http://i21www.ira.uka.de/image_sequences/ rheinhafen

[19] http://i21www.ira.uka.de/image_sequences/ Karl-

Wilhelm-Straße: stationary camera installation by

German Eichberger, Klaus Fleischer and Holger Leuck.