ARID ZONE JOURNAL OF ENGINEERING, TECHNOLOGY & ENVIRONMENT AZOJETE March 2020. Vol. 16(1):48-57 Published by the Faculty of Engineering, University of Maiduguri, Maiduguri, Nigeria. Print ISSN: 1596-2490, Electronic ISSN: 2545-5818 www.azojete.com.ng Corresponding author’s e-mail address: yausamaila002@gmail.com 48 ORIGINAL RESEARCH ARTICLE REAL-TIME DETECTION OF ABANDONED OBJECT USING CENTROID DIFFERENCE METHOD Y. A. Samaila1*, H. Rabiu2 and I. Mustapha1 (1Deparment of Electrical and Electronics Engineering, University of Maiduguri, Maiduguri, Nigeria 2Department of Electrical Engineering, Bayero University, Kano, Nigeria) * Corresponding author’s email address: yausamaila002@gmail.com 1.0 Introduction An abandoned object is a stationary object that has not been in a scene before. To detect the abandoned objects, find the static regions in the scene and determine whether they correspond to abandoned or not. Recently, several Bomb explosions occurred in public areas. For instance, on 20th September 2015, at the Ajilari area of Maiduguri, Nigeria, an abandoned polythene Bag containing an explosive kept at a Mosque entrance exploded, where several people were killed and many others sustained injury. The preventive action is imperative and wide scale deployment of surveillance systems are in demand. In spite of the sophisticated surveillance systems deployed in many places today, the problem still persists. Such limitations are connected with human involvement in the systems. Therefore, it is challenging for man to continuously monitor a scene round the clock, thus, the manual surveillance fails. Semi- automatic surveillance using close circuit Television (CCTV) also seems ineffective due to the ARTICLE INFORMATION ABSTRACT An abandoned object is one that remains stationary for an extended period. Such object might contain explosives and if left on purpose could cause death and injuries to people especially in crowded places. Abandoned objects need to be detected on time to prevent what might endanger people’s lives and health. Various methods have been developed to detect abandoned objects. The most reliable one is the vision-based method which automatically detects the abandoned object using image processing. The efficiency of the method was tested and evaluated on the customized datasets as well as the i-Lids advanced video surveillance system database. The Self -organizing Background Subtraction (SOBS) method overrides other methods in terms of its detection accuracy and simplicity of implementation, but fails for dynamic background scenarios. This work presents a real time vision-based object detection method using the centroid difference to improve on the accuracy of the detection and to tackle challenges of dynamic background of the SOBS method. Matlab Image processing toolbox was used to achieve this goal. The strategy is basically decomposed into two; foreground detection and stationary foreground object (SFO) detection. Gaussian Mixture Model is used for detecting the presence of newly introduced object into a scene (foreground detection), while the blob tracking approach based on frame counting is used to determine whether the detected foreground object is static/ abandoned or not. The results show that the detection accuracy of 83% was obtained which outperform the SOBS method with 67% accuracy. Future research should focus on tracking the person that abandoned the object for onward prosecution. © 2020 Faculty of Engineering, University of Maiduguri, Nigeria. All rights reserved. Submitted 21 March, 2019 Revised 27 September, 2019 Accepted 03 October, 2019 Keywords: Stationary Foreground Object Abandoned Object Gaussian Mixture Model Self -Organizing Background Subtraction Centroid Difference. http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, March, 2020; Vol. 16(1) 48-57. ISSN 1596-2490; e-ISSN 2545-5818; www.azojete.com.ng Corresponding author’s e-mail address: yausamaila002@gmail.com 49 fact that man cannot effectively monitor many scenes at a time without possible distraction. To ease this problem and improve scene monitoring systems, computer-based object detection and monitoring system is proposed. A computer-based surveillance system detects the left/abandoned object and activate alarm to alert security personnel act on it. Several methods have been devised to detect foreground object. These include frame differencing, background subtraction, optical flow, single Gaussian, Gaussian Mixture Model (Samaila et al., 2019). Background subtraction identifies the presence of moving object by considering the difference between a fixed reference frame and a current frame (Risha and Chempak, 2016). The frame differencing method identifies the presence of moving object by considering the difference between two consecutive frames. Frame differencing is subdivided into three parts. Initial step is the selection of perfect reference or background. The second step is the arithmetic subtraction operation and the third step is the selection of a suitable threshold. Reference image can be selected as a frame which is temporarily adjacent to an image from a dynamic sequence. This method lacks in obtaining the complete contour of the object (Risha and Chempak, 2016). This could arise due to suitable threshold selection that will be applied throughout the video frame, as each frame has its unique feature. A three (3) frame differencing is used to lessen this shortcoming (Shaikh et al., 2014). Interestingly, a hybrid approach co- opting background subtraction and frame differencing detects moving object a lot effectively and precisely (Alex and Wahi, 2014). For scenes that are having dynamic background (Tree branches, Bushes, Water Surface or Flags), a generalization based on a mixture of Gaussians can be used to model such variations (changes cannot be modeled using One Gaussian distribution per pixel). Stauffer and Grimson (1999) proposed a Gaussian Mixture Model (GMM) method to deal with scenarios consisting dynamic backgrounds, illumination challenges, camouflage among others. Tavakkoli, (2009) came up with a method that allows the background model to be a mixture of several Gaussians (typically between 3 and 5). Each pixel is labeled as foreground or background based on its probability. Furthermore, for the stationary foreground object (SFO) detection; tracking of foreground and dual foreground comparison are some of the renowned methods. In the tracking of foreground method, blobs statistics such as object size/area, centroid position, were used in some studies by Miguel and Martinez (2008), Bayona et al. (2009), Utikari and Uke (2014) and Singh et al. (2009) to determine if an object is static or not. Dual foreground comparison (DFC) strategy proposed by Porikli et al. (2008) tried to identify the SFOs by comparing two binary foreground masks at pixel level. These masks were obtained from two background models constructed with different learning rates. The models were constructed using multiple Gaussians. The main objective of the research is to developed a database and as well use it in developing an algorithm for detecting abandoned object. 2. Methodology The abandoned object detection method used in this work comprises of three stages. The block diagram representation of the abandoned object detection method is as shown in Figure 1. Figure 1: Block Diagram Representation of the Abandoned Object Detection Method file:///C:/Users/user/Downloads/azojete143/www.azojete.com.ng Samaila et al: Real-time detection of abandoned object using centroid difference method. AZOJETE,16(1):48-57. ISSN 1596-2490; e-ISSN 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: yausamaila002@gmail.com 50 The custom database was developed in addition to the publicly available database to implement the technique. red, green blue (RGB) partitioned video frames were converted to gray scale for easier and faster processing. Foreground detection: Gaussian mixture method was used to detect foreground objects in the gray scale video frames. Stationary Foreground Object (SFO) detection: Centroid difference tracking method was used to track the stationary foreground object(s) across successive frames. Figure 2 gives the flow chart of the GMM algorithm, from the design and the development of the database stage to the stationary object detection stage. Figure 2: Flow Chart of the GMM Algorithm 2.1. Design and Development of Database Two different databases were considered in this work. The Advanced Video Surveillance System (AVSS) which is a publicly available database, contains objects (of interest) with confined shapes and sizes. The custom database takes care of the shortcomings of the AVSS database as it considers objects of different shapes and sizes. The properties of the abandoned object detection database is shown in Table 1. http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, March, 2020; Vol. 16(1) 48-57. ISSN 1596-2490; e-ISSN 2545-5818; www.azojete.com.ng Corresponding author’s e-mail address: yausamaila002@gmail.com 51 Table 1: Properties of the Abandoned Object Detection Database. Sequence(S) No. of Frames Object of interest Size (Pixels) Customized Sequence 1(S1) 297 Polythene Bag 1390 Customized Sequence 2(S2) 660 Big Bag 1968 Customized Sequence 3(S3) 318 can 691 Customized Sequence 4(S4) 2071 Big Bag 2021 Customized Sequence 5(S5) 1676 Small Bag 1553 The Video (database) shown in Table 1 was partitioned into frames and converted from RGB to grayscale image in order to speed up the processing. Background model was developed using Gaussian mixture model in order to detect the foreground object. 2.2. The Gaussian Mixture Model Foreground Detection For Video scenes with dynamic background (tree branches, bushes, water surfaces or flags), a generalization based on a mixture of Gaussians can be used to model such variations (changes cannot be modeled using One Gaussian distribution per pixel). The use of a Gaussian mixture model (GMM) was first introduced by Stauffer and Grimson (2000) to deal with dynamic background scenarios. This method allows the background model to be a mixture of several Gaussians (typically between 3 and 5). Each pixel is labeled as foreground or background based on its probability. A pixel-based method was presented which models each pixel (regarded as background) into a mixture of Gaussians. The number of Gaussians K is typically set from 3 to 5 (Stauffer and Grimson, 2000). In addition, each Gaussian has its own weight to represent the portion of the data accounted for from corresponding distribution. The probability that a pixel regards a value x at a certain time t, Xt is given as follows; P Xt = j=1 k ω j,t ∗ ղ Xt ,m j,t , j,t�� (1) where K is the number of Gaussian distributions, ω j,t is the weight estimation of the jth Gaussian in the mixture at time t, mj,t and Σ j,t are the mean value and covariance matrix respectively, of the jth Gaussian in the mixture at time t, and η is a Gaussian pdf (probability density function) defined in (2); ղ Xt. ,m,Ʃ = 1 2π k 2 Ʃ 1 2 exp − 1 2 Xt −mt T Ʃ−1 Xt −mt (2) Table 2 shows the modified GMM Parameter values used which was originally adopted in another work (Power and Schoones, 2002). Table 2: Parameter Values for the modified GMM Symbol Value Related Parameter K 5 25 frames/seconds A 0.005 X ε [0,255] T 0.7 ωinit 0.05 Num Training Frames 50 @ 25fps X [0-255] file:///C:/Users/user/Downloads/azojete143/www.azojete.com.ng Samaila et al: Real-time detection of abandoned object using centroid difference method. AZOJETE,16(1):48-57. ISSN 1596-2490; e-ISSN 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: yausamaila002@gmail.com 52 where: K= Number of Gaussians T= Minimum Background Ratio X=pixel value σinit=Initial Variance α= Learning Rate ῳinit= initial weight NumTrainingFrames= Number of Training Frames The salient point of the GMM stage is given here. 1. The method terminates upon reaching convergence. The parameters are used to fit on the data point (each pixel is denoted as a data point). 2. Upon fitting the GMM to the data, the component or surface (K) with the highest probability claims the pixel (that particular incoming pixel). 3. The process is repeated for all incoming pixel of the current frame as compared to the background model. The detected foreground object is used as an input to the next stage to determine whether it is stationary/abandoned or not. 2.3 Stationary Foreground Object (SFO) Detection Using Centroid Difference Tracking Method The centroid is one of the easiest region properties used for determining whether a foreground object is stationary or otherwise. It comprises of two (2) axis-x and y. Centroid r�=1A (r,c)εR r� , c�=1A (r,c)εR c� , (3) Where r= row; c= column; R=region; A=area. Note: For a foreground blob to be considered static, it has to satisfy two conditions; The Centroid difference must be less than the set threshold [5 5]. The said difference should be maintained for at least 25 consecutive frames Blob counting (tracking) across several frames is employed to track the stationary objects in the sequence. The tracking process is explained in section 2.4. 2.4. Tracking of Foreground Using the Centroid Difference Algorithm The basic steps are: The variables were declared and initialized Counter(c)= 0, threshold (Th)= [5, 5], No. of consecutive frames = 25 The centroid and area of blobs in each frame were obtained and stored in an array. The maximum area and its index as well as its corresponding centroid (maximum centroid) were determined for each frame. The maximum centroid entries were labeled as k1(x1, y1) for the 1st frame, k2(x2, y2) for the second, up to kn (xn, yn) for the last frame. If k1-k2