Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Lightweight Acoustic Detection of Logging in Wireless Sensor Networks

László Czúni and Péter Zoltán Varga


Image Processing Laboratory, Dep. of Electrical Engineering and Information Systems
University of Pannonia, Veszprém 8200, Egyetem u. 10.
czuni@almos.vein.hu

ABSTRACT lens is wide then the resolution is low, otherwise the


monitored area is too small; the analysis of data
In our paper we investigate methods to detect the requires high complexity solutions; the required
acoustic signals of logging with the help of lightweight bandwidth of image transfer and the energy
sensors in a wireless sensor network. The main consumption of such devices is relatively large.
advantage of using such sensors is their small size, low In our paper we focus on the detection of illegal
cost, low power consumption, rare and cheap logging based on the detection of the acoustic signals
maintenance, and reasonable detection performance. of the chainsaws. The constraints of this application
These properties make such acoustic sensors area are similar to the above mentioned. Due to the
competitive to video based systems in large area nature of logging with chainsaw the use of acoustic
surveillance. sensors seems to be an optimal solution. In our article,
Besides specifying the hardware platform and the used after overviewing some similar approaches, we
test databases we detail the signal processing methods introduce a low cost and lightweight sensor platform,
for acoustic feature detection and classification and detail the proposed signal processing and feature
also discuss the performance of single node and multi classification methods, and discuss their performance.
sensors information fusion.

2 OVERVIEW OF RELATED WORKS


KEYWORDS
The usage of acoustic devices for surveillance can be
Acoustic signal processing, logging detection, found in several application areas. In [7] authors report
chainsaw detection, autocorrelation, feature detection, an acoustic surveillance experiment where the
classification, large area surveillance, wireless sensor proposed system, comprised of a computer and a
network microphone situated in a typical office environment,
continuously analyzes the acoustic activity at the site,
separates all interesting events, and stores them in a
1 INTRODUCTION database.
In [8] examples for real-time acoustic classification of
vehicles into two sets (cars and trucks) are proposed.
The surveillance of large territories of woods is
Different classifiers were tested in the spectral and
important from several aspects: the detection of illegal
cepstral domain. Best results, on a certain database,
logging, fires, illegal vehicle traffic can prevent great
could reach 97% with the usage of neural networks.
losses if the proper action can be done in time.
While there are several papers for the acoustic
There are different approaches to monitor large open
classification of vehicles we found not much
areas such as satellite image processing [1], [2], local
information regarding the possibilities for chainsaw
video surveillance [3], [4] or wireless sensor networks
detection. The most valuable information was found in
(WSNs) [5], [6].
[9] where a wireless sensor network for chainsaw
The state of the art of satellite signal based methods
detection is described. Authors took into consideration
does not support real-time operation in general, and
the limitations of the hardware platform when
also the spatial resolution is very limited.
designing an autocorrelation based detection
Unfortunately, conventional video surveillance suffers
mechanism. Detection is based on checking the
from several shortcomings: if the viewing angle of the
fundamental frequency, sound intensity, and the

ISBN:978-0-9891305-6-1 ©2014 SDIWC 120


