# Automatic detection of indoor air pollution-related activities using metal-oxide gas sensors and the temporal intrinsic dimensionality estimation of data

Luiz Miranda, Caroline Duc, Nathalie Redon, João Pinheiro, Bernadette Dorizzi, Jugurta Montalvão, Marie Verriele, Jérôme Boudy

► To cite this version:

Luiz Miranda, Caroline Duc, Nathalie Redon, João Pinheiro, Bernadette Dorizzi, et al. Automatic detection of indoor air pollution-related activities using metal-oxide gas sensors and the temporal intrinsic dimensionality estimation of data. Indoor Environments, 2024, 1 (3), pp.100026. 10.1016/j.indenv.2024.100026. hal-05300884

HAL Id: hal-05300884

https://hal.science/hal-05300884v1

Submitted on 7 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Automatic detection of indoor air pollution-related activities using metal-oxide gas sensors and the temporal intrinsic dimensionality estimation of data

<figure><img src="image_2.png" /></figure>

Luiz Miranda<sup>a,b,*</sup>, Caroline Duc<sup>a</sup>, Nathalie Redon<sup>a</sup>, João Pinheiro<sup>a</sup>, Bernadette Dorizzi<sup>c</sup>, Jugurta Montalvão<sup>d</sup>, Marie Verriele<sup>a</sup>, Jérôme Boudy<sup>c</sup>

## ARTICLE INFO

### Keywords:

- Indoor activity detection
- Metal-oxide gas sensors
- Intrinsic Dimensionality
- Indoor Air Quality

## ABSTRACT

Ensuring indoor air quality (IAQ) is crucial for safeguarding health, with daily occupant activities serving as significant sources of pollutants. This study addresses the need to identify and mitigate indoor pollution events caused by activities like cleaning and cooking. Employing metal-oxide gas (MOX) sensors, we propose a method that automatically detects indoor air pollution-related activities through intrinsic dimensionality estimation on time-windowed multivariate signals. The approach was validated using a dataset derived from two months of experiments involving 10 common household activities in a 13 m² (46 m³) room, utilizing 21 distinct MOX sensor references. The dataset, which included labeled activities, demonstrated the method's superior accuracy compared to existing literature, showcasing its robustness against sensor drift. This research contributes to raising awareness, enabling timely intervention, and facilitating the automation of smart ventilation systems to maintain healthy indoor environments.

## 1. Introduction

Monitoring indoor air quality (IAQ) is essential for understanding the quality of the air we breathe in our daily lives, given that we spend over 80% of our time indoors, including commuting, office hours, and time at home [1]. Routine activities like cooking, housekeeping, smoking, and the use of candles and incense contribute significantly to indoor pollution, particularly in terms of volatile organic compounds (VOC) [2] and particulate matter (PM) [3]. The adverse health effects associated with poor IAQ, known as sick building syndrome, have been extensively documented [4].

The early detection of pollution events, which could result in elevated emissions, plays a crucial role in preventing pollutant concentrations from reaching harmful levels. It serves to alert users about environmental risks and can potentially trigger actions to mitigate indoor pollution — such as implementing smart ventilation systems. While conventionally labeled as “Event Detection” within the context of Indoor Air Quality (IAQ) research [5–7], this work prefers the term

“Activity Detection”. This choice acknowledges that pollution events are often closely tied to specific activities occurring within indoor environments

This task usually involves setting thresholds on sensor measurements, signaling the start and end of pollution events when measurements exceed or fall below these values. Some studies go beyond this by employing techniques such as frequency analysis [8], support vector machines [7], or statistical analysis [2] on sensor measurements to detect indoor activities.

In this study, which expands upon our preliminary work published as a conference paper in [9], we propose using the intrinsic dimensionality estimation of metal-oxide-based (MOX) gas sensors' measurements within a small time window as a metric to detect indoor pollution events resulting from human activities — such as floor cleaning or cooking. The primary advantage of this approach lies in its focus on recent and raw measurements, avoiding the impact of the known long-term drift observed in these types of sensors [10]. This method eliminates the need to quantify pollutant concentrations or

<footnote><sup>a</sup> IMT Nord Europe, Institut Mines-Télécom, Univ. Lille, Center for Energy and Environment, Lille F-59000, France</footnote>

<footnote><sup>b</sup> ADEME - l'Agence de la transition écologique, Angers 49000, France</footnote>

<footnote><sup>c</sup> Samovar, Télécom SudParis, Institut Polytechnique de Paris, Palaiseau 91120, France</footnote>

<footnote><sup>d</sup> Universidade Federal de Sergipe, Departamento de Engenharia Elétrica, São Cristóvão 49100-000, Brazil</footnote>

<footnote>* Corresponding author at: IMT Nord Europe, Institut Mines-Télécom, Univ. Lille, Center for Energy and Environment, Lille F-59000, France
E-mail address: luiz.miranda@imt-nord-europe.fr (L. Miranda).</footnote>
<figure><img src="image_3.png" /><figcaption>**Fig. 1.** Illustration of the ID estimation method. Fig. 1(a): a synthetic dataset generated with data from three artificial sensors (x, y and z) in which three distinct regions arises with three distinct intrinsic dimensionalities, one 1D near the green cube, one 2D near the red cube, and one 3D around the black cube. The remaining images refer to the $log(C(r)) \times log(r)$ plot as the edge r of the cube varies in the three different regions of Fig. 1(a), the numbers along the plot represent the slope, equivalent to the estimated ID in this region. Fig. 1(b), (c), and (d) are the resulting graphs for the area around the green, the red, and the black cubes, respectively. They show the average slope in the central region of the lines, referring to the estimated ID of the data inside each cube.</figcaption></figure>

