Manuscript Offprint
arXiv:2610.32438Data Quality Audit and Bivariate Temperature-Humidity Analysis of a Long-Term LoRaWAN Network: Anomaly Detection, PCA, Clustering and Machine Learning
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Mamadou SOW
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 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 , 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.
Index Terms—LoRaWAN, IoT, data quality audit, anomaly detection, Principal Component Analysis, clustering, machine learning, C++, urban microclimate, heterogeneous sensors.
I. INTRODUCTION & COVERAGE AUDIT
A common pitfall in multivariate anomaly detection and predictive modeling is the a priori assumption of variable co-occurrence. Researchers and practitioners often design processing pipelines expecting all target variables—such as Temperature (T), Relative Humidity (H), Atmospheric Pressure (P), and Carbon Dioxide concentration ( )—to be present synchronously in every transmitted frame. However, in multi-sensor LPWAN deployments, distinct physical sensors often operate on different transmission schedules, report varying payload schemas across firmware revisions, or belong to completely separate device applications aggregated under a single network server instance.
B. Central Finding: Systematic Data Coverage Audit
To prevent silent pipeline failures and catastrophic data distortion (such as invalid outer joins producing null-dense matrices or artificial cross-device frame alignment), an explicit, automated Data Coverage Audit was embedded directly into the primary C++ extraction module (01_extract.cpp). The audit evaluated payload completeness across all registered device identifiers (devEUI) and application boundaries (applicationName).
The coverage audit revealed two critical structural properties of the raw dataset:
-
Total Absence of Carbon Dioxide ( ): Despite initial project documentation indicating monitoring for indoor environmental quality, zero frames across the multi-year corpus contained decoded payload fields. This stems either from a physical deployment omitting the gas sensor module or an unupdated network decoder instance.
-
Structural Isolation of Barometric Pressure (P): Pressure measurements originated exclusively from a secondary device cohort (Wyres sensors), whereas the primary sensor fleet consisted of four Elsys EMS (Environmental Monitoring Sensor) nodes. Because the Wyres and Elsys EMS devices transmitted asynchronously without clock synchronization, barometric pressure was structurally disconnected from the main stream at the individual frame level.

Fig. 1. LoRaWAN telemetry ingestion and cleaning pipeline: the coverage audit (Step 1) is executed before any downstream analysis, separating structurally unusable variables ( , pressure) from the retained bivariate (T,H) core dataset.
C. The Bivariate Temperature–Humidity Dataset
Attempting an inner join across all four initial variables would yield 0 usable rows, causing a complete execution failure. Conversely, performing a naive cross-device alignment would artificially merge environmental readings from physically distinct locations within the tower structure.
Consequently, the scope of the study was refocused on the largest, physically consistent, co-occurring payload schema: the bivariate Temperature–Humidity feature space provided by the four Elsys EMS nodes.
Following extraction, ISO 8601 timestamp parsing to Unix epoch, multi-gateway frame deduplication (keyed on devEui|fCount), and physical boundary validation ( °C, ), the clean corpus comprised complete bivariate frames, representing 95.76% of the retained frames telemetry corpus. This rigorous audit ensures that all subsequent statistical, dimensionality reduction, clustering, and machine learning models operate on true, synchronized physical observations.
II. RELATED WORK
The processing and analysis of long-term Internet of Things (IoT) data streams lie at the intersection of streaming anomaly detection, unsupervised subspace learning, spatial clustering, and supervised drift monitoring. This section reviews the theoretical and empirical literature foundational to our pipeline architecture.
A. Anomaly Detection in Edge Telemetry & Sensor Networks
Anomaly detection in streaming sensor networks has been extensively surveyed by [2] and [3]. Traditional point-based methods rely on statistical distributional assumptions, such as the univariate Z-score. However, as noted by [4], standard Z-scores based on sample mean and standard deviation break down in the presence of extreme spikes due to their low breakdown point; robust estimators like the Median Absolute Deviation (MAD) are required for non-Gaussian IoT telemetry.
For multivariate streams, [5] introduced the Isolation Forest algorithm, which isolates anomalies by randomly partitioning feature space using axis-aligned trees. Unlike distance or density estimators, Isolation Forest exhibits near-linear time complexity , making it particularly effective for high-volume edge streams. More recently, [6] emphasized the necessity of real-time edge processing architectures capable of detecting anomalies under memory and bandwidth constraints, reinforcing the importance of low-overhead C++ implementations over heavy Python runtime environments.
B. Subspace Methods & Dimensionality Reduction
Principal Component Analysis (PCA), established by [7] and generalized by [8], remains the standard technique for modeling global linear dependencies among continuous physical variables. In multivariate environmental sensing, PCA transforms correlated measurements into orthogonal variance components.
When deploying linear algebra algorithms directly on constrained IoT gateways or embedded systems, external libraries (e.g., LAPACK, Armadillo) introduce overhead and portability barriers. Golub and Van Loan [9] outline numerical diagonalization algorithms, specifically the Jacobi rotation method for symmetric matrices. For bivariate correlation matrices , closed-form algebraic solutions bypass iterative numerical solvers entirely, providing exact eigenvalue decomposition with zero iterative computational overhead.
C. Partitioning and Density-Based Clustering
Cluster analysis serves a dual purpose in environmental telemetry: segmenting distinct climatic regimes and isolating unstructured spatial noise.
• Partitioning Methods: The classical K-means algorithm [10] minimizes intra-cluster variance but is notoriously sensitive to initial centroid placement. [11] addressed this with K-means++, introducing probabilistic distance-weighted initialization that guarantees an approximation bound. To determine the optimal number of clusters K, [12] proposed the silhouette index, which quantifies cluster cohesion against separation.
• Density-Based Methods: Unlike K-means, DBSCAN [13] discovers clusters of arbitrary shapes and explicitly identifies noise points (labeled -1). However, naive DBSCAN scales at complexity and suffers from memory allocation limits (std::bad_alloc) when expanding dense spatial queues on large datasets ( ). Mitigating this requires spatial indexing structures—such as uniform grid bins or k-d trees—and objective hyperparameter calibration via k-distance plot analysis.
D. Predictive Modeling & Drift Identification
Supervised neural networks, specifically Multilayer Perceptrons (MLP) trained via backpropagation [14], are widely used to approximate nonlinear physical couplings between environmental variables. In training deep or recurrent networks, [15] demonstrated that gradient clipping and momentum-based stochastic gradient descent (SGD) stabilize convergence against exploding gradients.
While point-based univariate and multivariate detectors (Z-score, Isolation Forest, DBSCAN) evaluate each telemetry frame independently, they cannot identify progressive calibration loss or sensor degradation over multi-month horizons. As highlighted by [3], cross-validating a physical predictive model (e.g., predicting relative humidity from temperature and cyclical time encodings) allows large regression residuals ( ) to serve as a complementary indicator for slow, systemic sensor drifts that remain within static physical bounds.
E. Positioning Relative to Existing Multi-Method Pipelines and Data-Quality Auditing Practice
Sections II-A–II-D each address anomaly detection, subspace projection, clustering, or drift monitoring as largely separate bodies of literature. Multi-method pipelines that combine several of these detectors into a single, complementary framework specifically for LPWAN/IoT telemetry remain comparatively uncommon: most cited works (e.g., [5]; [13]) evaluate one detection paradigm in isolation, and surveys of IoT sensor-network data quality tend to treat missing-data handling, outlier detection, and drift correction as distinct tasks addressed by disjoint bodies of work rather than a single orthogonal, four-tier architecture of the kind proposed here. [16], in a recent review of data-quality applications for IoT monitoring sensor networks, make a closely related observation: despite the wide range of individual techniques available for outlier detection, missing-data imputation, and virtual sensing in environmental and air-quality monitoring networks, no framework in their survey unifies coverage auditing with cross-validated, complementary anomaly detection at the pipeline level — most deployments instead apply a single technique per data-quality dimension. This gap is precisely what the coverage-audit-first design proposed in Section IV-A, combined with the four-tier detection framework of Section III-B, is intended to address: rather than treating variable-coverage verification as a preliminary, disposable step, this work integrates it directly into the extraction pipeline and demonstrates empirically (Table II) that skipping it would have silently invalidated the entire downstream analysis. To our knowledge, no prior work specifically targets LoRaWAN deployments with an integrated coverage-audit-and-multi-tier-detection pipeline of this kind; positioning this contribution against the broader (but still comparatively sparse) IoT data-quality-auditing literature, rather than solely against single-technique anomaly detectors, is left as recommended future work for a revised version of this paper.
III. THEORETICAL FRAMEWORK & METHODOLOGY
A. The Need for Multi-Tiered Anomaly Detection in IoT Streams
Anomalies in environmental time-series data do not manifest as a single homogeneous class. In edge-computing and IoT sensor contexts, anomalies span a spectrum of behaviors:
• Extreme Univariate Outliers: Sensor spikes, electrical bursts, or out-of-spec hardware failures.
• Multivariate Structural Anomalies: Observations where each individual feature remains within normal seasonal bounds, but their joint combination violates fundamental physical laws or dominant environmental correlations.
• Density-Based Clustered Anomalies / Noise: Isolated noise points residing in low-density regions of the multivariate feature space.
• Systemic Temporal Drifts: Gradual, continuous calibration loss (e.g., aging capacitive humidity elements) that evades point-based detection because individual readings shift slowly over weeks or months.
No single detection algorithm can capture all four anomaly types simultaneously. Therefore, this work establishes a four-tier complementary detection framework, combining univariate statistics, random partitioning, geometric subspace projection, and supervised cross-validation.
B. Mathematical Formulation of the Complementary Framework
- Tier 1(a): Point-Based Univariate Detection — Modified Z-Score: Classical Z-scores rely on the sample mean ( ) and standard deviation ( ), both of which are notoriously sensitive to extreme outliers (low breakdown point). To ensure robust estimation over multi-year climate cycles, we employ the Modified Z-Score based on the Median Absolute Deviation (MAD) [4]:

