| Literature DB >> 35734254 |
Weijun Cheng1, Tengfei Ma1, Xiaoting Wang1, Gang Wang2.
Abstract
More recently, smart agriculture has received widespread attention, which is a deep combination of modern agriculture and the Internet of Things (IoT) technology. To achieve the aim of scientific cultivation and precise control, the agricultural environments are monitored in real time by using various types of sensors. As a result, smart agricultural IoT generated a large amount of multidimensional time series data. However, due to the limitation of applied scenarios, smart agricultural IoT often suffers from data loss and misrepresentation. Moreover, some intelligent decision-makings for agricultural management also require the detailed analysis of data. To address the above problems, this article proposes a new anomaly detection model based on generative adversarial networks (GAN), which can process the multidimensional time series data generated by smart agricultural IoT. GAN is a deep learning model to learn the distribution patterns of normal data and capture the temporal dependence of time series and the potential correlations between features through learning. For the problem of generator inversion, an encoder-decoder structure incorporating the attention mechanism is designed to improve the performance of the model in learning normal data. In addition, we also present a new reconstruction error calculation method that measures the error in terms of both point-wise difference and curve similarity to improve the detection effect. Finally, based on three smart agriculture-related datasets, experimental results show that our proposed model can accurately achieve anomaly detection. The experimental precision, recall, and F1 score exceeded the counterpart models by reaching 0.9351, 0.9625, and 0.9482, respectively.Entities:
Keywords: anomaly detection; attention mechanism; deep learning; generative adversarial network; smart agriculture; time series data
Year: 2022 PMID: 35734254 PMCID: PMC9207449 DOI: 10.3389/fpls.2022.890563
Source DB: PubMed Journal: Front Plant Sci ISSN: 1664-462X Impact factor: 6.627
Figure 1Sensors in different application scenarios.
Figure 2Overall framework of GAN.
Figure 3Enhanced LSTM structure.
Figure 4Encoder–decoder internal detailed structure (A) encoder structure; (B) decoder structure.
Figure 5Anomaly detection.
Figure 6Time shift issue of time series.
Algorithm 1Algorithm for proposed method.
Details of datasets.
| Dataset | Number of variables | The total length of time series | Proportion of anomaly |
|---|---|---|---|
| SWMRU | 18 | 35,139 | 5% |
| KDDCUP99 | 42 | 56,235 | 19.5% |
| HomeC | 32 | 503,900 | 8% |
Model parameter settings.
| Window size | Training window step size | Test window step size | Input dimension | Number of LSTM hidden units | Number of LSTM layers | Latent space dimension |
|---|---|---|---|---|---|---|
|
| 10 | Window size | Data set dimension | 100 | 3 | 15 |
Figure 7Comparison of reconstruction effects on the SWMRU data set (A) Real sample; (B) No attention mechanism; (C) attention mechanism.
Figure 8Comparison of reconstruction effects on the HomeC data set (A) Real sample; (B) No attention mechanism; (C) Attention mechanism.
Figure 9MMD values for each data set (A) SWMRU; (B) KDDCUP99; (C) HomeC.
Figure 10Variation of metric with time window for the HomeC data set(A) Precision; (B) Recall; (C) F1 Score.
Experimental results of different methods on three data sets.
| Data set | Methods | Precision (%) | Recall (%) | F1 score |
|---|---|---|---|---|
| SWMRU | Ours |
|
|
|
| Ours-Dis | 92.05 | 94.50 | 0.9403 | |
| Tad-GAN | 91.08 | 94.13 | 0.9348 | |
| Ours-Gen | 87.95 | 90.31 | 0.8891 | |
| Ours-Gen-Dis | 87.16 | 89.94 | 0.8835 | |
| MAD-GAN | 85.41 | 89.23 | 0.8754 | |
| TAnoGAN | 86.43 | 89.35 | 0.8876 | |
| AE | 69.48 | 75.26 | 0.7238 | |
| KDDCUP99 | Ours |
|
| 0.9385 |
| Ours-Dis | 93.38 | 96.05 | 0.9365 | |
| Tad-GAN | 93.17 | 94.83 |
| |
| Ours-Gen | 87.19 | 92.35 | 0.8847 | |
| Ours-Gen-Dis | 86.49 | 91.42 | 0.8794 | |
| MAD-GAN | 83.65 | 89.30 | 0.8689 | |
| TAnoGAN | 85.58 | 88.23 | 0.8736 | |
| AE | 75.43 | 81.41 | 0.7749 | |
| HomeC | Ours |
|
|
|
| Ours-Dis | 90.73 | 92.48 | 0.9205 | |
| Tad-GAN | 88.49 | 92.53 | 0.9199 | |
| Ours-Gen | 85.74 | 88.63 | 0.8749 | |
| Ours-Gen-Dis | 84.16 | 88.11 | 0.8636 | |
| MAD-GAN | 83.39 | 87.09 | 0.8419 | |
| TAnoGAN | 82.24 | 88.67 | 0.8676 | |
| AE | 67.26 | 72.84 | 0.6929 |
The bold values in Table 3 are the highest values of each experimental metric for each data set.