identify their nature to detect activity presence. However, a potential drawback is that it does not provide information about the harmfulness level of pollutants. To address this limitation, collaboration with epidemiologists becomes crucial, as they are increasingly exploring the potential of sensor systems to assess health impacts on an individual scale.

The remainder of this paper is divided as follows: in Section 2.1, we offer a brief explanation for our decision to employ MOX sensors rather than other sensor types, given that they are not typically chosen for this particular task. Section 2.2 delves into the theoretical underpinnings necessary for comprehending both the detection method and its implementation. The experiment, used to test this method, is detailed in Section 2.3, with subsequent sections providing the results and discussions on why various methods yield differing performances in Section 3. Finally, our conclusions are presented in Section 4.

## 2. Material and methods

### 2.1. Why use MOX instead of other types of sensors?

Activity detection can be performed by various types of sensors with proven high accuracy [11], including cameras, microphones, and binary sensors. However, they all have limitations when applied in the indoor environment, particularly in assessing indoor air quality (IAQ). Cameras and microphones, while effective in activity detection, raise

privacy concerns in residential settings and require significant computational power for data processing [12].

While binary sensors, such as passive infrared motion detectors and magnetic reed switches, are relatively inexpensive and show good accuracy in activity detection [13,14], they also lack the capability of assessing IAQ. Additionally, the installation and integration of these sensors within buildings can become cumbersome due to the lack of a fully established communication standard among these devices.

On the other hand, the use of gas sensors to assess IAQ have been studied extensively since the 2000s [15,16] with high levels of accuracy for individual pollutant detection, especially when grouped in sensor arrays such as IAQ monitoring devices [17], which offer portability and flexibility in placement for assessing air quality. These sensors have also been successfully used for both activity detection and activity recognition [18,19]. Metal-oxide semiconductor (MOX) sensors, in particular, are highlighted for their cost-effectiveness and compactness [16]. Despite their lack of selectivity when used individually, MOX sensors can effectively detect and quantify individual pollutant emissions when employed in arrays [20], although requiring additional processing techniques such as pattern recognition using methods like K-means clustering [19] or neural networks [20].

Given these advantages, our approach involves employing a set of multiple MOX sensors arranged in an IAQ monitor to detect pollution activity in indoor environments. To extract relevant information from these sensors, we propose utilizing the estimation of the temporal
<figure><img src="image_4.png" /><figcaption>Fig. 2. Measurements out of activity and during activity. Fig. 2(a) and (d), show the raw measurements of three MOX sensors, that when normalized become dominated either by measurement noise or the excitation coming from an activity shown in (b) and (e), respectively. Consequently, the space spanned by the sensors data will either occupy all the available space when no activity is being performed (high ID) or a small portion of the space when an activity is being performed (low ID) as shown in (c) and (f), respectively.</figcaption></figure>

intrinsic dimensionality of sensor readings, a metric which is described in section 2.2. Differently from a pattern recognition approach, which trains a model to recognize future samples, making it vulnerable to the drift problem inherent from these sensors, our approach only looks at the data within a small time window (one hour), making it less affected by the long term drift of these sensors.

## 2.2. Intrinsic dimensionality and activity detection

The dimensionality of a system is the number of variables it presents to the world. For a system with *D* sensors, for example, its data can be fully represented in a space with *D* dimensions, one for each sensor. As dimensionality goes up, visualization and interpretation of data becomes more difficult. High dimensional data, however, can often be described with fewer *d* variables (*d* < *D*) as the phenomenon it represents often is not complex enough to excite all sensors equally [21]. This lower number *d* is called the Intrinsic Dimensionality (ID) of the data and it is defined as “the minimum number of free variables needed to represent data without information loss” [21,22].

The *d* number can also be interpreted as the “real” dimensionality of the system. Consider, for example, a flat surface being represented in $\mathbb{R}^3$, as it is a 2-dimensional structure, it can be fully represented using a coordinate space with only two variables. So, while the dimensionality of the whole system is 3 (as it is represented in $\mathbb{R}^3$), the intrinsic dimensionality of the represented data is 2.

For experimental data with more than three sensors, it becomes impossible to visualize the structures that arise from the data. We can, however, estimate the dimensionality of these structures, their ID. To do so, in this work, we adopt the ID estimation method proposed by Grassberger and Procaccia [23] with the implementation from Montalvão et al. [24]. To illustrate how this method works, consider the synthetic dataset presented in Fig. 1(a). Each blue dot in this image consists of multivariate measurement from three virtual sensors (x, y, and z), sampled in a given time instant. Three notable regions arise