Fig. 2. Four-tier complementary detection framework: each tier targets a distinct, orthogonal anomaly signature within the clean bivariate (T,H) dataset.
where and . The constant 0.6745 equates the MAD to the standard deviation under a normal distribution. A point is flagged as a marginal univariate outlier if .
- Tier 1(b): Point-Based Multivariate Isolation — Isolation Forest: Univariate statistics cannot detect anomalous feature couplings. The Isolation Forest algorithm [5] exploits the principle that anomalous observations are few and different, making them susceptible to isolation via random recursive axis-aligned hyperplanes.
An ensemble of isolation trees partitions the standardized 2D space . The anomaly score for an observation over a dataset of size is defined as:
where is the average path length across all isolation trees, and is the average path length of unsuccessful searches in a Binary Search Tree (BST):
As , the path length , indicating an easily isolated multivariate anomaly. We enforce an empirical isolation threshold of .
- Tier 2: Geometric Subspace Anomaly Detection — Bivariate PCA Reconstruction Error: Principal Component Analysis (PCA) models the global covariance structure. In a standardized 2D space , the covariance matrix is diagonalized to yield eigenvectors and eigenvalues .
Retaining only the primary component (PC1, representing the dominant thermo-hygrometric opposition axis), the projection matrix is . The multivariate reconstruction error is given by:
In a 2D orthonormal basis, this reduces to the absolute magnitude of the rejected second principal component: . Observations with high represent severe departures from the physical correlation structure of the atmosphere (e.g., simultaneous high temperature and high humidity).
- Tier 3: Temporal & Drift Anomaly Detection — Supervised MLP Cross-Validation: Point-based methods (Modified Z-score, Isolation Forest, PCA) evaluate each frame as an isolated tuple, remaining blind to slow sensor drifts where values drift gradually while staying inside valid static bounds.
To capture temporal inconsistencies, a Multilayer Perceptron (MLP) is trained to predict H using Temperature T alongside cyclically encoded temporal features:
The network architecture (16 hidden units, tanh activation) minimizes the Mean Squared Error:
An observation that is not flagged by Tier 1 or Tier 2, yet exhibits a large prediction residual , serves as a prime indicator of localized sensor drift or unmodeled environmental micro-disturbances.
C. Methodological Orthogonality Summary
The theoretical necessity for this multi-tiered architecture is summarized in the matrix below:
TABLE I METHODOLOGICAL ORTHOGONALITY OF THE FOUR DETECTION TIERS.
| Detection Tier | Underlying Principle | Primary Target | Insensitive To |
|---|---|---|---|
| Modified Z-Score | Marginal distance from median, in units of MAD | Extreme single-variable spikes (T or H) | Multivariate correlation violations within normal marginal bounds |
| Isolation Forest | Random axis-aligned partitioning path length | Unusual joint combinations of (T, H) | 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 |
IV. DATA PROCESSING & ANALYTICAL PIPELINE
A. Data Acquisition, Coverage Audit & Cleaning
The primary data acquisition and preprocessing layer is implemented in 01_extract.cpp. The raw corpus comprises 421,937 JSON-Lines frames transmitted by five distinct LoRaWAN nodes deployed at the Perret Tower (Tour Perret) in Grenoble, France, between June 2021 and June 2023, decoded by a ChirpStack network server [1] (DOI 10.18709/perscido.2023.06.ds395).
- JSON Schema Robustness & Coverage Audit: Rather than querying rigid, static path keys, 01_extract.cpp executes a recursive, alias-tolerant search across each frame's JSON payload hierarchy (object.* for physical measurements, rxInfo[] for reception metadata). This handles schema variations across ChirpStack v3/v4, The Things Network (TTN) v3, and flat-format payloads without throwing runtime key-errors. Two schema-level pitfalls, identified by diagnostic inspection of the raw file prior to full extraction, required specific handling: (i) the timestamp field is neither time nor timestamp but appears as either _date (an ISO 8601 string) or _timestamp (a Unix epoch in milliseconds, not seconds — a common source of silent date-arithmetic errors if left unconverted); and (ii) Elsys EMS frames in this deployment do not always carry all four target variables jointly — the first frames inspected during development carried only temperature and humidity (alongside unrelated fields such as dewpoint, accMotion, pulseAbs, vdd, waterleak, x/y/z). An early extraction attempt requiring all four variables in the same frame therefore rejected the entire corpus, including frames where T and H were both perfectly valid — motivating the per-variable extraction strategy below.
Each of the four target variables is consequently extracted independently: a frame is retained as soon as it carries at least one target variable and a valid timestamp, with absent columns left empty in a sparse ("long") intermediate CSV rather than requiring a strict wide-format join. This design choice is what makes the coverage audit below possible in the first place — it lets per-variable and per-devEUI presence be measured across the entire corpus without first discarding rows for missing columns.
During extraction, an automated Data Coverage Audit evaluates payload completeness across all registered device identifiers (devEUI) and application boundaries (applicationName) in a single pass.
TABLE II COVERAGE PER VARIABLE AND PER DEVICE (AUDIT ON THE 421,937 RAW FRAMES).
| Variable | Raw Frames | Retained | Cov. (%Tot.) | Cov. Scope (%Ret.) | Nodes | |
|---|---|---|---|---|---|---|
| Temperature (T) | 393,685 | 214,076 | 93.30 | 100.00 | Elsys + Wyres | 5 |
| Humidity (H) | 384,614 | 205,005 | 91.15 | 95.76 | Elsys only | 4 |
| Pressure (P) | 9,071 | 0 (isolated) | 2.15 | 0.00 | Wyres only | 1 |
| Carbon | 0 | 0 (absent) | 0.00 | 0.00 — | 0 | |
| Dioxide () |
The coverage audit confirms, on the full real-world corpus, what the early four-variable extraction attempt had already suggested empirically: a static extraction assuming joint co-occurrence across all four initially planned variables yields zero rows by construction (complete-case filtering on an empty intersection). This audit — integrated into the extractor and executed in a single pass over the file — is itself the methodological step whose necessity this work argues for: without it, the four-variable hypothesis would have failed silently rather than being diagnosed and corrected.
Distribution by devEUI (214,076 retained frames): 4 Elsys EMS sensors (108,678, 35,387, 30,800, and 30,140 frames respectively, totaling 205,005 joint T+H frames) and 1 Wyres module (9,071 T+P frames, no humidity).
- Multi-Gateway Deduplication & Physical Bounds Filtering: In LoRaWAN deployments, a single wireless transmission frame is frequently picked up by multiple surrounding gateways. Frame deduplication is performed using a composite hash key combining the unique device identifier and the frame counter:
Deduplication eliminated 179,609 duplicate frame receipts (42.6% of total ingested logs), reflecting the dense gateway coverage across the Grenoble urban area. Following deduplication, physical boundary validation was applied based on the Elsys EMS manufacturer specification sheet [17]:
• Temperature:
• Relative Humidity:
Only three individual out-of-range sensor readings were discarded. The resulting retained core dataset consists of synchronized, bivariate frames from four Elsys EMS sensors (108,678, 35,387, 30,800, and 30,140 frames respectively), representing of the retained deduplicated corpus.

