# Water Pollution Detection Based on Hypothesis Testing in Sensor Networks

Authors: Xu Luo; Jun Yang
Journal: Journal of Sensors
 (2017)

---

## Abstract

Water pollution detection is of great importance in water conservation. In this paper, the water pollution detection problems of the network and of the node in sensor networks are discussed. The detection problems in both cases of the distribution of the monitoring noise being normal and nonnormal are considered. The pollution detection problems are analyzed based on hypothesis testing theory firstly; then, the specific detection algorithms are given. Finally, two implementation examples are given to illustrate how the proposed detection methods are used in the water pollution detection in sensor networks and prove the effectiveness of the proposed detection methods.


---

## Body

## 1. Introduction

Water is the most important material to human’s survival and valuable resource to industrial and agricultural production. With the development of economy and industry, more kinds of pollution materials are discharged into the water environment such as rivers and lakes, and more water pollution disasters have happened. Detecting the pollution timely is important for water conservation and is the precondition to locate and find the pollution source.In most pollution monitoring and pollution source localization applications by using sensor networks, the criteria of the pollution detecting are that the nodes have pollution concentration values and the concentration values are larger than a given threshold, such as the works about the pollution monitoring [1–8] and the works about the pollution source localization [9–12].Since there is an initial pollution concentration of normal production and life in water, when the sensor nodes have monitored relevant information, it cannot be deduced that there exists pollution generated by a pollution source. At the same time, in the water environment there are plankton, garbage, aquatic animals, plants, and so forth, which intervene in water pollution monitoring and bring disturbances to the monitoring data. The decision threshold to determine whether there is pollution is difficult to be given properly in the simple source detection method.In this paper, hypothesis testing is adopted to solve the water pollution detection problems. Firstly, a brief description of the monitoring sensor network and what problems there are in the pollution detection are given. Secondly, theoretical approaches to solve the detection problems are analyzed based on hypothesis testing. Thirdly, the specific detection algorithms are given. Finally, implementation examples are given to illustrate the proposed pollution detection methods.


## 2. Problem Statement

### 2.1. Network Deployment

The self-organizing sensor network is used in the water pollution monitoring.J(>5) sensor nodes are deployed in the monitoring area uniformly and the detail information of the pollutant to be monitored is known previously. The detection sensors which are stretched into water are identified. The locations of the nodes are fixed. The sensor nodes know their own positions and all static nodes in the network sample and store the concentration values synchronously with the same time interval. The background information such as the diffusion coefficient, the water depth, and the interval of sampling time is known previously. The monitoring information is routed to the sink node and processed by the data processing center. The network deployment is as shown in Figure 1.Figure 1
The sensor network for pollution detection.


### 2.2. The Detection Problems

The pollution detection problem of the network is to detect whether the sensor network finds the pollution. More specifically, that is,J static nodes sample and store the concentrations uniformly with a time interval T. At the sampling time t
l, based on the samples C
~
(
x
i
,
y
i
,
t
l
)
,
i
=
1,2
,
3
,
…
,
J of the J nodes determine whether there is pollution at a given significance level α in hypothesis testing.The purpose of the pollution detection of the network is to detect the pollution timely.The pollution detection problem of the node is that each node in the network determines whether it has accessed to the concentration information about the pollution source. More specifically, that is, all static nodes in the network sample and store the concentrations synchronously with a time intervalT. At a given significance level α in hypothesis testing, it is determined whether the node (
x
i
,
y
i
) has found the water pollution at t
L based on the known samples C
~
(
x
i
,
y
i
,
t
l
)
,
l
=
1,2
,
3
,
…
,
L.The change of the diffusion in the concentration field is slow. When the network finds the pollution, it is not that each sensor node has detected the pollution. With time passing, the sensor nodes having detected the pollution will be more and more. In the pollution source localization, a node can be used in the localization only when the node has detected the pollution.


## 2.1. Network Deployment

The self-organizing sensor network is used in the water pollution monitoring.J(>5) sensor nodes are deployed in the monitoring area uniformly and the detail information of the pollutant to be monitored is known previously. The detection sensors which are stretched into water are identified. The locations of the nodes are fixed. The sensor nodes know their own positions and all static nodes in the network sample and store the concentration values synchronously with the same time interval. The background information such as the diffusion coefficient, the water depth, and the interval of sampling time is known previously. The monitoring information is routed to the sink node and processed by the data processing center. The network deployment is as shown in Figure 1.Figure 1
The sensor network for pollution detection.


## 2.2. The Detection Problems

