# A Robust Home Alone Faint Detection Based on Wireless Sensor Networks

Authors: Zhen-hai Wang; Bo Xu
Journal: International Journal of Distributed Sensor Networks
 (2015)

---

## Abstract

Target detection and tracking are one of the fundamental problems for wireless sensor networks and play an important role in the safety field. Faint detection is an important problem for the elderly people or patients or even pregnant women. It has wide application in current society. This paper proposed a method to collect information about the behavior and position of faint event in the sensing environment. This method detects and tracks faint person by combining Kalman filter and Camshift tracking algorithm. Experiments showed that the method yields good detection and tracking performance in complex environments.


---

## Body

## 1. Introduction

With the development of science and technology, sensor technology and wireless communication technology have witnessed an unprecedented development. Because of wireless sensor network’s (WSN) low cost, low power consumption, and environmental adaptability characteristics, WSN has become a new access to information and information processing platforms which also become scholars’ research hotspot in recent years. Mass deployment of wireless sensor nodes in the target area forms a network in the form of self-organization and then carries out a variety of sensors (such as temperature and humidity) for a variety of environments in the network or detecting objects in real-time monitoring and sensing and access information. Being able to quickly layout and having strong adaptability and high precision monitoring, covering a wide range of features, make the wireless sensor network widely used in environmental monitoring, forest fires, medical care, logistics management, national defense, and target tracking.Wireless sensor network positioning and maneuvering target tracking are to use sensor nodes carry detectors in which the movement of the target measurements, moving target speed, position, acceleration, and methods are taken into account to estimate the state information tracking.Faint is one of the major problems that happens amongst the elderly peoples or patients or even pregnant women which may cause physical injuries or even mental problems. Fainting normally occurs when the person falls and his or her head hits the floor or other hard items. An emergency medical treatment for fainting largely depends on the response and rescue time. Therefore, detection of such incidents is very important in order to have the immediate treatment for this population [1].By applying ZigBee wireless communication technology, which is the most popular technology to organize the low cost, wide coverage and intelligent wireless sensor network. ZigBee has been widely used in many applications, such as military defense, environment monitoring, intelligent house, and medical attendance. But it is technically impossible to stream video over ZigBee because its capacity of wireless channel limits low data rate [2–4].In general, the target tracking system for wireless sensor network consists of four subsystems: the nodes self-organization, target state estimate, target tracking strategy, and target recovery issue.We propose a real time video surveillance system for faint detection consisting of many low cost sensors and a few wireless video cameras. The system allows a group of cooperating sensor devices to detect and track mobile objects and to report their positions to the sink node in the wireless sensor network. Then, the sink node uses the IP cameras deployed in the sensing area to record these events and display the present situations. In this paper, we mainly focus on target state estimate and target tracking.In the initial frame, object is extracted using frame differencing. This object is continually tracked in successive frames using Kalman filter and Camshift algorithm. The fainting event can be detected. When a fainting event occurs, the alarm will be triggered until the operator notes and resets the system.The remainder of this paper is organized as follows. Section2 describes Kalman filter and Camshift algorithm, respectively. Section 3 presents wireless sensor network deployment mode and the proposed algorithm for home alone faint detection. Experimental results and discussion are included in Section 4. Finally we conclude the paper and discuss some future work in Section 5.


## 2. Kalman Filter and Camshift Algorithm

### 2.1. Kalman Filter

The Kalman filter [5] is a well-known method in the field of motion prediction. It provides optimal prediction of a linear dynamic system containing white Gaussian noise. In addition, it is easy to implement with low computational cost because it is a successive and recursive algorithm.For efficient body tracking, the Kalman filter requires the setting of an appropriate trace model. We set the state vector as the center coordinates(x,y) of the detected body and the quantity of change (Δx,Δy) between previous and current frames.The state vector of the Kalman filter in timet is defined as
(1)xt=x,y,Δx,ΔyT.The Kalman filter assumes that the system state vector,x(t), evolves according time as
(2)xt+1=ϕtxt+ωt,
where ω(t) is a zero mean Gaussian noise with covariance Q(t). The covariance Q(t) is defined as
(3)Qt=0000000000100001.
The measurement vector is given by
(4)zt=Htxt+vt,
where v(t) is another zero mean Gaussian noise factor, with covariance R(t).The covarianceR(t) is defined as
(5)Rt=1001.
We assumed that faces move with uniform speed and linear direction. The state transition matrix ϕ(t) is defined as
(6)ϕt=1010010100100001.
The input vector is a four-dimensional vector that uses the center coordinates of the body and changes of the x-,y-,Δx-, and Δy-axes. Therefore, the measurement matrix H(t) is defined as
(7)Ht=10Δt0010Δt00100001.


### 2.2. Camshift Algorithm

Camshift algorithm [6] is a computer vision color tracking algorithm which belongs to moving object region based tracking techniques. It searches motion object using nonparametric clustering method. Because RGB color models are much more sensitive to lighting changes, this algorithm converts RGB color space to HSV color space in order to decrease illumination influence on tracking object.When tracking a colored object, Camshift operates on a color probability distribution image derived from color histograms. In comparison with mean shift algorithm, Camshift algorithm can adaptively adjust the size and location of the search window according to tracking result of last frame and obtain the object’s size and centroid of current frame.


