Data Quality Audit and Bivariate Temperature-Humidity Analysis of a Long-Term LoRaWAN Network: Anomaly Detection, PCA, Clustering and Machine Learning
Organizations: LIPN-CNRS7030, Université Sorbonne Paris Nord, 99 avenue JB Clément, F-93430 Villetaneuse, France
Abstract
Long-term environmental IoT/LPWAN deployments often aggregate heterogeneous data streams from diverse devices without systematic auditing of each variable's actual coverage prior to analysis-an increased risk when multiple sensor types coexist within the same network. This work proposes a C++17 processing pipeline applied to the Tour Perret LoRaWAN dataset (421 937 frames, June 2021--June 2023, 5 devices). A systematic coverage audit integrated into the extraction phase reveals that CO2 is completely missing (0% coverage) and pressure is reported only by an isolated base module (Wyres, 4.24% of the corpus), invalidating the initial hypothesis of a joint four-variable analysis. The analysis is refocused on the Temperature--Humidity pair, jointly available across 205{,}005 frames (95.76%) from 4 Elsys EMS sensors. The pipeline sequentially performs anomaly detection (modified Z-score, Isolation Forest), bivariate Principal Component Analysis, clustering (K-means, DBSCAN), and a multilayer perceptron predicting humidity from temperature and time, whose residuals serve as a detector for slow drift. On real-world data: Temperature--Humidity correlation r=-0.662, two-component PCA (PC1 =83.1% of variance), Isolation Forest detects 2.12% multivariate anomalies while univariate Z-score detects none, calibrated DBSCAN isolates 0.17% noise across 13 clusters, and the MLP achieves (RMSE =10.54%) in cross-validation. This work demonstrates that per-variable coverage auditing prior to modeling is a necessary methodological step for heterogeneous multi-sensor IoT datasets.
Figures & tables
| Detection Tier | Underlying Principle | Primary Target | Insensitive To |
|---|---|---|---|
| Modified Z-Score | Marginal distance from median, in units of MAD | Extreme single-variable spikes ( or ) | Multivariate correlation violations within normal marginal bounds |
| Isolation Forest | Random axis-aligned partitioning path length | Unusual joint combinations of | Slow, continuous calibration drifts over long horizons |
| PCA Reconstruction | Distance to the primary variance subspace | Departure from T–H anti-correlation ( ) | Anomalies aligned along the primary variance axis (PC1) |
| DBSCAN Noise Label | Local density threshold ( ) | Sparse spatial outliers, isolated noise points | Uniform dense clusters from sensor quantization |
| MLP Cross-Validation | Deviation from learned physical/temporal dependency | Slow sensor drift, temporal micro-climate anomalies | Sudden point anomalies uncoupled from diurnal/seasonal trends |
| Variable | Raw | Retained | Cov. | Cov. | Scope | Nodes |
|---|---|---|---|---|---|---|
| Frames | (%Tot.) | (%Ret.) | ||||
| Temperature ( ) | 393,685 | 214,076 | 93.30 | 100.00 | Elsys + Wyres | 5 |
| Humidity ( ) | 384,614 | 205,005 | 91.15 | 95.76 | Elsys only | 4 |
| Pressure ( ) | 9,071 | 0 (isolated) | 2.15 | 0.00 | Wyres only | 1 |
| Carbon Dioxide (CO 2 ) | 0 | 0 (absent) | 0.00 | 0.00 | — | 0 |
| Variable | Mean | Std. Dev. | Min | Q1 (25%) | Median | Q3 (75%) | Max |
|---|---|---|---|---|---|---|---|
| Temperature (°C) | 14.36 | 8.72 | 7.00 | 14.80 | 20.70 | 46.10 | |
| Humidity (%) | 72.14 | 18.41 | 19.00 | 58.00 | 74.00 | 88.00 | 100.00 |
| Component | Eigenvalue | Explained Var. (%) | Cumulative Var. (%) | Loading | Loading |
|---|---|---|---|---|---|
| PC1 | 1.6620 | 83.10% | 83.10% | ||
| PC2 | 0.3380 | 16.90% | 100.00% |
| Anomaly Detector | Primary Target Anomaly Type | Flagged ( ) | Rate (%) |
|---|---|---|---|
| Modified Z-Score ( ) | Extreme single-variable spikes | 0 | 0.00 |
| Isolation Forest ( ) | Atypical multivariate combinations | 4,346 | 2.12 |
| Joint Consensus (both methods) | Simultaneous univariate & multivariate | 0 | 0.00 |
| Cluster Count | Inertia | Silhouette | Structural Interpretation |
|---|---|---|---|
| 165,530 | 0.4910 | Optimal partition (Warm/Dry vs. Cool/Humid) | |
| 114,930 | 0.4040 | Fragmented intermediate transition zone | |
| 88,253 | 0.3760 | Arbitrary seasonal sub-division | |
| 68,978 | 0.3910 | Sub-cluster fragmentation | |
| 58,310 | 0.3740 | Over-segmented clusters | |
| 49,814 | 0.3780 | Over-segmented clusters |
Time-Series Anomaly Detection
Time-Series Anomaly Detection identifies unusual patterns or events in sequential data, from sensor readings and network traffic to health and industrial telemetry.
See all 208 papers