The pollution detection problem of the network is to detect whether the sensor network finds the pollution. More specifically, that is,J static nodes sample and store the concentrations uniformly with a time interval T. At the sampling time t
l, based on the samples C
~
(
x
i
,
y
i
,
t
l
)
,
i
=
1,2
,
3
,
…
,
J of the J nodes determine whether there is pollution at a given significance level α in hypothesis testing.The purpose of the pollution detection of the network is to detect the pollution timely.The pollution detection problem of the node is that each node in the network determines whether it has accessed to the concentration information about the pollution source. More specifically, that is, all static nodes in the network sample and store the concentrations synchronously with a time intervalT. At a given significance level α in hypothesis testing, it is determined whether the node (
x
i
,
y
i
) has found the water pollution at t
L based on the known samples C
~
(
x
i
,
y
i
,
t
l
)
,
l
=
1,2
,
3
,
…
,
L.The change of the diffusion in the concentration field is slow. When the network finds the pollution, it is not that each sensor node has detected the pollution. With time passing, the sensor nodes having detected the pollution will be more and more. In the pollution source localization, a node can be used in the localization only when the node has detected the pollution.


## 3. Pollution Detection Based on Hypothesis Testing

In [13], a simple discussion about the water pollution detection is given by the present authors under the assumption that the distribution of the monitoring noise is normal and known previously. In this paper, the pollution detection problems are discussed in more general cases.Assume that the initial pollutant concentration (the pollution concentration of normal production and living sewage) in water isC
0. If there is no diffusion source, C
~
(
x
i
,
y
i
,
t
l
)
=
C
0
+
e
,
i
=
1,2
,
3
,
…
,
J. If there is some node (
x
i
,
y
i
) having detected the pollution, C
~
(
x
i
,
y
i
,
t
l
)
=
C
(
x
i
,
y
i
,
t
l
)
+
C
0
+
e, where e is the measurement noise of sensor nodes and C
(
x
i
,
y
i
,
t
l
) is the theoretical concentration value related to the pollution source.Remark 1.
The concentrationC
(
x
i
,
y
i
,
t
l
) changes over time and at different locations. The specific forms of water pollution diffusion can be seen in literature [14].


### 3.1. Distribution Test

Under different statistical distributions of samples, the specific hypothesis testing problems are different. In the water pollution detection, the first is to determine whether the distribution of the observation noise is normal.In the initial state, there are only a few nodes perceiving the pollution or there is no node perceiving the pollution. When there is no pollution,C
~
(
x
i
,
y
i
,
t
1
)
=
C
0
+
e, and if the distribution of C
~
(
x
i
,
y
i
,
t
1
) is normal, e is a normal variable.In order to save cost, the number of sampling nodes is often limited in practical applications. The Shapiro-WilkW test [15] method in the case of small samples can be used as the distribution test method here.Step 1.
Remark the monitoring values of theJ nodes at t
1 as C
~
i
,
i
=
1,2
,
3
,
…
,
J. Order the values as follows:(1)
C
~
1
,
C
~
2
,
C
~
3
,
…
,
C
~
J
C
~
1
≤
C
~
2
≤
C
~
3
≤
⋯
≤
C
~
J
.Step 2.
The test statisticW is calculated as(2)
W
=
∑
i
=
1
J
a
i
C
~
i
2
∑
i
=
1
J
C
~
i
-
C
¯
2
,where C
¯
=
(
1
/
J
)
∑
i
=
1
J
C
~
i.Step 3.
At a given significance level of hypothesis testingα, if W
⩽
W
α, the distribution is nonnormal; otherwise, the distribution is normal.In the above steps, the values ofa
i and W
α can be obtained by the method of table lookup [16].The specific detection problems when the distribution of the sensing values is normal are different from the detection problems when the distribution is nonnormal. The detection methods in the two cases are discussed in the following.


### 3.2. The Pollution Detection of the Network

Case 1 (hypothesis testing under normal distribution).
According to the nature of the normal distribution, if the node has detected no pollution att
l, it can be deduced that (1) C
~
(
x
i
,
y
i
,
t
l
)
~
N
(
C
0
+
μ
,
δ
2
), the noise e
~
(
μ
,
δ
2
); (2) if c
~
1
=
min
⁡
{
C
~
(
x
i
,
y
i
,
t
l
)
,
i
=
1,2
,
3
,
…
,
J
}, (
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
)
~
N
(
0,2
δ
2
).
Investigate the mean valueμ
k of C
(
x
i
,
y
i
,
t
l
)
-
c
~
1
,
i
=
1,2
,
3,4
,
…
,
J. The hypotheses are given by(3)
H
0
1
:
μ
κ
=
0
,
H
1
1
:
μ
κ
≠
0
.As δ is unknown, the test statistic is(4)
G
1
=
C
¯
κ
S
κ
J
,where C
¯
κ
=
(
1
/
J
)
∑
i
=
1
J
(
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
) and S
κ
2
=
(
1
/
(
J
-
1
)
)
∑
i
=
1
J
(
(
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
)
-
C
¯
κ
)
2.
At the significance levelα [17], if(5)
G
1
≥
t
α
/
2
J
-
1
,that is, when P
(
G
1
≥
t
α
/
2
(
J
-
1
)
)
=
α reject H
0
(
1
), it is deduced that there is a pollution source. Note that t
α
/
2 is the α
/
2 quantile of t-distribution [17, 18].Case 2 (hypothesis testing under nonnormal distribution).
While the sample distribution is nonnormal, it is difficult to verify what the specifying distribution of the values is. In this case, the Wilcoxon rank sum test is used directly [17].
Our test problem is to determine whether there is significant difference between the two groups of independent samples in Table1. The hypotheses are(6)
H
0
1
:
μ
S
1
=
μ
S
2
,
H
1
1
:
μ
S
1
≠
μ
S
2
.
List the data in ascending order and allocate the rankss
j according to the order. The significance level of hypothesis testing is α, and R
1 is the sum of ranks of Sample 1.
When(7)
R
1
≤
C
L
α
2
or
R
1
≥
C
U
α
2reject H
0, there is a pollution source in the monitoring area. C
U
(
α
/
2
) and C
L
(
α
/
2
) are the upper tail value and lower tail value of the two-tailed rank sum test [17, 18].Table 1
The two groups of independent samples in the detection of the network.
Sample 1
C
~
(
x
1
,
y
1
,
t
l
)
C
~
(
x
2
,
y
2
,
t
l
)
C
~
(
x
3
,
y
3
,
t
l
)
⋯
C
~
(
x
J
/
2
,
y
J
/
2
,
t
l
)
Sample 2
C
~
(
x
J
/
2
+
1
,
y
J
/
2
+
1
,
t
l
)
C
~
(
x
J
/
2
+
2
,
y
J
/
2
+
2
,
t
l
)
C
~
(
x
J
/
2
+
3
,
y
J
/
2
+
3
,
t
l
)
⋯
C
~
(
x
J
,
y
J
,
t
l
)