from this dataset, one 1-dimensional around the green cube, one 2-dimensional around the red cube, and one 3-dimensional around the black cube. To estimate the ID, this method evaluates the number of sample pairs (pairs of blue dots) coinciding (also referred to as collision of observations) in a given observed region while also varying the size of the observation region. We illustrate this point using the different colored cubes. Consider that one of the cubes starts with a very small edge size *r*, and as *r* increases the count of sample collisions (or coincidences), $C(r)$, inside the cube (an empirical approximation of the correlation integral in Grassberger and Procaccia [23]) also increases. The ratio between the increase of edge size *r* of the cube and the increase in the count of sample collisions, $C(r)$, inside the cube is shown in [23] to be $C(r) \propto r^d$, in which *d* is the ID of the region in which the cube was placed. By performing this cube expansion operation in different regions and by keeping track of *r* and $C(r)$ we can estimate that the ID of the data is the slope of a $\log(C(r))$ versus $\log(r)$ plot. Fig. 1(b), (c), and (d) illustrate this process for the regions around the green, red, and black cubes, respectively.

While performing ID estimation using this method, sensor data is adjusted using a min-max normalization step before the dimensionality evaluation to prevent bias from sensors with large measurements. However, this preprocessing step results in situations where, in the absence of any stimulation, sensor measurements are primarily influenced by random noise. Consequently, upon normalization, this noise fills the entire space designated by the *D* sensors, leading to an anticipated ID of approximately *D*. Conversely, when sensors are exposed to pollutants coming from activities, the transient response induces a low dimensional structure which is formed in the space spanned by their measurements.

This phenomenon is illustrated in Fig. 2, where, after the raw measurements presented in Fig. 2(a) and (d) are normalized, as shown in (b) and (e), the influence of measurement noise and the excitation coming from the activity perform is increased, forming either a high dimensional structure in (c) or a low dimensional structure in (f),
respectively.

By applying a sliding window of observation of duration *T* to the signal, the estimated ID inside these time intervals can be extracted to determine if there was activity or not. We call this analysis of ID through time as “temporal ID” and we consider that an activity is being performed when the resulting temporal ID falls below a specified threshold. We applied this approach to determine the presence of activity on the dataset extracted from the indoor activity experiment described in section 2.3.

## 2.3. The experimental protocol

This approach underwent testing using a dataset derived from an indoor activity experiment conducted in a 13 m² (46 m³) room. Within this volume, 21 distinct models of MOX sensors were deployed across 4 IAQ monitoring modules: one module featuring 4 sensors, another with 6 sensors, and two modules each equipped with 10 sensors. The dataset was synchronized across all modules, and the sampling period was set to 10 s. Refer to Table 1 for a list of the MOX sensors utilized.

The experiment involved 10 types of activities: (i) Static activity (a person seated at a desk in the room); (ii) Cooking/eating (involving oil frying and consuming an egg); (iii) Humid activity (towel drying, with no one in the room); (iv) Vacuum cleaning; (v) Floor cleaning using bleach and detergent; (vi) Low-intensity exercise; (vii) Scented candle use; (viii) Renewing the room's air by opening a window; (ix) Emissions from using hot glue; and (x) Emissions from woodcutting and wood drilling. The chosen activities aimed to simulate typical household behaviors, generating pollutants characteristic of indoor air pollution (IAP). While activities were assigned a suggested duration, some variations within acceptable limits were permitted to replicate real-world scenarios.

Over 26 days, spanning from November to December 2022 and from February to March 2023, a total of 276 activities were carried out in the room. Two individuals shared the responsibility, with each performing approximately half of the activities. All activities were meticulously documented with their start and end times, recorded in an attached spreadsheet within the dataset.

# 3. Results

The dataset utilized a sampling period of 10 s. To ensure a sufficiently large sample size and mitigate bias in ID estimation to acceptable levels [24], the window size, denoted as *T*, was set to one hour, resulting in 360 samples. This sample size is deemed adequate for ID estimation of dimensionality up to 5 while maintaining acceptable bias levels in the estimation. The chosen duration aligns well with typical indoor activities. For a more in-depth understanding of the calculation of the minimum number of samples and estimation bias, refer to Montalvão et al. [24].

The signal scanning process involved overlapping windows, with each window moving in steps smaller than its size. In this context, the step size was constrained to a lower limit of 50 instances of measurements, equivalent to 500 s. Stationarity is assumed within observation windows, where all measurements within a step size of the sliding window are considered to share the same temporal ID.

Upon scanning the dataset and computing the temporal ID, we observed an average value of 2.2 during activities and 4.6 when no activity was ongoing. Notably, there was some overlap between these distributions, as illustrated in Fig. 3, with a standard deviation of 1.6 during activity and 3 outside activity.

Based on this information, we chose to set a detection threshold for activity through the False Acceptance Rate and False Rejection Rate, thereby determining the Equal Error Rate (EER). This approach also facilitates method comparison with others in the literature as it allows calculating the F-score of all methods.

<table><caption>**Table 1**

