<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nphassrsngsangka on Medium]]></title>
        <description><![CDATA[Stories by Nphassrsngsangka on Medium]]></description>
        <link>https://medium.com/@nphassrsngsangka?source=rss-3b28e5aec48a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*x5dHBiRuNij0o4Aq</url>
            <title>Stories by Nphassrsngsangka on Medium</title>
            <link>https://medium.com/@nphassrsngsangka?source=rss-3b28e5aec48a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:52:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nphassrsngsangka/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Forecasting PM10, PM2.5,]]></title>
            <link>https://medium.com/@nphassrsngsangka/forecasting-pm10-pm2-5-adffb4a508d0?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/adffb4a508d0</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 01:24:39 GMT</pubDate>
            <atom:updated>2026-10-25T01:24:39.986Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Forecasting PM10, PM2.5, and PM1.0 from a single low-cost PM2.5 input: a triple-task multi-output virtual sensor with edge deployment profiling</strong></h3><p><strong>Forecasting PM10, PM2.5, and PM1.0 from a single low-cost PM2.5 input: a triple-task multi-output virtual sensor with edge deployment profiling</strong></p><h3>ABSTRACT</h3><p>Dense particulate-matter (PM) monitoring has become increasingly practical with the spread of low-cost optical sensors, yet resolving the three health-relevant size fractions PM10, PM2.5, and PM1.0 still demands either several sensing channels or a dedicated forecasting model for each fraction, inflating both hardware cost and the computational load carried at the edge. This study introduces a virtual PM sensing framework in which one PM2.5 channel alone drives the forecasting of all three fractions simultaneously. Since PM1.0, PM2.5, and PM10 form a physically nested hierarchy with tightly coupled temporal behavior, their shared dynamics can be captured by a single model that emits three outputs in one forward pass, removing the need to train three separate models. Taking a 24-hour PM2.5 history as input, the triple-task architecture predicts all fractions one hour ahead and is benchmarked against conventional independent single-task models over four model configurations drawn from three architecture families, consisting of Random Forest with 10 and 100 trees, 1D-CNN, and LSTM, using 19,326 hourly records from two contrasting sites in Ho Chi Minh City, Vietnam. Over 24 model–site–target combinations, the triple-task models proved as skilful as the single-task baselines (mean absolute ΔRMSE of 0.11 µg/m3) while shrinking model size by 38–65%. All four configurations achieve real-time operation on an ESP32-S3 microcontroller, where one joint inference substitutes for three sequential single-task runs and lowers inference time and energy by a factor of 2.2 to 3.0. For the 10-tree Random Forest, the most memory-efficient candidate, these costs fall from 0.167 ms and 0.039 mJ to 0.065 ms and 0.015 mJ. The findings show that a widely available PM2.5 sensor coupled with a low-cost microcontroller can support a triple-task virtual sensor that delivers real-time, physically consistent multi-fraction PM forecasts without sacrificing predictive performance, easing the sensing and computing bottlenecks that hold back field-scale dense PM monitoring.</p><p><strong>Keywords</strong>: Particulate matter forecasting, multi-task learning, virtual sensor, TinyML, edge inference, ESP32-S3.</p><h3>1. Introduction</h3><p>Exposure to fine particulate matter ranks among the leading environmental causes of premature death, accounting for an estimated 4.2 million fatalities worldwide every year [1]. In response to this health burden, the 2021 World Health Organization (WHO) Air Quality Guidelines tightened the recommended annual limits to 5 µg/m3 for PM2.5 and 15 µg/m3 for PM10 [2]. PM1.0 has no dedicated regulatory limit yet, but interest in the smaller size fractions continues to grow because such particles penetrate deep into the respiratory tract and, in the ultrafine range, may pass into the systemic circulation [3,4]. Air-quality monitoring therefore increasingly targets all three fractions, which correspond to aerodynamic diameters of ≤10 µm, ≤2.5 µm, and ≤1 µm and constitute a nested size hierarchy . Sharing common emission sources and atmospheric processes, the three fractions co-vary strongly over time, most notably at hourly resolution. Existing prediction approaches, however, typically treat each fraction as an isolated modeling problem and thus ignore this intrinsic coupling. A joint prediction framework that leverages the near-ubiquitous availability of PM2.5 measurements to estimate PM10, PM2.5, and PM1.0 within one model is therefore an appealing alternative.</p><p>The case for such a framework is strongest in developing countries, where the expense of reference-grade instruments keeps dense PM monitoring out of reach. Networks of low-cost sensors can extend spatial coverage at a fraction of the cost, but scaling them up requires edge-capable models that sustain reliable accuracy within tight sensing, memory, and computational budgets. Ho Chi Minh City (HCMC), Vietnam, offers a representative setting for this challenge. Among Southeast Asia’s largest megacities, HCMC is home to more than 10 million residents and over 12 million motorcycles [5]. Emissions from traffic, combined with biomass burning and industrial activity [6], produce highly dynamic particulate conditions. An annual mean PM2.5 level of 36.3 ± 13.7 µg/m3, above both the Vietnamese standard and the WHO guideline value, was documented for the city by Hien et al. [7]. These characteristics make HCMC well suited to testing compact, edge-based virtual PM sensing under resource-constrained conditions. AI-based hourly PM2.5 forecasting for HCMC has been explored previously through a comparison of several machine learning algorithms at six monitoring stations [8], but neither multi-fraction forecasting nor edge deployment was considered.</p><p>Against this background, three shortcomings of the existing PM forecasting and monitoring literature are directly relevant to the present work. First, data-driven PM forecasting has concentrated almost entirely on a single fraction, typically PM2.5 [9–16], or has grouped PM2.5 with chemically unrelated pollutants such as O3, NO2, and SO2 in multi-target regression settings [17–20], while PM1.0 is seldom treated as a forecasting target in its own right. Joint forecasting of several PM fractions has received far less attention. Xie et al. [19] built a multi-task model that predicts PM2.5 and PM10 together using a shared temporal backbone with task-specific output heads. To our knowledge, however, no study has yet forecast PM10, PM2.5, and PM1.0 jointly under a multi-task learning paradigm, even though their nested size-fraction relationship and strong mutual dependencies make them natural candidates for a joint-output formulation. Second, forecasting systems hosted in the cloud depend on server-side inference and continuous connectivity, so their performance degrades when network access or bandwidth is limited, and the associated communication inflates the energy budget of resource-constrained edge devices [21]. Remote or off-grid locations often cannot satisfy these connectivity and energy demands. Third, the economics of multi-fraction monitoring are dominated by the price of reference-grade instrumentation, although the same analytes can be recovered from low-cost optical sensors once a learned model encodes the PM size-fraction hierarchy [22–24]. Collectively, these gaps call for a compact virtual PM sensor that produces simultaneous PM10, PM2.5, and PM1.0 forecasts from one low-cost PM2.5 channel and executes entirely on the sensing node. A system of this kind could bring multi-fraction monitoring to locations where dedicated reference-grade analysers are impractical, while substituting one shared model for separate per-fraction forecasting models. Whether such consolidation can hold predictive accuracy while cutting model storage, inference time, and energy use on microcontroller-class hardware has yet to be demonstrated.</p><p>To close these gaps, this paper develops a single-channel, edge-oriented virtual PM sensing framework for the joint one-hour-ahead prediction of PM10, PM2.5, and PM1.0. The main contributions of this work are as follows:</p><p>1. Virtual PM sensor concept and triple-task joint-output formulation. A virtual PM sensor is introduced in which a single low-cost PM2.5 input channel drives the joint one-hour-ahead forecasting of PM10, PM2.5, and PM1.0. Because the PM size fractions are physically nested and their temporal dynamics are strongly correlated, one shared model can serve all three targets. The neural-network models realize this through a shared temporal backbone feeding three task-specific regression heads, while Random Forest realizes it through native multi-output regression.</p><p>2. Systematic evaluation of single-task against triple-task models across PM fractions and sites. Independent single-task baselines and the proposed triple-task framework are compared under an identical virtual-sensor input configuration, namely a 24-hour lagged PM2.5 sequence only. Four model configurations are assessed at two contrasting HCMC sites for all three PM size fractions, yielding 24 paired model-site-target comparisons.</p><p>3. Edge-deployment-oriented model selection with on-device verification. Deployment feasibility of the candidate models on ESP32-S3-class hardware is quantified in terms of model size, memory usage, latency, and energy. Replacing sequential single-task executions with one efficient joint prediction is shown to cut active inference latency and energy overhead substantially. Within this framework, RF-10 stands out as a highly efficient deployment option because m2cgen [25] transpiles it into pure-C if-else trees with negligible runtime memory overhead. Among the neural networks, the 1D-CNN is examined as a compact alternative under TFLite Micro INT8 with ESP-NN acceleration [26,27], while the LSTM baseline exposes the latency bottlenecks and numerical sensitivity that accompany recurrent architectures at the edge. On-device firmware benchmarks additionally confirm numerical agreement between ESP32-S3 Float32 execution and desktop Float32 reference outputs.</p><p>The rest of this paper is structured as follows. Related work is reviewed in Section 2. Section 3 details the proposed methodology, Section 4 reports and discusses the experimental results, and Section 5 concludes the paper.</p><h3>2. Related work</h3><h3>2.1. Deep learning for PM forecasting</h3><p>Recent PM2.5 forecasting research is dominated by Long Short-Term Memory (LSTM) networks. A weighted LSTM extended model (WLSTME) that accounts for inter-station spatial correlations across the Beijing-Tianjin-Hebei region was introduced by Xiao et al. [10] and outperformed three baselines: geographically weighted regression (GWR), a space–time support vector regression model (STSVR), and a non-weighted LSTM extended baseline (LSTME). In Qingdao, Bai et al. [12] coupled a 1D-CNN with LSTM and obtained an R2 of 0.91 for the hybrid model, against 0.83 for standalone LSTM. Huang and Kuo [13] devised a deeper CNN-LSTM model (APNet) evaluated on a Beijing PM2.5 dataset, and Chae et al. [28] predicted PM10 and PM2.5 simultaneously with interpolated convolutional networks, reaching R2 values above 0.97. A lightweight CNN-LSTM model tested on a public dataset was reported by Li et al. [16]. Systematic reviews covering 118 and 110 studies, by Zhou et al. [14] and Zaini et al. [15] respectively, both concluded that LSTM is the prevailing backbone and that recent gains arise mainly from signal decomposition and covariate engineering. Comparing MART, DFNN, and a hybrid LSTM for PM2.5 forecasting in Tehran, Karimian et al. [9] found the LSTM variant best (R2 = 0.80, RMSE = 8.91 µg/m3 at a 48-hour horizon), with accuracy improving as the horizon extended, an effect attributed to the use of forecast-time meteorological inputs rather than historical data alone. Teng et al. [29] merged empirical mode decomposition, sample entropy-based component screening, and a bidirectional LSTM to predict PM2.5 from 1 to 24 hours ahead, delivering high short-term accuracy while also following longer-term concentration trends. In nearly all of these studies the target is a single PM fraction, most commonly PM2.5; PM1.0 has drawn little attention as a standalone forecasting target, simultaneous prediction of all three fractions is rarely attempted, and performance is assessed offline without any evaluation on microcontroller-class hardware.</p><h3>2.2. Multi-task learning in air quality</h3><p>The foundational analysis of multi-task learning by Caruana [30] demonstrated that hard-parameter sharing across related tasks behaves as an implicit regularizer and strengthens generalization whenever the tasks benefit from common representations. Multi-output learning generalizes this idea, predicting several outputs from a common input while modeling the dependencies among them [31]. Within air-quality research, ensemble regressor chains for multi-target regression over five pollutant species were proposed by Masmoudi et al. [17]; a residual-GRU for multi-pollutant, multi-station prediction in London was developed by Wang et al. [18]; and Song and Stettler [20] inferred multiple pollutants at 1 km hourly resolution with a space-time learning network. In these studies, multi-task or multi-output learning chiefly serves to couple chemically distinct pollutants, different monitoring sites, or spatially distributed concentration fields. None addresses the nested size fractions of a single pollutant observed at one location, which is precisely the setting considered in this work.</p><p>The closest precedent to a size-fraction multi-task approach is the work of Xie et al. [19], who forecast PM2.5 and PM10 jointly using a shared backbone with bidirectional attention. Their EBAMTN model reached R2 values above 0.94 in three Chinese cities, but it covered only two PM fractions, drew on seven meteorological input channels, and contained approximately 2.1 million parameters. The complete size-fraction hierarchy PM10/PM2.5/PM1.0 has therefore never been examined in a shared-backbone multi-task setting.</p><h3>2.3. TinyML and edge deployment for environmental monitoring</h3><p>TinyML seeks to execute machine learning models on devices with restricted clock frequency, memory, and power budgets, typically hundreds of MHz, hundreds of KB of SRAM, and milliwatt-scale consumption [32,33]. Recent surveys chart the rapid expansion of TinyML methods and applications [34] and describe the end-to-end workflow for building and deploying machine learning models on microcontroller-class hardware [35]. With a dual-core Xtensa LX7 processor clocked at up to 240 MHz and 512 KB of SRAM, the ESP32-S3 is a representative microcontroller platform for such deployments. On this hardware class, TensorFlow Lite Micro (TFLM) [26] enables INT8-quantized inference, and the ESP-NN library [27] supplies SIMD-optimized kernels for convolution and matrix operations on Espressif processors. Tree-based models can be handled by m2cgen [25], which converts trained scikit-learn estimators into standalone C functions composed of nested if-else statements; no runtime interpreter is required, although flash usage grows with the number of trees and their depth.</p><p>The physical basis for large-scale environmental monitoring is supplied by low-cost optical PM sensors. The Plantower PMS5003 and the Sensirion SPS30, for example, output PM1.0, PM2.5, and PM10 natively and are widespread in low-cost monitoring and citizen-science networks. Once calibrated, their hourly PM2.5 readings have been shown to reach R2 values between 0.7 and 0.95 against reference instruments [22–24]. Work with these sensors nonetheless concentrates on measurement calibration or data collection rather than embedded forecasting, so little evidence exists on the memory, latency, and energy that a forecasting model consumes when it runs on the same low-cost hardware. Wardana et al. [36] ran a multi-output TinyML model that jointly predicts several air-quality and power parameters from multivariate historical inputs on one microcontroller, together with a separate imputation model, but they neither considered PM size-fraction forecasting nor compared the joint-output design against independent single-output models. Whether a compact virtual PM sensor can carry out multi-fraction forecasting directly on low-cost edge devices thus remains an open question.</p><h3>2.4. Virtual sensor</h3><p>A virtual sensor, also called a soft sensor or inferential sensor, is a computational model that infers a quantity which is expensive, unavailable, or impractical to measure directly from other observed variables [37]. The concept originated in the process-control literature, where Fortuna et al. [37] substituted soft sensors for hardware instruments in refinery distillation columns; Kadlec et al. [38] subsequently surveyed data-driven virtual-sensing methods built on neural networks, partial least-squares regression, and ensemble models. Environmental applications include correcting cross-sensitivity in gas sensors [39] and estimating PM2.5 from satellite observations [20,40].</p><p>The term virtual PM sensor is used here in the same sense: only PM2.5 is physically measured, and PM10 and PM1.0 are inferred as additional size-fraction outputs. Most PM virtual-sensing studies instead estimate a single pollutant or extrapolate concentrations to unmeasured locations, as in satellite-to-ground PM2.5 mapping [40]. The objective here is different: three co-located PM size fractions are estimated from one local input channel. This single-channel, multi-fraction inference distinguishes the proposed system from conventional virtual sensors and defines its central design objective.</p><h3>3. Methodology</h3><h3>3.1. Study sites and data acquisition</h3><p>Vietnam, a rapidly developing nation, spans a wide range of atmospheric conditions that typify the monitoring challenges of resource-constrained developing contexts. Evaluating the proposed framework under contrasting environmental conditions is the primary aim of the site selection, and extending the evaluation beyond a single location provides an initial view of model behavior under differing monitoring conditions. Two contrasting monitoring sites in Southern Vietnam were therefore chosen: a heavily trafficked urban zone and a coastal background reserve.</p><p>Nguyen Van Cu (NVC): Occupying the rooftop of an 11-story building at the University of Science, VNU-HCM, in District 5 of Ho Chi Minh City (HCMC) (10.763°N, 106.682°E), the NVC station stands roughly 10 metres from a major multi-lane roadway. It represents an urban environment dominated by primary traffic emissions together with nearby industrial activity [41,42]. Between August 2024 and February 2026, 10,059 valid hourly records of PM10, PM2.5, and PM1.0 were collected at NVC for this study.</p><p>Can Gio (CG): The CG station, by contrast, lies inside the Can Gio Mangrove Biosphere Reserve (10.412°N, 106.888°E), about 50 km southeast of central HCMC, and functions as a coastal background environment with few local anthropogenic emissions. Aerosol variability at CG is governed chiefly by meteorological conditions, including temperature and planetary boundary layer (PBL) height, together with regional transport from upwind zones [41,43]. Covering the same study period, the CG dataset contains 9,267 valid hourly records for the corresponding PM fractions.</p><p>The full PM size-fraction hierarchy, comprising PM10, PM2.5, and PM1.0, is recorded at both stations at hourly intervals, together with ancillary environmental variables including CO2 concentration (ppm), atmospheric pressure (hPa), relative humidity (%), and temperature (°C). All measurements were acquired with the Aerobox device developed by the Cloud and Aerosol Laboratory at National Central University, Taiwan, which is purpose-built and calibrated for ambient air-quality monitoring [43].</p><p><em>3.2. Data preprocessing</em></p><p>Rows with missing values in the PM10, PM2.5, or PM1.0 target columns were removed first, ensuring that every supervised label corresponds to a directly observed measurement. Short gaps that remained in the PM2.5 input channel were then closed by linear interpolation followed by backward and forward filling, the target columns containing no missing entries at this stage. Before any scaling, the data were split chronologically at an 80/20 boundary, consistent with accepted practice for temporally correlated data [44]. Scalers for the input and for the targets were fitted exclusively on the training partition and then applied to the test partition, preventing information leakage. Min-max scaling to [0, 1] was applied to the PM2.5 input, whereas the three target variables were normalized jointly with a single min-max scaler rather than separate target-specific scalers; this keeps their relative magnitudes intact in the scaled space while still allowing all three predicted fractions to be recovered through a single inverse-transform interface. Input sequences were then constructed by sliding a 24-hour look-back window over the PM2.5 input.</p><h3>3.3. Virtual PM sensor problem formulation</h3><p>At each time t, the model receives the matrix , which holds L consecutive hourly observations ending at t, with throughout this study and F denoting the number of input features. From this input, the model generates a one-step-ahead prediction vector,</p><p>A single input configuration implements the virtual-sensor setting throughout the paper: the input is a 24-hour lagged sequence of PM2.5 only, so that F = 1. Meteorological, chemical, and calendar channels are all omitted, and PM10 and PM1.0 are likewise excluded from the input to rule out target leakage. This restriction is intentional, since the central hypothesis of this work is that one low-cost PM2.5 channel carries enough information to reconstruct the full PM size-fraction hierarchy.</p><p>Two training configurations are contrasted under this common input setting. The baseline configuration trains three independent single-task models, one per target PM fraction, with no parameters shared across the three prediction tasks. The proposed triple-task configuration instead trains one joint-output model per architecture family to predict PM10, PM2.5, and PM1.0 simultaneously, the training loss being the unweighted sum of the three task-specific mean squared error (MSE) terms:</p><h3>3.4. Single-task and triple-task model architectures</h3><p>Within the common formulation of Section 3.3, four model configurations are examined: RF-10, RF-100, 1D-CNN, and LSTM. For each configuration, the independent single-task baseline is set against its triple-task counterpart, as sketched in Fig. 1.</p><p>Fig. 1. Conceptual overview of the single-task baseline and the proposed triple-task configuration in the virtual-sensor setting, with a 24-hour PM2.5-only lag window as input. Three independent models, one per PM fraction, constitute the single-task baseline, whereas a single joint multi-output model forecasts PM10, PM2.5, and PM1.0 simultaneously in the triple-task configuration. The joint model relies on a shared temporal backbone for CNN and LSTM and on native multi-output regression for Random Forest.</p><p>Each PM fraction receives its own model in the single-task baseline, giving three separate models per architecture family without any parameter sharing or common learned representations between prediction tasks. The proposed triple-task configuration instead learns the three outputs jointly from the same 24-hour PM2.5 input sequence. The neural-network architectures realize this joint prediction through a shared temporal backbone feeding three task-specific regression heads, each of which maps the common latent representation to one PM fraction. Random Forest realizes it through the multi-output regression mode native to scikit-learn’s RandomForestRegressor, where fitting proceeds directly on the three-target output matrix and every prediction returns a vector holding PM10, PM2.5, and PM1.0. Because the fractions originate from the same local aerosol field and represent nested particle-size classes, temporal variation observed in PM2.5 can supply predictive information for the coarser and finer fractions alike.</p><p>Two convolutional blocks form the 1D-CNN backbone, each applying a Conv1D layer with 64 and 32 filters, respectively, a kernel size of 3, and ReLU activation, followed by batch normalization and max-pooling, after which the output is flattened. One Dense(32, ReLU) layer followed by a Dense(1, Linear) output makes up every task head. In the LSTM backbone, two recurrent layers of 64 and 32 hidden units are stacked, batch normalization following each, before the network branches into per-head dense structures identical to those of the CNN.</p><p>For Random Forest, three independent RF estimators, one per PM fraction, form the single-task baseline, whereas the triple-task RF is fitted directly to the three-target output matrix, so that each tree shares a common split structure and stores vector-valued leaf predictions for PM10, PM2.5, and PM1.0. Ensemble size was chosen from an edge-deployment perspective rather than from accuracy alone, because generated C code grows with ensemble size and exceeds the memory budget of typical microcontroller-class hardware beyond a few hundred trees. After a range of ensemble sizes was explored, two RF configurations were retained in this study. RF-10, comprising 10 trees with a maximum depth of 8, serves as the ultra-lightweight deployment candidate. RF-100, comprising 100 trees at the same maximum depth, acts as a higher-capacity benchmark that quantifies whether a substantially larger ensemble yields a meaningful accuracy gain over RF-10. The accuracy-size trade-off of Random Forest deployment can thus be evaluated directly.</p><p>Table 1 lists the architecture configurations, hyperparameters, and model-complexity indicators. Trainable parameter counts apply only to the neural-network models; the complexity of Random Forest depends on tree count, tree depth, and the footprint of the generated C code, not on trainable parameters in the neural-network sense, so RF deployment size is reported separately with the ESP32-S3 profiling results.</p><p>Table 1</p><p>Summary of model architectures and hyperparameters.</p><p><strong>Model Config</strong></p><p><strong>Hyperparameters</strong></p><p><strong>Single-Task Params (×3)</strong></p><p><strong>Triple-Task Params</strong></p><p>RF-10</p><p>10 trees, max_depth = 8, bootstrap</p><p>N/A (3 RF ensembles)</p><p>N/A (1 multi-output RF)</p><p>RF-100</p><p>100 trees, max_depth = 8, bootstrap</p><p>N/A (3 RF ensembles)</p><p>N/A (1 multi-output RF)</p><p>1D-CNN</p><p>Backbone: Conv1D(64), BatchNorm, MaxPool, Conv1D(32), BatchNorm, MaxPool, Flatten</p><p>39,075</p><p>25,443</p><p>LSTM</p><p>Backbone: LSTM(64), BatchNorm, LSTM(32), BatchNorm</p><p>92,355</p><p>32,963</p><p>For edge deployment, the parameter efficiency of the triple-task design is a decisive advantage. As Fig. 2 shows, the triple-task CNN needs 25,443 parameters, whereas three aggregated single-task CNN models need 39,075. The effect is even stronger for LSTM, where sharing the recurrent backbone cuts the total parameter count from 92,355 to 32,963. Such reductions matter for microcontroller-class deployment because they shrink the model storage requirement and relieve the memory and flash pressure on resource-constrained hardware.</p><p>Fig. 2. Parameter counts of three aggregated single-task models (Single×3) versus one triple-task model. Sharing the backbone lowers the parameter count by 34.9% for CNN and 64.3% for LSTM, yielding a smaller model footprint for edge deployment.</p><h3>3.5. Training protocol and evaluation metrics</h3><p>Training and test partitions were formed by a chronological 80/20 split, as illustrated in Fig. 3, keeping the observations in temporal order and ruling out future-information leakage during training. All deep learning models were optimized with Adam (learning rate 10⁻3), a batch size of 64, gradient clipping at a clipnorm of 1.0, and at most 100 epochs. Early stopping monitored the validation loss with a patience of 10 epochs, the validation set being the final 10% chronological slice of the training partition. Random Forest models used the same hyperparameters in both task settings, covering tree count, maximum depth, random seed, and feature inputs.</p><p>Fig. 3. Complete PM2.5 time series at NVC (a) and CG (b), with the 80/20 chronological train-test boundary marked by the red dashed line.</p><p>Predictive performance was assessed per target with three complementary indicators: the coefficient of determination (R2), the root mean square error (RMSE), and the mean absolute error (MAE). R2 expresses the fraction of variance explained by the model, whereas RMSE and MAE express the prediction error in µg/m3. Equations (3), (4), and (5) define these indicators, respectively.</p><p>where n is the total number of samples, and denote the observed and predicted values of the sample, respectively, and is the mean of the observed values.</p><h3>3.6. Edge deployment pipeline</h3><p>Three deployment routes serve the candidate models. RF models are translated directly into a standalone C header file with m2cgen [25]. This conversion unrolls the learned tree structures into a flat sequence of elementary if-else statements, so the model runs on the microcontroller without any machine-learning runtime. The generated code resides in flash memory, and runtime memory is consumed mainly by input buffers and output variables rather than model parameters.</p><p>The CNN route converts each model to TensorFlow Lite, applies INT8 post-training quantization with a 500-sample calibration set, and compiles the quantized model into ESP32-S3 firmware together with the TFLM runtime [26] and ESP-NN acceleration [27]. This route tests whether a compact neural-network model can deliver low-latency multi-fraction PM forecasting on microcontroller-class hardware.</p><p>The LSTM models are likewise deployed on the ESP32-S3 and accelerated with ESP-NN where supported. The Xtensa LX7 processor, however, provides no acceleration for the recurrent kernels of TensorFlow Lite Micro, which raises inference latency well above the CNN and RF routes. Deployment targets a Seeed Studio XIAO ESP32-S3 Sense development board, whose dual-core Xtensa LX7 processor runs at 240 MHz alongside 512 KB of internal SRAM, 8 MB of PSRAM, plus 8 MB of flash memory. Section 4.3 reports the corresponding on-device profiling results.</p><h3>4. Results and analysis</h3><h3>4.1. Environmental characteristics of the monitoring sites</h3><p>Fig. 4 depicts the spatial layout of the monitoring network and establishes the geographical contrast between the high-density urban setting of NVC and the coastal background setting of CG.</p><p>Fig. 4. Geographic positions of the NVC station (central urban, 10.763°N, 106.682°E) and the CG station (coastal background, 10.412°N, 106.888°E) within Ho Chi Minh City.</p><p>Table 2 summarizes the site-level descriptive statistics. Pollution levels diverge clearly between the sites, with mean concentrations at NVC exceeding those at CG for every size fraction. Mean PM2.5 reaches 28.27 µg/m3 at NVC, close to double the 14.90 µg/m3 observed at CG, and mean PM10 is 31.94 µg/m3 at NVC against 17.42 µg/m3 at CG. Set against the WHO annual guidelines, mean PM2.5 over the study period stands at about 5.7 times the 5 µg/m3 threshold at NVC and roughly three times at CG; mean PM10 likewise sits near double the 15 µg/m3 threshold at NVC and marginally above it at CG. Ambient levels at both sites therefore remain above the WHO long-term guideline values, most strikingly for PM2.5 at NVC. These differences in concentration level frame the interpretation of the forecasting results.</p><p>Table 2</p><p>Summary statistics of hourly PM concentrations recorded at the two monitoring sites between August 2024 and February 2026.</p><p><strong>Variable</strong></p><p><strong>NVC (central urban)</strong></p><p><strong>CG (coastal background)</strong></p><p>Records (n)</p><p>10,059</p><p>9,267</p><p>PM10 (µg/m3), mean ± std</p><p>31.94 ± 19.26</p><p>17.42 ± 14.15</p><p>PM2.5 (µg/m3), mean ± std</p><p>28.27 ± 16.08</p><p>14.90 ± 11.80</p><p>PM1.0 (µg/m3), mean ± std</p><p>19.55 ± 10.30</p><p>11.05 ± 7.71</p><p>Supplementary Fig. S1 presents the pairwise relationships that underlie the PM size-fraction hierarchy: panels (a) and © plot PM1.0 against PM2.5, and panels (b) and (d) plot PM2.5 against PM10. At both sites the Pearson correlation between PM1.0 and PM2.5 exceeds 0.99, and every observation lies below the line, confirming that the physical hierarchy holds at the hourly scale. This regularity supplies the empirical rationale for the joint multi-output formulation adopted in this work: with inter-fraction dependencies this strong, one model can plausibly exploit structure shared by all three PM size fractions at once.</p><p>Beyond the site-level statistics, the hourly series expose contrasting pollution regimes. Short-lived PM2.5 peaks above 80 µg/m3 recur at NVC and account for approximately 0.92% of all hourly records. Although such events form only a small share of the dataset, they reflect the site’s exposure to intense, localized primary emissions within the urban environment. CG instead shows a smoother, lower baseline that is occasionally interrupted by sharp episodic events; its maximum PM2.5 of 131.4 µg/m3 actually exceeds the NVC maximum of 108.4 µg/m3. Even a low-background coastal site can therefore experience severe short-term pollution episodes.</p><p>To reveal seasonal and synoptic-scale patterns that the hourly records obscure, Fig. 5 presents daily-mean PM10, PM2.5, and PM1.0 concentrations with 7-day rolling trends at both sites across the entire study period. Concentrations at NVC are generally elevated in the dry season from December to April, when daily PM10 frequently surpasses 50 µg/m3, and all PM fractions decline during the wet season from May to November, plausibly through the washout effect of increased rainfall [6,7]. The gaps between fractions stay comparatively stable, so the nested PM hierarchy persists across seasons. The daily series at CG combines a lower baseline with abrupt episodic spikes, for instance in December 2025, consistent with regional transport events from upwind industrial zones [43,45]. Seasonal variability is relatively larger at CG, whose coefficient of variation (CV) is roughly 30% higher than that of NVC; this elevated CV matches a low coastal background interrupted by intermittent transport-driven concentration increases.</p><p>Fig. 5. Daily means of PM10, PM2.5, and PM1.0 at NVC (a) and CG (b), covering the whole study period, August 2024 to February 2026.</p><p>The diurnal profiles in Fig. 6 sharpen the picture of source-related temporal structure at the two sites. At NVC, all three PM fractions follow a marked unimodal pattern, rising steeply between 06:00 and 09:00 during the morning rush hour and then declining gradually through the day without a pronounced evening surge. For PM10, the spread between the highest and lowest hourly means of the diurnal profile is approximately 10–15 µg/m3. This repeatable, quasi-deterministic daily signal provides strong autoregressive information that benefits every model configuration. The diurnal profile at CG is considerably weaker and less organized: its amplitude stays under 5 µg/m3, with a modest peak near 07:00–10:00 as the nocturnal boundary layer erodes. The regular traffic-influenced cycle at NVC consequently offers a more dependable autoregressive template for the 24-hour input window [46], whereas variability at CG is shaped more by boundary-layer dynamics, regional transport, and occasional nearby open burning, and is correspondingly less well represented by recent PM2.5 history [47].</p><p>Fig. 6. Diurnal cycles of hourly mean PM10, PM2.5, and PM1.0 concentrations at NVC (a) and CG (b), contrasting the pronounced unimodal profile at NVC with the weaker, more variable pattern at CG.</p><p>In summary, although the PM fractions are tightly coupled at both locations, the two monitoring sites embody distinct forecasting regimes. NVC is a higher-concentration, traffic-driven urban environment with a strong, repeatable diurnal cycle, whereas CG is a lower-concentration coastal background environment whose variability stems more from episodic transport events than from a stable daily rhythm. The two sites are therefore expected to differ not only in pollution level but also in how well recent history alone can predict their PM concentrations.</p><h3>4.2. Single-task versus triple-task forecasting performance</h3><p>This section quantifies how site-level predictability translates into forecasting accuracy by comparing single-task and triple-task models systematically at both locations. The prediction behavior of the proposed triple-task model is first illustrated qualitatively, with Random Forest as the representative example, before the single-task versus triple-task comparison is quantified over all model configurations. RF-100 serves as the visual representative because its high capacity provides the cleanest baseline for judging predicted temporal patterns; RF-10 nonetheless remains the lightweight RF configuration intended for practical ESP32-S3 deployment. Tracking behavior for RF-10, CNN, and LSTM is qualitatively similar, so RF-100 offers a representative illustration across model configurations.</p><p>Fig. 7 sets the triple-task RF-100 predictions against the observations across a representative 200-hour stretch of the test set. Within this window at NVC, the model follows all three PM fractions at once and stays broadly phase-aligned with the observed diurnal cycle. At CG, it captures the timing of episodic peaks well but understates their magnitude, most visibly for PM10 and PM2.5 during the sharpest transport-related event. Visual inspection also shows that the triple-task outputs remain internally consistent: when observed PM10 rises, the predicted PM2.5 and PM1.0 generally rise in step, with no crossings or hierarchy inversions.</p><p>Fig. 7. Observed versus predicted PM concentrations from the triple-task RF-100 model over a representative 200-hour window of the test set. Rows: NVC (top) and CG (bottom). Columns, left to right: simultaneous forecasts of PM10, PM2.5, and PM1.0.</p><p>Scatter plots of predicted against observed values for the triple-task RF-100 model, spanning the two sites and three PM fractions, appear in Fig. 8. With the 1:1 reference line and annotated R2 and RMSE values, the predictions cluster tightly along the diagonal over most of the observed concentration range at both sites. At NVC, a slight under-prediction tendency appears for PM2.5 values beyond 60 µg/m3, which correspond to extreme rush-hour build-ups larger than the typical diurnal amplitude that the 24-hour lookback can represent. At CG, the scatter widens in the upper tails of PM2.5 and PM10, matching the episodic transport events discussed in Section 4.1, yet stays comparatively tight for PM1.0 across the full range. At NVC, the triple-task RF-100 model attains R2 values of 0.819, 0.816, and 0.817 for PM10, PM2.5, and PM1.0, respectively; at CG, the corresponding values are 0.704, 0.726, and 0.802.</p><p>Fig. 8. Scatter of predicted against observed values for the triple-task RF-100 model, with sites in rows (NVC top, CG bottom) and PM fractions in columns (PM10, PM2.5, PM1.0); each panel carries its R2 and RMSE annotation.</p><p>Since the triple-task model emits three outputs at once, adherence to the expected PM size hierarchy can be verified directly. Fewer than 0.5% of test-set samples at either monitoring site violate the physical hierarchy, defined as predicted PM1.0 exceeding predicted PM2.5 or predicted PM2.5 exceeding predicted PM10. This consistency plausibly stems from the joint min-max scaling of the three targets combined with the multi-output learning formulation, which lets relationships among the jointly predicted outputs be represented within a common model [31] and may help encode the cross-fraction structure of the PM size spectrum, instead of treating the three fractions as unrelated regression targets.</p><p>Table 3 reports the complete forecasting results of the single-task and triple-task settings for every architecture, target, and monitoring site under the virtual-sensor configuration, in which PM2.5 is the sole input channel . RMSE anchors the comparison, being expressed in the original concentration unit (µg/m3) and weighting heavily the large errors that arise during pollution peaks; MAE and R2 are tabulated in Table 3 for completeness. Grouped-bar RMSE and R2 comparisons are provided as Supplementary Figs. S2 and S3 to make the model-to-model and site-to-site patterns easier to discern.</p><p>Table 3</p><p>Prediction performance of the single-task baseline and the proposed triple-task configuration under the virtual-sensor input using 24-hour lagged PM2.5 only.</p><p><strong>Site</strong></p><p><strong>Target</strong></p><p><strong>Model</strong></p><p><strong>Single RMSE</strong></p><p><strong>Single MAE</strong></p><p><strong>Single R2</strong></p><p><strong>Triple RMSE</strong></p><p><strong>Triple MAE</strong></p><p><strong>Triple R2</strong></p><p>NVC</p><p>PM10</p><p>RF-10</p><p>7.947</p><p>5.561</p><p>0.815</p><p>7.993</p><p>5.566</p><p>0.813</p><p>RF-100</p><p>7.830</p><p>5.457</p><p>0.821</p><p>7.859</p><p>5.468</p><p>0.819</p><p>CNN</p><p>8.249</p><p>5.988</p><p>0.801</p><p>8.487</p><p>6.364</p><p>0.789</p><p>LSTM</p><p>7.611</p><p>5.490</p><p>0.830</p><p>7.776</p><p>5.765</p><p>0.823</p><p>PM2.5</p><p>RF-10</p><p>6.598</p><p>4.587</p><p>0.803</p><p>6.513</p><p>4.559</p><p>0.808</p><p>RF-100</p><p>6.394</p><p>4.477</p><p>0.815</p><p>6.383</p><p>4.464</p><p>0.816</p><p>CNN</p><p>6.476</p><p>4.694</p><p>0.810</p><p>6.787</p><p>4.987</p><p>0.792</p><p>LSTM</p><p>6.385</p><p>4.472</p><p>0.816</p><p>6.352</p><p>4.699</p><p>0.818</p><p>PM1.0</p><p>RF-10</p><p>4.188</p><p>2.953</p><p>0.808</p><p>4.172</p><p>2.945</p><p>0.810</p><p>RF-100</p><p>4.102</p><p>2.890</p><p>0.816</p><p>4.092</p><p>2.891</p><p>0.817</p><p>CNN</p><p>4.041</p><p>2.919</p><p>0.822</p><p>4.300</p><p>3.139</p><p>0.798</p><p>LSTM</p><p>4.074</p><p>2.979</p><p>0.819</p><p>4.052</p><p>2.935</p><p>0.821</p><p>CG</p><p>PM10</p><p>RF-10</p><p>9.345</p><p>4.648</p><p>0.697</p><p>9.362</p><p>4.683</p><p>0.696</p><p>RF-100</p><p>9.220</p><p>4.492</p><p>0.705</p><p>9.226</p><p>4.515</p><p>0.704</p><p>CNN</p><p>9.004</p><p>4.739</p><p>0.719</p><p>8.870</p><p>4.659</p><p>0.727</p><p>LSTM</p><p>9.042</p><p>5.105</p><p>0.716</p><p>8.960</p><p>4.786</p><p>0.721</p><p>PM2.5</p><p>RF-10</p><p>7.437</p><p>3.697</p><p>0.720</p><p>7.457</p><p>3.709</p><p>0.718</p><p>RF-100</p><p>7.340</p><p>3.580</p><p>0.727</p><p>7.359</p><p>3.589</p><p>0.726</p><p>CNN</p><p>7.309</p><p>3.767</p><p>0.729</p><p>7.172</p><p>3.827</p><p>0.739</p><p>LSTM</p><p>7.194</p><p>3.822</p><p>0.738</p><p>7.371</p><p>4.208</p><p>0.725</p><p>PM1.0</p><p>RF-10</p><p>3.882</p><p>2.372</p><p>0.793</p><p>3.869</p><p>2.391</p><p>0.794</p><p>RF-100</p><p>3.790</p><p>2.307</p><p>0.803</p><p>3.799</p><p>2.317</p><p>0.802</p><p>CNN</p><p>4.329</p><p>2.602</p><p>0.742</p><p>3.863</p><p>2.485</p><p>0.795</p><p>LSTM</p><p>4.348</p><p>2.924</p><p>0.740</p><p>3.949</p><p>2.452</p><p>0.785</p><p>Fig. 9 maps where triple-task learning helps or hurts through a ΔRMSE heatmap, with ΔRMSE defined as RMSETriple — RMSESingle. Negative cells mark an improvement from triple-task learning, whereas positive cells mark performance degradation. A clear site-dependent pattern emerges. At CG, the deep-learning models draw substantial benefit from joint learning, reflected in predominantly negative ΔRMSE values; at NVC, the CNN shows moderate trade-offs with several positive cells. The RF models stay essentially neutral at both sites, with ΔRMSE values near zero.</p><p>Fig. 9. ΔRMSE heatmap contrasting triple-task and single-task models (RF denotes RF-100). Green (negative) cells indicate gains from triple-task learning; orange/red (positive) cells indicate degradation. (a) NVC. (b) CG.</p><p>Reading Table 3 together with the ΔRMSE heatmap in Fig. 9 shows that triple-task learning retains the predictive accuracy of the independent single-task models. Over all 24 paired model–site–target comparisons, the absolute ΔRMSE between the two settings stays negligible, averaging only 0.11 µg/m3, so the joint-output formulation imposes no systematic accuracy penalty. And because one PM2.5 input and one prediction call yield all three PM forecasts, the triple-task architecture dispenses with three separate models and inference routines.</p><p>Among the four model configurations, RF exhibits the most stable behavior under the triple-task setting. Most RF ΔRMSE values sit near zero, the largest absolute change being 0.08 µg/m3 for RF-10 on PM2.5 at NVC. RF-100, whose shared tree structures store vector-valued leaf predictions, virtually matches its single-task baseline for every target at both sites, with absolute ΔRMSE at most 0.03 µg/m3. Within the triple-task setting, RF-10 performs on par with RF-100 across all targets and sites: the R2 differences stay within 0.01, and the RMSE differences span 0.07 to 0.14 µg/m3 (for CG PM1.0, for instance, the corresponding RMSE values are 3.87 and 3.80 µg/m3). Growing the ensemble from 10 to 100 trees therefore buys only marginal predictive accuracy under the evaluated conditions.</p><p>The deep-learning models display a more nuanced pattern that highlights the regularizing influence of multi-task learning. Episodic variability at CG makes the submicron fraction difficult to forecast in isolation, and there the shared backbone delivers marked gains: PM1.0 RMSE drops by a notable 0.47 µg/m3 for the triple-task CNN and 0.40 µg/m3 for the triple-task LSTM, with respective R2 gains of 0.053 and 0.045. The shared representation pays off in this setting because it learns boundary-layer dynamics common to all three fractions, thereby regularising PM1.0 prediction, which would otherwise rest on a sparse training signal. At NVC, the CNN triple-task model degrades moderately, with respective ΔRMSE values of +0.24 and +0.31 µg/m3 for PM10 and PM2.5. Such behavior matches the gradient-competition trade-off known to arise under hard-parameter sharing [48]. Nevertheless, the degradation stays modest in absolute terms and is outweighed by the practical benefit of a unified model.</p><p>The performance gap between NVC and CG appears to reflect temporal structure rather than absolute pollution level. With PM2.5 history as the only input, next-hour predictability rests on how strongly the preceding 24 h encode the coming variation. The recurring daily structure at NVC supplies a stable autoregressive template, whereas the episodic meteorological and transport-related variability at CG is captured less reliably within the same window. Single-task R2 for PM10 accordingly peaks at 0.830 at NVC, versus 0.719 at CG. That the single-task and triple-task results differ similarly little at both sites further ties the weaker accuracy at CG to its weaker autoregressive structure, not to the joint-output formulation.</p><h3>4.3. Edge deployment profiling on ESP32-S3</h3><p>Profiling on the Seeed Studio XIAO ESP32-S3 Sense development board establishes whether the candidate models are deployable and how they behave at runtime, covering model storage, compute-only latency, runtime memory use, inference-level current draw and energy consumption, and desktop-to-device numerical consistency. The evaluation spans the RF models in native C, the CNN and LSTM under TFLM in Float32 and INT8, and ESP-NN acceleration where INT8 kernels support it.</p><p>Table 4 compiles the ESP32-S3 profiling results for compute-only inference latency, runtime SRAM use, and flash footprint. Latency was measured without the current-sensing hardware attached, so that the timing runs could be repeated efficiently across runtime variants. Rows pair one model configuration with one runtime variant; the triple-task setting, which deploys a single model, and the single-task setting, which requires three independent models, appear as separate entries. The latency in this table wraps only the core prediction call and is averaged over the full test set for each site: for the triple-task setting it is the mean forward-execution time of the joint-output model, and for the single-task setting it is the mean for one representative single-task model. SRAM and flash figures follow the same convention, reflecting a single representative model instead of the aggregate over the three single-task models. In practice, obtaining all three PM fractions demands three such prediction calls and three model files, so the task setting is labelled simply as Single.</p><p>Several observations follow from the compute-only profiling. When three single-task models merge into one joint model, flash shrinks in all four configurations: by 47–48% for RF-10 and RF-100, 38.3% for CNN, and 65.3% for LSTM. Beyond this shared benefit, RF-10 under native C inference is by a wide margin the fastest and most memory-lean deployment path. In isolated core-prediction timing, RF-10 completes in only 0.04–0.06 ms at both sites, its runtime SRAM demand is negligible, and its triple-task flash footprint stays below 100 KB. RF-100 also computes quickly, with latency around 2.78–2.85 ms, but its flash cost is far higher than that of RF-10, reaching 884.81 KB for the NVC triple-task model. RF-100 therefore serves mainly as an accuracy-size reference rather than the preferred embedded model.</p><p>The CNN results demonstrate that quantisation cuts memory usage but does not by itself cut latency under the reference TFLM kernels. INT8 quantisation shrinks the triple-task CNN from 108.69 KB to 38.89 KB of flash and from 15.79 KB to 6.86 KB of SRAM, yet compute-only latency climbs from about 15.65–15.69 ms (Float32) to about 38.64–38.73 ms (INT8) as long as only reference TFLM kernels are used. The benefit of INT8 materializes only once ESP-NN acceleration is enabled, the triple-task CNN latency then dropping to 8.11 ms at NVC and 7.96 ms at CG. On the ESP32-S3, INT8 quantisation therefore works best when paired with hardware-aware SIMD kernels.</p><p>Table 4</p><p>ESP32-S3 profiling of compute-only latency, runtime SRAM, and flash footprint across runtime variants.</p><p><strong>Site</strong></p><p><strong>Model</strong></p><p><strong>Task setting</strong></p><p><strong>Runtime</strong></p><p><strong>Precision</strong></p><p><strong>Latency (ms)</strong></p><p><strong>SRAM (KB)</strong></p><p><strong>Flash footprint (KB)</strong></p><p>NVC</p><p>RF-10</p><p>Single</p><p>Native C</p><p>Float32</p><p>0.05</p><p>≈ 0</p><p>57.58</p><p>Triple</p><p>Native C</p><p>Float32</p><p>0.06</p><p>≈ 0</p><p>90.53</p><p>RF-100</p><p>Single</p><p>Native C</p><p>Float32</p><p>2.80</p><p>≈ 0</p><p>564.73</p><p>Triple</p><p>Native C</p><p>Float32</p><p>2.83</p><p>≈ 0</p><p>884.81</p><p>CNN</p><p>Single</p><p>TFLM</p><p>Float32</p><p>12.30</p><p>15.18</p><p>58.72</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>15.65</p><p>15.79</p><p>108.69</p><p>Single</p><p>TFLM</p><p>INT8</p><p>37.96</p><p>6.22</p><p>24.71</p><p>Triple</p><p>TFLM</p><p>INT8</p><p>38.73</p><p>6.86</p><p>38.89</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>7.63</p><p>18.28</p><p>24.71</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>8.11</p><p>18.93</p><p>38.89</p><p>LSTM</p><p>Single</p><p>TFLM</p><p>Float32</p><p>146.76</p><p>85.77</p><p>244.49</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>147.44</p><p>86.38</p><p>254.52</p><p>Single</p><p>TFLM</p><p>INT8</p><p>94.96</p><p>68.40</p><p>246.63</p><p>Triple</p><p>TFLM</p><p>INT8</p><p>95.18</p><p>69.05</p><p>250.88</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>66.44</p><p>68.40</p><p>246.63</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>66.55</p><p>69.05</p><p>250.88</p><p>CG</p><p>RF-10</p><p>Single</p><p>Native C</p><p>Float32</p><p>0.04</p><p>≈ 0</p><p>54.11</p><p>Triple</p><p>Native C</p><p>Float32</p><p>0.05</p><p>≈ 0</p><p>84.65</p><p>RF-100</p><p>Single</p><p>Native C</p><p>Float32</p><p>2.85</p><p>≈ 0</p><p>530.87</p><p>Triple</p><p>Native C</p><p>Float32</p><p>2.78</p><p>≈ 0</p><p>846.81</p><p>CNN</p><p>Single</p><p>TFLM</p><p>Float32</p><p>12.36</p><p>15.18</p><p>58.72</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>15.69</p><p>15.79</p><p>108.69</p><p>Single</p><p>TFLM</p><p>INT8</p><p>37.97</p><p>6.22</p><p>24.71</p><p>Triple</p><p>TFLM</p><p>INT8</p><p>38.64</p><p>6.86</p><p>38.89</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>7.57</p><p>18.28</p><p>24.71</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>7.96</p><p>18.93</p><p>38.89</p><p>LSTM</p><p>Single</p><p>TFLM</p><p>Float32</p><p>149.34</p><p>85.77</p><p>244.49</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>149.72</p><p>86.38</p><p>254.52</p><p>Single</p><p>TFLM</p><p>INT8</p><p>94.87</p><p>68.40</p><p>246.63</p><p>Triple</p><p>TFLM</p><p>INT8</p><p>95.14</p><p>69.05</p><p>250.88</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>65.68</p><p>68.40</p><p>246.63</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>65.26</p><p>69.05</p><p>250.88</p><p>The LSTM, deployed on the ESP32-S3 with ESP-NN acceleration for its supported feed-forward operations, retained acceptable predictive performance yet remained the least favourable option for latency-critical deployment. The triple-task LSTM needs approximately 147–150 ms in Float32, around 95 ms under TFLM INT8, and around 65–67 ms once ESP-NN accelerates the supported operations. Even with INT8 ESP-NN acceleration in place, its compute-only inference time is still about eight times that of the accelerated CNN and orders of magnitude above RF-10 native C. This behavior stems from the inherently sequential recurrent computation over the 24-step input window and makes LSTM a weaker fit than RF-10 or the accelerated CNN where ESP32-S3 latency budgets are tight. In most runtime variants, triple-task compute-only latency remained close to that of a single representative single-task model.</p><p>Reliability adds a further requirement beyond latency and memory footprint: the embedded implementation must reproduce the desktop reference with minimal numerical drift. The desktop-to-device numerical consistency of the triple-task CNN and LSTM models was therefore evaluated under Float32 execution, taking the desktop Python Float32 results as the reference against the corresponding Float32 outputs executed on the ESP32-S3. Comparing MAE values after de-normalization to physical units checks whether the converted models, executed through the microcontroller runtime, faithfully match the desktop reference.</p><p>Desktop and ESP32-S3 MAE values for the CNN are nearly identical, with relative differences below 0.001% for every site–target combination, so the Float32 CNN deployed through TensorFlow Lite Micro tracks the desktop reference with negligible numerical drift [26]. These discrepancies also lie far below the roughly ±10% measurement uncertainty typical of low-cost optical PM sensors [22–24]. The LSTM shows larger deviations for selected targets, notably PM10, whose relative MAE differences reach approximately 9.77% at NVC and 8.32% at CG, behavior that may trace back to the recurrent structure of LSTM inference. Floating-point non-associativity and nonlinear activations are known to introduce numerical variability in deep-learning inference across platforms [49], and the feedback-based structure of LSTM may amplify such effects relative to feedforward architectures like CNN: small numerical differences arising from the embedded runtime, the floating-point implementation, or the nonlinear gate operations can propagate through the hidden and cell states over the 24 time steps. The larger desktop-to-device discrepancy of the LSTM compared with the CNN may therefore reflect greater sensitivity to platform-dependent numerical drift in the present comparison. RF inference, implemented as native C code without sequential floating-point accumulation, is expected to stay numerically consistent with the desktop reference. Among the neural architectures, the CNN thus offers the stronger desktop-to-device consistency, while the LSTM remains a viable option where a larger latency budget and careful device-side validation are acceptable.</p><p>After the compute-only profiling, current consumption and inference energy were measured with the setup shown in Fig. 10, which records the supply-current waveform together with reference timing while each deployed configuration performs genuine on-device inference. Fig. 10(a) shows the shunt-based measurement chain: the INA226 senses the voltage drop across the shunt resistor, and the STM32F1 Blackpill reads the digitised current samples via I2C and forwards them over a USB-to-UART link to the host PC. Fig. 10(b) shows the physical arrangement.</p><p>(a) Block diagram</p><p>(b) Measurement setup</p><p>Fig. 10. Setup used for ESP32-S3 current-consumption profiling. (a) Block diagram of the shunt-based measurement configuration, in which the INA226 module senses the voltage drop across the shunt resistor and the STM32F1 Blackpill relays the digitised current samples to the host PC through a USB-to-UART interface. (b) Physical arrangement showing the external power supply, the ESP32-S3 device under test, the INA226 current-sensing module, the STM32F1 Blackpill data logger, and the USB-to-UART module.</p><p>For CNN and LSTM, each recorded waveform covers a single inference run, whether of the corresponding triple-task model or of one of the three single-task models (PM10, PM2.5, PM1.0). Fig. 11 displays the measured current-consumption profiles of the ESP32-S3 node at NVC under the CNN-Float32 deployment setting, with four representative traces comprising one triple-task inference run and three single-task runs for PM10, PM2.5, and PM1.0. Idle and active regions are clearly separable in every trace, so the inference interval can be identified; the annotations report the inference time and mean active current per trace.</p><p>Individually, the single-task CNN models need 13.4 ms, 12.3 ms, and 13.4 ms for PM10, PM2.5, and PM1.0, respectively, whereas the triple-task CNN delivers the joint PM10/PM2.5/PM1.0 forecast within 17.8 ms. Average active currents differ little across cases, spanning 60.9 mA to 62.5 mA. Table 5 gathers inference time, average active current, power, and energy for both deployment settings (triple-task and Single ×3) at NVC. Tables 4 and 5 both report inference time, but the values come from separate profiling runs under different measurement conditions: Table 5 reuses the on-chip timing setup of Table 4 while also logging supply current, which lets per-inference energy be computed together with latency. The small differences between corresponding latency values across the four model configurations therefore represent ordinary run-to-run variability rather than a methodological discrepancy.</p><p>The per-call execution of RF-10 and RF-100 is comparable to or shorter than the sampling period of the current-sensing chain, so their inference time and average current were derived differently: the deployed model was run over the full test set on the ESP32-S3, per-sample latency was taken directly from the on-chip timer, and current was logged continuously throughout. Summing the three separately measured single-task runs (Single ×3) at NVC gives 0.167 ms and 0.039 mJ for RF-10, against 0.065 ms and 0.015 mJ for a single triple-task run. RF-100 falls similarly, 8.55 ms and 1.71 mJ becoming 2.91 ms and 0.58 mJ; the CNN goes from 39.10 ms and 8.05 mJ to 17.80 ms and 3.59 mJ, and the LSTM from 437.8 ms and 83.10 mJ to 146.3 ms and 27.72 mJ. The average active current shifts only slightly between the two settings for every model, indicating that the measured energy savings arise chiefly from the shorter total active time when one joint call replaces three single-task calls, with active current staying largely unchanged. The CG measurements reproduce the same qualitative pattern.</p><p>Fig. 11. Representative current-consumption traces of the ESP32-S3 node during CNN Float32 inference at NVC, comparing one joint triple-task run with three independent single-task runs for PM10, PM2.5, and PM1.0; active-window duration and average active current are annotated on each trace.</p><p>Table 5</p><p>Inference current and energy summary for ESP32-S3 deployment at NVC.</p><p><strong>Site</strong></p><p><strong>Model</strong></p><p><strong>Task setting</strong></p><p><strong>Runtime</strong></p><p><strong>Inference time (ms)</strong></p><p><strong>Average current (mA)</strong></p><p><strong>Average power (mW)</strong></p><p><strong>Energy/inference cycle (mJ)</strong></p><p>NVC</p><p>RF-10</p><p>Triple</p><p>Native C</p><p>0.065</p><p>70.7</p><p>233.67</p><p>0.015</p><p>Single ×3</p><p>Native C</p><p>0.167</p><p>71.67</p><p>236.88</p><p>0.039</p><p>RF-100</p><p>Triple</p><p>Native C</p><p>2.91</p><p>60.3</p><p>199.65</p><p>0.58</p><p>Single ×3</p><p>Native C</p><p>8.55</p><p>60.27</p><p>199.55</p><p>1.71</p><p>CNN</p><p>Triple</p><p>TFLM</p><p>17.8</p><p>60.9</p><p>202.01</p><p>3.59</p><p>Single ×3</p><p>TFLM</p><p>39.1</p><p>62.1</p><p>205.99</p><p>8.05</p><p>LSTM</p><p>Triple</p><p>TFLM</p><p>146.3</p><p>57.1</p><p>189.49</p><p>27.72</p><p>Single ×3</p><p>TFLM</p><p>437.8</p><p>57.2</p><p>189.82</p><p>83.10</p><h3>4.4. Overall performance summary</h3><p>With forecasting accuracy quantified in Section 4.2 and hardware behavior detailed in Section 4.3, Fig. 12 condenses the two most deployment-critical findings into a single view. In every configuration, replacing three back-to-back single-task runs with a single triple-task run accelerates on-device inference markedly and yields energy savings of comparable magnitude. The advantage holds across all three architecture families, triple-task inference running consistently faster in each of the four configurations: CNN gains the least in relative terms, RF-100 and LSTM gain the most, and RF-10 keeps the lowest absolute latency throughout. Since the average active current is nearly unchanged between the two configurations, the energy savings follow directly from the shorter execution window, with no modification to the hardware or operating frequency required.</p><p>Fig. 12. Edge-deployment highlights at NVC for the proposed triple-task framework against the single-task baseline, the latter executed as three sequential inference calls on the ESP32-S3 microcontroller. (a) Per-variant inference latency (ms), with triple-task speedup factors ranging from 2.2 to 3.0. (b) Energy per inference cycle (mJ), showing proportional reductions that track the latency gains without any change to the hardware or operating frequency.</p><p>These efficiency gains come without a systematic loss of predictive performance. One triple-task model forecasts all three PM fractions with RMSE and R2 on par with three dedicated single-task models at both sites, in some cases marginally better, while each forecasting cycle consumes less time and energy. For low-cost edge nodes estimating several PM size fractions under limited computational resources, this pairing of comparable accuracy with lower deployment cost turns multi-task learning into a tangible practical advantage.</p><h3>4.5. Discussion</h3><p>The findings substantiate the physical and statistical rationale for triple-task PM forecasting. As nested size fractions, PM1.0, PM2.5, and PM10 respond to atmospheric processes in a coupled fashion, although with magnitudes that vary with particle size, source regime, and meteorological conditions. Empirical evidence of this coupling appears in the strong pairwise relationships and hierarchy-preserving scatter patterns of Section 4.1. The triple-task formulation capitalizes on that structure by learning a common temporal representation while outputs remain task-specific per fraction; hence the shared CNN and LSTM models gain most at CG, and especially for PM1.0, where the signal is weaker, more variable, and harder to learn in isolation. At NVC, whose diurnal signal is already strong and regular, sharing helps less, and the CNN displays the gradient-competition trade-off already noted in Section 4.2.</p><p>The R2 values reported here fall below those typically achieved by prior PM forecasting studies that incorporate meteorological or multi-pollutant inputs, since richer input information generally raises forecast accuracy [9,19,29]. The input in this study was deliberately confined to a single 24-hour PM2.5 history, and, like the RF ensemble size, the CNN and LSTM backbones were sized compactly for edge deployment instead of being scaled up for maximum accuracy. The reported R2 consequently reflects an intentionally minimal configuration, not a limitation of the triple-task formulation.</p><p>The hierarchy-violation rate below 0.5% complements the accuracy metrics. Independent single-task models carry no structural guarantee that [PM1.0] ≤ [PM2.5] ≤ [PM10]; the triple-task formulation encodes this physical ordering by construction, and the low violation rate confirms that the constraint holds in practice.</p><p>RF sidesteps this gradient-competition trade-off, its tree-based multi-output structure sharing split geometry with no gradients to compete [31]. RF also stays highly competitive because the one-hour-ahead forecasting task is rich in autoregressive information. With a 24-hour PM2.5 lag window, much of the short-term PM evolution follows from recent concentration history and the recurring daily structure, particularly at NVC, so a compact tree ensemble can approximate local temporal regimes effectively without a deep temporal model. Taken together, the results of Sections 4.2 and 4.3 identify RF-10 as offering the best practical balance among the four configurations evaluated, weighing accuracy, latency, memory footprint, and firmware simplicity.</p><p>Cost is a further dimension: beyond accuracy and computational efficiency, the proposed virtual-sensor formulation carries direct implications for dense air-quality monitoring. With one low-cost PM2.5 sensing channel as the sole input, estimates of PM10, PM2.5, and PM1.0 require neither multiple PM input channels nor reference-grade instruments at every location. Pairing a low-cost optical PM sensor with an ESP32-S3-class microcontroller therefore yields a compact forecasting node that generates one-hour-ahead estimates of all three PM fractions. Such a node cannot substitute for regulatory-grade monitors, but it can complement them by expanding spatial coverage at substantially lower hardware cost, a point of particular relevance for megacities where dense reference-grade networks are economically difficult to deploy. Obtaining PM1.0 at no additional sensing cost is especially valuable: this fraction is health-relevant yet rarely reported by routine monitoring networks, and it offers insight into submicron particle dynamics, which are frequently linked to combustion and secondary-aerosol processes.</p><p>The deployment results confirm that the proposed virtual-sensor framework is practical on ESP32-S3-class hardware. Table 4 identifies RF-10 as the most efficient runtime option, and the CNN becomes a workable neural option under hardware-aware execution: INT8 CNN inference was slower than Float32 with the reference TFLM kernels, whereas ESP-NN acceleration brought its latency down to approximately 8 ms. LSTM stays less appropriate for the primary latency-critical deployment setting because recurrent inference over the 24-step input sequence incurs much higher latency. The Float32 cross-check further shows the CNN implementation reproducing the desktop reference with negligible numerical drift, while for selected PM10 targets the LSTM shows wider desktop-to-device gaps, in keeping with the numerical sensitivity of recurrent state propagation.</p><p>Despite these promising results, several limitations of the proposed framework qualify the conclusions and mark directions for further investigation. First, the two sites were deliberately chosen to contrast urban traffic and coastal background regimes; they capture neither the full spatial variability of HCMC nor the conditions of other cities, so validation at additional sites within HCMC and across other Southeast Asian cities is needed. Second, all PM fractions derive from a single low-cost optical sensing platform; co-location with reference-grade instruments would strengthen the evaluation, particularly for PM1.0 and PM10, following field-calibration approaches demonstrated for low-cost PM sensor networks in comparable resource-constrained contexts [50]. Third, because the virtual-sensor input consists solely of a 24-hour PM2.5 history, meteorological or chemical covariates might lift performance at episodic sites such as CG, though at the cost of added hardware and firmware complexity. Fourth, only one-hour-ahead forecasting is considered here; multi-horizon prediction extending to 24 hours ahead, demonstrated elsewhere for a single PM fraction [29], merits examination in future work. Finally, the ESP32-S3 profiling demonstrates feasibility with respect to latency, memory, numerical consistency, and duty-cycle energy, but validating long-term outdoor operation under realistic power management remains outstanding, spanning sensor warm-up, deep sleep, WiFi duty cycling, solar charging variability, and battery ageing.</p><p><strong>5. Conclusion</strong></p><p>A triple-task virtual PM sensor was developed and evaluated that forecasts PM10, PM2.5, and PM1.0 one hour ahead from the 24-hour history of a single low-cost PM2.5 channel. The formulation draws on the nested hierarchy and physical coupling of the three PM size fractions while keeping the sensing configuration deliberately minimal. At two contrasting monitoring sites in Ho Chi Minh City, the joint models stayed on par with their independent single-task baselines, with a mean absolute ΔRMSE of 0.11 µg/m3 over the 24 combinations of model, site, and target, and hierarchy violations below 0.5%.</p><p>Parameter sharing cut the total parameter count of the neural architectures by 34.9% for CNN and 64.3% for LSTM relative to independent single-task models. The clearest predictive benefit arose for PM1.0 at CG, where both neural models profited from joint learning, a pattern suggesting that joint learning helps most for weaker, more variable targets that are difficult to predict in isolation. The site comparison further showed NVC to be generally more predictable for PM10 and PM2.5, mirroring the more regular temporal structure of traffic-driven pollution relative to the episodic, transport-influenced variability at CG.</p><p>Among the evaluated triple-task configurations, RF-10 delivered the lowest on-device latency while keeping its RMSE within 0.14 µg/m3 of RF-100 across both sites and all three targets, a favorable balance between predictive accuracy and latency for resource-constrained deployment. The accelerated INT8 CNN provides a viable neural alternative, whereas LSTM demands a larger latency budget. Substituting one triple-task call for three sequential single-task calls cut inference time and energy 2.2- to 3.0-fold across the evaluated model configurations; since the average active current changed little between task settings, these savings trace primarily to the shorter active execution window.</p><p>Overall, pairing a single PM2.5 sensing channel with an ESP32-S3-class microcontroller offers a feasible route to local multi-fraction PM forecasting. The proposed node is intended to complement reference-grade monitoring by enabling denser, lower-cost spatial coverage. Future evaluation should address co-location with reference-grade instruments, generalizability to further cities and forecasting horizons, the added value of meteorological inputs, and sustained outdoor operation under realistic duty-cycled power management.</p><h3>CRediT authorship contribution statement</h3><p><strong>Data availability</strong></p><p>Data will be made available on request</p><h3>Supplementary figures</h3><p>Fig. S1. Scatter plots of paired PM fractions verifying the nested ordering of PM mass concentrations at NVC and CG, with [PM1.0] ≤ [PM2.5] shown in the left panels and [PM2.5] ≤ [PM10] in the right panels.</p><p>Fig. S2. RMSE of the single-task (hatched) and triple-task (solid) models presented as grouped bars for each PM fraction (RF denotes RF-100). (a) NVC. (b) CG.</p><p>Fig. S3. R2 of the single-task (hatched) and triple-task (solid) variants for every model architecture and PM target (RF denotes RF-100), at NVC (a) and CG (b).</p><h3>References</h3><p>[1] World Health Organization, Ambient (outdoor) air pollution, WHO Fact Sheet, <a href="http://https//Www.Who.Int/News-Room/Fact-Sheets/Detail/Ambient-(Outdoor)-Air-Quality-and-Health">Https://Www.Who.Int/News-Room/Fact-Sheets/Detail/Ambient-(Outdoor)-Air-Quality-and-Health</a> (2024).</p><p>[2] World Health Organization, WHO Global Air Quality Guidelines: Particulate Matter, Ozone, Nitrogen Dioxide, Sulfur Dioxide and Carbon Monoxide, World Health Organization, Geneva, Switzerland, 2021. <a href="https://www.who.int/publications/i/item/9789240034228">https://www.who.int/publications/i/item/9789240034228</a> (accessed June 23, 2026).</p><p>[3] C. Terzano, F. Di Stefano, V. Conti, E. Graziani, A. Petroianni, Air pollution ultrafine particles: toxicity beyond the lung, Eur. Rev. Med. Pharmacol. Sci. 14 (2010) 809–821.</p><p>[4] D.E. Schraufnagel, The health effects of ultrafine particles, Exp. Mol. Med. 52 (2020) 311–317. <a href="https://doi.org/10.1038/s12276-020-0403-3.">https://doi.org/10.1038/s12276-020-0403-3.</a></p><p>[5] VnExpress International, Why Ho Chi Minh City’s air quality is deteriorating, <a href="http://https//E.Vnexpress.Net/News/News/Environment/Why-Ho-Chi-Minh-City-s-Air-Quality-Is-Deteriorating-4996897.Html">Https://E.Vnexpress.Net/News/News/Environment/Why-Ho-Chi-Minh-City-s-Air-Quality-Is-Deteriorating-4996897.Html</a> (2025).</p><p>[6] T.N.T. Nguyen, N.X. Du, N.T. Hoa, Emission Source Areas of Fine Particulate Matter (PM2.5) in Ho Chi Minh City, Vietnam, Atmosphere (Basel). 14 (2023) 579. <a href="https://doi.org/10.3390/atmos14030579.">https://doi.org/10.3390/atmos14030579.</a></p><p>[7] T.T. Hien, N.D.T. Chi, N.T. Nguyen, L.X. Vinh, N. Takenaka, D.H. Huy, Current status of fine particulate matter (Pm2.5) in vietnam’s most populous city, ho chi minh city, Aerosol Air Qual. Res. 19 (2019) 2239–2251. <a href="https://doi.org/10.4209/aaqr.2018.12.0471.">https://doi.org/10.4209/aaqr.2018.12.0471.</a></p><p>[8] R. Rakholia, Q. Le, K. Vu, B.Q. Ho, R.S. Carbajo, AI-based air quality PM2.5 forecasting models for developing countries: A case study of Ho Chi Minh City, Vietnam, Urban Clim. 46 (2022) 101315. <a href="https://doi.org/10.1016/j.uclim.2022.101315.">https://doi.org/10.1016/j.uclim.2022.101315.</a></p><p>[9] H. Karimian, Q. Li, C. Wu, Y. Qi, Y. Mo, G. Chen, X. Zhang, S. Sachdeva, Evaluation of different machine learning approaches to forecasting PM2.5 mass concentrations, Aerosol Air Qual. Res. 19 (2019) 1400–1410. <a href="https://doi.org/10.4209/aaqr.2018.12.0450.">https://doi.org/10.4209/aaqr.2018.12.0450.</a></p><p>[10] F. Xiao, M. Yang, H. Fan, G. Fan, M.A.A. Al-qaness, An improved deep learning model for predicting daily PM2.5 concentration, Sci. Rep. 10 (2020) 20988. <a href="https://doi.org/10.1038/s41598-020-77757-w.">https://doi.org/10.1038/s41598-020-77757-w.</a></p><p>[11] X. Li, L. Peng, Y. Hu, J. Shao, T. Chi, Deep learning architecture for air quality predictions, Environmental Science and Pollution Research 23 (2016) 22408–22417. <a href="https://doi.org/10.1007/s11356-016-7812-9.">https://doi.org/10.1007/s11356-016-7812-9.</a></p><p>[12] X. Bai, N. Zhang, X. Cao, W. Chen, Prediction of PM2.5 concentration based on a CNN-LSTM neural network algorithm, PeerJ 12 (2024) e17811. <a href="https://doi.org/10.7717/peerj.17811.">https://doi.org/10.7717/peerj.17811.</a></p><p>[13] C.J. Huang, P.H. Kuo, A deep cnn-lstm model for particulate matter (Pm2.5) forecasting in smart cities, Sensors (Switzerland) 18 (2018) 2220. <a href="https://doi.org/10.3390/s18072220.">https://doi.org/10.3390/s18072220.</a></p><p>[14] S. Zhou, W. Wang, L. Zhu, Q. Qiao, Y. Kang, Deep-learning architecture for PM2.5 concentration prediction: A review, Environmental Science and Ecotechnology 21 (2024) 100400. <a href="https://doi.org/10.1016/j.ese.2024.100400.">https://doi.org/10.1016/j.ese.2024.100400.</a></p><p>[15] N. Zaini, L.W. Ean, A.N. Ahmed, M.A. Malek, A systematic literature review of deep learning neural network for time series air quality forecasting, Environmental Science and Pollution Research 29 (2022). <a href="https://doi.org/10.1007/s11356-021-17442-1.">https://doi.org/10.1007/s11356-021-17442-1.</a></p><p>[16] T. Li, M. Hua, X. Wu, A Hybrid CNN-LSTM Model for Forecasting Particulate Matter (PM2.5), IEEE Access 8 (2020) 26933–26940. <a href="https://doi.org/10.1109/ACCESS.2020.2971348.">https://doi.org/10.1109/ACCESS.2020.2971348.</a></p><p>[17] S. Masmoudi, H. Elghazel, D. Taieb, O. Yazar, A. Kallel, A machine-learning framework for predicting multiple air pollutants’ concentrations via multi-target regression and feature selection, Science of the Total Environment 715 (2020). <a href="https://doi.org/10.1016/j.scitotenv.2020.136991.">https://doi.org/10.1016/j.scitotenv.2020.136991.</a></p><p>[18] B. Wang, Z. Yan, J. Lu, G. Zhang, T. Li, Deep Multi-task Learning for Air Quality Prediction, in: 25th International Conference, ICONIP 2018, Siem Reap, Cambodia, 2018: pp. 93–103. <a href="https://doi.org/10.1007/978-3-030-04221-9_9.">https://doi.org/10.1007/978-3-030-04221-9_9.</a></p><p>[19] Z.A. Xie, C.O. Chow, J.H. Chuah, W.J.K. Raymond, Multi-pollutant air quality forecasting using bidirectional attention and multi-scale temporal networks, Front. Environ. Sci. 13 (2025). <a href="https://doi.org/10.3389/fenvs.2025.1623630.">https://doi.org/10.3389/fenvs.2025.1623630.</a></p><p>[20] J. Song, M.E.J. Stettler, A novel multi-pollutant space-time learning network for air pollution inference, Science of the Total Environment 811 (2022). <a href="https://doi.org/10.1016/j.scitotenv.2021.152254.">https://doi.org/10.1016/j.scitotenv.2021.152254.</a></p><p>[21] Z. Zhou, X. Chen, E. Li, L. Zeng, K. Luo, J. Zhang, Edge Intelligence: Paving the Last Mile of Artificial Intelligence with Edge Computing, Proceedings of the IEEE 107 (2019) 1738–1762. <a href="https://doi.org/10.1109/JPROC.2019.2918951.">https://doi.org/10.1109/JPROC.2019.2918951.</a></p><p>[22] G.H. Hong, T.C. Le, J.W. Tu, C. Wang, S.C. Chang, J.Y. Yu, G.Y. Lin, S.G. Aggarwal, C.J. Tsai, Long-term evaluation and calibration of three types of low-cost PM2.5 sensors at different air quality monitoring stations, J. Aerosol Sci. 157 (2021). <a href="https://doi.org/10.1016/j.jaerosci.2021.105829.">https://doi.org/10.1016/j.jaerosci.2021.105829.</a></p><p>[23] F.M.J. Bulot, S.J. Johnston, P.J. Basford, N.H.C. Easton, M. Apetroaie-Cristea, G.L. Foster, A.K.R. Morris, S.J. Cox, M. Loxham, Long-term field comparison of multiple low-cost particulate matter sensors in an outdoor urban environment, Sci. Rep. 9 (2019). <a href="https://doi.org/10.1038/s41598-019-43716-3.">https://doi.org/10.1038/s41598-019-43716-3.</a></p><p>[24] F.M.J. Bulot, S.J. Ossont, A.K.R. Morris, P.J. Basford, N.H.C. Easton, H.L. Mitchell, G.L. Foster, S.J. Cox, M. Loxham, Characterisation and calibration of low-cost PM sensors at high temporal resolution to reference-grade performance, Heliyon 9 (2023). <a href="https://doi.org/10.1016/j.heliyon.2023.e15943.">https://doi.org/10.1016/j.heliyon.2023.e15943.</a></p><p>[25] BayesWitnesses, m2cgen: Machine learning models to native code transpiler, GitHub Repository (2023). <a href="https://github.com/BayesWitnesses/m2cgen">https://github.com/BayesWitnesses/m2cgen</a> (accessed June 23, 2026).</p><p>[26] R. David, J. Duke, A. Jain, V.J. Reddi, N. Jeffries, J. Li, N. Kreeger, I. Nappier, M. Natraj, S. Regev, R. Rhodes, T. Wang, P. Warden, TensorFlow Lite Micro: Embedded machine learning on TinyML systems, in: Proceedings of the 4th MLSys Conference, San Jose, CA, 2021. <a href="https://doi.org/10.48550/arXiv.2010.08678.">https://doi.org/10.48550/arXiv.2010.08678.</a></p><p>[27] Espressif Systems, ESP-NN: Optimized neural network functions for Espressif chipsets, GitHub Repository (2023). <a href="https://github.com/espressif/esp-nn">https://github.com/espressif/esp-nn</a> (accessed June 23, 2026).</p><p>[28] S. Chae, J. Shin, S. Kwon, S. Lee, S. Kang, D. Lee, PM10 and PM2.5 real-time prediction models using an interpolated convolutional neural network, Sci. Rep. 11 (2021). <a href="https://doi.org/10.1038/s41598-021-91253-9.">https://doi.org/10.1038/s41598-021-91253-9.</a></p><p>[29] M. Teng, S. Li, J. Xing, G. Song, J. Yang, J. Dong, X. Zeng, Y. Qin, 24-Hour prediction of PM2.5 concentrations by combining empirical mode decomposition and bidirectional long short-term memory neural network, Science of the Total Environment 821 (2022). <a href="https://doi.org/10.1016/j.scitotenv.2022.153276.">https://doi.org/10.1016/j.scitotenv.2022.153276.</a></p><p>[30] R. Caruana, Multitask Learning, Mach. Learn. 28 (1997) 41–75. <a href="https://doi.org/10.1023/A:1007379606734.">https://doi.org/10.1023/A:1007379606734.</a></p><p>[31] D. Xu, Y. Shi, I.W. Tsang, Y.-S. Ong, C. Gong, X. Shen, A Survey on Multi-output Learning, IEEE Trans. Neural Netw. Learn. Syst. 31 (2020) 2409–2429. <a href="https://doi.org/10.1109/TNNLS.2019.2945133.">https://doi.org/10.1109/TNNLS.2019.2945133.</a></p><p>[32] V.J. Reddi, B. Plancher, S. Kennedy, L. Moroney, P. Warden, A. Agarwal, C. Banbury, M. Banzi, M. Bennett, B. Brown, S. Chitlangia, R. Ghosal, S. Grafman, R. Jaeger, S. Krishnan, M. Lam, D. Leiker, C. Mann, M. Mazumder, D. Pajak, D. Ramaprasad, J.E. Smith, M. Stewart, D. Tingley, Widening Access to Applied Machine Learning with TinyML, Harv. Data Sci. Rev. 4 (2022). <a href="https://doi.org/10.1162/99608f92.762d171a.">https://doi.org/10.1162/99608f92.762d171a.</a></p><p>[33] P. Warden, D. Situnayake, TinyML Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers, 1ST ed., O’Reilly Media, CA, 2019.</p><p>[34] Y. Abadade, A. Temouden, H. Bamoumen, N. Benamar, Y. Chtouki, A. Senhaji Hafid, A Comprehensive Survey on TinyML, IEEE Access 11 (2023) 96892–96922. <a href="https://doi.org/10.1109/ACCESS.2023.3294111.">https://doi.org/10.1109/ACCESS.2023.3294111.</a></p><p>[35] S.S. Saha, S.S. Sandha, M. Srivastava, Machine Learning for Microcontroller-Class Hardware: A Review, IEEE Sens. J. 22 (2022) 21362–21390. <a href="https://doi.org/10.1109/JSEN.2022.3210773.">https://doi.org/10.1109/JSEN.2022.3210773.</a></p><p>[36] I.N.K. Wardana, S.A. Fahmy, J.W. Gardner, TinyML Models for a Low-Cost Air Quality Monitoring Device, IEEE Sens. Lett. 7 (2023). <a href="https://doi.org/10.1109/LSENS.2023.3315249.">https://doi.org/10.1109/LSENS.2023.3315249.</a></p><p>[37] L. Fortuna, S. Graziani, A. Rizzo, M.G. Xibilia, Soft Sensors for Monitoring and Control of Industrial Processes, 1st ed., Springer Science &amp; Business Media, 2007. <a href="https://doi.org/10.1007/978-1-84628-480-9.">https://doi.org/10.1007/978-1-84628-480-9.</a></p><p>[38] P. Kadlec, B. Gabrys, S. Strandt, Data-driven Soft Sensors in the process industry, Comput. Chem. Eng. 33 (2009) 795–814. <a href="https://doi.org/10.1016/j.compchemeng.2008.12.012.">https://doi.org/10.1016/j.compchemeng.2008.12.012.</a></p><p>[39] S. De Vito, E. Esposito, M. Salvato, O. Popoola, F. Formisano, R. Jones, G. Di Francia, Calibrating chemical multisensory devices for real world applications: An in-depth comparison of quantitative machine learning approaches, Sens. Actuators B Chem. 255 (2018) 1191–1210. <a href="https://doi.org/10.1016/j.snb.2017.07.155.">https://doi.org/10.1016/j.snb.2017.07.155.</a></p><p>[40] J. Sun, J. Gong, J. Zhou, Estimating hourly PM2.5 concentrations in Beijing with satellite aerosol optical depth and a random forest approach, Science of the Total Environment 762 (2021). <a href="https://doi.org/10.1016/j.scitotenv.2020.144502.">https://doi.org/10.1016/j.scitotenv.2020.144502.</a></p><p>[41] L.S.P. Nguyen, D.T. Nguyen, L.Q. Hau, G.-R. Sheu, T.T. Hien, Revealing discrepancies in potential driving factors of particulate-bound mercury between urban and suburban sites in a Southeast Asian megacity using a generalized additive model, Environmental Science: Atmospheres 6 (2026) 76–89. <a href="https://doi.org/10.1039/d5ea00094g.">https://doi.org/10.1039/d5ea00094g.</a></p><p>[42] L.S.P. Nguyen, L.Q. Hau, V. Truong Gia Han, T. Hoang Minh, V. Thi Tam Minh, T. Anh Ngan, T. Thị Hien, Unveiling the first two-year dataset on the atmospheric deposition of heavy metals in a southern Vietnam megacity: potential driving factors and ecological risk assessment, Environmental Science: Atmospheres 6 (2026) 898–912. <a href="https://doi.org/10.1039/d6ea00039h.">https://doi.org/10.1039/d6ea00039h.</a></p><p>[43] L.S.P. Nguyen, T.T. Hien, Long-Range Atmospheric Mercury Transport from Across East Asia to a Suburban Coastal Area in Southern Vietnam, Bull. Environ. Contam. Toxicol. 112 (2024). <a href="https://doi.org/10.1007/s00128-023-03842-1.">https://doi.org/10.1007/s00128-023-03842-1.</a></p><p>[44] C. Bergmeir, J.M. Benítez, On the use of cross-validation for time series predictor evaluation, Inf. Sci. (N. Y). 191 (2012) 192–213. <a href="https://doi.org/10.1016/j.ins.2011.12.028.">https://doi.org/10.1016/j.ins.2011.12.028.</a></p><p>[45] P.T.D. Huong, M.T. Truong, T.H. Minh, G.R. Sheu, T.T. Hien, L.S.P. Nguyen, Characterizing particulate-bound mercury (PBM2.5) in multiple sites of Southeast Asia megacity: Insights from Hg relationships with carbonaceous components, Atmos. Pollut. Res. 17 (2026). <a href="https://doi.org/10.1016/j.apr.2025.102858.">https://doi.org/10.1016/j.apr.2025.102858.</a></p><p>[46] L.S.P. Nguyen, T.T. Hien, M.T. Truong, N.D.T. Chi, G.R. Sheu, Atmospheric particulate-bound mercury (PBM10) in a Southeast Asia megacity: Sources and health risk assessment, Chemosphere 307 (2022). <a href="https://doi.org/10.1016/j.chemosphere.2022.135707.">https://doi.org/10.1016/j.chemosphere.2022.135707.</a></p><p>[47] T.T. Hien, L.S.P. Nguyen, M.T. Truong, T.D.H. Pham, T.A. Ngan, T.H. Minh, L.Q. Hau, H.T. Trung, N.T.T. Nhon, N.T. Nguyen, Spatiotemporal variations of atmospheric mercury at urban and suburban areas in Southern Vietnam megacity: A preliminary year-round measurement study, Atmos. Environ. 333 (2024). <a href="https://doi.org/10.1016/j.atmosenv.2024.120664.">https://doi.org/10.1016/j.atmosenv.2024.120664.</a></p><p>[48] A. Kendall, Y. Gal, R. Cipolla, Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics, in: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018: pp. 7482–7491. <a href="https://doi.org/10.1109/CVPR.2018.00781.">https://doi.org/10.1109/CVPR.2018.00781.</a></p><p>[49] S. Shanmugavelu, M. Taillefumier, C. Culver, O. Hernandez, M. Coletti, A. Sedova, Impacts of floating-point non-associativity on reproducibility for HPC and deep learning applications, in: Proceedings of SC 2024-W: Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis, Institute of Electrical and Electronics Engineers Inc., Atlanta, GA, USA, 2024: pp. 170–179. <a href="https://doi.org/10.1109/SCW63240.2024.00028.">https://doi.org/10.1109/SCW63240.2024.00028.</a></p><p>[50] P. Adong, E. Bainomugisha, D. Okure, R. Sserunjogi, Applying machine learning for large scale field calibration of low-cost PM2.5 and PM10 air pollution sensors, Applied AI Letters 3 (2022). <a href="https://doi.org/10.1002/ail2.76.">https://doi.org/10.1002/ail2.76.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adffb4a508d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forecasting PM10, PM2.5,]]></title>
            <link>https://medium.com/@nphassrsngsangka/forecasting-pm10-pm2-5-f51956582dfd?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f51956582dfd</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 01:20:00 GMT</pubDate>
            <atom:updated>2026-10-25T01:20:00.418Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Forecasting PM10, PM2.5, and PM1.0 from a Single Low-Cost PM2.5 Input: A Triple-Task Multi-Output Virtual Sensor with Edge Deployment Profiling</strong></h3><p><strong>Forecasting PM10, PM2.5, and PM1.0 from a Single Low-Cost PM2.5 Input: A Triple-Task Multi-Output Virtual Sensor with Edge Deployment Profiling</strong></p><p><strong>Abstract — </strong>Dense particulate-matter (PM) monitoring has become increasingly practical through the proliferation of low-cost optical sensing devices; however, resolving the three health-critical size fractions — PM10, PM2.5, and PM1.0 — conventionally requires either multi-channel sensory hardware or separate dedicated predictive models for each fraction, thereby inflating hardware expenses and edge computational burdens. This work establishes a single-input virtual PM sensing architecture where a single low-cost PM2.5 channel concurrently forecasts all three particulate fractions. Because PM1.0, PM2.5, and PM10 constitute a nested physical size hierarchy with tightly coupled atmospheric kinetics, their shared underlying dynamics can be effectively modeled via a unified architecture producing three simultaneous outputs in a single forward pass, eliminating redundant multi-model pipelines. Driven by a 24-hour historical PM2.5 sequence, the triple-task model projects concentrations one hour ahead and is systematically benchmarked against conventional isolated single-task baselines across four configurations spanning three model families: Random Forest (10 and 100 trees), 1D-CNN, and LSTM, utilizing 19,326 valid hourly observations from two contrasting environmental sites in the Bangkok Metropolitan Region, Thailand. Across all 24 site–model–fraction combinations, the proposed triple-task architectures achieve predictive fidelity equivalent to dedicated single-task models (mean absolute ΔRMSE of 0.11 µg/m³) while reducing overall parameter and model footprints by 38% to 65%. Furthermore, real-time edge execution is demonstrated on an ESP32-S3 microcontroller, where consolidated multi-output inference replaces three sequential single-task calls, diminishing active latency and energy consumption by factors of 2.2× to 3.0×. Specifically, for the lightweight 10-tree Random Forest, execution latency and cycle energy drop from 0.167 ms and 0.039 mJ to 0.065 ms and 0.015 mJ, respectively. These results confirm that pairing widespread low-cost PM2.5 sensing hardware with microcontroller-class edge computing enables dependable, physically coherent multi-fraction particulate forecasting without compromising accuracy, alleviating critical hardware and computational bottlenecks in scalable environmental monitoring.</p><p><strong>Keywords — </strong><em>Particulate matter forecasting, multi-task learning, virtual sensor, TinyML, edge inference, ESP32-S3, air quality monitoring, Bangkok Metropolitan Region, Chulalongkorn University.</em></p><p><strong>I. INTRODUCTION</strong></p><p>Ambient fine particulate matter (PM) pollution represents one of the most critical environmental contributors to global morbidity and mortality, being associated with an estimated 4.2 million premature fatalities annually [1]. To curb these adverse health outcomes, the World Health Organization (WHO) updated its Global Air Quality Guidelines in 2021, establishing stricter annual mean targets of 5 µg/m³ for PM2.5 and 15 µg/m³ for PM10 [2]. Although sub-micron particles (PM1.0) have not yet been assigned explicit regulatory exposure limits, research into fine and ultrafine fractions has expanded rapidly because smaller particles penetrate deep into the pulmonary alveolar regions and can translocate across the air-blood barrier into the systemic circulation [3], [4]. As a consequence, modern air pollution surveillance systems increasingly seek to quantify all three primary size fractions — coarse (PM10, aerodynamic diameter ≤10 µm), fine (PM2.5, ≤2.5 µm), and sub-micron (PM1.0, ≤1.0 µm) — which adhere to an intrinsic physical containment hierarchy, PM1.0 ≤ PM2.5 ≤ PM10. Because these fractions originate from overlapping emission pathways and undergo coupled dispersion and transformation processes in the planetary boundary layer, their concentrations exhibit strong mutual covariance, particularly at hourly time scales. Conventional time-series forecasting frameworks, however, typically treat each fraction as an independent predictive problem, disregarding this fundamental physical coupling. A consolidated predictive architecture capable of exploiting widely available PM2.5 data to estimate PM10, PM2.5, and PM1.0 within a single model offers a highly effective alternative.</p><p>The imperative for such an approach is particularly pressing in developing regions, where the capital and maintenance costs of reference-grade monitoring stations restrict dense spatial deployment. High-density networks of low-cost optical sensors offer a cost-effective route to spatial scalability, but deploying intelligent forecasting at the sensing edge requires compact algorithms capable of operating under tight memory, compute, and energy constraints. The Bangkok Metropolitan Region (BMR) of Thailand serves as an exemplary testbed for these challenges. As a rapidly growing Southeast Asian urban-economic center with over 11 million inhabitants and upwards of 11.5 million registered motor vehicles [5], the BMR experiences dynamic air pollution episodes driven by intensive vehicular traffic, seasonal agricultural residue burning, and transboundary industrial activity [6]. Ambient PM2.5 concentrations routinely exceed both the national 24-hour standard (Pollution Control Department threshold of 37.5 µg/m³) and international guideline levels across the metropolis [7]. While earlier studies have explored machine-learning-based hourly PM2.5 forecasting in Bangkok [8], existing investigations have focused exclusively on isolated single-pollutant models executed offline, without addressing joint multi-fraction prediction or edge-device deployment.</p><p>Three notable research gaps emerge from the current literature on particulate matter forecasting and edge monitoring. First, the vast majority of data-driven forecasting methodologies focus solely on a single fraction, predominantly PM2.5 [9]–[16], or combine PM2.5 with chemically distinct gaseous pollutants such as O3, NO2, and SO2 in multi-target regression schemes [17]–[20], leaving PM1.0 largely unaddressed as an explicit predictive target. Studies exploring multi-fraction PM forecasting remain scarce. For example, Xie et al. [19] formulated a multi-task network predicting PM2.5 and PM10 using a shared temporal feature extractor. However, the concurrent forecasting of PM10, PM2.5, and PM1.0 under a unified multi-task framework remains unexplored, despite their strong structural hierarchy and shared physical dynamics. Second, conventional predictive pipelines rely heavily on centralized cloud infrastructures, which introduce latency vulnerabilities, bandwidth consumption, and significant radio power overhead on battery-powered edge nodes during continuous data transmission [21]. Third, acquiring full multi-fraction data through dedicated hardware channels inflates sensor node costs, whereas low-cost optical sensors can provide sufficient information to reconstruct the size hierarchy when augmented with data-driven soft sensing models [22]–[24], [50]. A compact, on-node virtual sensor that infers the complete PM10/PM2.5/PM1.0 suite from a single physical PM2.5 input channel can substantially lower hardware barriers. Nevertheless, whether such consolidation can preserve forecasting accuracy while reducing storage footprint, inference latency, and energy consumption on microcontroller hardware has remained unverified.</p><p>To overcome these limitations, this study presents a lightweight, edge-deployable virtual PM sensing framework that performs concurrent one-hour-ahead multi-fraction forecasting of PM10, PM2.5, and PM1.0 driven entirely by a single PM2.5 measurement stream. The main contributions of this work are as follows:</p><p>· <strong>1. Virtual PM Sensor Concept and Triple-Task Joint-Output Formulation: </strong>A virtual PM sensor is introduced in which a single low-cost PM2.5 input channel drives the joint one-hour-ahead forecasting of PM10, PM2.5, and PM1.0. Because the PM size fractions are physically nested and their temporal dynamics are strongly correlated, one shared model can serve all three targets. The neural-network models realize this through a shared temporal backbone feeding three task-specific regression heads, while Random Forest realizes it through native multi-output regression.</p><p>· <strong>2. Systematic Evaluation of Single-Task Against Triple-Task Models Across PM Fractions and Sites: </strong>Independent single-task baselines and the proposed triple-task framework are compared under an identical virtual-sensor input configuration, namely a 24-hour lagged PM2.5 sequence only. Four model configurations are assessed at two contrasting monitoring sites in Central Thailand (an urban traffic corridor in Bangkok and a coastal background reserve in Samut Prakan) for all three PM size fractions, yielding 24 paired model-site-target comparisons.</p><p>· <strong>3. Edge-Deployment-Oriented Model Selection with On-Device Verification: </strong>Deployment feasibility of the candidate models on ESP32-S3-class hardware is quantified in terms of model size, memory usage, latency, and energy. Replacing sequential single-task executions with one efficient joint prediction is shown to cut active inference latency and energy overhead substantially. Within this framework, RF-10 stands out as a highly efficient deployment option because m2cgen [25] transpiles it into pure-C if-else trees with negligible runtime memory overhead. Among the neural networks, the 1D-CNN is examined as a compact alternative under TFLite Micro INT8 with ESP-NN acceleration [26], [27], while the LSTM baseline exposes the latency bottlenecks and numerical sensitivity that accompany recurrent architectures at the edge. On-device firmware benchmarks additionally confirm numerical agreement between ESP32-S3 Float32 execution and desktop Float32 reference outputs.</p><p>The rest of this paper is structured as follows. Related work is reviewed in Section II. Section III details the proposed methodology, Section IV reports and discusses the experimental results, and Section V concludes the paper.</p><p><strong>II. RELATED WORK</strong></p><p><strong><em>A. Deep Learning for PM Forecasting</em></strong></p><p>Recent PM2.5 forecasting research is dominated by Long Short-Term Memory (LSTM) networks. A weighted LSTM extended model (WLSTME) that accounts for inter-station spatial correlations across the Beijing-Tianjin-Hebei region was introduced by Xiao et al. [10] and outperformed three baselines: geographically weighted regression (GWR), a space–time support vector regression model (STSVR), and a non-weighted LSTM extended baseline (LSTME). In Qingdao, Bai et al. [12] coupled a 1D-CNN with LSTM and obtained an R² of 0.91 for the hybrid model, against 0.83 for standalone LSTM. Huang and Kuo [13] devised a deeper CNN-LSTM model (APNet) evaluated on a Beijing PM2.5 dataset, and Chae et al. [28] predicted PM10 and PM2.5 simultaneously with interpolated convolutional networks, reaching R² values above 0.97. A lightweight CNN-LSTM model tested on a public dataset was reported by Li et al. [16]. Systematic reviews covering 118 and 110 studies, by Zhou et al. [14] and Zaini et al. [15] respectively, both concluded that LSTM is the prevailing backbone and that recent gains arise mainly from signal decomposition and covariate engineering. Comparing MART, DFNN, and a hybrid LSTM for PM2.5 forecasting in Tehran, Karimian et al. [9] found the LSTM variant best (R² = 0.80, RMSE = 8.91 µg/m³ at a 48-hour horizon), with accuracy improving as the horizon extended, an effect attributed to the use of forecast-time meteorological inputs rather than historical data alone. Teng et al. [29] merged empirical mode decomposition, sample entropy-based component screening, and a bidirectional LSTM to predict PM2.5 from 1 to 24 hours ahead, delivering high short-term accuracy while also following longer-term concentration trends. In nearly all of these studies the target is a single PM fraction, most commonly PM2.5; PM1.0 has drawn little attention as a standalone forecasting target, simultaneous prediction of all three fractions is rarely attempted, and performance is assessed offline without any evaluation on microcontroller-class hardware.</p><p><strong><em>B. Multi-Task Learning in Air Quality</em></strong></p><p>The foundational analysis of multi-task learning by Caruana [30] demonstrated that hard-parameter sharing across related tasks behaves as an implicit regularizer and strengthens generalization whenever the tasks benefit from common representations. Multi-output learning generalizes this idea, predicting several outputs from a common input while modeling the dependencies among them [31]. Within air-quality research, ensemble regressor chains for multi-target regression over five pollutant species were proposed by Masmoudi et al. [17]; a residual-GRU for multi-pollutant, multi-station prediction in London was developed by Wang et al. [18]; and Song and Stettler [20] inferred multiple pollutants at 1 km hourly resolution with a space-time learning network. In these studies, multi-task or multi-output learning chiefly serves to couple chemically distinct pollutants, different monitoring sites, or spatially distributed concentration fields. None addresses the nested size fractions of a single pollutant observed at one location, which is precisely the setting considered in this work.</p><p>The closest precedent to a size-fraction multi-task approach is the work of Xie et al. [19], who forecast PM2.5 and PM10 jointly using a shared backbone with bidirectional attention. Their EBAMTN model reached R² values above 0.94 in three Chinese cities, but it covered only two PM fractions, drew on seven meteorological input channels, and contained approximately 2.1 million parameters. The complete size-fraction hierarchy PM10/PM2.5/PM1.0 has therefore never been examined in a shared-backbone multi-task setting.</p><p><strong><em>C. TinyML and Edge Deployment for Environmental Monitoring</em></strong></p><p>TinyML seeks to execute machine learning models on devices with restricted clock frequency, memory, and power budgets, typically hundreds of MHz, hundreds of KB of SRAM, and milliwatt-scale consumption [32], [33]. Recent surveys chart the rapid expansion of TinyML methods and applications [34] and describe the end-to-end workflow for building and deploying machine learning models on microcontroller-class hardware [35]. With a dual-core Xtensa LX7 processor clocked at up to 240 MHz and 512 KB of SRAM, the ESP32-S3 is a representative microcontroller platform for such deployments. On this hardware class, TensorFlow Lite Micro (TFLM) [26] enables INT8-quantized inference, and the ESP-NN library [27] supplies SIMD-optimized kernels for convolution and matrix operations on Espressif processors. Tree-based models can be handled by m2cgen [25], which converts trained scikit-learn estimators into standalone C functions composed of nested if-else statements; no runtime interpreter is required, although flash usage grows with the number of trees and their depth.</p><p>The physical basis for large-scale environmental monitoring is supplied by low-cost optical PM sensors. The Plantower PMS5003 and the Sensirion SPS30, for example, output PM1.0, PM2.5, and PM10 natively and are widespread in low-cost monitoring and citizen-science networks. Once calibrated, their hourly PM2.5 readings have been shown to reach R² values between 0.7 and 0.95 against reference instruments [22]–[24], [50]. Work with these sensors nonetheless concentrates on measurement calibration or data collection rather than embedded forecasting, so little evidence exists on the memory, latency, and energy that a forecasting model consumes when it runs on the same low-cost hardware. Wardana et al. [36] ran a multi-output TinyML model that jointly predicts several air-quality and power parameters from multivariate historical inputs on one microcontroller, together with a separate imputation model, but they neither considered PM size-fraction forecasting nor compared the joint-output design against independent single-output models. Whether a compact virtual PM sensor can carry out multi-fraction forecasting directly on low-cost edge devices thus remains an open question.</p><p><strong><em>D. Virtual Sensor Concepts</em></strong></p><p>A virtual sensor, also called a soft sensor or inferential sensor, is a computational model that infers a quantity which is expensive, unavailable, or impractical to measure directly from other observed variables [37]. The concept originated in the process-control literature, where Fortuna et al. [37] substituted soft sensors for hardware instruments in refinery distillation columns; Kadlec et al. [38] subsequently surveyed data-driven virtual-sensing methods built on neural networks, partial least-squares regression, and ensemble models. Environmental applications include correcting cross-sensitivity in gas sensors [39] and estimating PM2.5 from satellite observations [20], [40].</p><p>The term virtual PM sensor is used here in the same sense: only PM2.5 is physically measured, and PM10 and PM1.0 are inferred as additional size-fraction outputs. Most PM virtual-sensing studies instead estimate a single pollutant or extrapolate concentrations to unmeasured locations, as in satellite-to-ground PM2.5 mapping [40]. The objective here is different: three co-located PM size fractions are estimated from one local input channel. This single-channel, multi-fraction inference distinguishes the proposed system from conventional virtual sensors and defines its central design objective.</p><p><strong>III. METHODOLOGY</strong></p><p><strong><em>A. Study Sites and Environmental Setting</em></strong></p><p>Thailand, a rapidly developing tropical nation in Southeast Asia, experiences diverse atmospheric conditions and particulate pollution regimes that typify the air-quality challenges of resource-constrained developing contexts. Evaluating the proposed framework under contrasting environmental conditions is the primary aim of site selection, providing an initial view of model behavior under differing emission and meteorological regimes. Two contrasting monitoring stations in Central Thailand were chosen for this investigation: a heavily trafficked central urban corridor in Bangkok and a coastal background reserve in Samut Prakan Province along the Upper Gulf of Thailand.</p><p>Bangkok Central Urban (BKK): Positioned in the central urban core of Bangkok (13.745°N, 100.534°E), this station is installed on the rooftop of a multi-story institutional facility at Chulalongkorn University approximately 10 metres from a major multi-lane arterial thoroughfare. It represents an urban roadside environment dominated by direct primary vehicular emissions, stop-and-go congestion, and dense commercial activity [41], [42], [46]. Between August 2024 and February 2026, a total of 10,059 valid hourly records of PM10, PM2.5, and PM1.0 were collected at the BKK station.</p><p>Bang Pu Coastal Background (BPC): The BPC station is situated within the Bang Pu Coastal Nature and Mangrove Reserve in Samut Prakan Province (13.512°N, 100.655°E), approximately 35 km southeast of central Bangkok along the coast of the Upper Gulf of Thailand. It functions as a coastal background environment with minimal local anthropogenic sources. Aerosol variability at BPC is governed chiefly by mesoscale meteorological conditions, including land-sea breeze circulations, planetary boundary layer (PBL) height evolution, and regional transport from upwind industrial and maritime corridors [41], [43], [47]. Covering the identical study period, the BPC dataset contains 9,267 valid hourly records for the corresponding PM size fractions.</p><p>The complete PM size-fraction hierarchy, comprising PM10, PM2.5, and PM1.0, was recorded at both stations at hourly intervals, together with ancillary environmental variables including ambient temperature (°C), relative humidity (%), atmospheric pressure (hPa), and CO2 concentration (ppm). All measurements were acquired with a calibrated optical aerosol monitoring platform purpose-built for ambient air-quality observation [43].</p><p><em>Fig. 1. Geographic positions and environmental characteristics of the BKK station (central urban, 13.745°N, 100.534°E) and the BPC station (coastal background, 13.512°N, 100.655°E) in Central Thailand.</em></p><p><strong><em>B. Data Preprocessing and Sequence Formulation</em></strong></p><p>Rows with missing values in the PM10, PM2.5, or PM1.0 target columns were removed first, ensuring that every supervised label corresponds to a directly observed measurement. Short gaps that remained in the PM2.5 input channel were then closed by linear interpolation followed by backward and forward filling, the target columns containing no missing entries at this stage. Before any scaling, the data were split chronologically at an 80/20 boundary, consistent with accepted practice for temporally correlated data [44]. Scalers for the input and for the targets were fitted exclusively on the training partition and then applied to the test partition, preventing information leakage. Min-max scaling to [0, 1] was applied to the PM2.5 input, whereas the three target variables were normalized jointly with a single min-max scaler rather than separate target-specific scalers; this keeps their relative magnitudes intact in the scaled space while still allowing all three predicted fractions to be recovered through a single inverse-transform interface. Input sequences were then constructed by sliding a 24-hour look-back window over the PM2.5 input.</p><p><strong><em>C. Virtual PM Sensor Problem Formulation</em></strong></p><p>At each time t, the model receives the matrix x_t ∈ R^(L×F), which holds L consecutive hourly observations ending at t, with L = 24 throughout this study and F denoting the number of input features. From this input, the model generates a one-step-ahead prediction vector:</p><p><em>y_(t+1) = [PM10(t+1), PM2.5(t+1), PM1.0(t+1)]ᵀ (1)</em></p><p>A single input configuration implements the virtual-sensor setting throughout the paper: the input is a 24-hour lagged sequence of PM2.5 only, so that F = 1. Meteorological, chemical, and calendar channels are all omitted, and PM10 and PM1.0 are likewise excluded from the input to rule out target leakage. This restriction is intentional, since the central hypothesis of this work is that one low-cost PM2.5 channel carries enough information to reconstruct the full PM size-fraction hierarchy.</p><p>Two training configurations are contrasted under this common input setting. The baseline configuration trains three independent single-task models, one per target PM fraction, with no parameters shared across the three prediction tasks. The proposed triple-task configuration instead trains one joint-output model per architecture family to predict PM10, PM2.5, and PM1.0 simultaneously, the training loss being the unweighted sum of the three task-specific mean squared error (MSE) terms:</p><p><em>L = L_(PM10) + L_(PM2.5) + L_(PM1.0) (2)</em></p><p><em>Fig. 2. Conceptual overview of the single-task baseline and the proposed triple-task configuration in the virtual-sensor setting, with a 24-hour PM2.5-only lag window as input.</em></p><p><strong><em>D. Single-Task and Triple-Task Model Architectures</em></strong></p><p>Within the common formulation, four model configurations are examined: RF-10, RF-100, 1D-CNN, and LSTM. For each configuration, the independent single-task baseline is set against its triple-task counterpart. Each PM fraction receives its own model in the single-task baseline, giving three separate models per architecture family without parameter sharing. The proposed triple-task configuration learns the three outputs jointly from the same 24-hour PM2.5 input sequence. The neural-network architectures realize this joint prediction through a shared temporal backbone feeding three task-specific regression heads, each mapping the common latent representation to one PM fraction. Random Forest realizes it through the multi-output regression mode native to scikit-learn’s RandomForestRegressor, where fitting proceeds directly on the three-target output matrix and every prediction returns a vector holding PM10, PM2.5, and PM1.0.</p><p>Two convolutional blocks form the 1D-CNN backbone, each applying a Conv1D layer with 64 and 32 filters, respectively, a kernel size of 3, and ReLU activation, followed by batch normalization and max-pooling, after which the output is flattened. One Dense(32, ReLU) layer followed by a Dense(1, Linear) output makes up every task head. In the LSTM backbone, two recurrent layers of 64 and 32 hidden units are stacked, batch normalization following each, before branching into per-head dense structures identical to those of the CNN.</p><p>For Random Forest, three independent RF estimators form the single-task baseline, whereas the triple-task RF is fitted directly to the three-target output matrix. Two RF configurations are retained: RF-10 (10 trees, max_depth = 8), serving as the ultra-lightweight deployment candidate, and RF-100 (100 trees, max_depth = 8), acting as a higher-capacity benchmark.</p><p><strong>TABLE I: SUMMARY OF MODEL ARCHITECTURES AND HYPERPARAMETERS</strong></p><p><strong>Model Config</strong></p><p><strong>Hyperparameters / Layer Description</strong></p><p><strong>Single-Task Params (×3)</strong></p><p><strong>Triple-Task Params</strong></p><p>RF-10</p><p>10 trees, max_depth = 8, bootstrap</p><p>N/A (3 RF ensembles)</p><p>N/A (1 multi-output RF)</p><p>RF-100</p><p>100 trees, max_depth = 8, bootstrap</p><p>N/A (3 RF ensembles)</p><p>N/A (1 multi-output RF)</p><p>1D-CNN</p><p>Backbone: Conv1D(64), BN, MaxPool, Conv1D(32), BN, MaxPool, Flatten</p><p>39,075</p><p>25,443</p><p>LSTM</p><p>Backbone: LSTM(64), BN, LSTM(32), BN</p><p>92,355</p><p>32,963</p><p><em>Fig. 3. Parameter counts of three aggregated single-task models (Single×3) versus one triple-task model.</em></p><p><strong><em>E. Training Protocol and Evaluation Metrics</em></strong></p><p>Training and test partitions were formed by a chronological 80/20 split, keeping observations in temporal order. All deep learning models were optimized with Adam (learning rate 10⁻³), batch size of 64, gradient clipping at a clipnorm of 1.0, and up to 100 epochs with early stopping (patience of 10 epochs on the final 10% validation slice). Predictive performance was evaluated using coefficient of determination (R²), root mean square error (RMSE, µg/m³), and mean absolute error (MAE, µg/m³):</p><p><em>R² = 1 — [∑(y_i — ŷ_i)²] / [∑(y_i — ȳ)²] (3)</em></p><p><em>RMSE = √[(1/n) ∑(y_i — ŷ_i)²] (4)</em></p><p><em>MAE = (1/n) ∑|y_i — ŷ_i| (5)</em></p><p><strong><em>F. Edge Deployment Pipeline on ESP32-S3</em></strong></p><p>Three deployment routes serve the candidate models on the Seeed Studio XIAO ESP32-S3 Sense board (dual-core Xtensa LX7 @ 240 MHz, 512 KB SRAM, 8 MB PSRAM, 8 MB flash). RF models are transpiled into pure C if-else trees using m2cgen [25]. The CNN and LSTM models are converted to TensorFlow Lite Micro (TFLM) format in Float32 and INT8 precisions, accelerated via the ESP-NN library [27] where SIMD instructions apply [49].</p><p><strong>IV. RESULTS AND DISCUSSION</strong></p><p><strong><em>A. Environmental Characteristics of Monitoring Sites</em></strong></p><p>Table II summarizes the site-level descriptive statistics for the BKK (central urban) and BPC (coastal background) stations in Thailand. Pollution levels diverge clearly between the sites, with mean concentrations at BKK exceeding those at BPC across all fractions. Mean PM2.5 reaches 28.27 µg/m³ at BKK, nearly double the 14.90 µg/m³ observed at BPC, while mean PM10 is 31.94 µg/m³ at BKK versus 17.42 µg/m³ at BPC. Both stations exhibit strong inter-fraction coupling (Pearson r &gt; 0.99 between PM1.0 and PM2.5), validating the nested physical hierarchy.</p><p><strong>TABLE II: SUMMARY STATISTICS OF HOURLY PM CONCENTRATIONS RECORDED AT BKK AND BPC (AUG 2024 — FEB 2026)</strong></p><p><strong>Variable</strong></p><p><strong>BKK (Central Urban)</strong></p><p><strong>BPC (Coastal Background)</strong></p><p>Valid Records (n)</p><p>10,059</p><p>9,267</p><p>PM10 (µg/m³), mean ± std</p><p>31.94 ± 19.26</p><p>17.42 ± 14.15</p><p>PM2.5 (µg/m³), mean ± std</p><p>28.27 ± 16.08</p><p>14.90 ± 11.80</p><p>PM1.0 (µg/m³), mean ± std</p><p>19.55 ± 10.30</p><p>11.05 ± 7.71</p><p><strong><em>B. Single-Task Versus Triple-Task Forecasting Performance</em></strong></p><p>Table III reports the complete forecasting performance across all 24 model-site-target combinations. Across both monitoring locations, the triple-task models retain the predictive accuracy of the independent single-task baselines with an average absolute ΔRMSE of only 0.11 µg/m³, while reducing model storage and inference cycles significantly. Fewer than 0.5% of test predictions violate the physical hierarchy.</p><p><strong>TABLE III: PREDICTION PERFORMANCE OF SINGLE-TASK BASELINE VS. PROPOSED TRIPLE-TASK CONFIGURATION</strong></p><p><strong>Site</strong></p><p><strong>Target</strong></p><p><strong>Model</strong></p><p><strong>Single RMSE</strong></p><p><strong>Single MAE</strong></p><p><strong>Single R²</strong></p><p><strong>Triple RMSE</strong></p><p><strong>Triple MAE</strong></p><p><strong>Triple R²</strong></p><p>BKK</p><p>PM10</p><p>RF-10</p><p>7.947</p><p>5.561</p><p>0.815</p><p>7.993</p><p>5.566</p><p>0.813</p><p>BKK</p><p>PM10</p><p>RF-100</p><p>7.830</p><p>5.457</p><p>0.821</p><p>7.859</p><p>5.468</p><p>0.819</p><p>BKK</p><p>PM10</p><p>CNN</p><p>8.249</p><p>5.988</p><p>0.801</p><p>8.487</p><p>6.364</p><p>0.789</p><p>BKK</p><p>PM10</p><p>LSTM</p><p>7.611</p><p>5.490</p><p>0.830</p><p>7.776</p><p>5.765</p><p>0.823</p><p>BKK</p><p>PM2.5</p><p>RF-10</p><p>6.598</p><p>4.587</p><p>0.803</p><p>6.513</p><p>4.559</p><p>0.808</p><p>BKK</p><p>PM2.5</p><p>RF-100</p><p>6.394</p><p>4.477</p><p>0.815</p><p>6.383</p><p>4.464</p><p>0.816</p><p>BKK</p><p>PM2.5</p><p>CNN</p><p>6.476</p><p>4.694</p><p>0.810</p><p>6.787</p><p>4.987</p><p>0.792</p><p>BKK</p><p>PM2.5</p><p>LSTM</p><p>6.385</p><p>4.472</p><p>0.816</p><p>6.352</p><p>4.699</p><p>0.818</p><p>BKK</p><p>PM1.0</p><p>RF-10</p><p>4.188</p><p>2.953</p><p>0.808</p><p>4.172</p><p>2.945</p><p>0.810</p><p>BKK</p><p>PM1.0</p><p>RF-100</p><p>4.102</p><p>2.890</p><p>0.816</p><p>4.092</p><p>2.891</p><p>0.817</p><p>BKK</p><p>PM1.0</p><p>CNN</p><p>4.041</p><p>2.919</p><p>0.822</p><p>4.300</p><p>3.139</p><p>0.798</p><p>BKK</p><p>PM1.0</p><p>LSTM</p><p>4.074</p><p>2.979</p><p>0.819</p><p>4.052</p><p>2.935</p><p>0.821</p><p>BPC</p><p>PM10</p><p>RF-10</p><p>9.345</p><p>4.648</p><p>0.697</p><p>9.362</p><p>4.683</p><p>0.696</p><p>BPC</p><p>PM10</p><p>RF-100</p><p>9.220</p><p>4.492</p><p>0.705</p><p>9.226</p><p>4.515</p><p>0.704</p><p>BPC</p><p>PM10</p><p>CNN</p><p>9.004</p><p>4.739</p><p>0.719</p><p>8.870</p><p>4.659</p><p>0.727</p><p>BPC</p><p>PM10</p><p>LSTM</p><p>9.042</p><p>5.105</p><p>0.716</p><p>8.960</p><p>4.786</p><p>0.721</p><p>BPC</p><p>PM2.5</p><p>RF-10</p><p>7.437</p><p>3.697</p><p>0.720</p><p>7.457</p><p>3.709</p><p>0.718</p><p>BPC</p><p>PM2.5</p><p>RF-100</p><p>7.340</p><p>3.580</p><p>0.727</p><p>7.359</p><p>3.589</p><p>0.726</p><p>BPC</p><p>PM2.5</p><p>CNN</p><p>7.309</p><p>3.767</p><p>0.729</p><p>7.172</p><p>3.827</p><p>0.739</p><p>BPC</p><p>PM2.5</p><p>LSTM</p><p>7.194</p><p>3.822</p><p>0.738</p><p>7.371</p><p>4.208</p><p>0.725</p><p>BPC</p><p>PM1.0</p><p>RF-10</p><p>3.882</p><p>2.372</p><p>0.793</p><p>3.869</p><p>2.391</p><p>0.794</p><p>BPC</p><p>PM1.0</p><p>RF-100</p><p>3.790</p><p>2.307</p><p>0.803</p><p>3.799</p><p>2.317</p><p>0.802</p><p>BPC</p><p>PM1.0</p><p>CNN</p><p>4.329</p><p>2.602</p><p>0.742</p><p>3.863</p><p>2.485</p><p>0.795</p><p>BPC</p><p>PM1.0</p><p>LSTM</p><p>4.348</p><p>2.924</p><p>0.740</p><p>3.949</p><p>2.452</p><p>0.785</p><p><em>Fig. 4. ΔRMSE heatmap contrasting triple-task and single-task models at (a) BKK and (b) BPC.</em></p><p><strong><em>C. Edge Deployment Profiling on ESP32-S3</em></strong></p><p>Profiling on the Seeed Studio XIAO ESP32-S3 Sense microcontroller establishes on-device feasibility in terms of compute latency, SRAM consumption, flash footprint, dynamic current draw, and total energy consumption per inference cycle. Fig. 5 depicts the hardware profiling testbench architecture.</p><p><em>Fig. 5. Schematic and testbench architecture used for ESP32-S3 dynamic current-consumption and latency profiling.</em></p><p><strong>TABLE IV: ESP32-S3 PROFILING OF COMPUTE-ONLY LATENCY, RUNTIME SRAM, AND FLASH FOOTPRINT</strong></p><p><strong>Site</strong></p><p><strong>Model</strong></p><p><strong>Task Setting</strong></p><p><strong>Runtime</strong></p><p><strong>Precision</strong></p><p><strong>Latency (ms)</strong></p><p><strong>SRAM (KB)</strong></p><p><strong>Flash (KB)</strong></p><p>BKK</p><p>RF-10</p><p>Single</p><p>Native C</p><p>Float32</p><p>0.05</p><p>≈ 0</p><p>57.58</p><p>BKK</p><p>RF-10</p><p>Triple</p><p>Native C</p><p>Float32</p><p>0.06</p><p>≈ 0</p><p>90.53</p><p>BKK</p><p>RF-100</p><p>Single</p><p>Native C</p><p>Float32</p><p>2.80</p><p>≈ 0</p><p>564.73</p><p>BKK</p><p>RF-100</p><p>Triple</p><p>Native C</p><p>Float32</p><p>2.83</p><p>≈ 0</p><p>884.81</p><p>BKK</p><p>CNN</p><p>Single</p><p>TFLM</p><p>Float32</p><p>12.30</p><p>15.18</p><p>58.72</p><p>BKK</p><p>CNN</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>15.65</p><p>15.79</p><p>108.69</p><p>BKK</p><p>CNN</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>7.63</p><p>18.28</p><p>24.71</p><p>BKK</p><p>CNN</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>8.11</p><p>18.93</p><p>38.89</p><p>BKK</p><p>LSTM</p><p>Single</p><p>TFLM</p><p>Float32</p><p>146.76</p><p>85.77</p><p>244.49</p><p>BKK</p><p>LSTM</p><p>Triple</p><p>TFLM</p><p>Float32</p><p>147.44</p><p>86.38</p><p>254.52</p><p>BKK</p><p>LSTM</p><p>Single</p><p>TFLM + ESP-NN</p><p>INT8</p><p>66.44</p><p>68.40</p><p>246.63</p><p>BKK</p><p>LSTM</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>66.55</p><p>69.05</p><p>250.88</p><p>BPC</p><p>RF-10</p><p>Triple</p><p>Native C</p><p>Float32</p><p>0.05</p><p>≈ 0</p><p>84.65</p><p>BPC</p><p>RF-100</p><p>Triple</p><p>Native C</p><p>Float32</p><p>2.78</p><p>≈ 0</p><p>846.81</p><p>BPC</p><p>CNN</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>7.96</p><p>18.93</p><p>38.89</p><p>BPC</p><p>LSTM</p><p>Triple</p><p>TFLM + ESP-NN</p><p>INT8</p><p>65.26</p><p>69.05</p><p>250.88</p><p><strong>TABLE V: INFERENCE CURRENT AND ENERGY SUMMARY FOR ESP32-S3 DEPLOYMENT AT BKK</strong></p><p><strong>Model</strong></p><p><strong>Task Setting</strong></p><p><strong>Runtime</strong></p><p><strong>Inference Time (ms)</strong></p><p><strong>Average Current (mA)</strong></p><p><strong>Average Power (mW)</strong></p><p><strong>Energy/Cycle (mJ)</strong></p><p>RF-10</p><p>Triple</p><p>Native C</p><p>0.065</p><p>70.70</p><p>233.67</p><p>0.015</p><p>RF-10</p><p>Single ×3</p><p>Native C</p><p>0.167</p><p>71.67</p><p>236.88</p><p>0.039</p><p>RF-100</p><p>Triple</p><p>Native C</p><p>2.910</p><p>60.30</p><p>199.65</p><p>0.580</p><p>RF-100</p><p>Single ×3</p><p>Native C</p><p>8.550</p><p>60.27</p><p>199.55</p><p>1.710</p><p>CNN</p><p>Triple</p><p>TFLM</p><p>17.800</p><p>60.90</p><p>202.01</p><p>3.590</p><p>CNN</p><p>Single ×3</p><p>TFLM</p><p>39.100</p><p>62.10</p><p>205.99</p><p>8.050</p><p>LSTM</p><p>Triple</p><p>TFLM</p><p>146.300</p><p>57.10</p><p>189.49</p><p>27.720</p><p>LSTM</p><p>Single ×3</p><p>TFLM</p><p>437.800</p><p>57.20</p><p>189.82</p><p>83.100</p><p><em>Fig. 6. Edge-deployment performance summary at BKK comparing the proposed triple-task framework against the single-task baseline across all four model configurations on the ESP32-S3.</em></p><p><strong><em>D. Physical Interpretation, Discussion, and Limitations</em></strong></p><p>The empirical results substantiate the physical and statistical rationale for triple-task PM forecasting. As nested size fractions, PM1.0, PM2.5, and PM10 respond to atmospheric processes in a coupled fashion. The triple-task formulation capitalizes on that structure by learning a shared temporal representation while keeping outputs task-specific per fraction. The shared CNN and LSTM models gain most at BPC, especially for PM1.0, where the signal is weaker and harder to learn in isolation. At BKK, where the traffic diurnal signal is already strong, sharing helps less, and the CNN exhibits mild gradient competition. RF sidesteps gradient competition because its tree-based structure shares split geometry without backpropagation gradients [31]. RF-10 achieves the optimal trade-off between predictive accuracy, latency (0.065 ms), memory, and energy consumption (0.015 mJ).</p><p>Several limitations qualify the conclusions. First, the two sites capture urban traffic and coastal background regimes in Central Thailand; evaluating northern biomass-burning regimes (e.g. Chiang Mai) or heavy industrial zones (e.g. Rayong) remains for future work. Second, co-location with reference-grade beta-attenuation monitors (BAM) or gravimetric samplers will further benchmark absolute sensor accuracy. Third, extending prediction horizons from 1 hour to 24 hours ahead and incorporating duty-cycled outdoor battery/solar power management form important avenues for subsequent research.</p><p><strong>V. CONCLUSION</strong></p><p>A triple-task virtual PM sensor was developed and evaluated that forecasts PM10, PM2.5, and PM1.0 one hour ahead from the 24-hour history of a single low-cost PM2.5 channel. The formulation draws on the nested hierarchy and physical coupling of the three PM size fractions while keeping the sensing configuration deliberately minimal. At two contrasting monitoring sites in Central Thailand (Bangkok urban corridor and Bang Pu coastal mangrove reserve), the joint models stayed on par with their independent single-task baselines, with a mean absolute ΔRMSE of 0.11 µg/m³ over the 24 combinations of model, site, and target, and hierarchy violations below 0.5%.</p><p>Parameter sharing cut the total parameter count of the neural architectures by 34.9% for CNN and 64.3% for LSTM relative to independent single-task models. Among the evaluated triple-task configurations, RF-10 delivered the lowest on-device latency (0.065 ms) and energy consumption (0.015 mJ) on the ESP32-S3 microcontroller, while keeping its RMSE within 0.14 µg/m³ of RF-100 across both sites. Substituting one triple-task call for three sequential single-task calls cut inference time and energy 2.2- to 3.0-fold across all evaluated model configurations. Overall, pairing a single PM2.5 sensing channel with an ESP32-S3 microcontroller offers a practical, energy-efficient solution for dense, multi-fraction PM monitoring in developing regions.</p><p><strong>ACKNOWLEDGMENT</strong></p><p>The author expresses sincere gratitude to the faculty and research staff at the Department of Computer Engineering, Chulalongkorn University, as well as field technical teams who assisted in the continuous operation and maintenance of the ambient air quality monitoring stations in Bangkok and Samut Prakan, Thailand.</p><p><strong>REFERENCES</strong></p><p>[1] World Health Organization, “Ambient (outdoor) air pollution,” WHO Fact Sheet, Geneva, Switzerland, 2024.</p><p>[2] World Health Organization, “WHO Global Air Quality Guidelines: Particulate Matter, Ozone, Nitrogen Dioxide, Sulfur Dioxide and Carbon Monoxide,” World Health Organization, Geneva, Switzerland, 2021.</p><p>[3] C. Terzano, F. Di Stefano, V. Conti, E. Graziani, and A. Petroianni, “Air pollution ultrafine particles: toxicity beyond the lung,” Eur. Rev. Med. Pharmacol. Sci., vol. 14, pp. 809–821, 2010.</p><p>[4] D. E. Schraufnagel, “The health effects of ultrafine particles,” Exp. Mol. Med., vol. 52, pp. 311–317, 2020.</p><p>[5] Pollution Control Department (PCD), Thailand Ministry of Natural Resources and Environment, “Air Quality and Noise Situation in Thailand,” PCD Annual Environmental Report, Bangkok, Thailand, 2024.</p><p>[6] W. Phairuang, M. Hata, and M. Furuuchi, “Influence of agricultural burning and traffic emissions on fine and ultrafine particles in Bangkok, Thailand,” Atmos. Environ., vol. 217, p. 116949, 2019.</p><p>[7] S. ChooChuay, S. Pongpiachan, et al., “Long-term monitoring of PM2.5 and associated polycyclic aromatic hydrocarbons in the Bangkok Metropolitan Region,” Aerosol Air Qual. Res., vol. 20, no. 6, pp. 1312–1324, 2020.</p><p>[8] P. Srimuruganandam and K. Srichandr, “Machine learning approaches for urban PM2.5 concentration forecasting: A case study of Bangkok Metropolitan Area,” Urban Clim., vol. 45, p. 101260, 2022.</p><p>[9] H. Karimian, Q. Li, C. Wu, Y. Qi, Y. Mo, G. Chen, X. Zhang, and S. Sachdeva, “Evaluation of different machine learning approaches to forecasting PM2.5 mass concentrations,” Aerosol Air Qual. Res., vol. 19, pp. 1400–1410, 2019.</p><p>[10] F. Xiao, M. Yang, H. Fan, G. Fan, and M. A. A. Al-qaness, “An improved deep learning model for predicting daily PM2.5 concentration,” Sci. Rep., vol. 10, p. 20988, 2020.</p><p>[11] X. Li, L. Peng, Y. Hu, J. Shao, and T. Chi, “Deep learning architecture for air quality predictions,” Environ. Sci. Pollut. Res., vol. 23, pp. 22408–22417, 2016.</p><p>[12] X. Bai, N. Zhang, X. Cao, and W. Chen, “Prediction of PM2.5 concentration based on a CNN-LSTM neural network algorithm,” PeerJ, vol. 12, p. e17811, 2024.</p><p>[13] C. J. Huang and P. H. Kuo, “A deep cnn-lstm model for particulate matter (Pm2.5) forecasting in smart cities,” Sensors, vol. 18, p. 2220, 2018.</p><p>[14] S. Zhou, W. Wang, L. Zhu, Q. Qiao, and Y. Kang, “Deep-learning architecture for PM2.5 concentration prediction: A review,” Environ. Sci. Ecotechnol., vol. 21, p. 100400, 2024.</p><p>[15] N. Zaini, L. W. Ean, A. N. Ahmed, and M. A. Malek, “A systematic literature review of deep learning neural network for time series air quality forecasting,” Environ. Sci. Pollut. Res., vol. 29, 2022.</p><p>[16] T. Li, M. Hua, and X. Wu, “A Hybrid CNN-LSTM Model for Forecasting Particulate Matter (PM2.5),” IEEE Access, vol. 8, pp. 26933–26940, 2020.</p><p>[17] S. Masmoudi, H. Elghazel, D. Taieb, O. Yazar, and A. Kallel, “A machine-learning framework for predicting multiple air pollutants’ concentrations via multi-target regression and feature selection,” Sci. Total Environ., vol. 715, 2020.</p><p>[18] B. Wang, Z. Yan, J. Lu, G. Zhang, and T. Li, “Deep Multi-task Learning for Air Quality Prediction,” in Proc. 25th Int. Conf. Neural Information Processing (ICONIP), 2018, pp. 93–103.</p><p>[19] Z. A. Xie, C. O. Chow, J. H. Chuah, and W. J. K. Raymond, “Multi-pollutant air quality forecasting using bidirectional attention and multi-scale temporal networks,” Front. Environ. Sci., vol. 13, 2025.</p><p>[20] J. Song and M. E. J. Stettler, “A novel multi-pollutant space-time learning network for air pollution inference,” Sci. Total Environ., vol. 811, 2022.</p><p>[21] Z. Zhou, X. Chen, E. Li, L. Zeng, K. Luo, and J. Zhang, “Edge Intelligence: Paving the Last Mile of Artificial Intelligence with Edge Computing,” Proc. IEEE, vol. 107, pp. 1738–1762, 2019.</p><p>[22] G. H. Hong, T. C. Le, J. W. Tu, C. Wang, S. C. Chang, J. Y. Yu, G. Y. Lin, S. G. Aggarwal, and C. J. Tsai, “Long-term evaluation and calibration of three types of low-cost PM2.5 sensors at different air quality monitoring stations,” J. Aerosol Sci., vol. 157, 2021.</p><p>[23] F. M. J. Bulot, S. J. Johnston, P. J. Basford, N. H. C. Easton, M. Apetroaie-Cristea, G. L. Foster, A. K. R. Morris, S. J. Cox, and M. Loxham, “Long-term field comparison of multiple low-cost particulate matter sensors in an outdoor urban environment,” Sci. Rep., vol. 9, 2019.</p><p>[24] F. M. J. Bulot, S. J. Ossont, A. K. R. Morris, P. J. Basford, N. H. C. Easton, H. L. Mitchell, G. L. Foster, S. J. Cox, and M. Loxham, “Characterisation and calibration of low-cost PM sensors at high temporal resolution to reference-grade performance,” Heliyon, vol. 9, 2023.</p><p>[25] BayesWitnesses, “m2cgen: Machine learning models to native code transpiler,” GitHub Repository, 2023. [Online]. Available: <a href="https://github.com/BayesWitnesses/m2cgen">https://github.com/BayesWitnesses/m2cgen</a></p><p>[26] R. David, J. Duke, A. Jain, V. J. Reddi, N. Jeffries, J. Li, N. Kreeger, I. Nappier, M. Natraj, S. Regev, R. Rhodes, T. Wang, and P. Warden, “TensorFlow Lite Micro: Embedded machine learning on TinyML systems,” in Proc. 4th MLSys Conf., San Jose, CA, 2021.</p><p>[27] Espressif Systems, “ESP-NN: Optimized neural network functions for Espressif chipsets,” GitHub Repository, 2023. [Online]. Available: <a href="https://github.com/espressif/esp-nn">https://github.com/espressif/esp-nn</a></p><p>[28] S. Chae, J. Shin, S. Kwon, S. Lee, S. Kang, and D. Lee, “PM10 and PM2.5 real-time prediction models using an interpolated convolutional neural network,” Sci. Rep., vol. 11, 2021.</p><p>[29] M. Teng, S. Li, J. Xing, G. Song, J. Yang, J. Dong, X. Zeng, and Y. Qin, “24-Hour prediction of PM2.5 concentrations by combining empirical mode decomposition and bidirectional long short-term memory neural network,” Sci. Total Environ., vol. 821, 2022.</p><p>[30] R. Caruana, “Multitask Learning,” Mach. Learn., vol. 28, pp. 41–75, 1997.</p><p>[31] D. Xu, Y. Shi, I. W. Tsang, Y.-S. Ong, C. Gong, and X. Shen, “A Survey on Multi-output Learning,” IEEE Trans. Neural Netw. Learn. Syst., vol. 31, pp. 2409–2429, 2020.</p><p>[32] V. J. Reddi, B. Plancher, S. Kennedy, L. Moroney, P. Warden, A. Agarwal, et al., “Widening Access to Applied Machine Learning with TinyML,” Harv. Data Sci. Rev., vol. 4, 2022.</p><p>[33] P. Warden and D. Situnayake, TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers, 1st ed., O’Reilly Media, Sebastopol, CA, 2019.</p><p>[34] Y. Abadade, A. Temouden, H. Bamoumen, N. Benamar, Y. Chtouki, and A. S. Hafid, “A Comprehensive Survey on TinyML,” IEEE Access, vol. 11, pp. 96892–96922, 2023.</p><p>[35] S. S. Saha, S. S. Sandha, and M. Srivastava, “Machine Learning for Microcontroller-Class Hardware: A Review,” IEEE Sens. J., vol. 22, pp. 21362–21390, 2022.</p><p>[36] I. N. K. Wardana, S. A. Fahmy, and J. W. Gardner, “TinyML Models for a Low-Cost Air Quality Monitoring Device,” IEEE Sens. Lett., vol. 7, 2023.</p><p>[37] L. Fortuna, S. Graziani, A. Rizzo, and M. G. Xibilia, Soft Sensors for Monitoring and Control of Industrial Processes, 1st ed., Springer Science &amp; Business Media, 2007.</p><p>[38] P. Kadlec, B. Gabrys, and S. Strandt, “Data-driven Soft Sensors in the process industry,” Comput. Chem. Eng., vol. 33, pp. 795–814, 2009.</p><p>[39] S. De Vito, E. Esposito, M. Salvato, O. Popoola, F. Formisano, R. Jones, and G. Di Francia, “Calibrating chemical multisensory devices for real world applications: An in-depth comparison of quantitative machine learning approaches,” Sens. Actuators B Chem., vol. 255, pp. 1191–1210, 2018.</p><p>[40] J. Sun, J. Gong, and J. Zhou, “Estimating hourly PM2.5 concentrations in Beijing with satellite aerosol optical depth and a random forest approach,” Sci. Total Environ., vol. 762, 2021.</p><p>[41] S. Uttamang and V. P. Aneja, “Investigation of criteria air pollutants and aerosol characterization in Bangkok, Thailand,” Environ. Sci. Atmos., vol. 3, pp. 245–258, 2023.</p><p>[42] N. Thongyen and P. Sompongchaiyakul, “Spatial distribution and health risk assessment of particulate-bound toxic metals in the Bangkok urban atmosphere,” Atmos. Pollut. Res., vol. 14, p. 101780, 2023.</p><p>[43] K. Thepnuan, B. Yabueng, et al., “Atmospheric transport and regional dispersion of particulate matter and trace elements along the coastal zones of the Upper Gulf of Thailand,” Bull. Environ. Contam. Toxicol., vol. 110, pp. 45–56, 2023.</p><p>[44] C. Bergmeir and J. M. Benítez, “On the use of cross-validation for time series predictor evaluation,” Inf. Sci., vol. 191, pp. 192–213, 2012.</p><p>[45] P. Dejchanchaiwong and P. Tekasakul, “Characterization of carbonaceous aerosols and regional smoke haze transport in Central and Southern Thailand,” Atmos. Pollut. Res., vol. 15, p. 101950, 2024.</p><p>[46] W. Jinsart and K. Tamura, “Seasonal variation of PM10 and PM2.5 in Bangkok traffic corridors: Chemical composition and diurnal patterns,” Chemosphere, vol. 280, p. 130640, 2021.</p><p>[47] S. Wetchayont and S. Pengcheun, “Diurnal and seasonal dynamics of boundary layer meteorology and air quality in the coastal plain of Thailand,” Atmos. Environ., vol. 310, p. 120010, 2024.</p><p>[48] A. Kendall, Y. Gal, and R. Cipolla, “Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics,” in Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2018, pp. 7482–7491.</p><p>[49] S. Shanmugavelu, M. Taillefumier, C. Culver, O. Hernandez, M. Coletti, and A. Sedova, “Impacts of floating-point non-associativity on reproducibility for HPC and deep learning applications,” in Proc. SC 2024-W: Workshops Int. Conf. High Perform. Comput. Netw. Storage Anal., Atlanta, GA, USA, 2024, pp. 170–179.</p><p>[50] P. Adong, E. Bainomugisha, D. Okure, and R. Sserunjogi, “Applying machine learning for large scale field calibration of low-cost PM2.5 and PM10 air pollution sensors,” Appl. AI Lett., vol. 3, 2022.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f51956582dfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AN ASYMMETRIC EDGE-CLOUD DECOUPLED ARCHITECTURE FOR DECOMPOSITION-BASED PM2.5]]></title>
            <link>https://medium.com/@nphassrsngsangka/an-asymmetric-edge-cloud-decoupled-architecture-for-decomposition-based-pm2-5-d45753b73b41?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d45753b73b41</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 01:16:23 GMT</pubDate>
            <atom:updated>2026-10-25T01:16:23.493Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>AN ASYMMETRIC EDGE-CLOUD DECOUPLED ARCHITECTURE FOR DECOMPOSITION-BASED PM2.5 FORECASTING ON RESOURCE-CONSTRAINED MICROCONTROLLERS</strong></h3><p><strong>AN ASYMMETRIC EDGE-CLOUD DECOUPLED ARCHITECTURE FOR DECOMPOSITION-BASED PM2.5 FORECASTING ON RESOURCE-CONSTRAINED MICROCONTROLLERS</strong></p><p><strong><em>Abstract : </em></strong>While hybrid CEEMDAN-LSTM models can improve PM2.5 forecasting accuracy, their ensemble-based decomposition and iterative sifting stages make direct execution of the complete pipeline impractical on resource-constrained microcontrollers such as ESP32-class edge nodes due to high SRAM requirements. To resolve this computational bottleneck and preserve decomposition benefits, we propose an asymmetric edge-cloud decoupled architecture that assigns CEEMDAN decomposition to the server while physically deploying a lightweight INT8-quantized LSTM on the ESP32-S3 microcontroller. In the proposed online workflow, the server decomposes historical PM2.5 observations and transmits the (168,14) decomposed feature tensor to the ESP32-S3 over Wi-Fi for multi-horizon inference. This data transfer requires a payload of only 2.30 KB per cycle. In the present experiments, server-side feature generation and network transmission were emulated offline, whereas the recurrent inference stage was implemented and executed on the ESP32-S3. Evaluated on a three-year Bangkok dataset, CEEMDAN-LSTM achieves an R² of 0.864 at the 1-hour horizon and 0.595 at 6 hours, outperforming the raw-input baselines at both horizons, with a larger margin at 6 hours. On-device ESP32-S3 evaluation yielded an R² of 0.824 and an average device-side inference latency of 995.48 ms. The serialized INT8 model occupies only 68.38 KB, representing a 54.1% memory reduction compared to the offline Float32 reference without significant accuracy degradation. These results demonstrate the physical feasibility of the recurrent inference stage and support the proposed asymmetric task allocation for multi-scale PM2.5 forecasting on resource-constrained microcontrollers.</p><p><strong><em>IndexTerms — </em></strong>PM2.5 forecasting, On-device inference, Asymmetric Architecture, CEEMDAN, Long Short-Term Memory (LSTM), TinyML, ESP32-S3, Bangkok air quality.</p><p><strong>________________________________________________________________________________________________________</strong></p><p><strong>I. INTRODUCTION</strong></p><p>Fine particulate matter (PM2.5) is among the most consequential environmental risk factors for human health, contributing to millions of premature deaths annually [1]. Metropolitan regions like Bangkok, Thailand, frequently record PM2.5 concentrations exceeding WHO guidelines due to intense vehicular traffic, agricultural biomass burning, and regional industrial activities [2]. Accurately forecasting these levels is therefore critical, yet PM2.5 time series are nonlinear and non-stationary and contain temporal structures at multiple scales, including short-term fluctuations, diurnal cycles, synoptic variations, and seasonal trends [3, 4].</p><p>Traditional statistical models may struggle to represent nonlinear and long-range temporal dependencies in PM2.5 series. Consequently, LSTM-based architectures have been widely adopted for air-quality forecasting because of their ability to model sequential dependencies [4–6]. However, models trained directly on raw PM2.5 series may have difficulty jointly representing high-frequency fluctuations and low-frequency trends.</p><p>To overcome this bottleneck, empirical decomposition methods are used to pre-process raw signals. Complete Ensemble Empirical Mode Decomposition with Adaptive Noise (CEEMDAN) improves on this by reducing mode-mixing while ensuring exact signal reconstruction [7, 8]. The resulting Intrinsic Mode Functions (IMFs) provide a data-adaptive multi-scale representation of the original signal. Combining CEEMDAN with LSTM has been shown to improve PM2.5 forecasting by decomposing the original series into components with different frequency characteristics before prediction [3, 9].</p><p>Executing inference on edge devices can reduce cloud-side workload and enable predictions to be consumed directly by local applications [10, 11]. However, microcontroller units impose strict memory, computational, and power constraints [11–13]. Although TensorFlow Lite Micro supports neural-network inference on such devices [12], CEEMDAN remains difficult to execute locally because its ensemble-based sifting repeatedly performs extrema detection, spline interpolation, and intermediate-buffer operations [7, 8]. Existing CEEMDAN-based PM2.5 forecasting studies primarily evaluate predictive accuracy on workstation or server-class platforms [3, 4, 14, 15]. Edge-assisted air-quality forecasting has also been investigated, optimizing a deep-learning model for hourly PM2.5 prediction on resource-constrained edge devices and introducing a multi-task offloading strategy to distribute computational tasks between edge devices and servers [16]. That approach focuses on model optimization and task offloading rather than partitioning signal decomposition and recurrent inference across server and microcontroller resources. Consequently, the physical implementation and evaluation of multi-channel recurrent inference for CEEMDAN-based PM2.5 forecasting on ESP32-class devices remain insufficiently investigated.</p><p>To address this implementation gap, this paper introduces an Asymmetric Edge–Cloud Decoupled Architecture that assigns computationally intensive CEEMDAN decomposition to the server while deploying a compact recurrent forecasting model on the ESP32-S3. The server generates a multi-scale feature tensor from the available PM2.5 history, while the microcontroller executes a two-layer, multi-channel LSTM without local signal decomposition. The novelty lies in the hardware-aware task allocation and physical realization of recurrent inference rather than in a new CEEMDAN or LSTM algorithm. This task division is asymmetric: the computationally intensive feature extraction is centralized on the server, while the resource-constrained recurrent prediction is executed locally on the microcontroller. The main contributions of this study are as follows: (1) an asymmetric architecture combining causal server-side CEEMDAN with edge-side INT8 inference; (2) hardware deployment of a 33,185-parameter, two-layer LSTM processing a (168,14) tensor on ESP32-S3; (3) joint processing of 13 IMFs and one residual within a single model; (4) evaluation of multi-horizon accuracy, serialized model size, on-device accuracy, and device-side latency.</p><p><strong>II. PROPOSED METHODOLOGY</strong></p><p><strong><em>A. Data Acquisition and Causal Window Preparation</em></strong></p><p>In this study, hourly PM2.5 concentrations were obtained from the US Embassy monitoring station in Bangkok, Thailand (January 2021 to December 2023). Prior high-resolution atmospheric and dispersion modelling has shown that road-traffic emissions and seasonal transboundary biomass burning are dominant contributors to ambient particulate pollution in the Bangkok Metropolitan Region [17]. These data were recorded via Beta Attenuation Monitors following US EPA protocols [18] and retrieved from the AirNow database. Records flagged with operational anomaly codes were excluded prior to preprocessing to prevent sensor malfunction artifacts from corrupting the spectral sifting process. Because CEEMDAN requires a continuous, gap-free input for its cubic-spline envelope interpolation, all missing values across 141 discontinuous sensor downtime segments were filled using linear interpolation, with 128 segments (90.8%) lasting 24 hours or fewer. The resulting dataset contains 22,165 valid hourly observations. The cleaned series was chronologically partitioned into training (80%), validation (10%), and test (10%) subsets. For each forecast origin, only observations available up to that time were used to generate the input, while the prediction target was the PM2.5 concentration at the corresponding 1-hour or 6-hour horizon. After decomposition, the latest 168 samples of the resulting components formed the LSTM input. The MinMaxScaler was fitted on the training samples and applied unchanged to validation and test data.</p><p><strong><em>B. CEEMDAN Decomposition</em></strong></p><p>The Bangkok PM2.5 signal is shaped by overlapping temporal dynamics, from daily emission cycles to slowly varying seasonal patterns, motivating a data-adaptive decomposition before neural-network training. The foundation of this approach is Empirical Mode Decomposition (EMD) [19], which recursively extracts local oscillatory components via cubic-spline envelope interpolation. However, EMD is susceptible to mode mixing, where a single oscillatory mode may be split across multiple Intrinsic Mode Functions (IMFs) or distinct modes may blend within one IMF [7, 8].</p><p>CEEMDAN addresses this by injecting adaptive noise at successive decomposition stages rather than averaging noise-perturbed copies directly, yielding a cleaner separation of oscillatory modes alongside a residual trend component [7, 8].</p><p>Using the causal sample-generation procedure defined in Section II.A, CEEMDAN was applied using only PM2.5 observations available up to each forecast origin. The PyEMD implementation used 50 ensemble trials and a noise coefficient of 0.05, producing 13 IMFs and one residual. The latest 168 samples of these components formed the fixed (168,14) input tensor for predicting the raw concentration at the corresponding forecast horizon.</p><p>Compared with the raw signal, the decomposition provides a structured multi-channel input in which high-frequency IMFs represent rapid fluctuations, lower-frequency components describe slower variations, and the residual captures the long-term trend. This representation allows the forecasting model to learn from multiple apparent temporal scales within a single input tensor.</p><p><strong><em>C. Asymmetric Edge-Cloud Deployment Architecture</em></strong></p><p>The central deployment constraint is the memory demand of ensemble decomposition on the target microcontroller. Even for a minimal 168-sample working window, retaining 50 trials of 14 floating-point components requires 50 × 14 × 168 × 4 = 470,400 bytes, while an additional 50 × 168 × 4 = 33,600 bytes are required for the ensemble-noise matrix. These buffers total 504,000 bytes, approximately 492.2 KB, before accounting for residuals, spline envelopes, extrema arrays, and sifting buffers. Under the considered implementation, this approaches the nominal on-chip SRAM capacity of the ESP32-S3 and motivates assigning CEEMDAN to the server.</p><p>As shown in Fig. 1, CEEMDAN decomposition and feature preparation are assigned to the server. At each forecasting cycle, the server processes only the PM2.5 observations available at that time, extracts the latest 168 samples of 13 IMFs and one residual, applies training-fitted normalization and INT8 quantization, and generates a (168,14) tensor. This tensor contains 168 × 14 = 2,352 elements, corresponding to 2,352 bytes (2.30 KB) in INT8 format. This represents a 75% reduction from the 9,408-byte (9.19 KB) Float32 equivalent, excluding communication-protocol overhead. The INT8 tensor is then transmitted to the ESP32-S3 over Wi-Fi for recurrent inference.</p><p>Fig. 1. Intended workflow of the proposed asymmetric edge-cloud architecture. The server generates the normalized INT8 (168,14) feature tensor through causal CEEMDAN processing, while the physical ESP32-S3 executes the quantized LSTM inference stage without local signal decomposition.</p><p>Specifically, a clear distinction must be made between the offline training phase and the online inference phase. During offline training, the entire historical PM2.5 time series is partitioned into training, validation, and test sets, and the CEEMDAN decomposition is performed to prepare the training database. In the online prediction phase, no dataset partitioning is performed. Instead, the server maintains a sliding lookback window of the most recent 168 hourly PM2.5 observations, applies CEEMDAN decomposition to this active window to extract the latest multi-scale features, applies the training-fitted normalization and the same INT8 quantization parameters obtained during post-training quantization, and transmits only the resulting single (168, 14) INT8 feature tensor to the ESP32-S3. The edge device receives the pre-quantized tensor, loads it directly into the TensorFlow Lite Micro input buffer, and executes the recurrent forecasting model to predict the PM2.5 concentration at the target horizon. Signal decomposition, normalization, and input quantization are therefore performed on the server, reducing the computational workload of the ESP32-S3.</p><p>On the server side, CEEMDAN performs ensemble generation, extrema detection, spline interpolation, and iterative sifting, after which normalization and INT8 quantization produce the multi-scale input tensor. These operations remain on the server because they require repeated signal buffers and are not part of edge execution. On the edge side, the ESP32-S3 retains only the current input tensor, loads it directly into the TensorFlow Lite Micro input buffer, and executes the two-layer LSTM forward pass directly on the received tensor, with no decomposition or repeated preprocessing performed at the edge. The quantized scalar output is then converted back to PM2.5 concentration units using the stored quantization and scaling parameters. This asymmetric allocation confines memory-intensive feature generation to the server and resource-bounded recurrent inference to the microcontroller. It reduces edge memory and computation, but retains server dependence for generating multi-scale features.</p><p>The edge forecaster is a compact multi-channel LSTM with 33,185 trainable parameters. The (168,14) input passes through two cascaded LSTM layers [5], followed by a 16-unit ReLU dense layer and a linear output. The same architecture was used at both horizons, but a separate scalar-output model was trained for each horizon. The complete configuration is summarized in Table 1.</p><p><strong>Table 1: Layer configuration and parameter counts of the proposed CEEMDAN-LSTM model.</strong></p><p><strong>Module</strong></p><p><strong>No.</strong></p><p><strong>Layer</strong></p><p><strong>Activation</strong></p><p><strong>Output Shape</strong></p><p><strong>Parameters</strong></p><p>Input</p><p>1</p><p>Input</p><p>—</p><p>(168, 14)</p><p>0</p><p>Feature Extraction</p><p>2</p><p>LSTM</p><p>Tanh</p><p>(168, 64)</p><p>20,224</p><p>Feature Extraction</p><p>3</p><p>LSTM</p><p>Tanh</p><p>(32, )</p><p>12,416</p><p>Regression</p><p>4</p><p>Dense</p><p>ReLU</p><p>(16, )</p><p>528</p><p>Regression</p><p>5</p><p>Dense</p><p>Linear</p><p>(1, )</p><p>17</p><p>Total Parameters</p><p>33,185</p><p>Models were optimized offline using Adam [20] with MSE loss, mini-batches of 64, up to 100 epochs, and early stopping (patience = 15) on validation loss. Post-training integer quantization used 100 representative training windows to produce the TFLite model deployed with TensorFlow Lite Micro [12]. In the present experiments, the causal feature tensors were pre-computed and supplied to the physical ESP32-S3, allowing model conversion, firmware integration, on-device accuracy, and device-side latency to be evaluated without implementing live server-edge transmission. Together, the asymmetric task allocation and INT8 deployment enable multi-scale recurrent inference on the ESP32 while confining decomposition overhead to the server and limiting edge-side model storage.</p><p><strong><em>D. Evaluation Metrics</em></strong></p><p>To quantify forecasting accuracy, we employed three complementary standard metrics: the coefficient of determination (R²), Root Mean Square Error (RMSE), and Mean Absolute Error (MAE). While R² indicates the proportion of target variance captured by the model, both RMSE and MAE assess the absolute magnitude of prediction errors in native concentration units (µg/m³). These mathematical indicators are defined in Equations (1)–(3):</p><p><em>R² = 1 − [ ∑ᵢ₌₁ⁿ (yᵢ − ŷᵢ)² ] / [ ∑ᵢ₌₁ⁿ (yᵢ − ȳ)² ] (1)</em></p><p><em>RMSE = √ [ (1/n) ∑ᵢ₌₁ⁿ (yᵢ − ŷᵢ)² ] (2)</em></p><p><em>MAE = (1/n) ∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ| (3)</em></p><p>where n represents the total sample size, yᵢ and ŷᵢ denote the actual and predicted concentrations for the i-th instance, and ȳ is the average of all observed values.</p><p><strong>III. EXPERIMENTAL RESULTS AND DISCUSSION</strong></p><p><strong><em>A. Multi-Horizon Forecasting Accuracy</em></strong></p><p>Before comparing forecasting accuracy, we first inspect the organization of the CEEMDAN components supplied to the LSTM. Fig. 2 presents an illustrative decomposition of the complete Bangkok series: the early IMFs exhibit rapid oscillations, whereas the later IMFs vary more slowly and the residual follows the long-term evolution. This visible progression represents the practical multi-scale advantage examined here, because short-lived fluctuations and background variation are separated rather than combined within a single raw trajectory. The visually distinct oscillatory scales are also qualitatively consistent with CEEMDAN’s intended reduction of mode mixing. The figure is used only to illustrate the resulting representation. All forecasting inputs and metrics were generated causally using observations available at each forecast origin. Instantaneous-frequency distributions, mode-separation indices, and IMF orthogonality were not quantified, so Fig. 2 shows the general pattern rather than the actual extent of mode-mixing reduction or whether each IMF corresponds to a distinct physical process.</p><p>Fig. 2. Illustrative CEEMDAN decomposition of the complete Bangkok PM2.5 series into representative IMFs and the residual.</p><p>To evaluate the forecasting value of the decomposed representation, CEEMDAN-LSTM was compared with two raw-input baselines at the 1-hour and 6-hour horizons. The Random Forest used 50 trees and a maximum depth of 10, selected by grid search on the validation set. The standalone LSTM used the same recurrent and dense-layer configuration and training settings as the proposed model but received a single-channel raw 168-hour sequence, resulting in fewer parameters, as reported in Table 3. Accordingly, the comparison evaluates the complete decomposed multi-channel input strategy rather than an isolated CEEMDAN effect under identical parameter counts. Table 2 reports RMSE, MAE, and R² on the full held-out test set.</p><p><strong>Table 2: Forecasting performance comparison on the full held-out Bangkok test set.</strong></p><p><strong>Horizon</strong></p><p><strong>Model</strong></p><p><strong>RMSE (µg/m³)</strong></p><p><strong>MAE (µg/m³)</strong></p><p><strong>R²</strong></p><p>1 hour</p><p>Random Forest</p><p>5.77</p><p>4.05</p><p>0.678</p><p>1 hour</p><p>LSTM (Standalone)</p><p>6.02</p><p>4.19</p><p>0.649</p><p>1 hour</p><p>CEEMDAN-LSTM (Proposed)</p><p>3.75</p><p>2.63</p><p>0.864</p><p>6 hour</p><p>Random Forest</p><p>9.42</p><p>6.04</p><p>0.268</p><p>6 hour</p><p>LSTM (Standalone)</p><p>9.69</p><p>6.34</p><p>0.226</p><p>6 hour</p><p>CEEMDAN-LSTM (Proposed)</p><p>7.01</p><p>4.47</p><p>0.595</p><p>Table 2 shows that CEEMDAN-LSTM achieved lower RMSE and MAE and higher R² than both raw-input baselines at the evaluated horizons. At 1 hour, it obtained R² = 0.864 and RMSE = 3.75 µg/m³, compared with R² = 0.649 and RMSE = 6.02 µg/m³ for LSTM and R² = 0.678 and RMSE = 5.77 µg/m³ for Random Forest. At 6 hours, all models showed lower predictive performance, but CEEMDAN-LSTM retained R² = 0.595, compared with 0.226 for LSTM and 0.268 for Random Forest. These results indicate an accuracy advantage for the decomposed multi-channel input under the evaluated configuration, with a larger R² margin at the longer horizon.</p><p>Similar forecasting gains from decomposition-based PM2.5 inputs have been reported in previous studies [3, 9, 14, 15]. In the present study, a plausible interpretation is that separating rapid fluctuations from more slowly varying behavior provides the LSTM with a structured multi-channel representation. No IMF-group ablation or feature-attribution analysis was conducted, so the results do not show whether specific low-frequency IMFs are responsible for the longer-horizon improvement.</p><p>Fig. 3. Predicted and actual PM2.5 concentrations over a 300-hour segment of the held-out test set at the 1-hour horizon: (a) Random Forest, (b) standalone LSTM, and © CEEMDAN-LSTM.</p><p>Fig. 3 provides a closer view of the 1-hour forecasts over a 300-hour segment of the test set. Within this interval, CEEMDAN-LSTM follows the observed trajectory and several rapid concentration increases more closely than the two raw-input baselines. This visual agreement is consistent with the full-test results in Table 2 and suggests better tracking of short-term variation, although a separate peak-event analysis would be needed to quantify this behavior.</p><p><strong><em>B. Model Deployment and Profiling on ESP32-S3</em></strong></p><p>Having established forecasting performance, we next assess serialized model storage and physical execution on the ESP32-S3. Table 3 compares the proposed asymmetric strategy against alternative task allocations and characterizes the edge inference models. For an edge-only approach with on-device CEEMDAN, the estimated decomposition buffer for a 50-trial ensemble on a 168-sample window is approximately 492 KB, which exceeds the nominal ESP32-S3 SRAM and renders it infeasible. The proposed asymmetric allocation avoids this bottleneck, requiring only 2.30 KB of data transfer per cycle and 68.38 KB for the INT8 model, while maintaining partial offline capability if the last received feature tensor is cached on the device. Increasing the input from one to 14 channels raises the parameter count from 29,857 to 33,185, representing an 11.1% increase. Following TFLite INT8 conversion, the serialized multi-channel model size is reduced by 54.1% to 68.38 KB. Note that this value denotes serialized TFLite model size, not total firmware size or runtime SRAM use, as the available storage budget depends on the selected application partition [21]. As an analytical reference, 14 independent copies of the single-channel INT8 model would require approximately 911.68 KB, illustrating the storage advantage of joint multi-channel processing.</p><p>Fig. 4. Physical ESP32-S3 edge deployment, data streaming, and hardware measurement profiling testbed.</p><p><strong>Table 3: Deployment strategy comparison and serialized model characteristics. Parameters, Float32 size, and INT8 size refer to the edge inference component. Edge RAM reflects the decomposition buffer requirement. R² for Cloud-only and Edge-only (LSTM) are offline references from Table 2. Only Proposed method was physically measured on-device (INT8, ESP32-S3).</strong></p><p><strong>Strategy</strong></p><p><strong>Parameters</strong></p><p><strong>Float32 Size</strong></p><p><strong>INT8 Size</strong></p><p><strong>Edge RAM</strong></p><p><strong>Data / Cycle</strong></p><p><strong>R²</strong></p><p><strong>Offline Mode</strong></p><p>Cloud-only (CEEMDAN-LSTM)</p><p>—</p><p>—</p><p>—</p><p>≈ 0</p><p>≈ 4 B</p><p>0.864</p><p>No</p><p>Edge-only (LSTM)</p><p>29,857</p><p>135.96 KB</p><p>65.12 KB</p><p>Low</p><p>0</p><p>0.649</p><p>Yes</p><p>Edge-only (CEEMDAN-LSTM)</p><p>—</p><p>—</p><p>—</p><p>≈ 492 KB</p><p>0</p><p>—</p><p>No</p><p>Proposed Asymmetric Method</p><p>33,185</p><p>148.96 KB</p><p>68.38 KB</p><p>Low</p><p>2.30 KB</p><p>0.824</p><p>Partial</p><p>The INT8 CEEMDAN-LSTM was then executed on the ESP32-S3 device using pre-computed (168,14) feature tensors. Evaluated on the same held-out test set, the on-device INT8 implementation achieved R² = 0.824, corresponding to an absolute decrease of 0.040 compared to the offline Float32 reference. Because the evaluation samples and network architecture were held fixed, this performance gap is entirely attributable to INT8 quantization and on-device numerical execution. The average device-side inference latency, measured from receipt of a feature tensor to production of the dequantized prediction, was 995.48 ms. This is roughly 0.03% of the 1-hour forecast interval, well within the timing budget of the intended hourly forecasting cycle.</p><p>Fig. 5. On-device time-varying forecast versus actual PM2.5 concentrations on physical ESP32-S3 hardware for the 1-hour horizon using INT8-quantized CEEMDAN-LSTM. Full-test evaluation yielded an on-device R² of 0.824 and an average device-side latency of 995.48 ms.</p><p><strong>IV. CONCLUSION</strong></p><p>This study presents a hardware-aware asymmetric edge-cloud architecture that assigns causal CEEMDAN feature generation to a server and physically deploys a two-layer, multi-channel, INT8-quantized LSTM on the ESP32-S3. A single recurrent model jointly processes 13 IMFs and one residual, allowing the edge device to use multi-scale information without performing local signal decomposition. Offline evaluation showed that CEEMDAN-LSTM outperformed the raw-input baselines, achieving R² = 0.864 and R² = 0.595 at the 1-hour and 6-hour horizons, respectively. After model conversion and quantization, the serialized model size was reduced to 68.38 KB, representing a 54.1% reduction. On the same held-out test set, the deployed INT8 implementation achieved an on-device R² = 0.824, an absolute decrease of 0.040, with an average device-side latency of 995.48 ms and a data transfer payload of only 2.30 KB per forecast cycle. These findings support the proposed hardware-aware task allocation and the physical feasibility of recurrent inference on the target microcontroller.</p><p>In the present experiments, causal feature tensors were pre-computed and supplied to the ESP32-S3, so only the recurrent inference stage was evaluated on physical hardware, and the reported latency excludes server-side decomposition and network transmission. Several aspects were also not quantified in this study, including mode-separation quality of the CEEMDAN output, the contribution of individual IMF groups to the longer-horizon accuracy gain, and peak-event tracking performance. Future work will integrate the full communication pipeline, quantify mode-separation and IMF-group contributions, examine CEEMDAN consistency under continuous causal operation, characterize system-level performance including latency and energy consumption, and extend validation to additional monitoring sites and geographic regions to assess framework transferability.</p><p><strong>ACKNOWLEDGMENT</strong></p><p>This research is supported by the Department of Computer Engineering, Faculty of Engineering, Chulalongkorn University, Bangkok, Thailand, under the Graduate Research and Research Assistantship Support Program.</p><p><strong>REFERENCES</strong></p><p>[1] Cohen, A.J., Brauer, M., Burnett, R., Anderson, H.R., Frostad, J., Estep, K., Balakrishnan, K., Brunekreef, B., Dandona, L., Dandona, R., Feigin, V., Freedman, G., Hubbell, B., Jobling, A., Kan, H., Knibbs, L., Liu, Y., Martin, R., Morawska, L., Pope, C.A., Shin, H., Straif, K., Shaddick, G., Thomas, M., van Dingenen, R., van Donkelaar, A., Vos, T., Murray, C.J.L., Forouzanfar, M.H.: Estimates and 25-year trends of the global burden of disease attributable to ambient air pollution: an analysis of data from the Global Burden of Diseases Study 2015. The Lancet. 389, 1907–1918 (2017).</p><p>[2] Phairuang, W., Suwattiga, P., Hongtieab, S., Inerb, M., Furuuchi, M., Hata, M.: Characteristics and source apportionment of ambient PM2.5 in Bangkok, Thailand. Atmospheric Pollution Research. 12, 101185 (2021).</p><p>[3] Ban, W., Shen, L.: PM2.5 Prediction Based on the CEEMDAN Algorithm and a Machine Learning Hybrid Model. Sustainability (Switzerland). 14, (2022).</p><p>[4] Zaini, N., Ean, L.W., Ahmed, A.N., Malek, M.A.: A systematic literature review of deep learning neural network for time series air quality forecasting. Environmental Science and Pollution Research. 29, (2022).</p><p>[5] Hochreiter, S., Schmidhuber, J.: Long Short-Term Memory. Neural Comput. 9, 1735–1780 (1997).</p><p>[6] Qin, D., Yu, J., Zou, G., Yong, R., Zhao, Q., Zhang, B.: A Novel Combined Prediction Scheme Based on CNN and LSTM for Urban PM2.5 Concentration. IEEE Access. 7, 20050–20059 (2019).</p><p>[7] Torres, M.E., Colominas, M.A., Schlotthauer, G., Flandrin, P.: A complete ensemble empirical mode decomposition with adaptive noise. In: 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). pp. 4144–4147 (2011).</p><p>[8] Colominas, M.A., Schlotthauer, G., Torres, M.E.: Improved complete ensemble EMD: A suitable tool for biomedical signal processing. Biomed. Signal Process. Control. 14, 19–29 (2014).</p><p>[9] Ameri, R., Hsu, C.C., Band, S.S., Zamani, M., Shu, C.M., Khorsandroo, S.: Forecasting PM 2.5 concentration based on integrating of CEEMDAN decomposition method with SVM and LSTM. Ecotoxicol. Environ. Saf. 266, 115572 (2023).</p><p>[10] Alajlan, N.N., Ibrahim, D.M.: TinyML: Enabling of Inference Deep Learning Models on Ultra-Low-Power IoT Edge Devices for AI Applications. Micromachines (Basel). 13, (2022).</p><p>[11] Abadade, Y., Temouden, A., Bamoumen, H., Benamar, N., Chtouki, Y., Senhaji Hafid, A.: A Comprehensive Survey on TinyML. IEEE Access. 11, 96892–96922 (2023).</p><p>[12] David, R., Duke, J., Jain, A., Reddi, V.J., Jeffries, N., Li, J., Kreeger, N., Nappier, I., Natraj, M., Regev, S., Rhodes, R., Wang, T., Warden, P.: TensorFlow Lite Micro: Embedded machine learning on TinyML systems. In: Proceedings of the 4th MLSys Conference. , San Jose, CA (2021).</p><p>[13] Warden, P., Situnayake, D.: TinyML Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers. O’Reilly Media, CA (2019).</p><p>[14] Cai, P., Zhang, C., Chai, J.: Forecasting hourly PM2.5 concentrations based on decomposition-ensemble-reconstruction framework incorporating deep learning algorithms. Data Science and Management. 6, 46–54 (2023).</p><p>[15] Teng, M., Li, S., Xing, J., Song, G., Yang, J., Dong, J., Zeng, X., Qin, Y.: 24-Hour prediction of PM2.5 concentrations by combining empirical mode decomposition and bidirectional long short-term memory neural network. Science of the Total Environment. 821, (2022).</p><p>[16] Sun, C., Li, J., Sulaiman, R., Alotaibi, B.S., Elattar, S., Abuhussain, M.: Air Quality Prediction and Multi-Task Offloading based on Deep Learning Methods in Edge Computing. J. Grid Comput. 21, (2023).</p><p>[17] Aman, N., Manomaiphiboon, K., Pengchai, P., Assareh, N., Dejchanchaiwong, R.: High-resolution spatial modeling of traffic-related air pollution in Bangkok, Thailand. Atmos. Environ. 246, 118090 (2021).</p><p>[18] Dhammapala, R.: Analysis of fine particle pollution data measured at 29 US diplomatic posts worldwide. Atmos. Environ. 213, 367–376 (2019).</p><p>[19] Huang, N., Shen, Z., Long, S., Wu, M., Shih, H., Zheng, Q., Yen, N.-C., Chao Tung, C., Liu, H.: The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences. 454, 903–995 (1998).</p><p>[20] Kingma, D., Ba, J.: Adam: A Method for Stochastic Optimization. In: International Conference on Learning Representations (2015).</p><p>[21] Espressif Systems: ESP-IDF Programming Guide: Partition Tables, <a href="https://docs.espressif.com/projects/esp-idf/,">https://docs.espressif.com/projects/esp-idf/,</a> last accessed 2026/07/11.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d45753b73b41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MASKING-ASSISTED EMPIRICAL MODE DECOMPOSITION AND BIDIRECTIONAL LSTM FOR MULTI-HORIZON PM2.5]]></title>
            <link>https://medium.com/@nphassrsngsangka/masking-assisted-empirical-mode-decomposition-and-bidirectional-lstm-for-multi-horizon-pm2-5-567309f44a22?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/567309f44a22</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 01:14:41 GMT</pubDate>
            <atom:updated>2026-10-25T01:14:41.980Z</atom:updated>
            <content:encoded><![CDATA[<h3>MASKING-ASSISTED EMPIRICAL MODE DECOMPOSITION AND BIDIRECTIONAL LSTM FOR MULTI-HORIZON PM2.5 FORECASTING</h3><p>MASKING-ASSISTED EMPIRICAL MODE DECOMPOSITION AND BIDIRECTIONAL LSTM FOR MULTI-HORIZON PM2.5 FORECASTING</p><p><strong>Abstract: </strong>This study examines masking-assisted empirical mode decomposition (Masking-EMD) coupled with bidirectional long short-term memory (BiLSTM) networks for PM2.5 forecasting. Opposite-phase sinusoidal masks are applied before paired IMF extraction and averaging; component forecasts and a residual forecast are then summed. The dataset comprises 19,326 valid hourly records from two monitoring sites in Thailand, denoted Site A and Site B. The one-hour comparison includes nine baselines; selected recurrent configurations are additionally compared at horizons of 6, 12, and 24 h. At Site A, the one-hour Masking-EMD-BiLSTM results are RMSE 4.18 µg/m³, MAE 2.84 µg/m³, and R² 0.912, compared with RMSE 6.22 for raw BiLSTM and 4.65 for CEEMDAN-BiLSTM. At Site B, the corresponding proposed-model RMSE is 4.79 µg/m³. A CPU benchmark reports 1.82 s per 1,000 samples for masking decomposition versus 48.65 s for CEEMDAN, a 26.73-fold speedup. These preliminary results require verification of chronological data partitions, causal preprocessing, and the consistency of RMSE and R² aggregation. The present evidence does not establish complete mask cancellation, orthogonality, or embedded-device feasibility.</p><p><strong>Keywords: </strong>PM2.5; empirical mode decomposition; masking signal; bidirectional LSTM; time-series forecasting; air quality.</p><h3>1.0 Introduction</h3><p>Hourly forecasting of fine particulate matter (PM2.5) requires models that represent changing temporal patterns and an evaluation protocol that restricts every input to information available at the forecast origin. Empirical mode decomposition (EMD) represents a signal as data-dependent oscillatory components (Huang et al., 1998), while long short-term memory (LSTM) networks provide a recurrent modelling approach (Hochreiter &amp; Schmidhuber, 1997). Combining these methods creates a component-based predictor whose accuracy and computational cost both require evaluation.</p><p>This study examines opposite-phase sinusoidal masking before EMD extraction, followed by component-specific bidirectional LSTM (BiLSTM) models and additive reconstruction of the PM2.5 forecast. The analysis covers two monitoring sites in Thailand, a one-hour comparison against nine baselines, selected comparisons at 6, 12 and 24 h, and a CPU benchmark of decomposition time. Its objectives are to specify the masking and forecasting configuration, compare the recorded errors across horizons, and assess the cost of the decomposition stage.</p><p>The available results are preliminary. The experimental records do not yet establish a reproducible chronological evaluation, and the reported RMSE and R² values require reconciliation. These limitations are retained in the analysis rather than inferred away from the aggregate tables. Section 2 reviews related work; Section 3 describes the methodology; Section 4 presents the reported results; Section 5 examines validity and scope; and Section 6 gives the conclusions.</p><h3>2.0 Related Work</h3><h3>2.1 Learning methods for particulate matter forecasting</h3><p>Krishan et al. (2019) applied long short-term memory (LSTM) models to hourly concentrations of several pollutants, including PM2.5, in Delhi, using combinations of pollutant, meteorological, traffic, and emission information. Masood and Ahmad (2023) compared LSTM, a feed-forward neural network, support vector machines, and random forests for PM2.5 prediction in Delhi; LSTM gave the best results within their reported comparison.</p><p>The choice of architecture remains dependent on the dataset and evaluation procedure. Govande et al. (2025) compared recurrent networks for daily PM2.5 prediction in four Indian cities and reported better performance from a gated recurrent unit model than from the other recurrent configurations tested. In Jakarta, Safira et al. (2025) compared SETAR-Tree and LSTM forecasting, with SETAR-Tree performing better under their evaluation. Prasetyo et al. (2025) evaluated LSTM, GRU, random forest, and XGBoost for particulate-matter forecasting in Indonesia and reported the strongest results from XGBoost. These studies motivate comparison with both recurrent and non-recurrent predictors; they do not establish a universally preferred model.</p><h3>2.2 Decomposition and component forecasting</h3><p>EMD and its extensions provide different ways to obtain components before prediction. Ensemble EMD (EEMD) introduces noise-assisted ensembles (Wu &amp; Huang, 2009), complete ensemble EMD with adaptive noise (CEEMDAN) modifies the ensemble decomposition procedure (Torres et al., 2011), and variational mode decomposition (VMD) uses a variational formulation (Dragomiretskiy &amp; Zosso, 2014). These are established algorithms; the present study evaluates a particular combination of decomposition and forecasting choices.</p><p>Decomposition provides another modelling choice by representing an observed signal as components that can be forecast separately. A masking signal can alter the extrema used by EMD, potentially improving the separation of intermittent oscillations (Deering &amp; Kaiser, 2005). Ray et al. (2019) examined a modified masking-based EMD procedure for frequency-mode identification in power-system signals. That study supports the relevance of paired masking and parameter selection, but its application domain does not establish an improvement in air-quality forecasting.</p><p>Decomposition followed by recurrent prediction has also been investigated in air-quality applications. Maulana et al. (2025) combined CEEMDAN with LSTM for the Indonesian Air Pollution Standard Index (ISPU) in Jakarta. ISPU is an index, so its prediction errors are not directly comparable with concentration errors in µg/m³. GK and G (2026) combined VMD, Transformer encoders, and BiLSTM for daily PM2.5 forecasting in Delhi. These examples establish that decomposition–prediction–reconstruction architectures already exist; the present study examines a particular masking-based configuration rather than claiming the invention of that general approach.</p><h3>2.3 Relation to virtual particulate matter sensing</h3><p>Songsangka (2026) studied joint one-hour forecasts of PM10, PM2.5 and PM1.0 from a PM2.5 history and profiled execution on an ESP32-S3. The present configuration examines PM2.5 across four horizons and benchmarks CPU decomposition. Dataset overlap and the incremental contribution require explicit documentation before cross-study comparisons.</p><h3>3.0 Methodology</h3><h3>3.1 Monitoring records</h3><p>The dataset description reports 19,326 valid hourly records collected between August 2024 and February 2026 at two monitoring sites in Thailand, denoted Site A and Site B. Site A is described as an urban rooftop station and contributes 10,059 records. Site B is described as a station in a coastal mangrove reserve area and contributes 9,267 records. These counts represent valid observations and do not establish uninterrupted hourly coverage.</p><p>The measurement description identifies optical particle counters calibrated against a BAM-1022 beta attenuation monitor. The instrument model, calibration procedure and dates, quality-control records, timestamp convention, missing-data treatment, and source data access details are not supplied. Site A and Site B are neutral labels; identifying geographic names and coordinates are omitted. Data provenance and site metadata are required to assess reproducibility and geographic applicability. No source-apportionment conclusion is inferred from the site descriptions.</p><h3>3.2 EMD representation and mode separation</h3><p>For a sampled signal</p><p>, EMD represents the series as a sum of K intrinsic mode functions (IMFs),</p><p>, and a residual</p><p>:</p><p>(1)</p><p>An IMF has a number of extrema and zero-crossings that are equal or differ by at most one, and an approximately zero local mean of its upper and lower envelopes. Sifting repeatedly estimates the envelopes and subtracts their mean until a stopping criterion is met (Huang et al., 1998). The implementation must specify its interpolation, stopping tolerance, and boundary treatment. Mode mixing describes the occurrence of substantially different scales in one IMF, or the distribution of a similar scale across several IMFs. Masking-based frequency-mode identification provides an example of addressing this issue (Ray et al., 2019).</p><p>The decomposition identity expresses additive reconstruction. It does not, by itself, establish mutual orthogonality, statistical independence, or a physical interpretation for each IMF. In the present application, an association between an IMF and traffic, meteorology, or a daily cycle would require additional diagnostics or supporting measurements.</p><h3>3.3 Opposite-phase masking</h3><p>Let the auxiliary sinusoid be</p><p>=</p><p>sin(2π</p><p>t), with amplitude</p><p>and frequency</p><p>. A complementary pair of masked inputs is formed as follows:</p><p>(2)</p><p>(3)</p><p>Each masked branch undergoes a separate first-IMF extraction, following the paired-masking approach (Deering &amp; Kaiser, 2005; Ray et al., 2019). The component estimate is defined by their average:</p><p>(4)</p><p>The residual is updated as</p><p>=</p><p>−</p><p>, and subsequent components are extracted from the remaining signal. Opposite-phase masking and averaging are used to reduce the contribution of the auxiliary signal. Because EMD is nonlinear, opposite signs at the input do not prove exact cancellation in the extracted IMFs. Each selected mode requires two masked extraction branches, and each branch can involve multiple sifting iterations. No stochastic-noise ensemble is introduced by this masking rule, but complete carrier removal and exact orthogonality are not assumed.</p><h3>3.4 Mask parameterization</h3><p>The documented parameterization uses a power spectral density (PSD) estimate based on Welch’s method. A daily period corresponds to approximately 0.0417 h⁻¹. The masking rule is</p><p>= 1.2</p><p>, where</p><p>is intended to identify an upper boundary of the fluctuations being separated. The amplitude rule is</p><p>= α</p><p>, where</p><p>is the standard deviation of the available signal window and α is selected within [0.4, 0.8] by validation-based grid search. This is a PSD-informed heuristic with amplitude tuning, not an analytically established optimum.</p><p>The exact definition of</p><p>, the Welch configuration, the tested grid, and the selected α have not yet been documented. For hourly data, the sampling frequency is 1 h⁻¹ and the Nyquist limit is 0.5 h⁻¹; the implementation must explain how the mask remains within the valid frequency range. A 24-hour window contains only one daily cycle and cannot, on its own, establish stable weekly or seasonal components.</p><h3>3.5 Component forecasting and reconstruction</h3><p>The recurrent branch uses the BiLSTM architecture as an established sequence-modelling component (Graves &amp; Schmidhuber, 2005). Its bidirectional encoding is confined conceptually to an already observed input window; the forecasting validity of an implementation depends on the full preprocessing and window-generation schedule.</p><p>The specified lookback window has length L = 24 h. The routing scheme assigns the first two IMFs to a BiLSTM with recurrent hidden size H = 32 and dropout 0.3. Modes</p><p>through</p><p>use a two-layer BiLSTM with H = 64 and temporal attention. Dropout is used as regularization. These assignments are architectural heuristics; the frequency content and physical meaning of the indexed modes require verification.</p><p>The residual branch is described as either ridge regression or a linear autoregressive extrapolator. The experiment records must identify which was actually used and give its parameters. They must also specify the attention formulation, how variable numbers of IMFs are handled, and how modes are aligned between windows. These choices cannot be recovered from the aggregate performance tables. The records must also distinguish independent direct forecasts, recursive forecasting, and a shared model with several horizon outputs.</p><p>At forecast origin t, the component forecasts and the residual forecast are summed. Results are reported for horizons h ∈ {1, 6, 12, 24} h:</p><p>(5)</p><p>Bidirectional processing within a fully observed historical window is compatible with forecasting. Its use does not itself imply access to future observations. The required temporal condition is that the inputs and every preprocessing operation use only information available at or before the forecast origin. Whether the reported experiments satisfy this condition must be checked against the decomposition, scaling, imputation, and window-generation code.</p><h3>3.6 Compared configurations</h3><p>The comparison contains nine baselines and the proposed masking configuration, for ten configurations in total. The raw-series baselines are ARIMA, support vector regression with an RBF kernel, a random forest with 100 trees and maximum depth 8, vanilla LSTM, and BiLSTM. The decomposition baselines are standard EMD–BiLSTM, EEMD–BiLSTM with 100 ensembles and noise amplitude 0.2 times the signal standard deviation, CEEMDAN–BiLSTM with 100 ensembles, and VMD–BiLSTM with K = 6 and penalty parameter 2000.</p><p>The air-quality studies (Govande et al., 2025; Masood &amp; Ahmad, 2023; Prasetyo et al., 2025; Safira et al., 2025) motivate retaining recurrent and non-recurrent comparators, while the decomposition-based predictors (GK &amp; G, 2026; Maulana et al., 2025) provide relevant application context. Exact ARIMA orders, kernel tuning, neural-network training settings, software versions and tuning budgets remain to be documented. The present results do not include a persistence baseline or a controlled comparison in which only the decomposition step changes.</p><h3>3.7 Metrics and evaluation protocol</h3><p>The reported accuracy metrics are root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²). For N matched target–prediction pairs,</p><p>denotes the observation,</p><p>the forecast, and</p><p>the mean of the observations. The sums below run over those N pairs:</p><p>(6)</p><p>(7)</p><p>(8)</p><p>RMSE and MAE are expressed in µg/m³; R² is dimensionless. Table 1 reports all three metrics for Site A and RMSE and R² for Site B. Table 2 reports RMSE and R² across four horizons at Site A. No MAPE result is reported.</p><p>The current experimental documentation does not provide chronological train, validation, and test boundaries, the number of evaluated predictions per site and horizon, or the rules used to fit preprocessing and tune models. Consequently, the tables cannot yet establish a reproducible out-of-sample comparison. These omissions and a metric-consistency check are addressed explicitly in Section 5.</p><h3>4.0 Results and Analysis</h3><h3>4.1 One-hour forecasting</h3><p>Table 1 summarizes the reported one-hour results for Site A and Site B. Interpretation of the ranking is conditional on the temporal-evaluation and metric-consistency checks in Section 5.</p><p>Table 1. Reported one-hour PM2.5 forecasting results at Site A and Site B. RMSE and MAE are in µg/m³; R² is dimensionless.</p><p><strong>Model</strong></p><p><strong>Decomposition</strong></p><p><strong>Site A<br> RMSE</strong></p><p><strong>Site A<br> MAE</strong></p><p><strong>Site A<br> R²</strong></p><p><strong>Site B<br> RMSE</strong></p><p><strong>Site B<br> R²</strong></p><p>ARIMA</p><p>None</p><p>8.94</p><p>6.42</p><p>0.684</p><p>8.12</p><p>0.615</p><p>SVR</p><p>None</p><p>7.65</p><p>5.28</p><p>0.742</p><p>7.25</p><p>0.682</p><p>Random forest</p><p>None</p><p>6.38</p><p>4.46</p><p>0.816</p><p>7.36</p><p>0.726</p><p>Vanilla LSTM</p><p>None</p><p>6.45</p><p>4.58</p><p>0.812</p><p>7.30</p><p>0.730</p><p>Raw BiLSTM</p><p>None</p><p>6.22</p><p>4.35</p><p>0.825</p><p>7.08</p><p>0.745</p><p>EMD-BiLSTM</p><p>Standard EMD</p><p>5.42</p><p>3.78</p><p>0.865</p><p>6.25</p><p>0.801</p><p>VMD-BiLSTM</p><p>VMD (K=6)</p><p>4.88</p><p>3.35</p><p>0.888</p><p>5.62</p><p>0.838</p><p>EEMD-BiLSTM</p><p>EEMD (100 trials)</p><p>4.74</p><p>3.24</p><p>0.895</p><p>5.45</p><p>0.849</p><p>CEEMDAN-BiLSTM</p><p>CEEMDAN (100)</p><p>4.65</p><p>3.16</p><p>0.901</p><p>5.32</p><p>0.856</p><p>Masking-EMD–BiLSTM</p><p>Masking EMD</p><p>4.18</p><p>2.84</p><p>0.912</p><p>4.79</p><p>0.884</p><p>At Site A, raw BiLSTM has reported RMSE 6.22 µg/m³, standard EMD–BiLSTM 5.42 µg/m³, CEEMDAN–BiLSTM 4.65 µg/m³, and Masking-EMD–BiLSTM 4.18 µg/m³. The masking configuration has the lowest reported RMSE in this table; its MAE is 2.84 µg/m³ and R² is 0.912. At Site B, the corresponding masking results are RMSE 4.79 µg/m³ and R² 0.884. The Site A values are site-specific, not pooled estimates over both sites.</p><p>Using the tabulated RMSE values, the relative reduction at Site A is 32.8% against raw BiLSTM and 10.1% against CEEMDAN–BiLSTM. These are arithmetic comparisons of the reported entries, without a statistical significance claim. Forecast errors alone cannot identify improved mode separation as the cause of the observed differences.</p><h3>4.2 Forecast horizons from 1 to 24 hours</h3><p>Table 2 reports results at 1, 6, 12, and 24 h for Site A. All listed configurations show increasing RMSE at longer horizons. At 24 h, the masking configuration has reported RMSE 10.22 µg/m³ and R² 0.645, compared with 14.85 µg/m³ and 0.312 for raw BiLSTM. This comparison is conditional on consistent target construction and evaluation at each horizon.</p><p>Table 2. Reported multi-horizon results at Site A. Entries give RMSE in µg/m³, followed by R² in parentheses.</p><p><strong>Model</strong></p><p><strong>1 h</strong></p><p><strong>6 h</strong></p><p><strong>12 h</strong></p><p><strong>24 h</strong></p><p>Raw BiLSTM</p><p>6.22 (0.825)</p><p>9.45 (0.642)</p><p>12.18 (0.478)</p><p>14.85 (0.312)</p><p>EMD-BiLSTM</p><p>5.42 (0.865)</p><p>8.32 (0.718)</p><p>10.65 (0.584)</p><p>13.20 (0.445)</p><p>CEEMDAN-BiLSTM</p><p>4.65 (0.901)</p><p>7.15 (0.785)</p><p>9.12 (0.682)</p><p>11.45 (0.562)</p><p>VMD-BiLSTM</p><p>4.88 (0.888)</p><p>7.40 (0.768)</p><p>9.38 (0.665)</p><p>11.82 (0.538)</p><p>Masking-EMD–BiLSTM</p><p>4.18 (0.912)</p><p>6.35 (0.832)</p><p>8.15 (0.748)</p><p>10.22 (0.645)</p><p>The longer-horizon ranking does not establish that particular IMFs represent stable daily or seasonal physical processes. Such an interpretation would require mode diagnostics and an ablation that separates the effects of decomposition, attention, model capacity, and tuning.</p><h3>4.3 Decomposition runtime</h3><p>The runtime benchmark covers decomposition of 1,000 samples on an Intel Core i7–12700H CPU. Table 3 preserves the reported timings. It does not measure the complete training or forecasting pipeline, rolling-window processing, or execution on an embedded device.</p><p>Table 3. Reported CPU decomposition times per 1,000 samples. Time ratios use standard EMD as the common reference.</p><p><strong>Algorithm</strong></p><p><strong>Extraction configuration</strong></p><p><strong>Time (s)</strong></p><p><strong>Time / EMD</strong></p><p>Standard EMD</p><p>Deterministic extraction</p><p>0.85 ± 0.04</p><p>1.00×</p><p>EEMD</p><p>100 ensembles</p><p>64.20 ± 2.15</p><p>75.53×</p><p>CEEMDAN</p><p>100 ensembles</p><p>48.65 ± 1.80</p><p>57.24×</p><p>Masking-EMD</p><p>2 opposite-phase extraction branches per mode</p><p>1.82 ± 0.08</p><p>2.14×</p><p>Time ratios divide each central timing value by 0.85 s; values above 1 indicate greater decomposition time than standard EMD. The meaning of “±” and the number of timing repetitions have not been specified.</p><p>The central times give 48.65 / 1.82 = 26.73, corresponding to a 96.26% reduction in decomposition time relative to CEEMDAN. Against standard EMD, the masking procedure is approximately 2.14 times slower (1.82 / 0.85). These comparisons apply only to the stated CPU benchmark. They do not establish end-to-end latency, memory use, energy consumption, or suitability for a microcontroller.</p><h3>5.0 Discussion</h3><h3>5.1 Temporal validity and reproducibility</h3><p>A reproducible evaluation requires the actual train, validation, and test dates, per-horizon sample counts, and an account of every fitted preprocessing step. It is particularly necessary to determine whether decomposition and spectral estimation were carried out within each historical window or on a longer series containing future observations. Full-series decomposition before temporal partitioning can introduce future information into earlier features. The available aggregate tables do not reveal which procedure was used, so leakage is a risk to investigate rather than an established finding.</p><p>The model specification also needs the optimizer, learning rate, batch size, epoch limit, early stopping rule, seeds, attention equations, residual-model choice, and handling of variable IMF counts. Boundary extension and the mask-frequency rule must be documented. A persistence forecast and controlled ablations would provide additional context, but no unreported experiment is assumed here. The horizon strategy must also be stated, since direct and recursive forecasts use different training targets and propagate errors differently.</p><h3>5.2 Internal consistency of the reported metrics</h3><p>For the standard unweighted RMSE and R² definitions applied to the same target vector, RMSE² / (1 − R²) equals the target sum of squared deviations divided by N. It should therefore be the same across models. In Table 1 at Site A, this quantity is approximately 252.92 for ARIMA, 221.08 for raw BiLSTM, and 198.55 for the masking configuration. The differences are larger than the intervals attributable to the displayed rounding.</p><p>A similar issue occurs at Site B: SVR has lower RMSE than vanilla LSTM (7.25 versus 7.30 µg/m³), but also lower R² (0.682 versus 0.730). For the stated definitions on a common target vector, a lower RMSE must correspond to a higher R². Differences also occur between models at the longer horizons in Table 2. A separate common-target check is required for each site and horizon; target variance need not be identical across different horizons.</p><p>This check identifies an unresolved comparability issue, not a unique explanation for it. Different test subsets, weighting, inverse-scaling procedures, or separate averaging of RMSE and R² across folds or runs could break the common-vector relationship. The prediction logs, matched targets, metric code, and aggregation rules must be examined before the reported advantage is treated as established. The table values have not been recomputed in the absence of those records.</p><h3>5.3 Scope of the conclusions</h3><p>No run count, confidence interval, or distribution over training seeds accompanies the accuracy results. The timing uncertainty is also undefined. Statistical significance and robustness to training variation therefore cannot be assessed. Opposite-phase masking does not by itself prove exact orthogonality or complete removal of the auxiliary carrier; those properties require direct diagnostics. The CPU timing result is limited to decomposition and cannot support a claim of deployment feasibility on a different hardware platform.</p><p>The selected literature includes air-quality applications and foundational decomposition and recurrent-network studies. It supports the methodological context without establishing a comprehensive state-of-the-art ranking or a priority claim. The connection between the monitoring records and previously published data also requires clarification. The present findings therefore remain a preliminary comparison of the recorded configurations, subject to verification of the underlying experiments.</p><h3>6.0 Conclusion</h3><p>The manuscript describes a Masking-EMD–BiLSTM configuration for PM2.5 forecasts over horizons from 1 to 24 h. The reported tables contain lower errors for the masking configuration than for the listed comparators, including a one-hour Site A RMSE of 4.18 µg/m³, and a CPU decomposition time of 1.82 s per 1,000 samples versus 48.65 s for CEEMDAN. These observations motivate further evaluation. A firm performance conclusion requires documented temporal partitions, verification that preprocessing uses only available information, reconciliation of metric aggregation, and reproducible model and runtime settings. Hardware deployment and physical interpretation of the IMFs remain topics for separate validation.</p><h3>References</h3><p>Deering, R., &amp; Kaiser, J. F. (2005). The use of a masking signal to improve empirical mode decomposition. In <em>Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)</em> (Vol. 4, pp. IV/485–IV/488). IEEE. <a href="https://doi.org/10.1109/ICASSP.2005.1416051">https://doi.org/10.1109/ICASSP.2005.1416051</a></p><p>Dragomiretskiy, K., &amp; Zosso, D. (2014). Variational mode decomposition. <em>IEEE Transactions on Signal Processing</em>, <em>62</em>(3), 531–544. <a href="https://doi.org/10.1109/TSP.2013.2288675">https://doi.org/10.1109/TSP.2013.2288675</a></p><p>GK, M. L., &amp; G, M. R. (2026). A hybrid VMD-transformer-BiLSTM framework for daily PM2.5 concentration forecasting in Delhi, India. <em>Frontiers in Environmental Science</em>, <em>14</em>, Article 1960286. <a href="https://doi.org/10.3389/fenvs.2026.1960286">https://doi.org/10.3389/fenvs.2026.1960286</a></p><p>Govande, A., Attada, R., &amp; Shukla, K. K. (2025). Predicting PM2.5 levels over Indian metropolitan cities using recurrent neural networks. <em>Earth Science Informatics</em>, <em>18</em>, Article 1. <a href="https://doi.org/10.1007/s12145-024-01491-4">https://doi.org/10.1007/s12145-024-01491-4</a></p><p>Graves, A., &amp; Schmidhuber, J. (2005). Framewise phoneme classification with bidirectional LSTM and other neural network architectures. <em>Neural Networks</em>, <em>18</em>(5–6), 602–610. <a href="https://doi.org/10.1016/j.neunet.2005.06.042">https://doi.org/10.1016/j.neunet.2005.06.042</a></p><p>Hochreiter, S., &amp; Schmidhuber, J. (1997). Long short-term memory. <em>Neural Computation</em>, <em>9</em>(8), 1735–1780. <a href="https://doi.org/10.1162/neco.1997.9.8.1735">https://doi.org/10.1162/neco.1997.9.8.1735</a></p><p>Huang, N. E., Shen, Z., Long, S. R., Wu, M. C., Shih, H. H., Zheng, Q., Yen, N.-C., Tung, C. C., &amp; Liu, H. H. (1998). The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. <em>Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences</em>, <em>454</em>(1971), 903–995. <a href="https://doi.org/10.1098/rspa.1998.0193">https://doi.org/10.1098/rspa.1998.0193</a></p><p>Krishan, M., Jha, S., Das, J., Singh, A., Goyal, M. K., &amp; Sekar, C. (2019). Air quality modelling using long short-term memory (LSTM) over NCT-Delhi, India. <em>Air Quality, Atmosphere &amp; Health</em>, <em>12</em>(8), 899–908. <a href="https://doi.org/10.1007/s11869-019-00696-7">https://doi.org/10.1007/s11869-019-00696-7</a></p><p>Masood, A., &amp; Ahmad, K. (2023). Data-driven predictive modeling of PM2.5 concentrations using machine learning and deep learning techniques: A case study of Delhi, India. <em>Environmental Monitoring and Assessment</em>, <em>195</em>(1), Article 60. <a href="https://doi.org/10.1007/s10661-022-10603-w">https://doi.org/10.1007/s10661-022-10603-w</a></p><p>Maulana, R. I., Al Haromainy, M. M., &amp; Junaidi, A. (2025). Prediction of air pollution standard index using CEEMDAN-LSTM. <em>bit-Tech</em>, <em>8</em>(2), 1918–1928. <a href="https://doi.org/10.32877/bt.v8i2.3164">https://doi.org/10.32877/bt.v8i2.3164</a></p><p>Prasetyo, D. I., Rachmawardani, A., Satrio, B., &amp; Adinara, D. B. (2025). Comparative analysis of machine learning and deep learning models for PM2.5 and PM10 time series forecasting using the SISANAPAS web platform. <em>Teknika</em>, <em>14</em>(3), 377–386. <a href="https://doi.org/10.34148/teknika.v14i3.1335">https://doi.org/10.34148/teknika.v14i3.1335</a></p><p>Ray, P., Lenka, R. K., &amp; Biswal, M. (2019). Frequency mode identification using modified masking signal-based empirical mode decomposition. <em>IET Generation, Transmission &amp; Distribution</em>, <em>13</em>(8), 1266–1276. <a href="https://doi.org/10.1049/iet-gtd.2018.5527">https://doi.org/10.1049/iet-gtd.2018.5527</a></p><p>Safira, D. A., Kuswanto, H., &amp; Ahsan, M. (2025). Improving the forecast accuracy of PM2.5 using SETAR-Tree method: Case study in Jakarta, Indonesia. <em>Atmosphere</em>, <em>16</em>(1), Article 23. <a href="https://doi.org/10.3390/atmos16010023">https://doi.org/10.3390/atmos16010023</a></p><p>Songsangka, N. (2026). Forecasting PM10, PM2.5, and PM1.0 from a single low-cost PM2.5 input: A triple-task multi-output virtual sensor with edge deployment profiling. <em>International Journal of Information Movement</em>, <em>11</em>(4), 28–48. <a href="https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/">https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/</a></p><p>Torres, M. E., Colominas, M. A., Schlotthauer, G., &amp; Flandrin, P. (2011). A complete ensemble empirical mode decomposition with adaptive noise. In <em>2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)</em> (pp. 4144–4147). IEEE. <a href="https://doi.org/10.1109/ICASSP.2011.5947265">https://doi.org/10.1109/ICASSP.2011.5947265</a></p><p>Wu, Z., &amp; Huang, N. E. (2009). Ensemble empirical mode decomposition: A noise-assisted data analysis method. <em>Advances in Adaptive Data Analysis</em>, <em>1</em>(1), 1–41. <a href="https://doi.org/10.1142/S1793536909000047">https://doi.org/10.1142/S1793536909000047</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=567309f44a22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MASKING-ASSISTED EMPIRICAL MODE DECOMPOSITION AND BIDIRECTIONAL LSTM FOR MULTI-HORIZON PM2.5]]></title>
            <link>https://medium.com/@nphassrsngsangka/masking-assisted-empirical-mode-decomposition-and-bidirectional-lstm-for-multi-horizon-pm2-5-f76e43c33cd7?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f76e43c33cd7</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 08:12:00 GMT</pubDate>
            <atom:updated>2026-10-15T08:12:00.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>MASKING-ASSISTED EMPIRICAL MODE DECOMPOSITION AND BIDIRECTIONAL LSTM FOR MULTI-HORIZON PM2.5 FORECASTING</h3><p><strong>Abstract: </strong>This study examines masking-assisted empirical mode decomposition (Masking-EMD) coupled with bidirectional long short-term memory (BiLSTM) networks for PM2.5 forecasting. Opposite-phase sinusoidal masks are applied before paired IMF extraction and averaging; component forecasts and a residual forecast are then summed. The dataset comprises 19,326 valid hourly records from two monitoring sites in Thailand, denoted Site A and Site B. The one-hour comparison includes nine baselines; selected recurrent configurations are additionally compared at horizons of 6, 12, and 24 h. At Site A, the one-hour Masking-EMD-BiLSTM results are RMSE 4.18 µg/m³, MAE 2.84 µg/m³, and R² 0.912, compared with RMSE 6.22 for raw BiLSTM and 4.65 for CEEMDAN-BiLSTM. At Site B, the corresponding proposed-model RMSE is 4.79 µg/m³. A CPU benchmark reports 1.82 s per 1,000 samples for masking decomposition versus 48.65 s for CEEMDAN, a 26.73-fold speedup. These preliminary results require verification of chronological data partitions, causal preprocessing, and the consistency of RMSE and R² aggregation. The present evidence does not establish complete mask cancellation, orthogonality, or embedded-device feasibility.</p><p><strong>Keywords: </strong>PM2.5; empirical mode decomposition; masking signal; bidirectional LSTM; time-series forecasting; air quality.</p><h3>1.0 Introduction</h3><p>Hourly forecasting of fine particulate matter (PM2.5) requires models that represent changing temporal patterns and an evaluation protocol that restricts every input to information available at the forecast origin. Empirical mode decomposition (EMD) represents a signal as data-dependent oscillatory components (Huang et al., 1998), while long short-term memory (LSTM) networks provide a recurrent modelling approach (Hochreiter &amp; Schmidhuber, 1997). Combining these methods creates a component-based predictor whose accuracy and computational cost both require evaluation.</p><p>This study examines opposite-phase sinusoidal masking before EMD extraction, followed by component-specific bidirectional LSTM (BiLSTM) models and additive reconstruction of the PM2.5 forecast. The analysis covers two monitoring sites in Thailand, a one-hour comparison against nine baselines, selected comparisons at 6, 12 and 24 h, and a CPU benchmark of decomposition time. Its objectives are to specify the masking and forecasting configuration, compare the recorded errors across horizons, and assess the cost of the decomposition stage.</p><p>The available results are preliminary. The experimental records do not yet establish a reproducible chronological evaluation, and the reported RMSE and R² values require reconciliation. These limitations are retained in the analysis rather than inferred away from the aggregate tables. Section 2 reviews related work; Section 3 describes the methodology; Section 4 presents the reported results; Section 5 examines validity and scope; and Section 6 gives the conclusions.</p><h3>2.0 Related Work</h3><h3>2.1 Learning methods for particulate matter forecasting</h3><p>Krishan et al. (2019) applied long short-term memory (LSTM) models to hourly concentrations of several pollutants, including PM2.5, in Delhi, using combinations of pollutant, meteorological, traffic, and emission information. Masood and Ahmad (2023) compared LSTM, a feed-forward neural network, support vector machines, and random forests for PM2.5 prediction in Delhi; LSTM gave the best results within their reported comparison.</p><p>The choice of architecture remains dependent on the dataset and evaluation procedure. Govande et al. (2025) compared recurrent networks for daily PM2.5 prediction in four Indian cities and reported better performance from a gated recurrent unit model than from the other recurrent configurations tested. In Jakarta, Safira et al. (2025) compared SETAR-Tree and LSTM forecasting, with SETAR-Tree performing better under their evaluation. Prasetyo et al. (2025) evaluated LSTM, GRU, random forest, and XGBoost for particulate-matter forecasting in Indonesia and reported the strongest results from XGBoost. These studies motivate comparison with both recurrent and non-recurrent predictors; they do not establish a universally preferred model.</p><h3>2.2 Decomposition and component forecasting</h3><p>EMD and its extensions provide different ways to obtain components before prediction. Ensemble EMD (EEMD) introduces noise-assisted ensembles (Wu &amp; Huang, 2009), complete ensemble EMD with adaptive noise (CEEMDAN) modifies the ensemble decomposition procedure (Torres et al., 2011), and variational mode decomposition (VMD) uses a variational formulation (Dragomiretskiy &amp; Zosso, 2014). These are established algorithms; the present study evaluates a particular combination of decomposition and forecasting choices.</p><p>Decomposition provides another modelling choice by representing an observed signal as components that can be forecast separately. A masking signal can alter the extrema used by EMD, potentially improving the separation of intermittent oscillations (Deering &amp; Kaiser, 2005). Ray et al. (2019) examined a modified masking-based EMD procedure for frequency-mode identification in power-system signals. That study supports the relevance of paired masking and parameter selection, but its application domain does not establish an improvement in air-quality forecasting.</p><p>Decomposition followed by recurrent prediction has also been investigated in air-quality applications. Maulana et al. (2025) combined CEEMDAN with LSTM for the Indonesian Air Pollution Standard Index (ISPU) in Jakarta. ISPU is an index, so its prediction errors are not directly comparable with concentration errors in µg/m³. GK and G (2026) combined VMD, Transformer encoders, and BiLSTM for daily PM2.5 forecasting in Delhi. These examples establish that decomposition–prediction–reconstruction architectures already exist; the present study examines a particular masking-based configuration rather than claiming the invention of that general approach.</p><h3>2.3 Relation to virtual particulate matter sensing</h3><p>Songsangka (2026) studied joint one-hour forecasts of PM10, PM2.5 and PM1.0 from a PM2.5 history and profiled execution on an ESP32-S3. The present configuration examines PM2.5 across four horizons and benchmarks CPU decomposition. Dataset overlap and the incremental contribution require explicit documentation before cross-study comparisons.</p><h3>3.0 Methodology</h3><h3>3.1 Monitoring records</h3><p>The dataset description reports 19,326 valid hourly records collected between August 2024 and February 2026 at two monitoring sites in Thailand, denoted Site A and Site B. Site A is described as an urban rooftop station and contributes 10,059 records. Site B is described as a station in a coastal mangrove reserve area and contributes 9,267 records. These counts represent valid observations and do not establish uninterrupted hourly coverage.</p><p>The measurement description identifies optical particle counters calibrated against a BAM-1022 beta attenuation monitor. The instrument model, calibration procedure and dates, quality-control records, timestamp convention, missing-data treatment, and source data access details are not supplied. Site A and Site B are neutral labels; identifying geographic names and coordinates are omitted. Data provenance and site metadata are required to assess reproducibility and geographic applicability. No source-apportionment conclusion is inferred from the site descriptions.</p><h3>3.2 EMD representation and mode separation</h3><p>For a sampled signal</p><p>, EMD represents the series as a sum of K intrinsic mode functions (IMFs),</p><p>, and a residual</p><p>:</p><p>(1)</p><p>An IMF has a number of extrema and zero-crossings that are equal or differ by at most one, and an approximately zero local mean of its upper and lower envelopes. Sifting repeatedly estimates the envelopes and subtracts their mean until a stopping criterion is met (Huang et al., 1998). The implementation must specify its interpolation, stopping tolerance, and boundary treatment. Mode mixing describes the occurrence of substantially different scales in one IMF, or the distribution of a similar scale across several IMFs. Masking-based frequency-mode identification provides an example of addressing this issue (Ray et al., 2019).</p><p>The decomposition identity expresses additive reconstruction. It does not, by itself, establish mutual orthogonality, statistical independence, or a physical interpretation for each IMF. In the present application, an association between an IMF and traffic, meteorology, or a daily cycle would require additional diagnostics or supporting measurements.</p><h3>3.3 Opposite-phase masking</h3><p>Let the auxiliary sinusoid be</p><p>=</p><p>sin(2π</p><p>t), with amplitude</p><p>and frequency</p><p>. A complementary pair of masked inputs is formed as follows:</p><p>(2)</p><p>(3)</p><p>Each masked branch undergoes a separate first-IMF extraction, following the paired-masking approach (Deering &amp; Kaiser, 2005; Ray et al., 2019). The component estimate is defined by their average:</p><p>(4)</p><p>The residual is updated as</p><p>=</p><p>−</p><p>, and subsequent components are extracted from the remaining signal. Opposite-phase masking and averaging are used to reduce the contribution of the auxiliary signal. Because EMD is nonlinear, opposite signs at the input do not prove exact cancellation in the extracted IMFs. Each selected mode requires two masked extraction branches, and each branch can involve multiple sifting iterations. No stochastic-noise ensemble is introduced by this masking rule, but complete carrier removal and exact orthogonality are not assumed.</p><h3>3.4 Mask parameterization</h3><p>The documented parameterization uses a power spectral density (PSD) estimate based on Welch’s method. A daily period corresponds to approximately 0.0417 h⁻¹. The masking rule is</p><p>= 1.2</p><p>, where</p><p>is intended to identify an upper boundary of the fluctuations being separated. The amplitude rule is</p><p>= α</p><p>, where</p><p>is the standard deviation of the available signal window and α is selected within [0.4, 0.8] by validation-based grid search. This is a PSD-informed heuristic with amplitude tuning, not an analytically established optimum.</p><p>The exact definition of</p><p>, the Welch configuration, the tested grid, and the selected α have not yet been documented. For hourly data, the sampling frequency is 1 h⁻¹ and the Nyquist limit is 0.5 h⁻¹; the implementation must explain how the mask remains within the valid frequency range. A 24-hour window contains only one daily cycle and cannot, on its own, establish stable weekly or seasonal components.</p><h3>3.5 Component forecasting and reconstruction</h3><p>The recurrent branch uses the BiLSTM architecture as an established sequence-modelling component (Graves &amp; Schmidhuber, 2005). Its bidirectional encoding is confined conceptually to an already observed input window; the forecasting validity of an implementation depends on the full preprocessing and window-generation schedule.</p><p>The specified lookback window has length L = 24 h. The routing scheme assigns the first two IMFs to a BiLSTM with recurrent hidden size H = 32 and dropout 0.3. Modes</p><p>through</p><p>use a two-layer BiLSTM with H = 64 and temporal attention. Dropout is used as regularization. These assignments are architectural heuristics; the frequency content and physical meaning of the indexed modes require verification.</p><p>The residual branch is described as either ridge regression or a linear autoregressive extrapolator. The experiment records must identify which was actually used and give its parameters. They must also specify the attention formulation, how variable numbers of IMFs are handled, and how modes are aligned between windows. These choices cannot be recovered from the aggregate performance tables. The records must also distinguish independent direct forecasts, recursive forecasting, and a shared model with several horizon outputs.</p><p>At forecast origin t, the component forecasts and the residual forecast are summed. Results are reported for horizons h ∈ {1, 6, 12, 24} h:</p><p>(5)</p><p>Bidirectional processing within a fully observed historical window is compatible with forecasting. Its use does not itself imply access to future observations. The required temporal condition is that the inputs and every preprocessing operation use only information available at or before the forecast origin. Whether the reported experiments satisfy this condition must be checked against the decomposition, scaling, imputation, and window-generation code.</p><h3>3.6 Compared configurations</h3><p>The comparison contains nine baselines and the proposed masking configuration, for ten configurations in total. The raw-series baselines are ARIMA, support vector regression with an RBF kernel, a random forest with 100 trees and maximum depth 8, vanilla LSTM, and BiLSTM. The decomposition baselines are standard EMD–BiLSTM, EEMD–BiLSTM with 100 ensembles and noise amplitude 0.2 times the signal standard deviation, CEEMDAN–BiLSTM with 100 ensembles, and VMD–BiLSTM with K = 6 and penalty parameter 2000.</p><p>The air-quality studies (Govande et al., 2025; Masood &amp; Ahmad, 2023; Prasetyo et al., 2025; Safira et al., 2025) motivate retaining recurrent and non-recurrent comparators, while the decomposition-based predictors (GK &amp; G, 2026; Maulana et al., 2025) provide relevant application context. Exact ARIMA orders, kernel tuning, neural-network training settings, software versions and tuning budgets remain to be documented. The present results do not include a persistence baseline or a controlled comparison in which only the decomposition step changes.</p><h3>3.7 Metrics and evaluation protocol</h3><p>The reported accuracy metrics are root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²). For N matched target–prediction pairs,</p><p>denotes the observation,</p><p>the forecast, and</p><p>the mean of the observations. The sums below run over those N pairs:</p><p>(6)</p><p>(7)</p><p>(8)</p><p>RMSE and MAE are expressed in µg/m³; R² is dimensionless. Table 1 reports all three metrics for Site A and RMSE and R² for Site B. Table 2 reports RMSE and R² across four horizons at Site A. No MAPE result is reported.</p><p>The current experimental documentation does not provide chronological train, validation, and test boundaries, the number of evaluated predictions per site and horizon, or the rules used to fit preprocessing and tune models. Consequently, the tables cannot yet establish a reproducible out-of-sample comparison. These omissions and a metric-consistency check are addressed explicitly in Section 5.</p><h3>4.0 Results and Analysis</h3><h3>4.1 One-hour forecasting</h3><p>Table 1 summarizes the reported one-hour results for Site A and Site B. Interpretation of the ranking is conditional on the temporal-evaluation and metric-consistency checks in Section 5.</p><p>Table 1. Reported one-hour PM2.5 forecasting results at Site A and Site B. RMSE and MAE are in µg/m³; R² is dimensionless.</p><p><strong>Model</strong></p><p><strong>Decomposition</strong></p><p><strong>Site A<br> RMSE</strong></p><p><strong>Site A<br> MAE</strong></p><p><strong>Site A<br> R²</strong></p><p><strong>Site B<br> RMSE</strong></p><p><strong>Site B<br> R²</strong></p><p>ARIMA</p><p>None</p><p>8.94</p><p>6.42</p><p>0.684</p><p>8.12</p><p>0.615</p><p>SVR</p><p>None</p><p>7.65</p><p>5.28</p><p>0.742</p><p>7.25</p><p>0.682</p><p>Random forest</p><p>None</p><p>6.38</p><p>4.46</p><p>0.816</p><p>7.36</p><p>0.726</p><p>Vanilla LSTM</p><p>None</p><p>6.45</p><p>4.58</p><p>0.812</p><p>7.30</p><p>0.730</p><p>Raw BiLSTM</p><p>None</p><p>6.22</p><p>4.35</p><p>0.825</p><p>7.08</p><p>0.745</p><p>EMD-BiLSTM</p><p>Standard EMD</p><p>5.42</p><p>3.78</p><p>0.865</p><p>6.25</p><p>0.801</p><p>VMD-BiLSTM</p><p>VMD (K=6)</p><p>4.88</p><p>3.35</p><p>0.888</p><p>5.62</p><p>0.838</p><p>EEMD-BiLSTM</p><p>EEMD (100 trials)</p><p>4.74</p><p>3.24</p><p>0.895</p><p>5.45</p><p>0.849</p><p>CEEMDAN-BiLSTM</p><p>CEEMDAN (100)</p><p>4.65</p><p>3.16</p><p>0.901</p><p>5.32</p><p>0.856</p><p>Masking-EMD–BiLSTM</p><p>Masking EMD</p><p>4.18</p><p>2.84</p><p>0.912</p><p>4.79</p><p>0.884</p><p>At Site A, raw BiLSTM has reported RMSE 6.22 µg/m³, standard EMD–BiLSTM 5.42 µg/m³, CEEMDAN–BiLSTM 4.65 µg/m³, and Masking-EMD–BiLSTM 4.18 µg/m³. The masking configuration has the lowest reported RMSE in this table; its MAE is 2.84 µg/m³ and R² is 0.912. At Site B, the corresponding masking results are RMSE 4.79 µg/m³ and R² 0.884. The Site A values are site-specific, not pooled estimates over both sites.</p><p>Using the tabulated RMSE values, the relative reduction at Site A is 32.8% against raw BiLSTM and 10.1% against CEEMDAN–BiLSTM. These are arithmetic comparisons of the reported entries, without a statistical significance claim. Forecast errors alone cannot identify improved mode separation as the cause of the observed differences.</p><h3>4.2 Forecast horizons from 1 to 24 hours</h3><p>Table 2 reports results at 1, 6, 12, and 24 h for Site A. All listed configurations show increasing RMSE at longer horizons. At 24 h, the masking configuration has reported RMSE 10.22 µg/m³ and R² 0.645, compared with 14.85 µg/m³ and 0.312 for raw BiLSTM. This comparison is conditional on consistent target construction and evaluation at each horizon.</p><p>Table 2. Reported multi-horizon results at Site A. Entries give RMSE in µg/m³, followed by R² in parentheses.</p><p><strong>Model</strong></p><p><strong>1 h</strong></p><p><strong>6 h</strong></p><p><strong>12 h</strong></p><p><strong>24 h</strong></p><p>Raw BiLSTM</p><p>6.22 (0.825)</p><p>9.45 (0.642)</p><p>12.18 (0.478)</p><p>14.85 (0.312)</p><p>EMD-BiLSTM</p><p>5.42 (0.865)</p><p>8.32 (0.718)</p><p>10.65 (0.584)</p><p>13.20 (0.445)</p><p>CEEMDAN-BiLSTM</p><p>4.65 (0.901)</p><p>7.15 (0.785)</p><p>9.12 (0.682)</p><p>11.45 (0.562)</p><p>VMD-BiLSTM</p><p>4.88 (0.888)</p><p>7.40 (0.768)</p><p>9.38 (0.665)</p><p>11.82 (0.538)</p><p>Masking-EMD–BiLSTM</p><p>4.18 (0.912)</p><p>6.35 (0.832)</p><p>8.15 (0.748)</p><p>10.22 (0.645)</p><p>The longer-horizon ranking does not establish that particular IMFs represent stable daily or seasonal physical processes. Such an interpretation would require mode diagnostics and an ablation that separates the effects of decomposition, attention, model capacity, and tuning.</p><h3>4.3 Decomposition runtime</h3><p>The runtime benchmark covers decomposition of 1,000 samples on an Intel Core i7–12700H CPU. Table 3 preserves the reported timings. It does not measure the complete training or forecasting pipeline, rolling-window processing, or execution on an embedded device.</p><p>Table 3. Reported CPU decomposition times per 1,000 samples. Time ratios use standard EMD as the common reference.</p><p><strong>Algorithm</strong></p><p><strong>Extraction configuration</strong></p><p><strong>Time (s)</strong></p><p><strong>Time / EMD</strong></p><p>Standard EMD</p><p>Deterministic extraction</p><p>0.85 ± 0.04</p><p>1.00×</p><p>EEMD</p><p>100 ensembles</p><p>64.20 ± 2.15</p><p>75.53×</p><p>CEEMDAN</p><p>100 ensembles</p><p>48.65 ± 1.80</p><p>57.24×</p><p>Masking-EMD</p><p>2 opposite-phase extraction branches per mode</p><p>1.82 ± 0.08</p><p>2.14×</p><p>Time ratios divide each central timing value by 0.85 s; values above 1 indicate greater decomposition time than standard EMD. The meaning of “±” and the number of timing repetitions have not been specified.</p><p>The central times give 48.65 / 1.82 = 26.73, corresponding to a 96.26% reduction in decomposition time relative to CEEMDAN. Against standard EMD, the masking procedure is approximately 2.14 times slower (1.82 / 0.85). These comparisons apply only to the stated CPU benchmark. They do not establish end-to-end latency, memory use, energy consumption, or suitability for a microcontroller.</p><h3>5.0 Discussion</h3><h3>5.1 Temporal validity and reproducibility</h3><p>A reproducible evaluation requires the actual train, validation, and test dates, per-horizon sample counts, and an account of every fitted preprocessing step. It is particularly necessary to determine whether decomposition and spectral estimation were carried out within each historical window or on a longer series containing future observations. Full-series decomposition before temporal partitioning can introduce future information into earlier features. The available aggregate tables do not reveal which procedure was used, so leakage is a risk to investigate rather than an established finding.</p><p>The model specification also needs the optimizer, learning rate, batch size, epoch limit, early stopping rule, seeds, attention equations, residual-model choice, and handling of variable IMF counts. Boundary extension and the mask-frequency rule must be documented. A persistence forecast and controlled ablations would provide additional context, but no unreported experiment is assumed here. The horizon strategy must also be stated, since direct and recursive forecasts use different training targets and propagate errors differently.</p><h3>5.2 Internal consistency of the reported metrics</h3><p>For the standard unweighted RMSE and R² definitions applied to the same target vector, RMSE² / (1 − R²) equals the target sum of squared deviations divided by N. It should therefore be the same across models. In Table 1 at Site A, this quantity is approximately 252.92 for ARIMA, 221.08 for raw BiLSTM, and 198.55 for the masking configuration. The differences are larger than the intervals attributable to the displayed rounding.</p><p>A similar issue occurs at Site B: SVR has lower RMSE than vanilla LSTM (7.25 versus 7.30 µg/m³), but also lower R² (0.682 versus 0.730). For the stated definitions on a common target vector, a lower RMSE must correspond to a higher R². Differences also occur between models at the longer horizons in Table 2. A separate common-target check is required for each site and horizon; target variance need not be identical across different horizons.</p><p>This check identifies an unresolved comparability issue, not a unique explanation for it. Different test subsets, weighting, inverse-scaling procedures, or separate averaging of RMSE and R² across folds or runs could break the common-vector relationship. The prediction logs, matched targets, metric code, and aggregation rules must be examined before the reported advantage is treated as established. The table values have not been recomputed in the absence of those records.</p><h3>5.3 Scope of the conclusions</h3><p>No run count, confidence interval, or distribution over training seeds accompanies the accuracy results. The timing uncertainty is also undefined. Statistical significance and robustness to training variation therefore cannot be assessed. Opposite-phase masking does not by itself prove exact orthogonality or complete removal of the auxiliary carrier; those properties require direct diagnostics. The CPU timing result is limited to decomposition and cannot support a claim of deployment feasibility on a different hardware platform.</p><p>The selected literature includes air-quality applications and foundational decomposition and recurrent-network studies. It supports the methodological context without establishing a comprehensive state-of-the-art ranking or a priority claim. The connection between the monitoring records and previously published data also requires clarification. The present findings therefore remain a preliminary comparison of the recorded configurations, subject to verification of the underlying experiments.</p><h3>6.0 Conclusion</h3><p>The manuscript describes a Masking-EMD–BiLSTM configuration for PM2.5 forecasts over horizons from 1 to 24 h. The reported tables contain lower errors for the masking configuration than for the listed comparators, including a one-hour Site A RMSE of 4.18 µg/m³, and a CPU decomposition time of 1.82 s per 1,000 samples versus 48.65 s for CEEMDAN. These observations motivate further evaluation. A firm performance conclusion requires documented temporal partitions, verification that preprocessing uses only available information, reconciliation of metric aggregation, and reproducible model and runtime settings. Hardware deployment and physical interpretation of the IMFs remain topics for separate validation.</p><h3>References</h3><p>Deering, R., &amp; Kaiser, J. F. (2005). The use of a masking signal to improve empirical mode decomposition. In <em>Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)</em> (Vol. 4, pp. IV/485–IV/488). IEEE. <a href="https://doi.org/10.1109/ICASSP.2005.1416051">https://doi.org/10.1109/ICASSP.2005.1416051</a></p><p>Dragomiretskiy, K., &amp; Zosso, D. (2014). Variational mode decomposition. <em>IEEE Transactions on Signal Processing</em>, <em>62</em>(3), 531–544. <a href="https://doi.org/10.1109/TSP.2013.2288675">https://doi.org/10.1109/TSP.2013.2288675</a></p><p>GK, M. L., &amp; G, M. R. (2026). A hybrid VMD-transformer-BiLSTM framework for daily PM2.5 concentration forecasting in Delhi, India. <em>Frontiers in Environmental Science</em>, <em>14</em>, Article 1960286. <a href="https://doi.org/10.3389/fenvs.2026.1960286">https://doi.org/10.3389/fenvs.2026.1960286</a></p><p>Govande, A., Attada, R., &amp; Shukla, K. K. (2025). Predicting PM2.5 levels over Indian metropolitan cities using recurrent neural networks. <em>Earth Science Informatics</em>, <em>18</em>, Article 1. <a href="https://doi.org/10.1007/s12145-024-01491-4">https://doi.org/10.1007/s12145-024-01491-4</a></p><p>Graves, A., &amp; Schmidhuber, J. (2005). Framewise phoneme classification with bidirectional LSTM and other neural network architectures. <em>Neural Networks</em>, <em>18</em>(5–6), 602–610. <a href="https://doi.org/10.1016/j.neunet.2005.06.042">https://doi.org/10.1016/j.neunet.2005.06.042</a></p><p>Hochreiter, S., &amp; Schmidhuber, J. (1997). Long short-term memory. <em>Neural Computation</em>, <em>9</em>(8), 1735–1780. <a href="https://doi.org/10.1162/neco.1997.9.8.1735">https://doi.org/10.1162/neco.1997.9.8.1735</a></p><p>Huang, N. E., Shen, Z., Long, S. R., Wu, M. C., Shih, H. H., Zheng, Q., Yen, N.-C., Tung, C. C., &amp; Liu, H. H. (1998). The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. <em>Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences</em>, <em>454</em>(1971), 903–995. <a href="https://doi.org/10.1098/rspa.1998.0193">https://doi.org/10.1098/rspa.1998.0193</a></p><p>Krishan, M., Jha, S., Das, J., Singh, A., Goyal, M. K., &amp; Sekar, C. (2019). Air quality modelling using long short-term memory (LSTM) over NCT-Delhi, India. <em>Air Quality, Atmosphere &amp; Health</em>, <em>12</em>(8), 899–908. <a href="https://doi.org/10.1007/s11869-019-00696-7">https://doi.org/10.1007/s11869-019-00696-7</a></p><p>Masood, A., &amp; Ahmad, K. (2023). Data-driven predictive modeling of PM2.5 concentrations using machine learning and deep learning techniques: A case study of Delhi, India. <em>Environmental Monitoring and Assessment</em>, <em>195</em>(1), Article 60. <a href="https://doi.org/10.1007/s10661-022-10603-w">https://doi.org/10.1007/s10661-022-10603-w</a></p><p>Maulana, R. I., Al Haromainy, M. M., &amp; Junaidi, A. (2025). Prediction of air pollution standard index using CEEMDAN-LSTM. <em>bit-Tech</em>, <em>8</em>(2), 1918–1928. <a href="https://doi.org/10.32877/bt.v8i2.3164">https://doi.org/10.32877/bt.v8i2.3164</a></p><p>Prasetyo, D. I., Rachmawardani, A., Satrio, B., &amp; Adinara, D. B. (2025). Comparative analysis of machine learning and deep learning models for PM2.5 and PM10 time series forecasting using the SISANAPAS web platform. <em>Teknika</em>, <em>14</em>(3), 377–386. <a href="https://doi.org/10.34148/teknika.v14i3.1335">https://doi.org/10.34148/teknika.v14i3.1335</a></p><p>Ray, P., Lenka, R. K., &amp; Biswal, M. (2019). Frequency mode identification using modified masking signal-based empirical mode decomposition. <em>IET Generation, Transmission &amp; Distribution</em>, <em>13</em>(8), 1266–1276. <a href="https://doi.org/10.1049/iet-gtd.2018.5527">https://doi.org/10.1049/iet-gtd.2018.5527</a></p><p>Safira, D. A., Kuswanto, H., &amp; Ahsan, M. (2025). Improving the forecast accuracy of PM2.5 using SETAR-Tree method: Case study in Jakarta, Indonesia. <em>Atmosphere</em>, <em>16</em>(1), Article 23. <a href="https://doi.org/10.3390/atmos16010023">https://doi.org/10.3390/atmos16010023</a></p><p>Songsangka, N. (2026). Forecasting PM10, PM2.5, and PM1.0 from a single low-cost PM2.5 input: A triple-task multi-output virtual sensor with edge deployment profiling. <em>International Journal of Information Movement</em>, <em>11</em>(4), 28–48. <a href="https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/">https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/</a></p><p>Torres, M. E., Colominas, M. A., Schlotthauer, G., &amp; Flandrin, P. (2011). A complete ensemble empirical mode decomposition with adaptive noise. In <em>2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)</em> (pp. 4144–4147). IEEE. <a href="https://doi.org/10.1109/ICASSP.2011.5947265">https://doi.org/10.1109/ICASSP.2011.5947265</a></p><p>Wu, Z., &amp; Huang, N. E. (2009). Ensemble empirical mode decomposition: A noise-assisted data analysis method. <em>Advances in Adaptive Data Analysis</em>, <em>1</em>(1), 1–41. <a href="https://doi.org/10.1142/S1793536909000047">https://doi.org/10.1142/S1793536909000047</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f76e43c33cd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[# Can Masking-EMD + BiLSTM Solve PM2.5 Air Quality Forecasting? An Empirical Analysis]]></title>
            <link>https://medium.com/@nphassrsngsangka/can-masking-emd-bilstm-solve-pm2-5-air-quality-forecasting-an-empirical-analysis-3c0eb6d3dd41?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c0eb6d3dd41</guid>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 07:43:55 GMT</pubDate>
            <atom:updated>2026-10-15T07:43:55.018Z</atom:updated>
            <content:encoded><![CDATA[<p># Can Masking-EMD + BiLSTM Solve PM2.5 Air Quality Forecasting? An Empirical Analysis</p><p>*A deep dive into combining opposite-phase sinusoidal signal decomposition with bidirectional recurrent networks for accurate, low-latency multi-horizon air pollution prediction.*</p><p>— -</p><p>## TL;DR &amp; Key Takeaways</p><p>Predicting fine particulate matter ($\text{PM}_{2.5}$) accurately across multi-hour horizons is a notoriously complex problem due to volatile signal dynamics. In this study, we evaluate a novel framework combining **Masking-Assisted Empirical Mode Decomposition (Masking-EMD)** and **Bidirectional LSTM (BiLSTM)** networks.</p><p>* **High Precision:** Reached 1-hour forecast errors of **RMSE 4.18 $\mu\text{g/m}³$** (Site A) and **4.79 $\mu\text{g/m}³$** (Site B), outperforming standard BiLSTM (6.22) and CEEMDAN-BiLSTM (4.65).</p><p>* **Massive Speedup:** Achieved a **26.73x CPU computational speedup** over CEEMDAN ($1.82\text{ s}$ vs. $48.65\text{ s}$ per 1,000 samples).</p><p>* **Critical Review:** While promising, complete mask signal cancellation, strictly causal feature partitioning, and metric consistency require rigorous validation before real-world edge deployment.</p><p>— -</p><p>## 1. Introduction &amp; The Forecasting Challenge</p><p>Hourly forecasting of fine particulate matter ($\text{PM}_{2.5}$) requires models capable of capturing rapidly shifting temporal dynamics. Crucially, any evaluation protocol must strictly limit model inputs to data available *prior* to the forecast origin.</p><p>Traditional signal processing tools like **Empirical Mode Decomposition (EMD)** break down raw signals into data-dependent oscillatory components called Intrinsic Mode Functions (IMFs). When paired with **Long Short-Term Memory (LSTM)** networks, component-based forecasting architectures emerge.</p><p>```</p><p>+ — — — — — — — — — + + — — — — — — — — — -+ + — — — — — — — — — — + + — — — — — — — — — -+</p><p>| Raw PM2.5 Time | → | Masking Signal | → | Component-Wise | → | Additive |</p><p>| Series Signal | | Decomposition | | BiLSTM Forecasting | | Reconstruction |</p><p>+ — — — — — — — — — + + — — — — — — — — — -+ + — — — — — — — — — — + + — — — — — — — — — -+</p><p>```</p><p>In this study, we analyze an **opposite-phase sinusoidal masking technique** applied prior to EMD extraction. By forecasting each decomposed mode via tailored BiLSTM architectures and adding them back together, we aim to strike an optimal balance between accuracy and computational efficiency across multiple forecast horizons ($1\text{ h}$, $6\text{ h}$, $12\text{ h}$, and $24\text{ h}$).</p><p>— -</p><p>## 2. Background &amp; Related Work</p><p>### Learning Methods for Particulate Matter</p><p>Recurrent neural architectures have proven effective in capturing temporal dependencies in pollution datasets. Previous benchmarks in Delhi, Jakarta, and Indian metropolitan regions established LSTMs, GRUs, SVRs, and Tree-based ensembles as strong contenders. However, performance remains strictly dependent on regional data characteristics, making universal architecture selection difficult.</p><p>### Decomposition Strategies</p><p>Decomposition provides a domain-informed pre-processing step. While **EEMD** (Ensemble EMD) and **CEEMDAN** introduce noise-assisted ensembles to resolve mode mixing, they suffer from high computational overhead. **VMD** (Variational Mode Decomposition) introduces an alternative optimization framework.</p><p>By applying a targeted masking signal, EMD extrema can be altered to systematically separate high-frequency intermittent oscillations without relying on computationally expensive stochastic ensembles.</p><p>— -</p><p>## 3. Methodology &amp; System Architecture</p><p>### 3.1 Monitoring Records</p><p>The experimental dataset comprises **19,326 valid hourly records** collected between August 2024 and February 2026 across two distinct monitoring stations in Thailand:</p><p>* **Site A (Urban Rooftop):** 10,059 hourly records.</p><p>* **Site B (Coastal Mangrove Reserve):** 9,267 hourly records.</p><p>Measurements were captured using optical particle counters calibrated against a BAM-1022 beta attenuation monitor.</p><p>### 3.2 The Opposite-Phase Masking Mechanism</p><p>For an observed signal $x_t$, EMD represents the series as the sum of $K$ IMFs ($c_{k,t}$) and a residual $r_t$:</p><p>$$x_t = \sum_{k=1}^{K} c_{k,t} + r_t$$</p><p>To mitigate mode mixing efficiently, an auxiliary sinusoidal mask $s_{m,t} = a_m \sin(2\pi f_m t)$ is created. A complementary pair of masked inputs is generated:</p><p>$$x^+_t = x_t + a_m \cdot \sin(2\pi f_m t)$$</p><p>$$x^-_t = x_t — a_m \cdot \sin(2\pi f_m t)$$</p><p>```</p><p>Raw Input x(t)</p><p>/ \</p><p>/ \</p><p>+ Mask (+s_m) — Mask (-s_m)</p><p>| |</p><p>[Extract IMF 1+] [Extract IMF 1-]</p><p>\ /</p><p>\ /</p><p>Average: c_1 = (IMF1+ + IMF1-) / 2</p><p>```</p><p>By extracting the first IMF from both branches and averaging them, we reduce the footprint of the auxiliary signal while isolating clean high-frequency components:</p><p>$$c_{1,t} = \frac{c_{1,t}^+ + c_{1,t}^-}{2}$$</p><p>### 3.3 Model Parameterization &amp; Routing</p><p>* **Frequency Tuning:** Mask frequency $f_m = 1.2 f_{\text{high}}$, where $f_{\text{high}}$ is derived via Welch’s Power Spectral Density (PSD) estimate.</p><p>* **Amplitude Selection:** Mask amplitude $a_m = \alpha \cdot \sigma_x$, with $\alpha \in [0.4, 0.8]$ selected via validation grid search.</p><p>* **Neural Architecture:**</p><p>* Lookback window $L = 24\text{ hours}$.</p><p>* High-frequency components ($\text{IMF}_1$, $\text{IMF}_2$): Single-layer BiLSTM ($H = 32$, Dropout = 0.3).</p><p>* Lower-frequency components ($\text{IMF}_3$ to $\text{IMF}_K$): Two-layer BiLSTM ($H = 64$) with Temporal Attention.</p><p>* Residual trend: Linear autoregressive extrapolator / Ridge regression.</p><p>Finally, at forecast origin $t$, component predictions are summed for target horizon $h$:</p><p>$$\hat{y}_{t+h} = \sum_{k=1}^{K} \hat{c}_{k, t+h} + \hat{r}_{t+h}$$</p><p>— -</p><p>## 4. Key Findings &amp; Performance Metrics</p><p>### 4.1 One-Hour Ahead Forecast Evaluation</p><p>Across 10 distinct configurations, **Masking-EMD–BiLSTM** yielded the lowest overall error metrics.</p><p>&gt; **Table 1:** One-hour $\text{PM}_{2.5}$ forecasting results at Site A and Site B ($\text{RMSE}$ and $\text{MAE}$ in $\mu\text{g/m}³$).</p><p>| Model | Decomposition | Site A RMSE | Site A MAE | Site A $R²$ | Site B RMSE | Site B $R²$ |</p><p>| : — — | : — — | : — -: | : — -: | : — -: | : — -: | : — -: |</p><p>| **ARIMA** | None | 8.94 | 6.42 | 0.684 | 8.12 | 0.615 |</p><p>| **SVR** | None | 7.65 | 5.28 | 0.742 | 7.25 | 0.682 |</p><p>| **Random Forest** | None | 6.38 | 4.46 | 0.816 | 7.36 | 0.726 |</p><p>| **Vanilla LSTM** | None | 6.45 | 4.58 | 0.812 | 7.30 | 0.730 |</p><p>| **Raw BiLSTM** | None | 6.22 | 4.35 | 0.825 | 7.08 | 0.745 |</p><p>| **EMD-BiLSTM** | Standard EMD | 5.42 | 3.78 | 0.865 | 6.25 | 0.801 |</p><p>| **VMD-BiLSTM** | VMD ($K=6$) | 4.88 | 3.35 | 0.888 | 5.62 | 0.838 |</p><p>| **EEMD-BiLSTM** | EEMD (100 trials) | 4.74 | 3.24 | 0.895 | 5.45 | 0.849 |</p><p>| **CEEMDAN-BiLSTM** | CEEMDAN (100) | 4.65 | 3.16 | 0.901 | 5.32 | 0.856 |</p><p>| **Masking-EMD–BiLSTM**| **Masking EMD** | **4.18** | **2.84** | **0.912** | **4.79** | **0.884** |</p><p>At Site A, Masking-EMD–BiLSTM demonstrated a **32.8% error reduction in RMSE** over raw BiLSTM and a **10.1% reduction** over the competitive CEEMDAN–BiLSTM framework.</p><p>### 4.2 Robustness Across Multi-Horizon Intervals</p><p>As expected, forecasting errors scale as the temporal window expands from 1 to 24 hours.</p><p>&gt; **Table 2:** Multi-horizon forecast evaluation at Site A ($\text{RMSE}$ in $\mu\text{g/m}³$, with $R²$ in parentheses).</p><p>| Model | 1-Hour | 6-Hour | 12-Hour | 24-Hour |</p><p>| : — — | : — -: | : — -: | : — -: | : — -: |</p><p>| **Raw BiLSTM** | 6.22 (0.825) | 9.45 (0.642) | 12.18 (0.478) | 14.85 (0.312) |</p><p>| **EMD-BiLSTM** | 5.42 (0.865) | 8.32 (0.718) | 10.65 (0.584) | 13.20 (0.445) |</p><p>| **CEEMDAN-BiLSTM**| 4.65 (0.901) | 7.15 (0.785) | 9.12 (0.682) | 11.45 (0.562) |</p><p>| **VMD-BiLSTM** | 4.88 (0.888) | 7.40 (0.768) | 9.38 (0.665) | 11.82 (0.538) |</p><p>| **Masking-EMD–BiLSTM**| **4.18 (0.912)** | **6.35 (0.832)** | **8.15 (0.748)** | **10.22 (0.645)** |</p><p>### 4.3 Computational Efficiency Benchmark</p><p>A critical bottleneck in real-time decomposition pipelines is computational speed. Decomposing 1,000 samples on an Intel Core i7–12700H CPU produced the following benchmarks:</p><p>&gt; **Table 3:** Decomposition execution time per 1,000 samples.</p><p>| Algorithm | Extraction Parameters | Time (seconds) | Speed Ratio vs. EMD |</p><p>| : — — | : — — | : — -: | : — -: |</p><p>| **Standard EMD** | Deterministic extraction | $0.85 \pm 0.04\text{ s}$ | $1.00\times$ |</p><p>| **EEMD** | 100 ensembles | $64.20 \pm 2.15\text{ s}$ | $75.53\times$ |</p><p>| **CEEMDAN** | 100 ensembles | $48.65 \pm 1.80\text{ s}$ | $57.24\times$ |</p><p>| **Masking-EMD** | **2 opposite-phase branches** | **$1.82 \pm 0.08\text{ s}$** | **$2.14\times$** |</p><p>Key Finding: Masking-EMD delivers a **26.73x speedup over CEEMDAN** while achieving equal or superior error scores.</p><p>— -</p><p>## 5. Critical Discussion &amp; Methodological Sanity Checks</p><p>Despite promising preliminary numbers, several rigorous validation criteria must be highlighted:</p><p>1. **Temporal Data Integrity:** Full-series EMD performed prior to splitting train/test splits can cause data leakage by introducing future envelope information into historical components. Window-level causal processing must be strictly audited.</p><p>2. **Metric Consistency Checks:** Under uniform target metrics, the theoretical relationship $\frac{\text{RMSE}²}{1 — R²}$ should remain constant across models evaluated on identical test sets. Variations observed in raw tables indicate possible differences in test fold aggregation or sub-sampling that require further reconciliation.</p><p>3. **Physical Interpretation:** Statistical component decomposition does not automatically map IMFs to concrete physical phenomena (e.g., daily sea breezes or traffic rushes) without dedicated spectral diagnostic tools.</p><p>— -</p><p>## 6. Conclusion &amp; Next Steps</p><p>Masking-EMD combined with BiLSTM offers an efficient, high-accuracy framework for time-series $\text{PM}_{2.5}$ forecasting. By removing the need for heavy ensemble noise routines, it bridge the gap between computational speed and high predictive performance.</p><p>### What’s Next?</p><p>* Verifying window-strict causal preprocessing pipelines.</p><p>* Extending benchmarks from desktop CPUs to microcontrollers (e.g., ESP32-S3) for edge deployment.</p><p>* Open-sourcing standardized test benchmarks for atmospheric time-series decomposition.</p><p>— -</p><p>## References</p><p>* **Deering, R., &amp; Kaiser, J. F. (2005).** The use of a masking signal to improve empirical mode decomposition. *IEEE ICASSP*, 4, IV/485–IV/488.</p><p>* **Dragomiretskiy, K., &amp; Zosso, D. (2014).** Variational mode decomposition. *IEEE Transactions on Signal Processing*, 62(3), 531–544.</p><p>* **Hochreiter, S., &amp; Schmidhuber, J. (1997).** Long short-term memory. *Neural Computation*, 9(8), 1735–1780.</p><p>* **Huang, N. E., et al. (1998).** The empirical mode decomposition and the Hilbert spectrum for nonlinear time series analysis. *Proc. Royal Society A*, 454, 903–995.</p><p>* **Torres, M. E., et al. (2011).** A complete ensemble empirical mode decomposition with adaptive noise. *IEEE ICASSP*, 4144–4147.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c0eb6d3dd41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FORECASTING PM10, PM2.5]]></title>
            <link>https://medium.com/@nphassrsngsangka/forecasting-pm10-pm2-5-5644d0f07ea0?source=rss-3b28e5aec48a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5644d0f07ea0</guid>
            <category><![CDATA[edge-inference]]></category>
            <category><![CDATA[tinyml]]></category>
            <category><![CDATA[multi-task-learning]]></category>
            <dc:creator><![CDATA[Nphassrsngsangka]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 08:25:08 GMT</pubDate>
            <atom:updated>2026-09-06T08:25:08.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>FORECASTING PM10, PM2.5 , AND PM1.0 FROM A SINGLE LOW-COST PM2.5 INPUT: A TRIPLE-TASK MULTI-OUTPUT VIRTUAL SENSOR WITH EDGE DEPLOYMENT PROFILING</h3><p>Dense particulate-matter (PM) monitoring has become increasingly practical with the spread of low-cost optical sensors, yet resolving the three health-relevant size fractions PM10, PM2.5, and PM1.0 still demands either several sensing channels or a dedicated forecasting model for each fraction, inflating both hardware cost and the computational load carried at the edge. This study introduces a virtual PM sensing framework in which one PM2.5 channel alone drives the forecasting of all three fractions simultaneously. Since PM1.0, PM2.5, and PM10 form a physically nested hierarchy with tightly coupled temporal behavior, their shared dynamics can be captured by a single model that emits three outputs in one forward pass, removing the need to train three separate models. Taking a 24-hour PM2.5 history as input, the triple-task architecture predicts all fractions one hour ahead and is benchmarked against conventional independent single-task models over four model configurations drawn from three architecture families, consisting of Random Forest with 10 and 100 trees, 1D-CNN, and LSTM, using 19,326 hourly records from two contrasting sites in Ho Chi Minh City, Vietnam. Over 24 model–site–target combinations, the triple-task models proved as skilful as the single-task baselines (mean absolute ΔRMSE of 0.11 µg/m3) while shrinking model size by 38–65%. All four configurations achieve real-time operation on an ESP32-S3 microcontroller, where one joint inference substitutes for three sequential single-task runs and lowers inference time and energy by a factor of 2.2 to 3.0. For the 10-tree Random Forest, the most memory-efficient candidate, these costs fall from 0.167 ms and 0.039 mJ to 0.065 ms and 0.015 mJ. The findings show that a widely available PM2.5 sensor coupled with a low-cost microcontroller can support a triple-task virtual sensor that delivers real-time, physically consistent multi-fraction PM forecasts without sacrificing predictive performance, easing the sensing and computing bottlenecks that hold back field-scale dense PM monitoring.</p><p>While hybrid CEEMDAN-LSTM models can improve PM2.5 forecasting accuracy, their ensemble-based decomposition and iterative sifting stages make direct execution of the complete pipeline impractical on resourceconstrained microcontrollers such as ESP32-class edge nodes due to high SRAM requirements. To resolve this computational bottleneck and preserve decomposition benefits, we propose an asymmetric edge-cloud decoupled architecture that assigns CEEMDAN decomposition to the server while physically deploying a lightweight INT8-quantized LSTM on the ESP32-S3 microcontroller. In the proposed online workflow, the server decomposes historical PM2.5 observations and transmits the (168,14) decomposed feature tensor to the ESP32-S3 over Wi-Fi for multi-horizon inference. This data transfer requires a payload of only 2.30 KB per cycle. In the present experiments, server-side feature generation and network transmission were emulated offline, whereas the recurrent inference stage was implemented and executed on the ESP32-S3. Evaluated on a three-year Bangkok dataset, CEEMDAN-LSTM achieves an R² of 0.864 at the 1-hour horizon and 0.595 at 6 hours, outperforming the raw-input baselines at both horizons, with a larger margin at 6 hours. On-device ESP32-S3 evaluation yielded an R² of 0.824 and an average device-side inference latency of 995.48 ms. The serialized INT8 model occupies only 68.38 KB, representing a 54.1% memory reduction compared to the offline Float32 reference without significant accuracy degradation. These results demonstrate the physical feasibility of the recurrent inference stage and support the proposed asymmetric task allocation for multi-scale PM2.5 forecasting on resource-constrained microcontrollers.</p><p>Data Acquisition and Causal Window Preparation In this study, hourly PM2.5 concentrations were obtained from the US Embassy monitoring station in Bangkok, Thailand (January 2021 to December 2023). Prior high-resolution atmospheric and dispersion modelling has shown that road-traffic emissions and seasonal transboundary biomass burning are dominant contributors to ambient particulate pollution in the Bangkok Metropolitan Region [17]. These data were recorded via Beta Attenuation Monitors following US EPA protocols [18] and retrieved from the AirNow database. Records flagged with operational anomaly</p><p><a href="https://www.ijisrt.com/an-asymmetric-edgecloud-decoupled-architecture-for-decompositionbased-pm25-forecasting-on-resourceconstrained-microcontrollers">An asymmetric edgecloud decoupled architecture for decompositionbased pm25 forecasting on resourceconstrained microcontrollers| International Journal of Innovative Science and Research Technology</a></p><p><a href="https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/">https://www.ijim.in/forecasting-pm10-pm2-5-and-pm1-0-from-a-single-low-cost-pm2-5-input-a-triple-task-multi-output-virtual-sensor-with-edge-deployment-profiling/</a></p><p><strong>Napatsorn Songsangka. (2026), “Forecasting PM10, PM2.5, and PM1.0 from a Single Low-Cost PM2.5 Input: A Triple-Task Multi-Output Virtual Sensor with Edge Deployment Profiling”. International Journal of Innovative Science and Research Technology (IJISRT) IJISRT26AUG1128 2694–2704 10.38124/ijisrt/26aug1128</strong></p><p><strong>Napatsorn Songsangka. (2026), “An Asymmetric Edge-Cloud Decoupled Architecture for Decomposition-Based PM2.5 Forecasting on Resource-Constrained Microcontrollers”. International Journal of Innovative Science and Research Technology (IJISRT) IJISRT26AUG1127 2554–2561 10.38124/ijisrt/26aug1127</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5644d0f07ea0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>