### 3.3. The Pollution Source Detection of the Node

Based on the monitoring valuesC
~
(
x
i
,
y
i
,
t
l
)
,
l
=
1,2
,
3
,
…
,
L of node (
x
i
,
y
i
), determine whether the node has detected the pollution source.Case 1 (hypothesis testing under normal distribution).
If the sample noisee is normal, when the node does not detect the pollution at t
l, there is (
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
)
~
N
(
0,2
δ
2
).
Letμ
′ be the average value of {
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
), l
=
2,3
,
…
,
L
.
}. The hypotheses are given by(8)
H
0
3
:
μ
′
=
0
H
1
3
:
μ
′
≠
0
.The test statistic is(9)
G
2
=
C
¯
′
S
′
L
-
1
,where C
¯
′
=
(
1
/
(
L
-
1
)
)
∑
l
=
2
L
(
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
) and  S
′
2
=
(
1
/
(
L
-
2
)
)
∑
l
=
2
L
(
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
-
C
¯
′
)
2.
If(10)
G
2
≥
t
α
/
2
L
-
2
,that is, when P
(
G
2
≥
t
α
/
2
(
L
-
2
)
)
=
α, reject H
0
(
3
), and it is deduced that the node has detected the pollution. Here, t
α
/
2 is the α
/
2 quantile of t-distribution, and α is the significance level of hypothesis testing [17, 18].Case 2 (hypothesis testing under nonnormal distribution).
The Wilcoxon rank sum test is used. Our test problem is to determine whether there is significant difference between the two groups of independent samples in Table2.
The hypotheses are(11)
H
0
4
:
μ
S
3
=
μ
S
4
H
1
4
:
μ
S
3
≠
μ
S
4
.The same solving method as hypothesis testing problem (6) can be used in (11).Table 2
The two groups of independent samples in the detection of the node.
Sample 3
C
~
(
x
i
,
y
i
,
t
1
)
C
~
(
x
i
,
y
i
,
t
2
)
⋅
⋅
⋅
C
~
(
x
i
,
y
i
,
t
L
/
2
)
Sample 4
C
~
(
x
i
,
y
i
,
t
L
/
2
+
1
)
C
~
(
x
i
,
y
i
,
t
L
/
2
+
2
)
⋅
⋅
⋅
C
~
(
x
i
,
y
i
,
t
L
)


### 3.4. Sample Size Requirements in Detection

#### 3.4.1. Basic Requirements

According to the basic sample number requirements of the hypothesis testing methods [17, 18], the basic sample size requirements in our detection methods are given as follows. In the distribution test, the number of samples J should be 3
≤
J
≤
50. When the distribution of the sample noise is normal, there should be at least 4 samples in the pollution detection of the network and the pollution detection of the node, so J
≥
4 and L
≥
5. When the distribution is not normal, there should be at least 6 samples in the pollution detection of the network and in the pollution detection of the node, so the sample numbers should satisfy J
≥
6 and L
≥
6.


#### 3.4.2. The Power of Tests