Fig. 3. Data processing and analytical pipeline: from raw LoRaWAN logs to the four output reports (anomaly, MLP, PCA/cluster) that feed the Results section.
B. Anomaly Detection Framework
The C++ module 02_anomaly_detection.cpp implements the three point/density-based tiers of the complementary detection framework introduced in Section III-B, refocused on the bivariate space jointly available across the 205,005 Elsys EMS frames — down from the four dimensions initially planned.
-
(a) Point-Based Univariate Outliers: Robust Modified Z-Score: The Modified Z-score (Eq. (1), Section III-B) is computed independently for T and H; observations with are flagged as univariate marginal outliers.
-
(b) Multivariate Point Outliers: Isolation Forest: The Isolation Forest anomaly score (Eqs. (2)–(3), Section III-B) is evaluated on standardized bivariate vectors . The forest is instantiated with isolation trees, each built on a subsample of observations, with maximum tree depth capped at . As in Section III-B, an empirical decision threshold of is enforced.
-
(c) Global multivariate structure: DBSCAN: DBSCAN (04_clustering.cpp, Section IV-D and Section V-D) contributes a third, orthogonal detector: points located in low-density regions of the PCA space (label -1) reflect the global multivariate structure rather than a per-variable score or random-tree isolation path.
C. Dimensionality Reduction: Closed-Form Bivariate PCA
The module 03_pca.cpp performs the Tier-2 subspace projection introduced in Section III-B (reconstruction error , Eq. (4)), and derives its exact closed-form solution for the bivariate case.
- Standardization & Closed-Form Diagonalization: Given raw features with incompatible physical units ( C and ), features are standardized to zero mean and unit variance: . The sample correlation matrix S is expressed as:
While general multivariate PCA ( ) requires numerical solvers such as the Jacobi rotation algorithm [9], a symmetric matrix admits an exact closed-form algebraic solution for its eigenvalues :
The corresponding orthonormal eigenvectors define the principal subspace projection matrix :
Substituting into the reconstruction error of Eq. (4) (Section III-B) and exploiting the 2D orthonormal basis, reduces directly to the absolute magnitude of the rejected PC2 coordinate, — this closed form is what 03_pca.cpp evaluates for every observation. Observations with high represent severe departures from the dominant physical correlation structure of the atmosphere.
D. Clustering Algorithms & Real-World Scaling Optimizations
The module 04_clustering.cpp implements K-means++ and DBSCAN for spatial partitioning and density analysis.
- K-means++ Inertia Minimization & Silhouette Optimization: K-means minimizes intra-cluster variance (inertia) J:
Using Lloyd's algorithm [10] with K-means++ seeding [11], initial cluster centers are sampled with probability proportional to their squared distance to the nearest existing center: . To select the optimal number of clusters K, the silhouette index [12] is computed across candidate evaluations :
where represents mean intra-cluster distance and denotes mean nearest-neighbor cluster distance.
- DBSCAN Spatial Indexing & Algorithmic Scaling (n = 205,005): DBSCAN [13] defines clusters as continuous high-density regions separated by low-density space. A point p is a core point if its -neighborhood contains at least minPts points:
Points not density-reachable from any core point are flagged as noise (label -1).