List of modules used in the experiments and their MOX sensors.</caption><thead><tr><th>IAQ monitoring module</th><th>Sensor model</th><th>Target Pollutants (according to datasheet)</th></tr></thead><tbody><tr><td rowspan="3">3 x Module 1</td><td>MICS 5524</td><td>CO + C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + NH<sub>3</sub> + CH<sub>4</sub></td></tr><tr><td>MICS 5914</td><td>NH<sub>3</sub> + C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + C<sub>3</sub>H<sub>8</sub> + C<sub>4</sub>H<sub>10</sub></td></tr><tr><td>CCS 801<br>TGS 8100</td><td>C<sub>2</sub>H<sub>5</sub>OH + CO + C<sub>7</sub>H<sub>8</sub><br>C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + CO + C<sub>4</sub>H<sub>10</sub></td></tr><tr><td rowspan="2">1 x Module 2</td><td>TGS 2603</td><td>C<sub>2</sub>H<sub>5</sub>OH + C<sub>3</sub>H<sub>9</sub>N + CH<sub>4</sub>S + H<sub>2</sub>S + H<sub>2</sub></td></tr><tr><td>TGS 2620<br>COM 31<br>H2SM 31<br>VOCM 31<br>TGS 2600<br>TGS 2602<br>SB 5100<br>SBAQ 106</td><td>C<sub>2</sub>H<sub>5</sub>OH + Solvent vapours<br>CO<br>H<sub>2</sub>S<br>VOC<br>H<sub>2</sub> + C<sub>2</sub>H<sub>5</sub>OH + C<sub>4</sub>H<sub>10</sub><br>VOC (Toluene + ethanol)<br>H<sub>2</sub>S<br>VOC</td></tr><tr><td rowspan="8">1 x Module 3</td><td>GM 102B</td><td>NO<sub>2</sub></td></tr><tr><td>GM 302B</td><td>ALCOHOL</td></tr><tr><td>GM 402B</td><td>C<sub>3</sub>H<sub>8</sub> + CH<sub>4</sub></td></tr><tr><td>GM 502B</td><td>VOC</td></tr><tr><td>GM 602B</td><td>H<sub>2</sub>S</td></tr><tr><td>GM 702B</td><td>CO</td></tr><tr><td>GM 802B</td><td>NH<sub>3</sub></td></tr><tr><td>MICS 5524</td><td>CO + C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + NH<sub>3</sub> + CH<sub>4</sub></td></tr><tr><td rowspan="3">2 x Module 4</td><td>MICS 2714</td><td>NO<sub>2</sub></td></tr><tr><td>MICS 5914</td><td>NH<sub>3</sub> + C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + C<sub>2</sub>H<sub>8</sub> + C<sub>4</sub>H<sub>10</sub></td></tr><tr><td>TGS 4161</td><td>CO<sub>2</sub></td></tr><tr><td></td><td>MICS 2714</td><td>NO<sub>2</sub></td></tr><tr><td></td><td>TGS 2442</td><td>CO</td></tr><tr><td></td><td>MICS 5524</td><td>CO + C<sub>2</sub>H<sub>5</sub>OH + H<sub>2</sub> + NH<sub>3</sub> + CH<sub>4</sub></td></tr><tr><td></td><td>TGS 2602</td><td>VOC (Toluene + ethanol)</td></tr><tr><td></td><td>TGS 2620</td><td>VOC</td></tr></tbody></table>

VOC: Volatile Organic Compounds; C<sub>2</sub>H<sub>5</sub>OH: Ethanol; C<sub>3</sub>H<sub>8</sub>: Propane; C<sub>3</sub>H<sub>9</sub>N: Propylamine; C<sub>4</sub>H<sub>10</sub>: Butane; C<sub>7</sub>H<sub>8</sub>: Toluene; CH<sub>4</sub>: Methane; CH<sub>4</sub>S: Methyl mercaptan; CO: Carbon monoxide; CO<sub>2</sub>: Carbon dioxide; H<sub>2</sub>: Hydrogen gas; H<sub>2</sub>S: Hydrogen sulfide; NH<sub>3</sub>: Ammonia; NO<sub>2</sub>: Nitrogen dioxide

## 3.1. Performance evaluation compared to the literature

The FAR (False Acceptance Rate, also called error type II in statistics) is a measure of how often the method incorrectly classifies a sample (window of time in our case) as 'in activity'. It is calculated using Equation (1), in which *fp* represents the number of false positives (samples erroneously classified as 'in activity') and *tn* represents the number of true negatives (samples correctly classified as 'out of activity').

Conversely, the FRR (False Rejection Rate, also called error type I in statistics) measures how often the method incorrectly classifies a sample as 'out of activity'. It is calculated using Equation (2), in which *fn* represents the number of false negatives (samples erroneously classified as 'out of activity') and *tp* represents the number of true positives (samples correctly classified as 'in activity').

$$ FAR = \frac{fp}{fp + tn} \qquad (1) $$

$$ FRR = \frac{fn}{fn + tp} \qquad (2) $$

Ideally, both FAR and FRR should be as low as possible. While it is unlikely for both FAR and FRR to be zero, a compromise solution occurs when both rates are equal. This point is called the Equal Error Rate (EER). To find this rate, we varied a threshold of decision between the lowest and the highest values of the metric provided by the tested
<figure><img src="image_5.png" /><figcaption>Fig. 3. Relative frequency of temporal ID during (blue) and out of (orange) activity.</figcaption></figure>