(A)
t
Test. In hypotheses test under the normal distribution, the OC function of t test of (3) and (8) is(12)
β
μ
=
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
sqrt
⁡
n
<
t
α
/
2
n
-
1
,where C
¯
/
(
s
/
s
q
r
t
(
n
)
)
=
(
(
C
¯
-
μ
)
/
(
δ
/
s
q
r
t
n
)
+
μ
/
(
δ
/
s
q
r
t
n
)
)
/
(
s
/
δ
), C
¯ is C
¯
κ in (4) and C
¯
′ in (9), respectively, s is S
k in (4) and S
′ in (9), respectively, and n
=
J in (4) and n
=
L
-
1 in (9). μ is μ
k in (3) and μ
′ in (8), respectively.In the pollution detection of the network, to reduce the cost, the number of nodes is always given previously. So there is a precondition; that is, the number of the sensor nodes isn
≤
N
1, where N
1 is a given number. For the purpose of participating in the pollution source localization timely, there also should not be many sampling times in the pollution detection of the node, and the maximum sampling number is also often given.To reduce the probability of false alarm, under given thresholdsβ, θ
>
0, in the hypothesis testing problems (3) and (8), the significance level α should satisfy(13)
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
s
q
r
t
n
<
t
α
/
2
n
-
1
≤
β
,when μ
∈
H
1 and μ
/
δ
≥
θ.(B) The Nonparametric Test. There are no explicit expressions of the test power in nonparametric tests. When the maximum number of samples is given, if we want to reduce the possibility of the I type error in the test, the possibility of the II type error often increases [19], so an appropriate significance level is necessary. In nonparametric tests, α
=
0.05 is often adopted.


## 3.1. Distribution Test

Under different statistical distributions of samples, the specific hypothesis testing problems are different. In the water pollution detection, the first is to determine whether the distribution of the observation noise is normal.In the initial state, there are only a few nodes perceiving the pollution or there is no node perceiving the pollution. When there is no pollution,C
~
(
x
i
,
y
i
,
t
1
)
=
C
0
+
e, and if the distribution of C
~
(
x
i
,
y
i
,
t
1
) is normal, e is a normal variable.In order to save cost, the number of sampling nodes is often limited in practical applications. The Shapiro-WilkW test [15] method in the case of small samples can be used as the distribution test method here.Step 1.
Remark the monitoring values of theJ nodes at t
1 as C
~
i
,
i
=
1,2
,
3
,
…
,
J. Order the values as follows:(1)
C
~
1
,
C
~
2
,
C
~
3
,
…
,
C
~
J
C
~
1
≤
C
~
2
≤
C
~
3
≤
⋯
≤
C
~
J
.Step 2.
The test statisticW is calculated as(2)
W
=
∑
i
=
1
J
a
i
C
~
i
2
∑
i
=
1
J
C
~
i
-
C
¯
2
,where C
¯
=
(
1
/
J
)
∑
i
=
1
J
C
~
i.Step 3.
At a given significance level of hypothesis testingα, if W
⩽
W
α, the distribution is nonnormal; otherwise, the distribution is normal.In the above steps, the values ofa
i and W
α can be obtained by the method of table lookup [16].The specific detection problems when the distribution of the sensing values is normal are different from the detection problems when the distribution is nonnormal. The detection methods in the two cases are discussed in the following.


## 3.2. The Pollution Detection of the Network

Case 1 (hypothesis testing under normal distribution).
According to the nature of the normal distribution, if the node has detected no pollution att
l, it can be deduced that (1) C
~
(
x
i
,
y
i
,
t
l
)
~
N
(
C
0
+
μ
,
δ
2
), the noise e
~
(
μ
,
δ
2
); (2) if c
~
1
=
min
⁡
{
C
~
(
x
i
,
y
i
,
t
l
)
,
i
=
1,2
,
3
,
…
,
J
}, (
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
)
~
N
(
0,2
δ
2
).
Investigate the mean valueμ
k of C
(
x
i
,
y
i
,
t
l
)
-
c
~
1
,
i
=
1,2
,
3,4
,
…
,
J. The hypotheses are given by(3)
H
0
1
:
μ
κ
=
0
,
H
1
1
:
μ
κ
≠
0
.As δ is unknown, the test statistic is(4)
G
1
=
C
¯
κ
S
κ
J
,where C
¯
κ
=
(
1
/
J
)
∑
i
=
1
J
(
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
) and S
κ
2
=
(
1
/
(
J
-
1
)
)
∑
i
=
1
J
(
(
C
~
(
x
i
,
y
i
,
t
l
)
-
c
~
1
)
-
C
¯
κ
)
2.
At the significance levelα [17], if(5)
G
1
≥
t
α
/
2
J
-
1
,that is, when P
(
G
1
≥
t
α
/
2
(
J
-
1
)
)
=
α reject H
0
(
1
), it is deduced that there is a pollution source. Note that t
α
/
2 is the α
/
2 quantile of t-distribution [17, 18].Case 2 (hypothesis testing under nonnormal distribution).
While the sample distribution is nonnormal, it is difficult to verify what the specifying distribution of the values is. In this case, the Wilcoxon rank sum test is used directly [17].
Our test problem is to determine whether there is significant difference between the two groups of independent samples in Table1. The hypotheses are(6)
H
0
1
:
μ
S
1
=
μ
S
2
,
H
1
1
:
μ
S
1
≠
μ
S
2
.
List the data in ascending order and allocate the rankss
j according to the order. The significance level of hypothesis testing is α, and R
1 is the sum of ranks of Sample 1.
When(7)
R
1
≤
C
L
α
2
or
R
1
≥
C
U
α
2reject H
0, there is a pollution source in the monitoring area. C
U
(
α
/
2
) and C
L
(
α
/
2
) are the upper tail value and lower tail value of the two-tailed rank sum test [17, 18].Table 1
The two groups of independent samples in the detection of the network.
Sample 1
C
~
(
x
1
,
y
1
,
t
l
)
C
~
(
x
2
,
y
2
,
t
l
)
C
~
(
x
3
,
y
3
,
t
l
)
⋯
C
~
(
x
J
/
2
,
y
J
/
2
,
t
l
)
Sample 2
C
~
(
x
J
/
2
+
1
,
y
J
/
2
+
1
,
t
l
)
C
~
(
x
J
/
2
+
2
,
y
J
/
2
+
2
,
t
l
)
C
~
(
x
J
/
2
+
3
,
y
J
/
2
+
3
,
t
l
)
⋯
C
~
(
x
J
,
y
J
,
t
l
)