number of local maximums of the autocorrelation
function. The best detection correctness was 80%,
unfortunately neither the exact classification method
nor the experimental setup or the test database is
described in details.
We can conclude that while the area of acoustic signal
processing is very large, the detection of chainsaw, an
important event in forest surveillance, is not analyzed
deeply. Moreover, most papers don’t consider the Figure 1. The applied wireless node with acoustic sensor
limited hardware resources and energy supply board and antenna
available in WSNs. Contrary, in our paper we report
the algorithms (and their performance) implemented in 3.2 Preprocessing
low consumption sensors including information fusion. While the hardware platform enables us of high
frequency sampling, due to the acoustic nature of the
chainsaw and the limitations of available SRAM, it is
3 CHAINSAW DETECTION IN A satisfactory to apply 8333Hz 10 bit sampling as the
WIRELESS SENSOR NETWORK lowest built in option of the node. As we will see, this
is still high for the proposed feature detection.
First we introduce the available hardware platform for Therefore we apply a down-sampling to one fourth
sensing and data processing defining the limitations in preceded by FIR low pass filtering. This saves memory
memory, computing power, and power supply. Then and decreases the computational complexity of further
the test databases, used in the evaluation of the processing.
proposed detection mechanism, are described. Later We implemented an autogain mechanism to set the
the signal processing and classification methods are amplitude of the signal making it possible to detect
detailed with the possibilities to use a single node or chainsaw from a few meters to more than 50 meters
several nodes applying information fusion. distance from the node. A fast autogain mechanism is
achieved, with the two cascaded amplifiers of the node,
3.1 Hardware platform of nodes considering only the peaks of the incoming signal
The WSN consists of nodes, equipped with electret avoiding signal overflow and too low signal energies.
microphones, responsible for recording and processing The available SRAM of the node enables us to store
small audio segments (see Figure 1). Closely placed and evaluate only 4 consecutive acoustic samples of
base stations are responsible for forwarding high level 1/8 sec length for the detection of logging at a time.
information from the nodes to a remote back-end
computer via GPRS or fusing information of the slave 3.3 Test databases
nodes. The communication between the nodes and the We built two test beds for the testing of the different
base station is achieved at 868MHz within a range of algorithms.
300 meters at a maximum bit-rate of 1000kb/s. Node The Single Source Database (SSDB) contains
side information processing and data transmission is chainsaw samples, recorded within a range of 5-60
done with an ATMega128RFA1 combined meters from the chainsaw at 53-84dB sound level, and
microcontroller-radio chip programmed in nesC, using open-air city noises such a wind, remote vehicle traffic,
the TinyOS operating system. This 8 bit architecture is talking, bird sounds and other effects at around 42dB
equipped with 16KB SRAM and 2MB Flash memory. noise level. SSDB contains 570 samples (each segment
The node is supplied with two AA type 2600mAh is of 1/8 sec length) with 60% chainsaw and 40%
batteries. The advantage of this lightweight setup is background noise. SSDB is used in training and testing
low power consumption (long operation time) and low for single sensor detection.
cost while it makes difficult to implement sophisticated The Half-Synthetic Database (HSDB) is composed of
data processing algorithms. forest chainsaw recordings as positive samples (154
short segments) and different negative samples
(rainfall, wind, bird sounds, remote traffic, cricket
chirps) from various internet resources (1000
segments). The positive chainsaw samples were
manipulated by adding noise effects to simulate as the
samples were recorded from the same chainsaw but at

ISBN:978-0-9891305-6-1 ©2014 SDIWC 121


different distances at different signal-to-noise ratio. In simpler FFT such as in [10] but the application of such
future we plan to substitute this later database with real techniques are above the limitations of our research.)
synchronized multi-sensor recordings but at the current The general form of the autocorrelation function of the
state of the work the HSDB was used to test multi input signal 𝑠 is calculated as:

sensor fusion. In our tests less than 50% percent of
samples were used for training the remaining for 𝑅 𝑚 = 𝑠𝑛 ⋅ 𝑠𝑛+𝑚 (1)
testing the classification methods. n=−∞
while in our case:
s
3.4 Feature extraction
As discussed in [9] the different chainsaw engines have 𝑅 𝑚 = (𝑠𝑛 − 𝑠) ⋅ 𝑠 𝑛+𝑚 𝑚𝑜𝑑 𝑠 −𝑠 (2)
a baseline frequency somewhere between 100 and 300 n=0
Hz depending on the type and rev of the engine. While where 𝑠𝑛 is the nth input signal, 𝑠 is its mean and
other acoustic sources can have similar properties the s = 256 is the length of the input vector. Figure 4.
distribution of peaks of the Fourier spectra is quite illustrates the autocorrelation function of signals of
different and it can also vary greatly in their case. Just Figure 2. As can be seen for the chainsaw the shape of
for illustration we show the time signal and the Fourier 𝑅 𝑚 is quite regular with a long series of high peaks.
Transformation (FT) of a chainsaw sample and of a
wind acoustic sample in Figure 2. and Figure 3.

Figure 4. The autocorrelation of the chainsaw (left) and wind