method after we ran it through our dataset. The samples that were above this threshold were considered ‘out of activity’ and the samples that were below this value were considered ‘in activity’. We calculated the FAR and FRR values for each threshold value and plotted the FAR vs FRR curve, also known as the Receiver Operating Characteristics (ROC) curve.

Some of the tested methods didn't allow for generating a full ROC graph. In such cases, we just calculated the FAR and FRR. A summary of the ROC analysis is presented in Fig. 4.

To compare the performance of our method with other methods in the literature we used the F-score [25] (with parameter $\beta$ = 1), a measure of classification accuracy specifically designed for binary classification tasks, that ranges between 0 (indicating poor accuracy) and 1 (perfect accuracy). The F-score was calculated through Equation (3). This metric considers two important aspects: precision and recall. Precision, calculated using Equation (4), indicates the proportion of detected positives that were correctly identified. On the other hand, recall, calculated using Equation (5), indicates the proportion of actual positives that were successfully detected.

ROC of temporal ID, NSTD, Threshold based and K-NN based activity detection methods

<figure><img src="image_6.png" /><figcaption>Fig. 4. Receiver operating characteristics (ROC) plot of all methods tested, Temporal ID, NSTD, Pollutant threshold based, and K-NN. The blue and red lines were used to obtain the decision threshold for Temporal ID and NSTD, respectively. The dots, circles, and asterisc are results from the classification of the activities using 30% of the dataset for all methods but the pollutant threshold, which used the complete dataset as no training was needed.</figcaption></figure>

$$f_{score} = \frac{2tp}{2tp + fp + fn} = \frac{2(precision \times recall)}{precision + recall} \quad (3)$$

$$precision = \frac{tp}{fp + tp} \quad (4)$$

$$recall = \frac{tp}{tp + fn} \quad (5)$$

A summary of the F-scores from the tested methods can be found in Table 2. The overall counts of false positives, false negatives, true positives, and true negatives are presented in Table 3.

Next, we computed the detection threshold using ROC analysis on 70% of the dataset, reserving the calculation of the F-score for the remaining 30% after conducting activity detection. This 70–30 (train-test) separation is done to avoid over-fitting of the classification method.

The resulting threshold for temporal ID was 2.66, providing an EER of 22.6%. The achieved F-score was 0.391. To put this result into perspective we implemented a few methods for comparison.

First, we selected and implemented a well-referenced work by Fang et al. [6], in which they used the highest normalized standard deviation (NSTD) among the sensors to detect pollution events. This approach was also based on a scanning time window through the sensors' signals to detect peaks in pollutant presence. In our implementation of their method, we used the same parameters as in our method, window of size T equal to 1 h, or 360 instances of sensor measurements, and window step size of 50 instances, or 500 s. In their work, they considered that a pollution event was happening when the resulting NSTD was above 0.27. After implementing their method and applying it to our dataset we found an EER of 31.5% when using a threshold of 0.16, giving an F-score of 0.347. The same 70–30 (train-test) separation mentioned before was used here for threshold determination and F-score calculation.

Additionally, we implemented a method of pollution event detection based on indoor air quality guidelines. For this method, we considered that there was a pollution event, which we assume to be an indoor activity when the levels of any of the monitored pollutants surpassed their respective threshold in the guidelines. The monitored pollutants were: CO2 monitored by a nondispersive infrared (NDIR) sensor (GSS CozIR-A) and PM2.5 monitored by an optical particle counter (SM-PWM-01 C). We also tried to monitor total VOC using formaldehyde as a proxy, measured by electrochemical sensors (DART Formaldehyde), but their measurements showed no change during the whole experiment, so we discarded this measurement. The guidelines used were from the World Health Organization [26] for PM2.5 (25 $\mu g/m^3$) and from the American Society of Heating, Refrigerating and Air-Conditioning (ASHRAE) [27] for CO2 (1000 ppm). Results from this method achieved a FAR of 69.3% and an FRR of 11.1%, which shows that, although it detects the non-activities relatively well, it detects activity very poorly as it considers many ‘out of activity’ measurements as ‘in activity’. The resulting F-score for this method was 0.12. Due to the threshold being pre-established by the guidelines, no training or data separation was done.

Finally, we applied a third method using a similar approach to the ones used in Maciejewska et al. [18]. This method applies a K-NN (K-Nearest Neighbors) with Euclidean distance to verify if the current sample can be classified as ‘in activity’ or not. If the label of all the K nearest neighbors is ‘in activity’ we consider that the sample is in activity, otherwise it is ‘out of activity’. In the case that there are samples of the two labels among the K nearest neighbors, we attribute to the sample the label corresponding to the majority of samples. We also used the 70–30 separation here, but in this case, 70% was used to provide the known labels and 30% to test the detection.

We evaluated this method with K = 1, resulting in a FAR of 8.1%, FRR of 63.6%, and F-score of 0.342, and with K = 3, resulting in a FAR of 7.8%, FRR of 64.1% and F-score of 0.343.
<table><caption>**Table 2**
Summary of the classification results for all tested methods.</caption><thead><tr><th>Method</th><th>F-score</th><th>Precision</th><th>Recall</th></tr></thead><tbody><tr><td>Temporal ID</td><td>0.3913</td><td>0.2609</td><td>0.7818</td></tr><tr><td>NSTD [6]</td><td>0.3467</td><td>0.2227</td><td>0.7827</td></tr><tr><td>Threshold-based</td><td>0.1247</td><td>0.0670</td><td>0.8895</td></tr><tr><td>1-NN</td><td>0.3421</td><td>0.3228</td><td>0.3637</td></tr><tr><td>3-NN</td><td>0.3429</td><td>0.3281</td><td>0.3591</td></tr></tbody></table>