## 3.3. The Pollution Source Detection of the Node

Based on the monitoring valuesC
~
(
x
i
,
y
i
,
t
l
)
,
l
=
1,2
,
3
,
…
,
L of node (
x
i
,
y
i
), determine whether the node has detected the pollution source.Case 1 (hypothesis testing under normal distribution).
If the sample noisee is normal, when the node does not detect the pollution at t
l, there is (
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
)
~
N
(
0,2
δ
2
).
Letμ
′ be the average value of {
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
), l
=
2,3
,
…
,
L
.
}. The hypotheses are given by(8)
H
0
3
:
μ
′
=
0
H
1
3
:
μ
′
≠
0
.The test statistic is(9)
G
2
=
C
¯
′
S
′
L
-
1
,where C
¯
′
=
(
1
/
(
L
-
1
)
)
∑
l
=
2
L
(
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
) and  S
′
2
=
(
1
/
(
L
-
2
)
)
∑
l
=
2
L
(
C
~
(
x
i
,
y
i
,
t
l
)
-
C
~
(
x
i
,
y
i
,
t
1
)
-
C
¯
′
)
2.
If(10)
G
2
≥
t
α
/
2
L
-
2
,that is, when P
(
G
2
≥
t
α
/
2
(
L
-
2
)
)
=
α, reject H
0
(
3
), and it is deduced that the node has detected the pollution. Here, t
α
/
2 is the α
/
2 quantile of t-distribution, and α is the significance level of hypothesis testing [17, 18].Case 2 (hypothesis testing under nonnormal distribution).
The Wilcoxon rank sum test is used. Our test problem is to determine whether there is significant difference between the two groups of independent samples in Table2.
The hypotheses are(11)
H
0
4
:
μ
S
3
=
μ
S
4
H
1
4
:
μ
S
3
≠
μ
S
4
.The same solving method as hypothesis testing problem (6) can be used in (11).Table 2
The two groups of independent samples in the detection of the node.
Sample 3
C
~
(
x
i
,
y
i
,
t
1
)
C
~
(
x
i
,
y
i
,
t
2
)
⋅
⋅
⋅
C
~
(
x
i
,
y
i
,
t
L
/
2
)
Sample 4
C
~
(
x
i
,
y
i
,
t
L
/
2
+
1
)
C
~
(
x
i
,
y
i
,
t
L
/
2
+
2
)
⋅
⋅
⋅
C
~
(
x
i
,
y
i
,
t
L
)


## 3.4. Sample Size Requirements in Detection

### 3.4.1. Basic Requirements

According to the basic sample number requirements of the hypothesis testing methods [17, 18], the basic sample size requirements in our detection methods are given as follows. In the distribution test, the number of samples J should be 3
≤
J
≤
50. When the distribution of the sample noise is normal, there should be at least 4 samples in the pollution detection of the network and the pollution detection of the node, so J
≥
4 and L
≥
5. When the distribution is not normal, there should be at least 6 samples in the pollution detection of the network and in the pollution detection of the node, so the sample numbers should satisfy J
≥
6 and L
≥
6.


### 3.4.2. The Power of Tests

(A)
t
Test. In hypotheses test under the normal distribution, the OC function of t test of (3) and (8) is(12)
β
μ
=
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
sqrt
⁡
n
<
t
α
/
2
n
-
1
,where C
¯
/
(
s
/
s
q
r
t
(
n
)
)
=
(
(
C
¯
-
μ
)
/
(
δ
/
s
q
r
t
n
)
+
μ
/
(
δ
/
s
q
r
t
n
)
)
/
(
s
/
δ
), C
¯ is C
¯
κ in (4) and C
¯
′ in (9), respectively, s is S
k in (4) and S
′ in (9), respectively, and n
=
J in (4) and n
=
L
-
1 in (9). μ is μ
k in (3) and μ
′ in (8), respectively.In the pollution detection of the network, to reduce the cost, the number of nodes is always given previously. So there is a precondition; that is, the number of the sensor nodes isn
≤
N
1, where N
1 is a given number. For the purpose of participating in the pollution source localization timely, there also should not be many sampling times in the pollution detection of the node, and the maximum sampling number is also often given.To reduce the probability of false alarm, under given thresholdsβ, θ
>
0, in the hypothesis testing problems (3) and (8), the significance level α should satisfy(13)
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
s
q
r
t
n
<
t
α
/
2
n
-
1
≤
β
,when μ
∈
H
1 and μ
/
δ
≥
θ.(B) The Nonparametric Test. There are no explicit expressions of the test power in nonparametric tests. When the maximum number of samples is given, if we want to reduce the possibility of the I type error in the test, the possibility of the II type error often increases [19], so an appropriate significance level is necessary. In nonparametric tests, α
=
0.05 is often adopted.


