Building Occupancy Estimation using a Probabilistic Approach

DOI : 10.17577/IJERTV3IS060168

Download Full-Text PDF Cite this Publication

Text Only Version

Building Occupancy Estimation using a Probabilistic Approach

Reda Shbib

School of Engineering University of Portsmouth Portsmouth, United Kingdom

Shikun Zhou

School of Engineering University of Portsmouth Portsmouth, United Kingdom

Abstract-Lighting and ventilation can be easily controlled if occupancy detection system is available which enable saving of energy and offering more comfortable building environment, however, exact and accurate measurements of occupancy detection remains not easy task to achieve. This paper present a technique to determine the occupancy level in a building which is divided into zones using video cameras deployed at the front of each zone where image processing algorithm has been developed in order to determine the number of passing people in every zone

Keywords-occupancy; video suirveillance; image prcessing;

  1. INTRODUCTION & BACKGROUND Around 40% of the universal used energy is spent in

    buildings [1], of which roughly half is used for Heating, Ventilation, and Air Conditioning (HVAC) in industrial countries .At the same time the building sector has a large potential for cost-effective reduction of CO2 emissions and most investments in building energy efficiency can be expected to pay back through reduced energy bills. Amongst other possibilities, such as improved insulation and more energy efficient appliances, one way to address the problem of reducing the energy consumption of buildings is improved HVAC control.

    Measuring occupancy has been used in many buildings in order to reduce the consumption of energy [2].Building control systems can use occupancy data for several purposes include air condition, lighting, and energy consumption of a total building.

    Occupancy detection provide as well information to these building systems to permit them operate correspondingly to the number of people in the building. In addition, Obtainable information would help in search and rescue, and improve the management of emergency events, thus saving people lives. Moreover, it can enable management to optimize resources in a room or building and implement more effective disaster management system. At economic side, it can assist businesses to gain more information about costumer behaviors. (Time spent direction).

    A model has developed by [3]shows that for lighting, up to 50% of energy has been saved based with a good occupancy measures. For HVAC, shows that occupancy driven control could enable energy savings of 20%. Important energy savings are promising by controlling users PC power on and sleep conditions as a function of usage. Apart from energy consumption, occupancy detection can be used to collect and analyze information for example, how a specific facility is used, by and how many people and when, crowd behavior in specific building or shopping Centre. This latter is extremely useful in behavioral economic and can help businesses to optimize commercial activities.

    Nowadays, different types of sensors can be used in order to determine occupancy levels in current buildings. Such sensors consist of video cameras, passive infra-red (PIR), measuring of elevator load, access control devices, and computer key- strokes detection (Operators PCs occupancy detection). Sometimes location can be determined by active devices (RFID tags, Cell phones) that are carried by individuals.

    The initial stage is to design an estimator that determines the occupancy level of persons in the divided sectors of the building. The design if the building and the location of the sensors, the confidence level of sensors (accuracy level, range detection) play as input parameters of the estimator. It is very important to define a building mode ( style of the building ) in order to have more understanding of people movement patterns to estimate the number of people in the locations that are not fully covered by the cameras . Probability distribution is the result of the estimator of the number or persons in the buildings sectors where the building is separated to non- overlapping sectors in which these sectors would cover the whole building locations.

    This paper reports the estimation problem of one of our university building, and can be generalized to other buildings. This building has 3 floors of 10,000 square feet, has usual occupancy levels up to 300 students, and has 15 video cameras

    The rest of this article is organized as follows. State of arts has been reviewed is the next section. The proposed technique of model estimator is described in section 3. Face detection and Kalman filter tracking integrated with AMM is presented in section 4. Some of Experimental results which provide a validation of the proposed approach is demonstrated in section 5 followed by a conclusion and future work.


    Generally traditional occupancy estimation systems have some weaknesses. Infrared Sensors is one of the major and common technology for controlling light that have been used in last few years in non-domestic building however in case , a static occupant , Passive infrared Sensor ( PIR) fails in detection , consequently the services will be falsely switched off[4] . A smart occupancy detection system has been proposed by [5] which is able to be adjusted with the motion level of people in the building. In this work, it has been demonstrated by the author that the amount of the false detection can be minimized to the minimum trough the variation of the sensor time delay taking into consideration the known activity pattern of passing people. However, when the occupancy pattern is unclear, time delay changing couldnt totally remove false detection. Reference [6]tried to resolve this problem by proposing an approach using Bayesian network including three infrared sensors combined with a telephone in order to deduce a probabilistic occupancy. Markov chain has been used to model the occupancy state of small offices. Primary detection results has showed an accuracy level of 76%, however the system was not able to detect the number of people. A multi-sensor fusion system that measure CO2 level, acoustic and infrared sensor, has been proposed by [7]in order to detect occupancy level in offices. The proposed system is able to extract data from sensor and fuse them using Support Vector Machine algorithm. An accuracy level of 73 % has been achieved.

    Ultrasonic motion detectors are used in non-residential buildings specifically for controlling light, but it has shown some failure detection of occupants existence as they are static. These sensors are mounted specifically to measure occupancy levels and for controlling building systems for energy saving purposes. Disadvantages to such occupancy sensing comprise high installation cost and use, limited level of accuracy, and sometimes improper installation and lack of networking capabilities for data collection. [2]

    A smart occupancy sensor has been developed by [9] which can adapt to changing activity levels. This sensor has the ability to learn the variation in activity level of the occupants with respect to time of the day. The experiment conducted in this model have shown that time delay TD (the time after which the lights or any other load will be switched off after the last motion is detected by the sensor) can be minimized and shorter.

    Using of wearable sensors has been developed by in order to observe the recovery of hospital patients, however, this might be clearly unfeasible in several other situations, not least,

    public structures.A variation of energy saving from 10 % to 40

    % has been reported by using PIR sensors forlighting control based on the setting of the detectors and the nature of room .In addition, PIR sensors showed a successful use for lighting control in infrequently occupied closed locations but problems has been reported for more open places.[2, 6]

    CCTV has been used [8], although occupants privacy is a serious concern, while biometric systems has high setup cost to implement .Low cost sound sensors has been deployed for events observation of occupants in a house, although careful differentiating between sources of sound is essential to prevent errors

    A various number of researches have highlighted the importance of occupancy detection by observing the use of equipments offices .For instance, measuring building occupancy using existing network infrastructures has been developed by[2] .IP addresses of occupants, activities of mouse and keyboards has been monitored .An accuracy level of 80 % is achieved at the whole building level.

    Using of many sensors in our system would offer redundancy, which, allow the system keeping delivering information needed in a partial failure situation data might be loosed from a sensor, the capability of fault tolerance and efficient functionality. It comes to be clear that it is valuable to develop an approach for measuring buildings occupancy using a sensor fusion technique.

    Estimating the number of people in building sectors based on the collected information from sensors is the main key of this paper. However, this is not an easy task since; the large number of sensors would causes information redundancy e.g. field of view might be overlapped between two cameras as well areas that cannot be covered by the sensors. In addition, one more issue is that there is no 100 % of accuracy data level can be offered by the sensor itself.


    The proposed building estimator in this can be applied for other building. The university building has three floors; in this work we have addressed the ground floor. The main layout of the ground floor is described in Figure 1.

    Red Cameras shown in fig 2 are mounted with an angle down of around 35 degrees at the main hallways and the entrances of the building. Information collected by camera will be sent to a central server where image processing algorithms is being applied

    Cameras videos are mounted in such way to segment the ground floor into three sectors (fig 3). Each camera covers a specific sector. Number of passing students across sectors will be defined as a probability distribution function pdf. Divided sectors are shown in the fig below.

    Fig. 1: Building layout

    Fig. 2: Cameras Location


    1. Data Collection

      Occupancy data has been collated from Monday till Friday for the five selected zone using six wireless IP cameras which

      cover the ground floor. The sectors used for data collected are shown in the fig 3. Gaussian Mixture model has been used for background subtraction for helping identifying images having students. In general, the occupancy of the hallways depends

      on the time spent by students either waking or having some discussion, which might long for a ten seconds.

      The graphs below show the occupancy variation of four location within the building, two class rooms, and lab and staff room. Both room2 and room2 are used for teaching; most of student arrives approximately at 9 or 10 in the morning.

      Pattern variation of the occupancy can be realized. Since the staff room is mainly used for meeting there is a slight occupancy variation along the week.

      Let s E = General Estimation Occupancy

      In order to obtain E, The proposed model will add and subtract of the N number student outputs from each sensor and for each of sectors based on the direction of the occupants. Moreover track the Probability Distribution equivalent to the output of every sensor.

      Graphical divided zones are represented as nodes as shown in fig 3. Each of these nodes has a line to the neighbor node.

      Lets Yi (t) for i = 1 .n denotes the estimated number of students in sector i at any time t and Kij (t) denotes number of students passing from sector i to sector j at any time t

      Fig. 3: Graph representation of 4 zones

      Yi (t) = Estimated number of students Based on the detected number of faces.

      1. Estimate (t):

        The proposed method of face detection involves three key

        components. Frame segmentation of the moving object, Facial features extractions and face detection.

        As a first step the video stream is pre-processed using Gaussian mixture modelling (GMM) for image segmentation and background subtraction in order to extract the region that contain human face. Then a multi-layer classification has been adopted using Adaboost algorithm in order to obtain the precise position of candidates faces. Figure 1 show the proposed system below.

        Video Stream

        Non face



        Background subtraction




        Median Filtering

        Face Classifier

        Feature Selection

        Face detection and


        Fig 4: Proposed Approach

    2. Object segmentation

      Single state HMM or a GMM is a robust parametric model for modelling various types of distributions or densities. It has been used for adaptive Gaussian mixture modelling of an image background subtraction[9]. A Gaussian mixture model is a parametric learning model and it assumes the process

      being modelled has the characteristics of a Gaussian process. A Gaussian process assumes that the parameters do not change over time. So this is an excellent assumption which is true as an Image can easily be assumed to be stationary during a single frame.

      A GMM tries to capture the underlying probability distribution governing the instances presented during training of the GMM. In our case, we let it learn the background pixels by analyzing the common pixels across a few video frames (first few video frames). Given a test instance it tries to

      estimate the maximum likelihood of each of the image pixels to test whether each area (comprising of pixels) is background or the Blob (moving objects on the background) given the trained GMM model. It operates on the probability of a pixel lying under in the background or the foreground. This threshold is configurable.

      In this model the value of particular pixel over the time is seen as a measurementXt of a stochastic variable. At any time along the current measurement of Xt , thehistory Mt = { X1 , X2 , , Xt1} is known (Stauffer, 1999).

      Therefore, the current history of a particular pixel can be

      modeled by mixture of K Gaussian distributions. Different colors are supposed to denotes as different Gaussian .The probability to detect the current background pixel Xt is the weighted sum of the K distribution

      rectangle. The detection process used by Paul Viola et al. is based on the features instead of directly pixel detections. Three types of features have been used.

      Fig.5:Two-rectangle feature

      Fig.6. Three-rectangle feature


      P Xt = K


      (Xt , i,t , k ) (1)

      K= number of Gaussian distributions

      wi,t , is the wieght of ith distrubution at time t ,and the wi


      Where k is the mean and k is the covariance matrix of the kth density

      Thus , how longer a color is staying in the picture in represented by the probability density function :

      Fig.7. Four- rectangle feature

      e 2

      1 1 T 1

      X i,t

      , k =

      (Xk )

      n 1

      k (Xk )


      (2)2 | k |2

      After applying GMM for pixel edge extract of subsequent

      frames. Dilation and median filter approach has been applied in order to reduce the noise. The equation 3 shows the Dilation calculation:

      IImage = A B = i Bi A (3)

      Where A and B are the binary images

    3. Features extractions

    • Haar features

    After image processing segmentation and background subtraction we have to extract facial features in order to detect the face candidates. In this part and for very fast features evaluation we adopt face detector developed by Paul Viola et al. [10]. Viola has developed effective Haar features for face detection in 2001 which would be and effective method to differentiate between face and non-face, one of the main advantages of using Haar-like features is its the very fast speed of its calculation. Haar features are a composition of rectangular features. As definition, it is the difference between

    In this work, Haar features that have been selected are shown in Fig8.

    a b c

    d e 6

    Fig.8: Selected Haar Features

    We can calculate easily Haar features using the approach of the integral image that can be computed as follows.

    the summations of the value of pixels of areas within the

    ii x, y = x x,y y i(x , y )


    Where i(x , y ) represent the original image and has (x , y )


    Each point within the obtained integral image represents the summation of the values of pixel in the rectangle which use the origin of the image and the point in order to construct the diagonal endpoint.


    Fig.10. Integral value of (x, y)

    Fig.11 Proposed Approach Results vs. Actual Results

    Using a recurrence process the integral image can be then calculated

    ii x, y = ii x 1, y + s x, y (5)

    s x, y = s x, y 1 + i x, y (6)

    Given a set of features and tanning set of face and non- face images, there variety of machine learning technique that can be effectively used in order to learn a classification function. Adaboost techniques have been used in order to select the features set and for the classification training. Full explanation of Adaboost algorithm can be found in [10]


    Using the proposed approach in this work for face detection multi-face video images, we have got a good detection which has good level of accuracy. Some experimental results are shown in fig 11