## 3.2. Discussion

### 3.2.1. F-score results

Results from both the ROC analysis and the F-score comparison show that our method performs better compared to all the methods tested. However, the overall F-score in these tests was low, all of them below 0.5. This could be explained by the huge imbalance between the number of samples 'out of activity' and the number of samples 'in activity'. When considered in the calculation of the precision (Eq. (4)), the large number of 'out of activity' events causes a large number in the denominator due to the false positives (erroneously detecting activity) even if the FAR is low, as seen in Table 3.

Although the false positive rate after training is relatively low (FAR of 23.4% for temporal ID), the absolute count of false positives is very high (see Table 3), which can be problematic, as around one-fifth of the time (false positives divided by the sample size of the whole test dataset) a system using our method will detect pollution event activity when none is occurring. On the other hand, a system using our method will only fail to detect pollution activity 2.1% of the time (false negatives divided by the sample size of the whole test dataset). We consider this a positive trade-off in the application at hand. For example, it's better to occasionally activate smart ventilation systems unnecessarily than to frequently be exposed to harmful pollution.

### 3.2.2. Threshold-based detection

As mentioned in Section 3.1, we couldn't count on a VOC-specific sensor to perform a threshold-based analysis with this type of pollutant's guideline and we didn't find a satisfying reason for the non-responsiveness of the three copies of this sensor (one in each copy of module 1 from Table 1). However, after analyzing the results of the threshold-based approach, shown in Table 3, and knowing that this measure detects activity based on the worst level of the two pollutants monitored (three if VOC data was available), we see that the addition of VOC data would probably not increase the accuracy of the method too much.

This is due to two reasons. First, the number of false positives resulting from this method is uncommonly large, which happens because of the low fixed threshold of the pollutants, particularly of the PM2.5, causing the method to frequently identify an 'out of activity' sample as 'in activity'. The presence of VOC data would either not change the number of false positives or increase it. Second, the addition of VOC data could, at best, increase the number of true positives (correct detection of activity). This number, however, is already the highest among all the methods, which is good. Nonetheless, as mentioned before, the count of false positives has a disproportionately significant impact on the model's accuracy compared to other values. This tendency makes a system that uses this method needlessly

activate air cleaning measures 65% of the time. Conversely, the system would fail to detect air pollution events only 0.6% of the time. In conclusion, the procedure is good for the occupant, but very energy inefficient.

In addition to that, the use of air quality guidelines to determine the level of pollution in an indoor environment using live measurements has a fundamental flaw. These guidelines are prepared using long-term measurements collected by laboratory equipment, and they are presented in duration of exposition steps. They are not designed to assess instant exposition harmfulness, even if the sensors can measure live pollutant concentration. Thus, we should not compare live sensor measurements with long-term exposition guidelines.

### 3.2.3. NSTD vs. Temporal ID

As mentioned in section 3.1, the NSTD [6] method uses the largest change in normalized standard deviation among the observed sensors within a time window as a metric to detect pollution activity. Conceptually, this is equivalent to detecting when one sensor starts providing a wide range of measurements, or to detect sudden wide changes in the sensors' measurements. This idea shares some similarity with our method, which is reflected in the comparable F-score outcomes.

However, temporal ID not only considers the measurement range across sensors but also takes into account the interrelationship and structure they collectively exhibit. This nuanced approach introduces additional dimensions of information that can enhance accuracy, as shown by the results we obtained. While the F-score similarity between the methods might imply the existence of shared conceptual elements, the underlying intricacies and comprehensiveness of temporal ID contribute to the observed accuracy improvements.

### 3.2.4. K-NN based detection

Detecting the presence of pollution activity using live sensor data, as pursued in this study, essentially consists of a time-series analysis problem. In this field, it is common for such challenges to involve elements of memory, given the temporal nature of the data. Consequently, it is not surprising that the methods that performed best were the ones considering multiple consecutive samples as a basis for their processing, as seen with the Temporal ID and NSTD approaches.

However, even though the implementation of the K-NN used in this work was kept intentionally simple, with no memory elements and no data engineering, the results for K-NN were very close to the two best ones. It is plausible that the inclusion of multiple consecutive samples in the implementation would increase the accuracy of the method. However, our main motivation for utilizing K-NN in this work was to compare our results with the literature, mainly the work of Maciejewska et al. [18]. As our current K-NN implementation is aligned with the one described in their paper, we considered that the refining and optimization of the K-NN approach is beyond the scope of this work.

Nevertheless, we acknowledge the potential for K-NN to yield promising accuracy results in this context, especially with further exploration and optimization in future research.

## 4. Conclusions

A technique for identifying household pollution activities was developed, relying on the estimation of intrinsic dimensionality (ID)

<caption>**Table 3**</caption>