## 3.4.1. Basic Requirements

According to the basic sample number requirements of the hypothesis testing methods [17, 18], the basic sample size requirements in our detection methods are given as follows. In the distribution test, the number of samples J should be 3
≤
J
≤
50. When the distribution of the sample noise is normal, there should be at least 4 samples in the pollution detection of the network and the pollution detection of the node, so J
≥
4 and L
≥
5. When the distribution is not normal, there should be at least 6 samples in the pollution detection of the network and in the pollution detection of the node, so the sample numbers should satisfy J
≥
6 and L
≥
6.


## 3.4.2. The Power of Tests

(A)
t
Test. In hypotheses test under the normal distribution, the OC function of t test of (3) and (8) is(12)
β
μ
=
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
sqrt
⁡
n
<
t
α
/
2
n
-
1
,where C
¯
/
(
s
/
s
q
r
t
(
n
)
)
=
(
(
C
¯
-
μ
)
/
(
δ
/
s
q
r
t
n
)
+
μ
/
(
δ
/
s
q
r
t
n
)
)
/
(
s
/
δ
), C
¯ is C
¯
κ in (4) and C
¯
′ in (9), respectively, s is S
k in (4) and S
′ in (9), respectively, and n
=
J in (4) and n
=
L
-
1 in (9). μ is μ
k in (3) and μ
′ in (8), respectively.In the pollution detection of the network, to reduce the cost, the number of nodes is always given previously. So there is a precondition; that is, the number of the sensor nodes isn
≤
N
1, where N
1 is a given number. For the purpose of participating in the pollution source localization timely, there also should not be many sampling times in the pollution detection of the node, and the maximum sampling number is also often given.To reduce the probability of false alarm, under given thresholdsβ, θ
>
0, in the hypothesis testing problems (3) and (8), the significance level α should satisfy(13)
P
μ
accept
H
0
=
P
μ
-
t
α
/
2
n
-
1
<
C
¯
s
/
s
q
r
t
n
<
t
α
/
2
n
-
1
≤
β
,when μ
∈
H
1 and μ
/
δ
≥
θ.(B) The Nonparametric Test. There are no explicit expressions of the test power in nonparametric tests. When the maximum number of samples is given, if we want to reduce the possibility of the I type error in the test, the possibility of the II type error often increases [19], so an appropriate significance level is necessary. In nonparametric tests, α
=
0.05 is often adopted.


## 4. The Detection Algorithms

Based on the theoretical research above, there are pollution source detection algorithms as follows.Algorithm 1 (the pollution detection of the network).
Preconditions. The number of providing samples J is large enough and known. The samples at the first sampling time t
1 and the detection time t
l are known. The parameters β and θ which are related to the test power are given.Step 1.
Use Shapiro-WilkW test to test the distribution of the sample noise according to (2) at the first sampling time t
1.Step 2.
If the distribution is normal, get the value range of the significance level according to (13), choose an any significance level α in the range, calculate the test statistic as (4), and go to Step 3. If the distribution is nonnormal, go to Step 4.Step 3.
When the test statistic satisfies the test criterion (5), there is pollution; otherwise, there is no pollution.Step 4.
List the data in ascending order and allocate the ranks according to the order. CalculateR
1 which is the sum of ranks of Samples 1 in Table 1. Look up the table to get the tail values in the rank sum test. When the sum R
1 satisfies the test criterion (7), there is pollution; otherwise, there is no pollution.
At timet
l, if the network does not detect the pollution, the pollution detection of the network will be made at t
l
+
1.Algorithm 2 (the pollution detection of the node(
x
i
,
y
i
)).
Preconditions. The number of samples L is large enough and known. The samples at the first sampling time t
1 are known. The samples of the detection node (
x
i
,
y
i
) are known. The parameters β and θ which are related to the test power are given.Step 1.
Use Shapiro-WilkW test to test the distribution of the sample noise according to (2) at the first sampling time t
1.Step 2.
If the distribution is normal, get the value range of the significance level according to (13), choose an any significance level α in the range, calculate the test statistic as (9), and go to Step 3. If the distribution is nonnormal, go to Step 4.Step 3.
When the test statistic satisfies the test criterion (10), the node detects the pollution; otherwise, the node fails to detect the pollution.Step 4.
List the data in ascending order and allocate the ranks according to the order. CalculateR
3 which is the sum of ranks of Samples 3 in Table 2. Look up the table to get the tail values in the rank sum test. When the sum R
3 satisfies the test criterion (7), the node detects the pollution; otherwise, the node fails to detect the pollution.