Fig. 4. Uniform grid spatial index (2D), cell size = : DBSCAN's -neighborhood query is restricted to a neighborhood of grid cells around the query point's cell, avoiding an full scan.
- Real-World Scaling Challenges: Executing naive spatial range queries on bivariate points leads to two computational failures: excessive execution times and memory allocation faults (std::bad_alloc) caused by unchecked expansion queues in high-density regions. To resolve these limitations, 04_clustering.cpp incorporates two structural optimizations:
-
Uniform Grid Spatial Indexing: Standardized PCA feature space is partitioned into a uniform 2D grid with square bin width equal to . Range queries for point are restricted to candidate points residing within its home grid cell and the 8 immediate neighboring cells. Under quasi-uniform spatial distributions, search complexity scales from down to .
-
Expansion Queue State Tracking: A boolean visited array (std::vector<bool> in_queue) tracks point assignments during region expansion, preventing identical points from being repeatedly queued and eliminating runaway memory allocation.
-
Hyperparameter Calibration via k-Distance Plot Rather than using arbitrary default parameters (e.g., ), parameter selection is driven by k-distance analysis with . For every point in the dataset, the Euclidean distance to its 10th-nearest neighbor was calculated and sorted in ascending order. The maximum curvature point (“knee”) of the resulting curve occurs at . Setting proved too coarse, merging 100% of points into a single cluster and returning zero noise points.