Overall count of false positives (fp), false negatives (fn), true positives (tp), and true negatives (tn) for each method and their respective FAR and FRR. All results but the Threshold-based ones are obtained using 30% of the dataset. Threshold-based uses the whole dataset as no training is needed.

<table><thead><tr><th>Method</th><th># of fp</th><th># of fn</th><th># of tp</th><th># of tn</th><th>FAR</th><th>FRR</th></tr></thead><tbody><tr><td>Temporal ID</td><td>38907</td><td>3834</td><td>13736</td><td>126976</td><td>23.4%</td><td>21.8%</td></tr><tr><td>NSTD [6]</td><td>47998</td><td>3818</td><td>13752</td><td>117885</td><td>28.9%</td><td>21.7%</td></tr><tr><td>Threshold based</td><td>401096</td><td>3580</td><td>28824</td><td>178013</td><td>69.3%</td><td>11.5%</td></tr><tr><td>1-NN</td><td>13407</td><td>11180</td><td>6390</td><td>152477</td><td>8.1%</td><td>63.6%</td></tr><tr><td>3-NN</td><td>12926</td><td>11260</td><td>6310</td><td>152958</td><td>7.8%</td><td>64.1%</td></tr></tbody></table>
within observation windows, referred to as temporal ID, using data from metal-oxide gas sensors (MOX sensors). This approach was evaluated on a dataset encompassing data from domestic activities conducted in a 13 m² (46 m³) room from 2022 to 2023, utilizing 21 distinct MOX sensors, with known activity timestamps. Detection of activity was determined when the temporal ID fell below a predetermined threshold, established by assessing the equal error rate of classification (EER). Our method was compared with three alternative approaches: a well-established method, normalized standard deviation (NSTD) [6], a pollutant concentration threshold-based strategy, and a K-NN approach. Method accuracy was compared using the F-score metric, detailed in Table 2, and the ROC analysis presented in Fig. 4.

The F-score results showed that our method performed better than the ones we tested, mainly because it was capable of extracting more inherent information about the interrelationship of the sensors and because it includes a memory element in the form of a sliding observation window. Results were not great in absolute terms, mainly due to the imbalance of classes. For future works we suggest to compensate for this imbalance using techniques such as a Bayesian approach using the a priori probability of each class or similar techniques.

Tests were limited, however. We were constrained to a single dataset, our own, due to limitations on the availability of this type of study. Additionally, the scope of methods investigated was also restricted, mainly due to frequent practices in indoor air quality research, which often define a pollution event onset when specific pollutant concentration thresholds, established by guidelines, are exceeded.

However, it's worth noting that these guidelines assume a certain monitoring methodology, which doesn't always align with real-world practices. Many studies use live sensor data and compare their measurements to the respective pollutant guideline values, which are established using laboratory equipment experiencing long exposure (hours, days, weeks) to pollutants. We believe that this is a fundamental methodology flaw, and we are working on proving that we should not perform these comparisons going further in this research path.

## CRediT authorship contribution statement

**João Pinheiro:** Software, Investigation, Data curation. **Marie Verriele:** Writing – review & editing. Resources, Project administration, Methodology, Funding acquisition. **Nathalie Redon:** Writing – review & editing, Supervision, Resources, Methodology. **Caroline Duc:** Writing – review & editing, Supervision, Methodology, Funding acquisition, Conceptualization. **Luiz Miranda:** Writing – original draft, Visualization, Software, Investigation, Formal analysis, Data curation. **Jugurta Montalvão:** Writing – review & editing, Supervision, Methodology, Conceptualization. **Jérôme Boudy:** Writing – review & editing, Project administration, Methodology. **Bernadette Dorizzi:** Writing – review & editing, Supervision, Conceptualization.

## Data availability

The final dataset is available upon request to the corresponding author.

## Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

## Acknowledgements

The authors thank ADEME and the French Region of Hauts-de-France for the provided PhD grant to Luiz Miranda. We would also like

to thank Ellona for providing us with the multi-sensor platforms used to extract the dataset in this work, without the need for financial compensation or limitations regarding to publication of results.

## References

[1] M.Z.B. Śmielowska, M. Marć, Indoor air quality in public utility environments—a review, Environ. Sci. Pollut. Res. 24 (2017) 11166–11176, https://doi.org/10.1007/s11356-017-8567-7 number: 12.

[2] C. Rösch, T. Kohajda, S. Röder, M.v. Bergen, U. Schlink, Relationship between sources and patterns of VOCs in indoor air, Atmos. Pollut. Res. 5 (2014) 129–137, https://doi.org/10.5094/APR.2014.016.

[3] L. Tofful, S. Canepari, T. Sargolini, C. Perrino, Indoor air quality in a domestic environment: Combined contribution of indoor and outdoor PM sources, Build. Environ. 202 (2021) 108050, https://doi.org/10.1016/j.buildenv.2021.108050.

[4] P. Burge, Sick building syndrome, Occup. Environ. Med. 61 (2004) 185–190, https://doi.org/10.1136/oem.2003.008813.

[5] A. Caron, N. Redon, F. Thevenet, B. Hanoue, P. Coddeville, Performances and limitations of electronic gas sensors to investigate an indoor air quality event, Build. Environ. 107 (2016) 19–28, https://doi.org/10.1016/j.buildenv.2016.07.006.