## 5. Implementation Examples

Experiment 1.
A simulation is carried out to test the proposed detection algorithms. The distribution of monitoring noises is normal.
Background. The size of the static shallow water is 10 m × 10 m, and the average depth of the water is f
=
10m. Apart from the coast of impervious Y, there is a continuous source at (
x
0
,
y
0
)
=
(
1.05,5.55
) (m). Starting from time t
0
=
0h, the solution with pollutant is injected into the water. The mass of the pollutant is M
=
100kg. The diffusion coefficient is D
=
0.1m2/h. The nodes in the network sample the concentration uniformly with interval T
=
0.05h. The diffusion can be depicted by the model:(14)
C
x
,
y
,
x
0
,
y
0
=
M
4
π
D
t
-
t
0
e
-
x
-
x
0
2
+
y
-
y
0
2
/
4
D
t
-
t
0
,where t is the current time. The locations of the monitoring nodes are (2.05, 5.55), (1.05, 4.55), (0.05, 5.55), (1.05, 6.55), (0.55, 6.05), (1.55, 6.05), (0.55, 5.05), (1.55, 5.05), (0.05, 6.25), and (1.05, 7.05). The monitoring values in the experiment are the simulation values of (14) adding the noise with a normal distribution N
(
0
,
δ
2
). The given parameters are β
=
0.5 and θ
=
1, and there are 10 nodes, n
=
N
1
=
10.(A) The Pollution Detection of the Network. According to constraint (13) and the sample size table of t test in [18], it is can be deduced that α
>
0.025 under the given parameters β, θ, and δ in Table 3.Table 3
The detection results of the network.
δ
Significance levels
Detection results
0.01
0.03
100/100
0.01
0.05
100/100
0.01
0.1
100/100
0.1
0.03
100/100
0.1
0.05
99/100
0.1
0.1
100/100
0.5
0.03
99/100
0.5
0.05
100/100
0.5
0.1
100/100For differentδ values and significance levels, detect the pollution at the initial observation time 0.01 h, and the results are shown in Table 3. The hypothesis testing detection method under the normal distribution is used, and in the table, “X
/
100” represents that in the 100 experiments the pollution is detected successfully X times.The results show that the pollution can be detected by the network soon.(B) The Pollution Detection of the Node. Detect whether the node has detected the pollution source based on the observed data of the node (1.05, 7.05). The monitoring data is as shown in Table 4. Compare with the simple detection method in which the criterion of whether the pollution source has been detected is that the monitoring value is larger than a given threshold, and the results are shown in Table 5.Table 4
The monitoring values of node (1.05, 7.05) in Experiment1.
Time(s)
T
2T
3T
4T
5T
6T
7T
8T
9T
10T
Observations (g/L)
0.008
0.009
0.010
0.015
0.017
0.019
0.081
0.217
0.423
0.748Table 5
The detection results comparing with the simple detection method.
Significance levels
Detection time oft test
Threshold (g/L)
Detection time of the simple detection method
0.03
—
0.03
7
T
0.05
6
T
0.05
7
T
0.1
5
T
0.1
8
T
0.15
5
T
0.15
8
T
0.2
5
T
0.2
8
T
0.5
4
T
0.5
10
TIn Table5, “—” represents no result. Comparing the results in the table, it can be seen that the detection method using hypothesis testing is more stable if an appropriate significance level is chosen, and in the simple detection, to detect the pollution source timely the threshold should be as small as possible. But apparently, if the noise in the practical applications is considered, small thresholds may bring about large false alarm rates.Experiment 2.
A practical experiment is carried out to test the proposed detection algorithms.
Background. In water, of which the size is 200 cm × 200 cm, the average depth f
=
100cm. There is a continuous source at the boundary. Starting from t
0
=
0s, the solution of MgSO4 is discharged to the water continually. The nodes deployment is depicted by Figure 2. The monitoring values of different sensor nodes in the experiment are shown in Table 6.
Distribution Verification. Both at time 5 s and 10 s, for different significance levels α
=
0.01, α
=
0.05, and α
=
0.1, the detection results all show that the distribution of monitoring data is not normal. So, the detection methods based on the Wilcoxon rank sum tests are used.Table 6
The monitoring values in Experiment2.
Time(s)
Node 0 (g/L)
Node 1 (g/L)
Node 2 (g/L)
Node 3 (g/L)
Node 4 (g/L)
Node 5 (g/L)
Node 6 (g/L)
Node 7 (g/L)
5
0.00000
0.00000
0.00032
0.00000
0.00016
0.00000
0.00000
0.00000
10
0.00000
0.00000
0.00242
0.00000
0.00548
0.00000
0.00000
0.00000
15
0.00000
0.00000
0.00581
0.00000
0.01210
0.00000
0.00000
0.00000
20
0.00000
0.00000
0.00790
0.00000
0.01726
0.00000
0.00000
0.00000
25
0.00000
0.00000
0.01161
0.00000
0.03532
0.00000
0.00000
0.00000
30
0.00210
0.00000
0.01661
0.00050
0.04532
0.00000
0.00033
0.00000
35
0.01726
0.00000
0.05686
0.00415
0.06284
0.00242
0.01561
0.00000
40
0.05686
0.00000
0.08422
0.01445
0.09608
0.03048
0.03206
0.00000
45
0.06216
0.00000
0.10429
0.01877
0.12071
0.04081
0.05216
0.00000
50
0.08441
0.00000
0.12990
0.05186
0.13163
0.07324
0.06912
0.00000
55
0.09333
0.00000
0.14969
0.06784
0.15386
0.09186
0.08118
0.00000
60
0.11235
0.00000
0.16957
0.08324
0.17286
0.10673
0.09559
0.00000
65
0.12439
0.00000
0.18557
0.09804
0.17557
0.11449
0.11316
0.00000
70
0.12959
0.00016
0.19014
0.11694
0.17957
0.12418
0.12663
0.00000
75
0.13449
0.00129
0.19457
0.12245
0.18786
0.13122
0.13010
0.00081
80
0.13673
0.00177
0.20385
0.12561
0.19957
0.13449
0.13449
0.00258
85
0.14204
0.00242
0.20846
0.12888
0.20846
0.13990
0.13684
0.00290
90
0.14643
0.00403
0.21135
0.13224
0.21019
0.14122
0.13847
0.00435
95
0.14878
0.00516
0.21692
0.13786
0.21154
0.14714
0.14327
0.00613
100
0.15114
0.00532
0.21808
0.14133
0.21346
0.15071
0.15200
0.00694
105
0.15386
0.00726
0.22423
0.14776
0.21481
0.15343
0.15814
0.00823
110
0.15686
0.00790
0.22885
0.15300
0.21558
0.15714
0.16043
0.00790
115
0.16000
0.00839
0.23115
0.15829
0.21962
0.16214
0.16643
0.00839
120
0.16329
0.01000
0.23462
0.16343
0.22154
0.16543
0.16814
0.01097
125
0.16557
0.01194
0.23558
0.16986
0.22288
0.16814
0.17000
0.01161
130
0.16757
0.01339
0.23885
0.17214
0.22365
0.17386
0.17114
0.01403
135
0.16814
0.01484
0.23923
0.17329
0.22404
0.17414
0.17186
0.01597
140
0.16857
0.01516
0.23942
0.17386
0.22500
0.17429
0.17229
0.01613
145
0.16914
0.01613
0.23962
0.17414
0.22519
0.17457
0.17286
0.01694
150
0.16929
0.01774
0.24000
0.17457
0.22519
0.17457
0.17300
0.01774
155
0.16971
0.01887
0.24058
0.17486
0.22558
0.17471
0.17314
0.01887
160
0.17014
0.01919
0.24077
0.17514
0.22577
0.17486
0.17357
0.02871
165
0.17086
0.01935
0.24096
0.17543
0.22615
0.17514
0.17371
0.02968
170
0.17114
0.02048
0.24115
0.17571
0.22635
0.17529
0.17414
0.03000
175
0.17157
0.02065
0.24154
0.17614
0.22654
0.17557
0.17429
0.03016
180
0.17171
0.02097
0.24173
0.17629
0.22712
0.17571
0.17457
0.03065Figure 2
The nodes deployment in Experiment2.(A) The Pollution Detection of the Network. The given significance level is α
=
0.05, and the network detects the pollution at 30 s.(B) The Pollution Detection of the Node. The significance level is α
=
0.05, and the time when nodes 0, 1, 2, 3, 4, 5, 6, and 7 find the pollution is shown in Table 7. The detection method is as (11).Table 7
The detection time of different nodes in Experiment2.
Significance level
Node 0 (s)
Node 1 (s)
Node 2 (s)
Node 3 (s)
Node 4 (s)
Node 5 (s)
Node 6 (s)
Node 7 (s)
0.05
50
95
40
50
40
50
50
100The results show that the pollution can be detected by the nodes only when there are some increasing concentration samples.From the results of the experiments above, it can been seen that, in the simple detection method, an appropriate decision threshold is hard to be given, so the pollution source detection by using hypothesis testing is more preferable. Whether the distribution of the sample noise is normal or not, the corresponding detection algorithms are available.


## 6. Conclusions

Water pollution detection is important in the water environment monitoring. The pollution source detection problems of the network and of the node are discussed based on hypothesis testing. The sample size requirements in different detection problems are also analyzed. In implementation examples, the proposed pollution detection algorithms are tested. The effectiveness of the detection algorithms is proved. This work mainly focuses on theoretical detection approaches based on hypothesis testing. In the future work, more problems in the practical applications will be studied when the proposed detection algorithms are adopted, such as the optimized detection methods of the node related to large or small concentration variations, and the influences of the concentration variations on the statistical distribution in the distribution test step.



---

*Source: 3829894-2017-01-16.xml*