## 2.1. Kalman Filter

The Kalman filter [5] is a well-known method in the field of motion prediction. It provides optimal prediction of a linear dynamic system containing white Gaussian noise. In addition, it is easy to implement with low computational cost because it is a successive and recursive algorithm.For efficient body tracking, the Kalman filter requires the setting of an appropriate trace model. We set the state vector as the center coordinates(x,y) of the detected body and the quantity of change (Δx,Δy) between previous and current frames.The state vector of the Kalman filter in timet is defined as
(1)xt=x,y,Δx,ΔyT.The Kalman filter assumes that the system state vector,x(t), evolves according time as
(2)xt+1=ϕtxt+ωt,
where ω(t) is a zero mean Gaussian noise with covariance Q(t). The covariance Q(t) is defined as
(3)Qt=0000000000100001.
The measurement vector is given by
(4)zt=Htxt+vt,
where v(t) is another zero mean Gaussian noise factor, with covariance R(t).The covarianceR(t) is defined as
(5)Rt=1001.
We assumed that faces move with uniform speed and linear direction. The state transition matrix ϕ(t) is defined as
(6)ϕt=1010010100100001.
The input vector is a four-dimensional vector that uses the center coordinates of the body and changes of the x-,y-,Δx-, and Δy-axes. Therefore, the measurement matrix H(t) is defined as
(7)Ht=10Δt0010Δt00100001.


## 2.2. Camshift Algorithm

Camshift algorithm [6] is a computer vision color tracking algorithm which belongs to moving object region based tracking techniques. It searches motion object using nonparametric clustering method. Because RGB color models are much more sensitive to lighting changes, this algorithm converts RGB color space to HSV color space in order to decrease illumination influence on tracking object.When tracking a colored object, Camshift operates on a color probability distribution image derived from color histograms. In comparison with mean shift algorithm, Camshift algorithm can adaptively adjust the size and location of the search window according to tracking result of last frame and obtain the object’s size and centroid of current frame.


## 3. Faint Detection in Infrared Images

### 3.1. System Model

Figure1 shows the deployment of our surveillance system. Mode includes two groups of sensor and two wireless thermal cameras in the region of interest. The system allows each group of cooperating sensor devices to detect and track the positions of faint and to report their positions to the sink node in the wireless sensor network. Then, the sink node triggers the IP thermal cameras. The camera sends captured information to information processing center or surveillance center via WLAN. Then, image sequences input into computer and are processed by faint detection and tracking algorithm. An alarm will be triggered and notify emergency medical treatment or host by internet or smart phone if a faint detection is found. Therefore, faint people will get immediate treatment.Figure 1
Sensor network deployment.


### 3.2. Object Extraction

Frame difference is a simple method to segment the moving object in image video. The target is segmented by the differences of frames int-1,  t, and t+1. Frame difference uses the difference of consecutive frames to detect the change area of frames and can get image 12 and image 23. The differential frame can be defined as
(8)FD(x,y,t)=0iffx,y,t+1-fx,y,t≤threshold,1otherwise,
where f(x,y,t) and f(x,y,t+1) are the pixels at position (x,y) in frames t and t+1.The segmented moving object, image, is obtained through the AND operator of the two differences, image 12 and image 23. To reduce the noise, image is processed using morphological opening and closing operations. The detection result is shown in Figure2.Figure 2
Detection result using frame difference.


### 3.3. Detection and Tracking Algorithm

Step 1 (global parameters definition).
Define global parameters to be used in algorithm such thatHp is human’s height in previous image, Hc is human’s height in current image, Wp is human’s width in previous image, Wc is human’s width in current image, f is accumulator for human lying image, F is total frames (time) to decide whether a human being is faint, and S is smallest possible human being’s size in an image.Step 2 (image acquisition).
Acquire image from thermal camera and store it as RGB image. The current frame image is subtracted from previous frame image to get a difference image which is marked by a rectangle.Step 3.
Kalman filter prediction is exploited to estimate the location of search window of Camshift algorithm. Perform Camshift tracking.Step 4.
Estimation of Camshift is obtained from the observation of Kalman filter. Perform Kalman filter prediction.Step 5.
Calculate the size of rectangle and perform faint detection as follows.IFHc≥Wc,THEN the human is considered standing, walking, or bending. Continue to Step6.IFHc<Wc and Wc≠Wp and Hc≠Hp and f<F,THEN the human is considered scrambling or bending. Continue to Step6.IFHc<Wc and Wc=Wp and Hc=Hp and f<F,THEN the human is considered scrambling or lying for a while. Continue to Step7.IFHc<Wc and Wc=Wp and Hc=Hp and f≥F,THEN the human is considered faint. Continue to Step8.Step 6.
Reset faint frame counter and start new cycle:
setf=0; update Wc=Wp and Hc=Hp. Repeat Step 2.Step 7.
Increase frame counter by 1 and start new cycle:
setf=f+1; update Wc=Wp and Hc=Hp. Repeat Step 2.Step 8 (faint case).
Signals alarm until operator notes and performs rescue and resets the system manually.