[6] B. Fang, Q. Xu, T. Park, M. Zhang, AirSense: an intelligent home-based sensing system for indoor air quality analytics (2016)109-119.10.1145/2971648.2971720.

[7] J. Fonollosa, I. Rodriguez-Lujan, A.V. Shevade, M.L. Homer, M.A. Ryan, R. Huerta, Human activity monitoring using gas sensor arrays, Sens. Actuators B: Chem. 199 (2014) 398–402, https://doi.org/10.1016/j.snb.2014.03.102.

[8] T. Oyabu, T. Onodera, H. Kimura, T. Katsube, Characteristics of tin oxide gas sensors for human vital signs during sleep, Sens. Mater. 12 (2000) 25–34.

[9] L. Miranda, C. Duc, N. Redon, M. Verriele, B. Dorizzi, J. Montalvão, J. Pinheiro, J. Boudy, Pollution activity detection based on metal-oxide gas sensors and intrinsic dimensionality estimation for indoor air quality applications, In: Colloque en TélésAnté et dispositifs biomédicaux, 2023. https://hal.science/hal-04251112.

[10] N. Dennler, S. Rastogi, J. Fonollosa, A. van Schaik, M. Schmuker, Drift in a popular metal oxide sensor dataset reveals limitations for gas classification benchmarks, Sens. Actuators B: Chem. 361 (2022) 131668, https://doi.org/10.1016/j.snb.2022.131668.

[11] M. Meratwal, N. Spicher, T.M. Deserno, Multi-camera and multi-person indoor activity recognition for continuous health monitoring using long short term memory, In: Medical imaging 2022: imaging informatics for healthcare, research, and applications, volume 12037, SPIE, 2022, 64-71.

[12] A. Szczurek, M. Maciejewska, T. Pietrucha, Occupancy Detection Using Gas Sensors (2017)99-107.

[13] G. Hripcsak, A.S. Rothschild, Agreement, the f-measure, and reliability in information retrieval, J. Am. Med. Inform. Inform. Assoc. 12 (2005) 296–298.

[14] F.J. Ordóñez, P. De Toledo, A. Sanchis, Activity Recognition Using Hybrid Generative/Discriminative Models on Home Environments Using Binary Sensors, Sensors 13 (2013) 5460–5477, https://doi.org/10.3390/s130505460 number: 5 Publisher: Multidisciplinary Digital Publishing Institute.

[15] S. Zampolli, I. Elmi, F. Ahmed, M. Passini, G. Cardinali, S. Nicoletti, L. Dori, An electronic nose based on solid state sensor arrays for low-cost indoor air quality monitoring applications, Sens. Actuators B: Chem. 101 (2004) 39–46.

[16] G. Neri, First fifty years of chemoresistive gas sensors, Chemosensors 3 (2015) 1–20, https://doi.org/10.3390/chemosensors3010001 <https://www.mdpi.com/2227-9040/3/1/1>.

[17] J. Saini, M. Dutta, G. Marques, Indoor air quality monitoring systems based on internet of things: A systematic review, Int. J. Environ. Res. Public Health 17 (2020), https://doi.org/10.3390/ijerph17144942 <https://www.mdpi.com/1660-4601/17/14/4942>.

[18] M. Maciejewska, A. Szczurek, A. Dolega, AP3.4 - Recognition of indoor events using gas sensors (2018)386-387.10.5162/IMCS2018/AP3.4.

[19] A. Caron, N. Redon, P. Coddeville, B. Hanoue, Identification of indoor air quality events using a K-means clustering analysis of gas sensors data, Sens. Actuators B: Chem. 297 (2019) 126709, https://doi.org/10.1016/j.snb.2019.126709.

[20] J. He, L. Xu, P. Wang, Q. Wang, A high precise E-nose for daily indoor air quality monitoring in living environment, Integration 58 (2017) 286–294, https://doi.org/10.1016/j.vlsi.2016.12.010.

[21] F. Camastra, A. Staiano, Intrinsic dimension estimation: Advances and open problems, Inf. Sci. 328 (2016) 26–41, https://doi.org/10.1016/j.ins.2015.08.029.

[22] R.S. Bennet, Representation and analysis of signals part xxi. the intrinsic dimensionality of signal collections. (1965). Section: Technical Reports.

[23] P. Grassberger, I. Procaccia, Characterization of Strange Attractors, Phys. Rev. Lett. 50 (1983) 346–349, https://doi.org/10.1103/PhysRevLett.50.346 (publisher: American Physical Society).

[24] J. Montalvão, J. Canuto, L. Miranda, Bias-Compensated Estimator for Intrinsic Dimension and Differential Entropy, J. Commun. Inf. Syst. 35 (2020) 300–310, https://doi.org/10.14209/jcis.2020.30 number: 1.

[25] C. Goutte, E. Gaussier, A probabilistic interpretation of precision, recall and f-score, with implication for evaluation, In: European conference on information retrieval, Springer, 2005, 345-359.

[26] World Health Organization, WHO guidelines for indoor air quality: selected pollutants, World Health Organization. Regional Office for Europe, 2010.

[27] J.E. Janssen, Ventilation for acceptable indoor air quality. (1989).