The Total Occupancy E at the first zone is equal:

Y1 t + 1 = Y1 t + K2 1 t + K4 1 (t) (7) For I = 1 to n = 4 (number of zones) in this equation Y1 t + 1

denote the occupancy to estimate based on the prior

knowledge Yi t and the recent estimate of the sensorsKi j t In this work we are trying to calculate the probability distribution at each zone

P [ Yi t + 1 = n / { i j t and P (Yj t } = M] (8)

Then number of student moving from zone i to zone j is denoted by Ki j t and the prior estimated at any given time t is represented by P (Yj t } = M

Scenario 1:

The probability distribution function of zone 4 is the convolution of functions f4 f14 f24 f34

Pdf if zone 4 is equal:

Over count

Miss count


Proposed Approach



92.5 %

Head Detection



85 %

Y1 t+1

= Y1 t

Y1 4 t

Y2 4 t

Y3 4 t


Where represent the convolution operation between


The probability distribution function of Y1 t can be identified by the prior reiteration of the estimation. At a given time t = 0

the estimation of Y1 t is initialized. At the when there no people it is equal to 0

The probability distribution function of Ki j t is computed based on i j t which is presented by

P [ Kij t = a and i j t = b] (10)

So using Bayes theorem. It can be computed P [ Kij t = a /

i j t = b] = P [ ij t = a / Kij t = b]. P [ Kij t = b]

Fig. 12 Class Room & Laboratory Occupancies

Fig. 13: Counting Results of overall building


Determining the existence or the accurate number of people within a specific location at any given time would provide essential information for an effective building space management and several building operation control such as safety, security, room usages and emergency.

A new approach for building occupancy estimation using Video cameras has been proposed in this work. The presented methodology highlights the efficiency of deploying existing and low cost IP camera for detecting building occupancy for in order to improve room usages efficiency and achieve more comfortable levels.


  1. K. Nyarko and C. Wright-Brown, "Cloud based passive building occupancy characterization for attack and disaster response," in Technologies for Homeland Security (HST), 2013 IEEE International Conference on, 2013, pp. 748-753.

  2. R. Melfi, et al., "Measuring building occupancy using existing network infrastructure," in Green Computing Conference and Workshops (IGCC), 2011 International, 2011, pp. 1-8.

  3. L. Chenda and P. Barooah, "An integrated approach to occupancy modeling and estimation in commercial buildings," in American Control Conference (ACC), 2010, 2010, pp. 3130-3135.

  4. D. T. Delaney, et al., " Evaluation of energy-efficiency in lighting systems using sensor networks " presented at the Proceedings of the First ACM Workshop on Embedded Sensing Systems for Energy-

    Efficiency in Buildings, Berkeley, California, 2009

  5. V. Garg and N. K. Bansal, "Smart occupancy sensors to reduce energy consumption," Energy and Buildings, vol. 32, pp. 81-87, 2000.

  6. R. H. Dodier, et al., "Building occupancy detection through sensor belief networks," Energy and Buildings, vol. 38, pp. 1033-1043, 2006.

  7. M. H. K.P. Lam, B. Dong, "Occupancy detection through an extensive environmental sensork network in an open-plan office building," presented at the Proceedings of the Eleventh International IBPSA conference, Glasgow, Scotland, 2009.

  8. T. Ekwevugbe, et al., "A design model for building occupancy detection using sensor fusion," in Digital Ecosystems Technologies (DEST), 2012 6th IEEE International Conference on, 2012, pp. 1-6.

  9. C. a. G. Stauffer, W.E.L, "Adaptive Background Mixture Models for Real-Time Tracking, Computer," August 1999, pp. pp. 2246-252.

  10. P. Viola and M. Jones, "Rapid object detection using a boosted cascade of simple features," in Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on, 2001, pp. I-511-I-518 vol.1.

Leave a Reply