Fig. 5. k-distance plot ( ) used to objectively select the DBSCAN neighborhood radius on real-world data. Candidate thresholds are overlaid; the knee of the curve, identified via maximum perpendicular distance to the chord, is retained at .
E. Cross-Validation via Supervised Learning (MLP)
The module 05_mlp_regression.cpp implements a Multilayer Perceptron (MLP) to model physical dependencies between variables and detect progressive sensor drift.
- Target Revision & Physical Rationale: In the initial project design, the MLP was specified to predict concentration from thermal and pressure covariates. However, the data coverage audit (Section IV-A) proved that is entirely absent from the multi-year corpus (0% presence).
To preserve the predictive cross-validation architecture, the target variable was revised to predict Relative Humidity (H) using Temperature (T) and temporal features. Relative Humidity is especially prone to hardware degradation and capacitive element saturation under prolonged humid conditions, making it an ideal target for cross-validation drift analysis.
- Cyclical Feature Encoding & Architecture: Time components are cyclically encoded exactly as defined in Eq. (5) (Section III-B), preventing artificial boundary discontinuities at daily (23h → 00h) and annual (Dec 31 → Jan 1) transitions. The input vector feeds a feedforward network comprising one hidden layer with 16 neurons (tanh activation) and a single linear output unit predicting .
Network parameters are optimized using stochastic gradient descent (SGD) with momentum ( , learning rate ) and gradient norm clipping [15], minimizing the MSE loss of Eq. (6) (Section III-B):
- High Residuals as Long-Term Drift Signals: Point-based detectors evaluate individual frames as independent events, making them blind to slow calibration drifts where readings remain within static physical bounds. By cross-validating physical dependencies through the neural network, observations exhibiting large regression residuals:
serve as an independent fourth anomaly indicator targeting progressive sensor drift and micro-climatic disruptions.
F. Synthetic Validation Set: Generation Procedure and Role in the Study Design
Before being applied to the real-world Tour Perret corpus, every module of the pipeline (Sections IV-B–IV-E) was first exercised against a synthetic bivariate Temperature–Humidity dataset (n = 20,000 samples) generated with a known, near-deterministic thermo-hygrometric anti-correlation (target ). This synthetic set was not designed as a formal experimental baseline to be reported as a standalone result; rather, it served as a pre-deployment calibration and software-verification harness, distinct from the numerical cross-check already described for 03_pca.cpp — in which the C++ eigen-decomposition is independently recomputed in Python (numpy.linalg.eigh) on the real data to confirm bit-for-bit agreement on PC1 = 83.10%, PC2 = 16.90% (Section IV-C). The synthetic set, by contrast, was used earlier in the pipeline’s development, before the idiosyncrasies of the real corpus (variable sparsity, actual point density) were fully characterized. It played three concrete roles:
-
Default-parameter calibration and its failure mode (Section IV-D). DBSCAN's initial density threshold was calibrated on the synthetic set at . Applied unchanged to the real corpus ( , substantially denser in standardized PCA space than the synthetic sample), this value proved far too permissive: it collapsed the entire dataset into a single cluster with 0% noise — an uninformative result that made clustering structure impossible to assess. This failure is itself an informative finding: it demonstrates that DBSCAN hyperparameters calibrated on a synthetic proxy do not transfer to the real deployment, and it directly motivated the data-driven k-distance recalibration described in Section IV-D, which yielded the retained value .
-
MLP negative control (Section V-E). For the regression cross-validation, the synthetic humidity target was additionally corrupted with deliberately strong multiplicative noise, calibrated so that no learnable relationship would remain. The MLP trained on this corrupted synthetic target achieved — statistically indistinguishable from a non-informative predictor. This negative-control result is the reference against which the real-world performance ( , Section V-E) should be read: it shows that the architecture does not spuriously report a high in the absence of genuine signal, which in turn supports treating the real-world as evidence of a real, learnable thermo-hygrometric and diurnal/seasonal dependency rather than an artifact of model capacity or overfitting.
-
Visualization scale reference (Figure 11). The synthetic sample size (n = 20,000) is markedly smaller and less dense than the real corpus (n = 205,005); marker size and transparency in the PCA projection scatter plots were adjusted accordingly (smaller, more transparent markers) once the pipeline moved from the synthetic development set to the real, denser point cloud.
Interpretation. Read together, the correlation and comparisons in Section V-B and Section V-E are not a same-footing benchmark between two datasets of equal experimental status: the synthetic set encodes a clean, controllable ground truth used to verify that each detector behaves as expected (or, in the case of DBSCAN's initial , to expose a calibration that does not transfer) before the same code is trusted on field data. The lower real-world correlation magnitude ( vs. 0.93 on the synthetic set) reflects genuine microclimatic variability, weather events, and sensor noise absent from the synthetic generator (Section V-B); the higher real-world (0.672 vs. 0.019 on the noise-corrupted synthetic set) confirms the MLP is picking up a genuine physical signal rather than an artifact of the fitting procedure (Section V-E).
V. RESULTS
A. Descriptive Statistics (n = 205,005, Complete Elsys EMS T+H Frames)
TABLE III STATISTICAL SUMMARY OF THE n = 205,005 SYNCHRONIZED ELSYS EMS BIVARIATE TELEMETRY CORPUS.
| Variable | Mean | Std. Dev. | Min | Q1 (25%) | Median | Q3 (75%) | Max |
|---|---|---|---|---|---|---|---|
| Temperature T (°C) | 14.36 | 8.72 | -4.30 | 7.00 | 14.80 | 20.70 | 46.10 |
| Humidity H (%) | 72.14 | 18.41 | 19.00 | 58.00 | 74.00 | 88.00 | 100.00 |
- Physical Interpretation & Measurement Artifacts:
-
Thermal Extremes ( ): The maximum recorded temperature exceeds ambient climate norms for Grenoble. This reflects localized solar irradiance heating on the unshaded exterior housing of the rooftop node.
-
Humidity Saturation ( ): Relative humidity exhibits strong left-skewness, with a third quartile of Q3 = 88.00% and frequent saturation at 100.00%. This behavior corresponds to capacitive sensor saturation during sustained rainfall or high atmospheric humidity.
B. Bivariate PCA Analysis
The Pearson correlation coefficient between standardized Temperature and Humidity is . Through the characteristics of Figure 7, this confirms a strong inverse thermo-hygrometric relationship, consistent with the physical property that warmer air exhibits higher saturation vapor capacity.

Fig. 6. Bivariate PCA eigenvector axes in standardized space. Variance PC1 = 83.10%, PC2 = 16.90%. Points are a schematic reconstruction of the standardized ( , ) cloud preserving the reported correlation r = -0.662; the plotted axes are exact ( loadings, Eq. (10)).
TABLE IV EIGENVALUE DECOMPOSITION OF THE CORRELATION MATRIX (CF. FIGURE 8).
| Component | Eigenvalue | Explained Var. (%) | Cumulative Var. (%) | T Loading | H Loading |
|---|---|---|---|---|---|
| PC1 | 1.6620 | 83.10% | 83.10% | -0.7071 | +0.7071 |
| PC2 | 0.3380 | 16.90% | 100.00% | -0.7071 | -0.7071 |
Loadings: T (PC1 = -0.707, PC2 = -0.707), H (PC1 = +0.707, PC2 = -0.707)—PC1 represents, as expected from a strongly correlated bivariate PCA, the classic thermohygrometric opposition axis (bisector), while PC2 acts as its orthogonal complement (sum T+H, which can be interpreted as a global “thermo-hygrometric energy” indicator for the sensor system).
- Principal Axis Physical Meanings:
-
PC1 (Thermo-Hygrometric Opposition Axis): Captures 83.10% of total variance, aligning with the line of inverse correlation ( ).
-
PC2 (Thermo-Hygrometric Energy Axis): Captures the remaining 16.90% of variance along the orthogonal bisector ( ). Elevated values along PC2 indicate high simultaneous temperature and humidity, signaling severe departures from normal atmospheric behavior.
Figure 7 (correlation): —a moderate to strong anti-correlation, consistent with expected physics (air capacity to hold water vapor increases with temperature), yet noticeably noisier than on the synthetic validation set (, see Section IV-F for its generation procedure and role in the study design). This is expected: real-world data incorporates microclimatic variability, weather events, and measurement noise that a synthetic dataset cannot reproduce.

Fig. 7. Actual Pearson correlation matrix, Temperature–Humidity (n = 205,005).

Fig. 8. Scree plot of eigenvalues (bivariate PCA: T, H, real data). PC1 alone captures 83.10% of total variance.
C. Anomaly Detection: Demonstration of Complementarity on Real-World Data
TABLE V COMPARATIVE PERFORMANCE ACROSS THE PRIMARY POINT-BASED ANOMALY DETECTORS (n = 205,005).
| Anomaly Detector | Primary Target Anomaly Type | Flagged (n) | Rate (%) |
|---|---|---|---|
| Modified Z-Score () | Extreme single-variable spikes | 0 | 0.00 |
| Isolation Forest (s > 0.62) | Atypical multivariate combinations | 4,346 | 2.12 |
| Joint Consensus (both methods) | Simultaneous univariate & multivariate | 0 | 0.00 |
- Methodological Insights: The contrast between the univariate Modified Z-score (0%) and the multivariate Isolation Forest (2.12%) highlights the necessity of multi-tiered detection architectures:
-
Univariate Robustness: Even extreme single-variable observations () remain below the statistical outlier threshold () due to the wide, natural multi-year climate spread.
-
Multivariate Detection: The Isolation Forest successfully flags 4,346 frames where temperature and humidity violate their expected inverse coupling (e.g., high humidity occurring at elevated ambient temperatures), despite both variables remaining within valid single-variable ranges.

Fig. 9. Schematic reconstruction of the temperature/humidity time series for the Perret Tower (2021–2023) with Isolation Forest-flagged anomalies overlaid (Modified Z-score set to zero anomalies on this dataset). Curve shape preserves the reported seasonal range and anomaly rate (2.12%); exact daily values are not reproduced from the original data.
This result—zero in univariate, non-zero in multivariate—is the clearest empirical demonstration of the methodological complementarity discussed in Section II [3]: the marginal extremes for T (max = 46.1 °C, ) and H (min = 19%, ) remain, when considered in isolation, below the significance threshold (3.5) given the natural spread across two full seasonal cycles—yet 2.12% of the (T, H) combinations are statistically atypical under multivariate isolation. This reveals unusual thermo-hygrometric couplings (such as high temperatures combined with high humidity, contradicting the dominant anti-correlation) that remain invisible to single-variable analysis.
D. Cluster Structure Analysis
Silhouette-based selection of K (Table VI) clearly favors K = 2 (silhouette = 0.491), with the silhouette score dropping sharply starting at K = 3 (0.404) and then stabilizing around 0.34–0.39 for —a sign that the dominant structure of the validation data is a binary opposition between normal regime / extreme events rather than a fine-grained segmentation into multiple climate regimes (the latter being expected on real-world data, where seasonal and diurnal cyclicity should yield a 3–4 cluster structure, see Section VI).

Fig. 10. DBSCAN density clustering in standardized PCA space ( , minPts=10), accelerated by the uniform grid spatial index of Figure 4. Point cloud is a schematic reconstruction preserving the reported cluster/noise proportions.
TABLE VI EVALUATING K-MEANS++ CLUSTERING ACROSS USING THE SILHOUETTE INDEX.
| Cluster Count K | Inertia J | Silhouette s | Structural Interpretation |
|---|---|---|---|
| K = 2 | 165,530 | 0.4910 | Optimal partition (Warm/Dry vs. Cool/Humid) |
| K = 3 | 114,930 | 0.4040 | Fragmented intermediate transition zone |
| K = 4 | 88,253 | 0.3760 | Arbitrary seasonal sub-division |
| K = 5 | 68,978 | 0.3910 | Sub-cluster fragmentation |
| K = 6 | 58,310 | 0.3740 | Over-segmented clusters |
| K = 7 | 49,814 | 0.3780 | Over-segmented clusters |
| K = 8 | 44,585 | 0.3480 | Over-segmented clusters |
clearly dominates (silhouette 0.491), as the main structure of the real-world data is—as shown in Figure 11a—a simple bipartition along PC1 (high T/low H vs. low T/high H), directly reflecting the strong anti-correlation in Section V-C, rather than a fine-grained segmentation into multiple seasonal regimes.
Optimal partitioning occurs at (), reflecting a clear separation along PC1 between high-temperature/low-humidity regimes and low-temperature/high-humidity regimes.
- DBSCAN Density Partitioning & Quantization Artifacts: Applying DBSCAN with and minPts = 10 yielded:
-
Primary Cluster: 1 main cluster containing 203,791 points (99.41% of the dataset).
-
Noise Observations: 339 isolated spatial points (0.17%).
-
Quantization Micro-Clusters: 12 small, isolated sub-clusters (875 points total).
Further analysis revealed that the 12 micro-clusters are caused by coarse sensor resolution (0.1°C for temperature, 1% for humidity). These coarse measurement steps produce identical repeated values, creating artificially dense point stacks in low-density boundary regions.
DBSCAN ( determined via k-distance plot, Figure 5, minPts=10): 13 clusters, 339 noise points (0.17%). Figures 10–11b reveal a massive main cluster and 12 microclusters localized in the region PC1 , PC2 to -2.5—corresponding to exact duplicate values resulting from sensor quantization (temperature to the nearest 0.1 °C, humidity to the nearest integer), which create strictly identical points in sufficient numbers to locally form their own dense clusters in the DBSCAN sense. This phenomenon, distinct from a genuine climate structure, is discussed in Section VI.
E. Performance of the Cross-Validation MLP
Evaluated on an 80/20 train/test split of the dataset, the MLP achieved:
- Root Mean Squared Error (RMSE): 10.54% Relative Humidity
• Coefficient of Determination ( ): 0.672
This demonstrates that 67.2% of relative humidity variance is predictable directly from ambient temperature and cyclical temporal encodings.
RMSE = 10.54% (humidity), . Significantly higher than the obtained on the synthetic validation set (a deliberately noise-corrupted negative control, see Section IV-F), this result confirms that a substantial portion (67%) of humidity variance is indeed predictable solely from temperature and the temporal cycle, consistent with the thermohygrometric coupling highlighted by the PCA (Section V-B). The residual distribution (Figure 12) is slightly asymmetrical (median -1.68%, standard deviation 10.48%, max 54.07%); 0.62% of the observations exhibit a residual greater than 3×RMSE, forming a candidate subset for investigating slow sensor drifts not captured by the point-based detectors in Section V-C.
- Residual Analysis & Sensor Drift Candidates: The residual distribution displays a median of -1.68% and a standard deviation of 10.48%. A subset of 1,271 observations (0.62% of the corpus) produced prediction residuals exceeding the drift threshold:
Because these frames pass univariate and multivariate point-based filters, they represent primary candidates for long-term calibration drift and localized hardware degradation.
VI. Discussion
A. Methodological Value of Systematic Coverage Audits
The empirical findings underscore the necessity of performing explicit coverage audits in multi-sensor LPWAN deployments. Had the pipeline assumed full variable co-occurrence , execution would have failed completely (0 retained frames).
(a) K-means (K=2, silhouette=0.491)

(b) DBSCAN (eps=0.071, 13 clusters, 0.17% noise)
Fig. 11. Actual PCA projection (PC1–PC2, n = 205,005) and partitioning: (a) K-means bipartition along PC1, colored by cluster label; (b) DBSCAN partition, dominated by a single continuous cluster (label -1 = noise), with the 12 quantization micro-clusters and noise points overlaid. Schematic reconstruction preserving reported silhouette and cluster statistics.

Fig. 12. MLP regression residual distribution ( ), predictive cross-validation (humidity estimation). A subset of frames (0.62%) exceeds the drift threshold. Density curve is a schematic reconstruction matching the reported median (-1.68%) and standard deviation (10.48%).
Furthermore, naive cross-device joins without device-level auditing risk merging asynchronous streams from physically separated sensors, introducing artificial correlations into downstream models.
B. Sensor Physics, Saturation Limits & Quantization Artifacts
-
Solar Irradiance Exposure: Peak recorded temperatures (46.10°C) highlight solar radiation effects on unshaded sensor enclosures, demonstrating that outdoor node deployments require radiation shields to collect accurate ambient air temperatures.
-
Humidity Saturation Truncation: Persistent saturation at 100% reflects physical limits in capacitive humidity elements under wet conditions. Future pipeline revisions should treat upper-bound saturation as a known sensor limit rather than an extreme anomaly.
-
Density-Based Micro-Clusters: The discovery of 12 DBSCAN micro-clusters demonstrates how coarse measurement quantization (0.1 °C, 1%) can distort density-based clustering. Introducing low-amplitude random dithering prior to spatial density estimation can prevent artificial micro-cluster formation.
C. Complementarity of Point-Based vs. Predictive Anomaly Detectors
No single statistical model captures all anomaly types in long-term IoT telemetry streams. Point-based methods (Modified Z-score, Isolation Forest) excel at detecting sudden spikes and illegal joint states, but remain blind to gradual calibration shifts that stay within valid static bounds.
In contrast, cross-validating physical relationships using a supervised model (MLP) isolates slow calibration drifts by flagging sustained regression residuals ( ).
D. Operational Recommendations for IoT Gateways
-
In-Pipeline Auditing: Embed automated coverage audits per variable and per device within data ingestion software prior to multivariate modeling.
-
Closed-Form Subspace Processing: Use closed-form PCA matrix formulations for edge devices to reduce computational overhead.
-
Spatial Acceleration & Memory Caps: Enforce spatial grid indexing and explicit queue caps when running density-based algorithms on edge hardware to prevent memory allocation faults (std::bad_alloc).
-
Multi-Tiered Anomaly Detection: Combine point-based statistical filters with predictive ML models to capture both immediate spikes and gradual hardware degradation over time.
(a) Observed vs. predicted

(b) Distribution of residues (RMSE=10.54%, )
Fig. 13. Actual performance of the cross-validated MLP (humidity prediction). Panel (a): observed vs. predicted humidity. Panel (b): residual histogram. Schematic reconstruction preserving reported RMSE and .
VII. Conclusion & Outlook
This work presents a C++ pipeline for long-term LoRaWAN telemetry processing, evaluated on 421,937 raw records from the Tour Perret deployment. An automated coverage audit proved that was completely absent (0%) and barometric pressure was structurally isolated, refocusing analysis on a clean bivariate core dataset of 205,005 Temperature-Humidity frames (95.76% retention).
Using closed-form PCA, grid-accelerated DBSCAN, and an MLP regression model, the pipeline demonstrated the complementary nature of multi-tiered anomaly detection:
• Univariate Modified Z-scores flagged 0% extreme spikes.
• Multivariate Isolation Forest identified 2.12% atypical joint states.
• MLP cross-validation isolated 0.62% candidate frames displaying long-term calibration drift.
A. Future Research Directions
-
Hardware verification: coordinate with deployment maintainers to confirm whether sensors were omitted or require updated firmware decoders.
-
Temporal stream alignment: realign the isolated Wyres pressure stream with Elsys EMS readings using hourly window aggregation to enable trivariate modeling.
-
Sensor dithering and saturation handling: add controlled dither noise to prevent quantization micro-clusters in DBSCAN, and implement explicit truncation handling for humidity saturation at 100%.
-
Node-specific drift tracking: evaluate regression residuals individually per devEUI to isolate hardware degradation on specific sensor nodes.
VIII. DATA & CODE AVAILABILITY
A. Open-Access Dataset
• Citation: Donsez, D., Alphand, O., & Albarel, N. (2023). The Tour Perret LoRaWAN frames dataset [Data set]. PerSCiDO, Université Grenoble Alpes.
• DOI: 10.18709/perscido.2023.06.ds395
B. Source Code & Dependencies
• Repository Structure:
-
01_extract.cpp — Data ingestion, coverage audit, deduplication, and bounds filtering.
-
02_anomaly_detection.cpp — Univariate Modified Z-score and bivariate Isolation Forest.
-
03_pca.cpp — Closed-form PCA and reconstruction error computation.
-
04_clustering.cpp — K-means++ and grid-accelerated DBSCAN clustering.
-
05_mlp_regression.cpp — Cyclical feature encoding and MLP regression for drift detection.
• Dependencies: Standalone C++17 standard library implementation. Header-only nlohmann/json library used exclusively for raw JSON parsing.
C. Processing Pipeline and Source Code Architecture
Compilation command for the standalone C++ pipeline:
g++ -O2 -std=c++17 0X_file.cpp -o executable
- Module Descriptions:
- 01_extract.cpp: Parses JSON-Lines payloads, executes coverage audit, deduplicates frames via devEui|fCount, filters physical bounds (
[-40, 85]°C, , and exports cleaned bivariate frames.
-
02_anomaly_detection.cpp: Evaluates Modified Z-scores ( ) and builds an Isolation Forest ensemble ( ).
-
03_pca.cpp: Standardizes features, solves closed-form covariance matrix eigenvalues/eigenvectors, and calculates PC2 reconstruction errors ( ).
-
04_clustering.cpp: Executes K-means++ ( ) with silhouette optimization, and grid-accelerated DBSCAN ( , minPts = 10).
-
05_mlp_regression.cpp: Encodes cyclical temporal features (sin/cos), trains a 5-16-1 MLP using backpropagation with momentum and gradient clipping, and flags drift candidates where .
All programs are self-contained (C++17 standard library + nlohmann::json for JSON parsing only), operate sequentially as follows:
The processing sequence, shown in Figure 14, mirrors the pipeline diagram of Figure 3.
-
01_extract.cpp — Extraction and Cleaning: Parses the JSON-Lines file via a recursive, alias-tolerant search across each frame's payload hierarchy, executes the per-variable/per-device coverage audit (Section IV-A, Table II), retains Elsys EMS frames with co-occurring temperature and humidity fields (the only pair jointly available at sufficient scale — CO₂ is 0% present and pressure is structurally isolated on the separate Wyres stream, see Section I-B), converts ISO 8601 timestamps to Unix epoch, eliminates multi-gateway reception duplicates (using key devEui | fCount), and discards values outside the physical boundaries of the sensor (manufacturer datasheet: °C, ).
-
02_anomaly_detection.cpp — Anomaly Detection: Two complementary detectors:
(a) Modified Z-score (MAD) — [4]. Robust to extreme values, unlike the classic Z-score based on mean and standard deviation:
Recommended threshold: .
(b) Isolation Forest — [5]. Constructs t isolation trees via random splits; an anomalous point isolates with a shorter average path length:
: strong anomaly; : normal point. Selected empirical threshold: .
- 03_pca.cpp — Dimensionality Reduction (PCA): Standardization , covariance matrix , diagonalized using the closed-form algebraic solution (Eqs. (8)–(10), Section IV-C) rather than an iterative solver such as Jacobi rotation [9] (cited in Section II-B as the general-d alternative)—a self-contained implementation without external linear algebra library dependencies (suitable for embedded environments / IoT gateways). Projection onto the primary component:
reconstruction error
The reconstruction error constitutes a 3rd anomaly score, multivariate and based on the global covariance structure (complementary to the point-based scores from 02).
- 04_clustering.cpp — Clustering:
• K-means++ [11] + Lloyd [10], with selection of K via silhouette index [12] over K = 2..8:
• DBSCAN [13]: natively identifies noise (label -1), providing a 4th anomaly detector based on local density and without assuming spherical shapes—orthogonal to Isolation Forest.
- 05_mlp_regression.cpp — Cross-Validation via Supervised ML: Multilayer Perceptron [14], 1 hidden layer (16 neurons, tanh), trained via backpropagation + SGD-momentum (with gradient clipping, [15]) to predict Relative Humidity (H) from Temperature (T) and cyclically encoded hour and day of the year (sin, cos) — the target was revised from the originally planned CO₂ prediction because the coverage audit (Section IV-A) found CO₂ entirely absent from the corpus (see Section IV-E):
A high residual on an observation unflagged by 02/04 serves as an indicator of slow sensor drift (gradual bias), undetectable by point-based methods—a strong novelty argument for the Discussion.
IX. COMPLETE GLOSSARY OF ALL TECHNICAL CONCEPTS, ALGORITHMS, METRICS AND ACRONYMS
A. Acronyms & IoT Infrastructure
• ChirpStack / The Things Network (TTN): LoRaWAN Network Servers responsible for data ingestion, raw frame decoding, and managing connectivity for IoT devices.
• devEUI (Device Extended Unique Identifier): A globally unique 64-bit hardware identifier assigned to each LoRaWAN node.
• fCount (Frame Counter): A counter incremented by the sensor node for each transmission. Paired with devEUI, it forms a unique deduplication key to eliminate multi-gateway duplicate receipts.

Fig. 14. Sequential execution flow of the five C++ modules and their intermediate CSV reports.
• LoRaWAN (Long Range Wide Area Network): A low-power, long-range Media Access Control (MAC) protocol designed for wireless, low-bitrate communication among IoT devices.
• LPWAN (Low-Power Wide-Area Network): A category of wireless telecommunication networks optimized for long-range communication and multi-year battery operation.
B. Data Engineering & Stream Quality
• Coverage Audit: An automated inspection procedure that evaluates payload completeness and variable co-occurrence per device (devEUI) and application before running multivariate analyses.
• Multi-Gateway Deduplication: Filtering out duplicate receipts generated when a single LoRaWAN transmission frame is captured by multiple surrounding gateways, identified via the (devEui, fCount) tuple.
• Sensor Drift: A progressive degradation in sensor calibration (e.g., saturation or aging of a capacitive humidity element) causing a systematic bias over time without breaching static physical bounds.
• Quantization Micro-Clusters: Artificial high-density clusters formed during DBSCAN execution due to coarse sensor measurement steps (e.g., 0.1°C or 1%), resulting in large stacks of identical point values.
• Sensor Saturation: A physical state where the measured environmental parameter reaches or exceeds the sensor’s maximum readable limit (e.g., 100% relative humidity during heavy rainfall).
C. Algorithms & Anomaly Detection
• DBSCAN (Density-Based Spatial Clustering of Applications with Noise): A spatial clustering algorithm that groups points located in dense neighborhoods ( , minPts) and flags sparse boundary points as noise (label -1).
• Isolation Forest: An unsupervised anomaly detection algorithm that isolates multivariate outliers using random decision trees. Anomalies require significantly shorter tree path lengths ( ).
• K-means++: An optimized variant of K-means clustering that uses probabilistic centroid initialization based on squared distances, avoiding convergence to poor local minima.
• MLP (Multilayer Perceptron): A feedforward artificial neural network trained via backpropagation. In this pipeline, it performs predictive cross-validation to estimate humidity from temperature and cyclical time encodings.
REFERENCES
• PCA (Principal Component Analysis): A linear dimensionality reduction technique that identifies orthogonal directions of maximum variance. Solved via an exact closed-form matrix formulation in the bivariate case.
• Modified Z-Score: A robust univariate outlier metric computed using the sample median and Median Absolute Deviation (MAD), making it resilient to extreme outliers compared to standard mean-based Z-scores.
D. Mathematical & Algorithmic Concepts
• Thermo-Hygrometric Opposition Axis (PC1): The primary principal component capturing 83.10% of total variance along the inverse correlation axis between temperature and relative humidity ( ).
• Thermo-Hygrometric Energy Axis (PC2): The secondary principal component orthogonal to PC1 (16.90% variance). Magnitude along this axis measures departures from standard atmospheric thermodynamic coupling.
• Cyclical Temporal Encoding: A trigonometric transformation (sin, cos) mapping periodic time dimensions (hours of the day, days of the year) onto continuous 2D coordinates without boundary discontinuities (23h → 00h).
• Reconstruction Error ( ): The Euclidean distance between an original standardized data vector and its projection onto the primary subspace. In 2D, it equals the absolute coordinate value along the second principal component: .
- k-Distance Plot: A calibration heuristic that plots sorted distances to each point's kth-nearest neighbor (minPts) to identify the maximum curvature point (“knee”) for setting the optimal DBSCAN search radius .
• Uniform Grid Indexing: A spatial partitioning optimization that divides feature space into square cells of width , restricting neighbor queries to the point's cell and its 8 adjacent neighbors to scale DBSCAN execution time from down to .
• MAD (Median Absolute Deviation): A robust measure of statistical dispersion defined as .
• Silhouette Index: A metric assessing clustering quality by comparing intra-cluster distance against nearest-cluster distance ( ).
E. Regression Evaluation Metrics
• (Coefficient of Determination): The proportion of variance in the target variable (Relative Humidity) explained by the MLP model ( ).
• RMSE (Root Mean Squared Error): The square root of the average squared residuals, measuring prediction error (RMSE = 10.54%). Observations yielding residuals are flagged as primary sensor drift candidates.
[1] D. Donsez, O. Alphand, and N. Albarel, “The tour perret lorawan frames dataset,” [Data set], 2023.
[2] V. Chandola, A. Banerjee, and V. Kumar, “Anomaly detection: A survey,” ACM Computing Surveys, vol. 41, no. 3, pp. 1–58, 2009.
[3] C. C. Aggarwal, Outlier Analysis, 2nd ed. Springer, 2017.
[4] B. Iglewicz and D. C. Hoaglin, How to Detect and Handle Outliers. ASQC Quality Press, 1993.
[5] F. T. Liu, K. M. Ting, and Z.-H. Zhou, “Isolation forest,” in Proceedings of the IEEE International Conference on Data Mining (ICDM), 2008, pp. 413–422.
[6] S. Bhatia et al., “Real-time anomaly detection in edge streams,” ACM Transactions on Knowledge Discovery from Data (TKDD), vol. 16, no. 4, pp. 1–25, 2022.
[7] K. Pearson, “On lines and planes of closest fit to systems of points in space,” Philosophical Magazine, vol. 2, no. 11, pp. 559–572, 1901.
[8] H. Hotelling, “Analysis of a complex of statistical variables into principal components,” Journal of Educational Psychology, vol. 24, no. 6, pp. 417–441, 1933.
[9] G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed. Johns Hopkins University Press, 2013.
[10] S. Lloyd, “Least squares quantization in pcm,” IEEE Transactions on Information Theory, vol. 28, no. 2, pp. 129–137, 1982.
[11] D. Arthur and S. Vassilvitskii, “k-means++: The advantages of careful seeding,” in Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2007, pp. 1027–1035.
[12] P. J. Rousseeuw, “Silhouettes: A graphical aid to the interpretation and validation of cluster analysis,” Journal of Computational and Applied Mathematics, vol. 20, pp. 53–65, 1987.
[13] M. Ester, H.-P. Kriegel, J. Sander, and X. Xu, “A density-based algorithm for discovering clusters in large spatial databases with noise,” in Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD), 1996, pp. 226–231.
[14] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, “Learning representations by back-propagating errors,” Nature, vol. 323, no. 6088, pp. 533–536, 1986.
[15] R. Pascanu, T. Mikolov, and Y. Bengio, “On the difficulty of training recurrent neural networks,” in International Conference on Machine Learning (ICML), 2013, pp. 1310–1318.
[16] P. Ferrer-Cid, J. M. Barcelo-Ordinas, and J. Garcia-Vidal, “A review of graph-powered data quality applications for iot monitoring sensor networks,” Journal of Network and Computer Applications, 2025, preprint: arXiv:2410.21006, 2024.
[17] Elsys AB, Elsys EMS — Environmental Monitoring Sensor, Technical Specification, Elsys AB.