## 3.1. System Model

Figure1 shows the deployment of our surveillance system. Mode includes two groups of sensor and two wireless thermal cameras in the region of interest. The system allows each group of cooperating sensor devices to detect and track the positions of faint and to report their positions to the sink node in the wireless sensor network. Then, the sink node triggers the IP thermal cameras. The camera sends captured information to information processing center or surveillance center via WLAN. Then, image sequences input into computer and are processed by faint detection and tracking algorithm. An alarm will be triggered and notify emergency medical treatment or host by internet or smart phone if a faint detection is found. Therefore, faint people will get immediate treatment.Figure 1
Sensor network deployment.


## 3.2. Object Extraction

Frame difference is a simple method to segment the moving object in image video. The target is segmented by the differences of frames int-1,  t, and t+1. Frame difference uses the difference of consecutive frames to detect the change area of frames and can get image 12 and image 23. The differential frame can be defined as
(8)FD(x,y,t)=0iffx,y,t+1-fx,y,t≤threshold,1otherwise,
where f(x,y,t) and f(x,y,t+1) are the pixels at position (x,y) in frames t and t+1.The segmented moving object, image, is obtained through the AND operator of the two differences, image 12 and image 23. To reduce the noise, image is processed using morphological opening and closing operations. The detection result is shown in Figure2.Figure 2
Detection result using frame difference.


## 3.3. Detection and Tracking Algorithm

Step 1 (global parameters definition).
Define global parameters to be used in algorithm such thatHp is human’s height in previous image, Hc is human’s height in current image, Wp is human’s width in previous image, Wc is human’s width in current image, f is accumulator for human lying image, F is total frames (time) to decide whether a human being is faint, and S is smallest possible human being’s size in an image.Step 2 (image acquisition).
Acquire image from thermal camera and store it as RGB image. The current frame image is subtracted from previous frame image to get a difference image which is marked by a rectangle.Step 3.
Kalman filter prediction is exploited to estimate the location of search window of Camshift algorithm. Perform Camshift tracking.Step 4.
Estimation of Camshift is obtained from the observation of Kalman filter. Perform Kalman filter prediction.Step 5.
Calculate the size of rectangle and perform faint detection as follows.IFHc≥Wc,THEN the human is considered standing, walking, or bending. Continue to Step6.IFHc<Wc and Wc≠Wp and Hc≠Hp and f<F,THEN the human is considered scrambling or bending. Continue to Step6.IFHc<Wc and Wc=Wp and Hc=Hp and f<F,THEN the human is considered scrambling or lying for a while. Continue to Step7.IFHc<Wc and Wc=Wp and Hc=Hp and f≥F,THEN the human is considered faint. Continue to Step8.Step 6.
Reset faint frame counter and start new cycle:
setf=0; update Wc=Wp and Hc=Hp. Repeat Step 2.Step 7.
Increase frame counter by 1 and start new cycle:
setf=f+1; update Wc=Wp and Hc=Hp. Repeat Step 2.Step 8 (faint case).
Signals alarm until operator notes and performs rescue and resets the system manually.


## 4. Experimental and Evaluation

Our experiments are performed on an Intel Core i3 3.40 GHz PC with 4 G memory, and codes are implemented in C++.The proposed method is applied to image sequences that were captured form indoor environment. Figures3–6 show the tracking result, such as bending, standing, walking, fainting, scrambling, and lying down. The whole performing time including the time for capturing image and signal alarm is 4 frames per second. Thus we set F=40 which is a threshold. An alarm will be triggered if the frame that the person lies on is the same place beyond more than 40 frames, so that if the person lies on the same place with the same size for 10 seconds, that is 4*10≥40, then the system will judge the person as fainting.Figure 3
Walking or standing motion.Figure 4
Blending motion.Figure 5
Scrambling motion.Figure 6
Lying or faint motion.Compared to the literature [1], the proposed approach detects faint person by tracking method. On the one hand, Kalman filter can successfully predict object state in the next frame. It can be used to solve some challenging problems, such as object loss and occlusion. Camshift algorithm can adaptively adjust tracking windows size according to object motion. On the other hand, the proposed method is suitable to detect and track multiple people.


## 5. Conclusions

Recently, surveillance systems combining wireless sensor networks with video cameras have become more and more popular. This paper proposed a robust faint detection algorithm to detect and track faint person by a group of cooperating sensor devices. First, objects are detected by frame differencing. Then, objects are tracked in each frame using Kalman filter and Camshift. Tracking result is used to analyze whether a faint event occurs. When a faint detection case occurs, the signal will trigger the alarm until the operator performs the rescue action and resets the system manually. Experimental results indicate that the proposed method can robustly detect interestingly faint person, and system can expand easily. Furthermore, this method can be applied in the fields of cold chain logistics warehouse management for intelligent surveillance.



---

*Source: 534980-2015-08-18.xml*