(right) samples of Figure 2.
Figure 2. The typical signal shape of chainsaw (left) and
wind (right). After finding the local maximum, with a gradient
search method, in the autocorrelation function we
calculate the following descriptors:

 Average distance of the local maxima 𝑚𝑎𝑥𝑖 :


1 |𝑚𝑎𝑥 |
𝑎𝑣𝑔𝐷𝑖𝑠𝑡 = |𝑚𝑎𝑥 | 𝑖=1 𝑑𝑖𝑠𝑡𝑖 (3)

where max is the set of local maximum, and


𝑑𝑖𝑠𝑡𝑖 = 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 𝑚𝑎𝑥𝑖 − 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛(𝑚𝑎𝑥𝑖−1 )
Figure 3. The FT in the 0-1000Hz range of the time signals  Variance of distances of local maximum:
of Figure 2. Chainsaw (left) and wind (right). |𝑚𝑎𝑥 |
1 2
𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 = 𝑑𝑖𝑠𝑡𝑖 − 𝑎𝑣𝑔𝐷𝑖𝑠𝑡 (4)
Peaks of the Fourier spectrum could be considered for |𝑚𝑎𝑥|
feature extraction; however the application of Fast 𝑖=1
Fourier Transformation (FFT) is still above the  The number of local maximum:
capabilities of the node’s processor. Instead of using
FFT (with a complexity of n x log n) we calculate the |𝑚𝑎𝑥|
autocorrelation (with complexity n x n). At first sight it  The short time energy of the input signal:
seems to be unreasonable to choose the method with
|S|
higher theoretical complexity but the limitation of the
node’s architecture (8 bit integers and 16KB SRAM) STE = 𝑠𝑛2 , n ∈ N (5)
and the requirements of the sampling of the sinusoidal n=0
signals and the handling of the complex values makes
it unfeasible to compute the FFT on our platform.
(Here we mention that there are possibilities for

ISBN:978-0-9891305-6-1 ©2014 SDIWC 122


3.5 Classification based on a single node 50
Memory limitations of the node allow the recording of 40
4 pieces of samples with 1/8 sec duration each. The 30
20
feature extraction and classification of these 4 samples 10
takes 3 seconds. 0
For the sake of lightweight classification we tested
different decision trees first, namely Alternating
Decision Tree (ADT) [11], Best-First decision tree
[12], Decision Stump [13], J48 (C4.5) [14], J48Graft
(grafted C4.5) [15], LogitBoost Alternating Decision Figure 6. The hitrate (in %) normalized by false positive
Tree (LADTree) [11], Random Forest [17], Random detections of different decision trees based on single samples
Tree [13], Reduced-Error Pruning Tree [13], Simple of the SSDB.
Classification and Regression Tree (CART) [18].
While decision trees can be considered as generally As Figure 6. shows ADT gives the best performance if
good classifiers in pattern recognition, their main the rate of false positive decisions is also considered.
advantage is the simple and cost efficient ADT is a decision tree built with the help of a boosting
implementation considering speed and memory usage. mechanism using several weak classifiers [11]. The
output of this binary classifier is a real number in a
range of 0 and 100. Binary classification is achieved by
thresholding this number, as default 50 is set to make
90,00
the decision. The average hitrate of ADT on SSDB is
80,00
84.9% giving 2% average false positive and 13%
70,00
average false negative rates. The confusion matrix of
60,00
ADT is given in Table 1.
50,00

Table 1. The confusion matrix (in %) of ADT based on


single samples of the SSDB.
Decision
Figure 5. The hitrate (in %) of different decision trees based
Ground truth Chainsaw Other
on single samples of the SSDB.
Chainsaw 76.19 23.81
Figure 5. compares the hitrate (true positive rate) of the Other 2.67 97.33
different tree-based classifiers evaluated on the SSDB.
While a few is above 80% we should also consider the There are several possibilities to consider several
false positives to get a better picture of these methods. samples of a given node. After testing different
It is important to have a picture of false positive approaches we just give the best three methods all
detections since in a real surveillance system the false using 4 consecutive samples:
alarms can cause extra costs due to the implied labor  Averaging the features of 4 samples and applying
demanding local monitoring. Since logging takes a ADT for classification (4sADT).
relatively long time the rate of false negatives, based  Averaging the features of 4 samples and applying
on a single measurement, is not so dangerous. Figure 6. SVM [19] for classification (4sSVM).
shows the hitrate divided by the number of false
 Averaging the output (in 0-100 range) of the 4
positives.
ADT single classifiers. The average value is then
thresholded to make the final decision
(4sADTAVR).

The results of these methods can be found in Table 2.


where the threshold for 4sADTAVR is set to 42.
Figure 7. shows the ROC (Receiver Operating Curve)
of the 4sADTAVR approach with different thresholds.
In general we can say that the application of

ISBN:978-0-9891305-6-1 ©2014 SDIWC 123


consecutive samples could give only a moderate gain
over single sample decisions. Table 3. The confusion matrix (in %) of kNN based on
samples of the HSDB.
Decision
Table 2. The confusion matrix (in %) of different methods
Ground truth Chainsaw Other
using the data of a single node. The 4sADTAVR used 42 as
threshold. Chainsaw 97.06% 2.94%
Decision Other 2.25% 97.75%
Single sample 4 samples 4 samples 4 samples ADT
ADT ADT SVM averaging
Ground
truth Chains. Other Chains. Other Chains. Other Chains. Other 4. CONCLUSION AND FUTURE WORK
Chains. 76.19 23.81 69.01 30.99 78.87 21.13 77.46 21.13
In our article we investigated the problem of chainsaw
Other 2.67 97.33 6.25 93.75 6.25 93.75 2.08 97.92
detection with lightweight sensors in a WSN. The main
constraints of the tasks are the limited processing
power, memory, communication bandwidth, and power
supply of the components of the WSN. We proposed
the analysis of some features of the autocorrelation
function of the recorded acoustic signals with the help
of decision trees, SVM, and kNN. We used real data
for the evaluations of the different approaches. The
best hitrate for a single sensor was 84.9% and 97.7%
for the fusion of three sensors. For testing sensor
fusion half-synthetic data were used.
Based on our initial tests (under 20 degree Celsius
temperature) with single sensors we found if 33% of
the time is monitored then the energy supply of the two
AA batteries keeps for approximately 42 days. If only
every 20th second (5% of total time) is recorded and
analyzed then the batteries last for about 300 days.
Taking into consideration the nature of logging these
Figure 7. The ROC of the 4sADTAVR approach with
different thresholds. If the false positive detection is around values seem to be reasonable in a forest surveillance
zero than the true positive detection is around 50%. application.
In future we plan to set up the WSN in forests under
3.6 Using multiple sensors different environmental circumstances and run long-
The advantage of the single sensor multiple samples term performance tests.
approach is that we need no overlapping of the sensible
areas thus we can achieve the maximum coverage of
the area under surveillance. Unfortunately we could 5 ACKNOWLEDGEMENTS
not exceed 77.46/2.08 true positive/false positive ratio.
Using the HSDB set we could test multiple sensors This research was supported by the Hungarian
fusion. In this setup we calculated the weighted sum of Government and the European Union and co-financed
the measured features and also added variables to by the European Social Fund under projects
represent the variance of each feature coming from the GOP-1.1.1-11-2011-0070 and TÁMOP-4.2.2.C-
different sensors. 11/1/KONV-2012-0004. László Czúni was supported
For classification we also tested decision trees and by the Bolyai scholarship of the Hungarian Academy
SVM but in this case the kNN (k=15) classifier [20] of Sciences. Special thanks for the help of Péter József
gave the best results. For confusion matrix see Table Kiss, Gergely Vakulya and Gyula Simon.
3., the average hitrate is 97.7%. This fusion can be
easily computed by the base stations based on the
synchronization of the slave nodes.

ISBN:978-0-9891305-6-1 ©2014 SDIWC 124


6 REFERENCES [17] Leo Breiman (2001). Random Forests. Machine
Learning. 45(1):5-32.
[18] Leo Breiman, Jerome H. Friedman, Richard A. Olshen,
[1] Guangmeng, Q., & Mei, Z. (2004). Using MODIS land Charles J. Stone (1984). Classification and Regression
surface temperature to evaluate forest fire risk of Trees. Wadsworth International Group, Belmont,
northeast China. Geoscience and Remote Sensing California.
Letters, IEEE, 1(2), 98-100.
[19] J. Platt: Fast Training of Support Vector Machines using
[2] Kyzirakos, K., Karpathiotakis, M., Garbis, G., Sequential Minimal Optimization. In B. Schoelkopf and
Nikolaou, C., Bereta, K., Papoutsis, I., & Kontoes, C. C. Burges and A. Smola, editors, Advances in Kernel
(2014). Wildfire monitoring using satellite images, Methods - Support Vector Learning, 1998.
ontologies and linked geospatial data. Web Semantics:
Science, Services and Agents on the World Wide Web. [20] D. Aha, D. Kibler (1991). Instance-based learning
[3] Xiong, Z., Caballero, R., Wang, H., Finn, A. M., Lelic, algorithms. Machine Learning. 6:37-66.
M. A., & Peng, P. Y. (2007, March). Video-based
smoke detection: possibilities, techniques, and
challenges. In IFPA, fire suppression and detection
research and applications—a technical working
conference (SUPDET), Orlando, FL.
[4] Bo Lei; Zhijie Zhang; Song Yue and Chensheng Wang
"Forest smoke detection in video images based on
constant speed rotating platform", Proc. SPIE 8908,
International Symposium on Photoelectronic Detection
and Imaging 2013: Imaging Sensors and Applications,
89082K (August 21, 2013)
[5] Son, Byungrak, Yong-sork Her, and J. Kim. "A design
and implementation of forest-fires surveillance system
based on wireless sensor networks for South Korea
mountains." International Journal of Computer Science
and Network Security (IJCSNS) 6.9 (2006): 124-130.
[6] Lloret, J., Garcia, M., Bri, D., & Sendra, S. (2009). A
wireless sensor network deployment for rural and forest
fire detection and verification. Sensors, 9(11), 8722-
8747.
[7] Harma, A., McKinney, M. F., & Skowronek, J. (2005,
July). Automatic surveillance of the acoustic activity in
our living environment. In Multimedia and Expo, 2005.
ICME 2005. IEEE International Conference on (pp. 4-
pp). IEEE.
[8] Andreas Starzacher, Bernhard Rinner, "Single Sensor
Acoustic Feature Extraction for Embedded Realtime
Vehicle Classification," International Conference on
Parallel and Distributed Computing, Applications and
Technologies, pp. 378-383, 2009
[9] Papán, Jozef, Matús Jurecka, and Jana Púchyová. "WSN
for Forest Monitoring to Prevent Illegal Logging." in
Proceedings of the Federated Conference on Computer
Science and Information Systems, pp. 809-812. 2012.
[10] Khoirul Anwar and Minoru Okada (2011). Low
Complexity Fourier Transforms using Multiple Square
Waves, Fourier Transforms - Approach to Scientific
Principles, Prof. Goran Nikolic (Ed.), ISBN: 978-953-
307-231-9, InTech
[11] Freund, Y., Mason, L.: The alternating decision tree
learning algorithm. Proceeding of the Sixteenth
International Conference on Machine Learning, Bled,
Slovenia, (1999) 124-133.
[12] Haijian Shi (2007). Best-first decision tree learning.
Hamilton, NZ.
[13] Mark Hall, Eibe Frank, Geoffrey Holmes, Bernhard
Pfahringer, Peter Reutemann, Ian H. Witten (2009); The
WEKA Data Mining Software: An Update; SIGKDD
Explorations, Volume 11, Issue 1.
[14] Ross Quinlan (1993). C4.5: Programs for Machine
Learning. Morgan Kaufmann Publishers, San Mateo,
CA.
[15] Geoff Webb: Decision Tree Grafting From the All-
Tests-But-One Partition. In: , San Francisco, CA, 1999.
[16] Geoffrey Holmes, Bernhard Pfahringer, Richard Kirkby,
Eibe Frank, Mark Hall: Multiclass alternating decision
trees. In: ECML, 161-172, 2001.

ISBN:978-0-9891305-6-1 ©2014 SDIWC 125

You might also like