## 3 Grid-Based Event Detection
### Reducing Erroneous Readings Due to Transient Faults  
Transient faults may occur at any sensor nodes even though they are functional. Treating sensor nodes with transient faults as faulty nodes will reduce the number of usable sensor nodes, and it thus needs to be avoided. To effectively deal with transient faults, we employ a simple filter to correct most errors due to the faults. The reason for employing a filter is that an event will cause the sensor readings to be 1 for an extended period of time, while measurement errors due to transient faults might occur randomly and independently.  
Let \(x_{i}^{k}\) represent the binary sensor reading at time \(t=k\) at node \(v_{i}\). Then the filtered output \(b_{i}^{k}\) is determined based on the \(w\) most recent readings with a threshold \(q\) as follows.  
\[b_{i}^{k}=1\quad\text{if}\sum_{j=k-w+1}^{k}x_{i}^{j}\geq q \tag{2}\]  
If \(w=\) 4 and \(q=\) 3, for example, \(b_{i}^{k}\) can be 1 only if there are at least three 1's out of four consecutive readings. This will correct most measurement errors due to transient faults unless they appear repeatedly for some extended period of time or at consecutive sampling times. Consequently, the number of false reports to the cluster head will be considerably reduced. The decision on an event at the cluster head will be made using a threshold test based on \(b_{j}^{k}s\) from the member nodes. Due to the smoothing an event would be reported to the cluster head with some manageably small delay, depending on the window size \(w\) and \(q\). The window size \(w\) depends on the sampling interval and the behavior of transient faults. In this paper, sampling period is assumed to be short, but long enough to treat transient faults independent. If some transient faults affect for an extended period of time such that the sensor readings are incorrect over several sampling times, they will be treated as they are. The window size needs to be small enough to minimize the delay involved. If necessary, however, an early warning can optionally be given to the cluster-head for its attention. Under the independence assumption the window size \(w\) and \(q\) are determined as follows.  
Filtering out most errors induced by transient faults will effectively reduce the transient fault probability \(p_{t}\). For transient faults occurring randomly and independently in sensor nodes with the same probability \(p_{t}\), the effective transient fault probability \(\tilde{p}_{t}\) for various values of \(w\) and \(q\) can be estimatedusing \(\sum_{j=q}^{w}p_{t}^{j}(1-p_{t})^{w-j}\), and the resulting reductions are shown in Table 2, where \(p_{t}\) = 0.2 is assumed. If \(w\) = 4 and \(q\) = 3, for example, \(p_{t}\) can be effectively reduced from 0.2 to 0.027.  
The reduction in \(p_{t}\) depends on the filter employed. The selection of a filter, however, might not be of importance as long as \(p_{t}\) can be reduced in such a way that the tradeoff between detection accuracy and false alarm rate can be greatly lessened. As can be seen in simulation, the simple filter with \(w\) = 4 and \(q\) = 3 is good enough to achieve almost perfect performance even for \(p_{t}\) = 0.2. The smoothing filter functions effectively for a wide range of \(p_{t}\), and can still function positively even when \(p_{t}=0.5\). However, it might be reasonable to assume that \(p_{t}\) is much smaller than 0.5 for wireless sensor networks to be used in environmental monitoring applications.