Chemical Gas Sensor Drift Compensation Using Classifier Ensembles Vergara 2012

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Sensors and Actuators B 166–167 (2012) 320–329

Contents lists available at SciVerse ScienceDirect

Sensors and Actuators B: Chemical


journal homepage: www.elsevier.com/locate/snb

Chemical gas sensor drift compensation using classifier ensembles


Alexander Vergara a,∗,1 , Shankar Vembu a,1 , Tuba Ayhan b,2 , Margaret A. Ryan c , Margie L. Homer c ,
Ramón Huerta a
a
BioCircuits Institute, University of California, San Diego, La Jolla, CA 92093, USA
b
Department of Electronics and Communication Engineering, Technical University of Istanbul, Maslak, TR-34469 Istanbul, Turkey
c
Jet Propulsion Laboratory, California Institute of Technology, 4800 Oak Grove Drive, Pasadena, CA 91109, USA

a r t i c l e i n f o a b s t r a c t

Article history: Sensor drift remains to be the most challenging problem in chemical sensing. To address this problem we
Received 27 September 2011 have collected an extensive dataset for six different volatile organic compounds over a period of three
Received in revised form years under tightly controlled operating conditions using an array of 16 metal-oxide gas sensors. The
26 November 2011
recordings were made using the same sensor array and a robust gas delivery system. To the best of our
Accepted 17 January 2012
knowledge, this is one of the most comprehensive datasets available for the design and development
Available online 1 March 2012
of drift compensation methods, which is freely reachable on-line. We introduced a machine learning
approach, namely an ensemble of classifiers, to solve a gas discrimination problem over extended periods
Keywords:
Sensor drift
of time with high accuracy rates. Experiments clearly indicate the presence of drift in the sensors during
Metal-oxide sensors the period of three years and that it degrades the performance of the classifiers. Our proposed ensemble
Time series classification method based on support vector machines uses a weighted combination of classifiers trained at different
Ensemble methods points of time. As our experimental results illustrate, the ensemble of classifiers is able to cope well with
Support vector machines sensor drift and performs better than the baseline competing methods.
© 2012 Elsevier B.V. All rights reserved.

1. Introduction Drift has plagued the sensor research community for many
years, deteriorating the performance of classifiers used for gas
In the history of sensors’ development, the electronic noses, or recognition and augmenting the maintenance costs of chemo-
simply e-noses, are a relatively new addition to the world of sensors, sensory systems, or artificial electronic noses, during real-time
and can be defined as a collection of broadly cross-reactive sensors operations. In general, sensor drift can be attributed to two
connected to electronics and an effective pattern recognition sys- predominant sources [8,9]. First, the ‘real-drift’ (a.k.a. first-order
tem used to detect, classify, and, where necessary, quantify a variety drift) due to the chemical and physical interaction processes
of chemical analytes or odors of concern in a certain area [1,2]. Ide- of the chemical analytes, in gas phase, occurring at the sensing
ally, these systems would greatly benefit from chemical sensors film microstructure, such as aging (e.g. the reorganization of the
that would always show an identical response when exposed to sensor surface over long periods of time) and poisoning (e.g.,
the same analyte or a chemical mixture and return to their baseline irreversible binding due to external contamination). And second,
level immediately after the gas being evaluated is no longer present the ‘second-order drift’ (or measurement system drift, among
at the sensor surface. However, in real-life applications, where sen- many other names), produced by the external and uncontrollable
sors are operated over a long period of time, such an ideal situation alterations of the experimental operating system, including, but
is still largely unrealizable today [3]. The gradual and unpredictable not limited to, changes in the environment (e.g., temperature and
variation of the chemo-sensory signal responses when exposed to humidity variations); measurement delivery system noise (e.g.,
the same analyte under identical conditions, a.k.a. sensor drift, has tubes condensation, sample conditioning, etc.); and thermal and
long been recognized as one of the most serious impairments faced memory effects (e.g., hysteresis or remnants of previous gases). In
by chemical sensors [4–7]. general, a number of approaches under the notion of sensor drift
counteraction have been implemented in the literature, but one of
the pioneering works, and perhaps the most systematic sensor drift
analysis was performed by Romain and co-workers [10,11], who
∗ Corresponding author. Tel.: +1 8585346758; fax: +1 8585347664. utilized a very comprehensive dataset, collected over long periods
E-mail address: [email protected] (A. Vergara). of time in real operating conditions, to provide a deep insight into
1
Joint first authors.
2 the sensor drift problem, for both the real and second-order drift.
Tuba Ayhan carried out most of her work on this article while visiting the Bio-
Circuits Institute at UCSD. Among the many interesting conclusions drawn from that work,

0925-4005/$ – see front matter © 2012 Elsevier B.V. All rights reserved.
doi:10.1016/j.snb.2012.01.074
A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329 321

the following three aspects were emphasized: (i) from all the ensemble method used in this paper complements, rather than
sensing technologies available, metal oxide based gas sensors [12] competes against, the existent component correction methods
remain the best option for long term applications for continuous mentioned above; since component correction methods are essen-
monitoring systems; (ii) a calibration gas is recommended to tially a pre-processing technique, we can indeed use the ensemble
estimate sensor drift compensation, and (iii), sensor replacement method on the pre-processed data, too. In the remainder of this
is unavoidable over long periods of time. paper, we first describe the experimental setup, the dataset, and
In practical applications, it is difficult to empirically differentiate the feature extraction methods considered in this work (Section
between real drift and second-order drift, if possible at all. Accord- 2). We then describe the drift compensation algorithm (Section
ingly, it is hard to develop methods to correct different sources 3), followed by a detailed description of our experimental find-
of drift because the origin of it cannot be ascertained. Utilizing an ings (Section 4). And finally, we present the concluding comments
effective delivery system allows the chemical sensors to bypass the drawn from the results presented in this paper (Section 5).
second-order drift effect, making it possible to exclusively concen-
trate on the chemical sensors for compensating real drift. In our
2. Data collection
particular gas delivery system, we can control the second-order
drift, too, so we can exclusively address the real drift problem. Thus,
We apply our drift compensation method to an extensive
in the remainder of this document we use the term drift to refer to
dataset3 recorded by a metal-oxide gas sensor array. In this
real drift. Concerning real drift reduction, many efforts have been
section, we describe the experimental setup, the recording pro-
devoted to find the sensor materials that can reversibly interact
tocol, and the signal processing algorithms used for feature
with the gas so that the detected molecules unbind the sensor mate-
extraction.
rial as soon as the gas has been purged out from the sensor surface
[13–15]. Other solutions based on periodically changing the sen-
sor working temperature [16,17] have also been implemented in 2.1. The experimental setup
an effort to minimize the effects of irreversibility in the sensors’
responses due to poisoning. Undoubtedly, heightened reversibility We used a sixteen screen-printed commercially available
in the sensor response is necessary for the effective drift counterac- metal-oxide semiconductor gas sensors array, manufactured and
tion. However, this general treatment only constitutes one facet of commercialized by Figaro Inc. [12], for our experiments. The
the problem—the so-called short-term drift—a substantial study of custom design used in the sensing technology includes an indepen-
the sensor variability over longer periods of time is also necessary. dently controlled RuO2 (Ruthenium Oxide) electrical heating line
The most commonly used solutions to cope with sensor drift and a metal oxide semiconductor film as a sensor material printed
within the chemical sensing community are univariate and multi- onto the measuring electrodes (noble metal). The obtained sensor
variate methods, where drift compensation is performed either on element is mounted onto an alumina substrate and then connected
each sensor individually or on the entire sensor array [9,18]. Among by lead wires to the pins of the sensor package. The resulting array,
the multivariate drift compensation methods, unsupervised com- populated by sensor devices (4 of each) tagged by the manufacturer
ponent correction techniques are the most popular [4,19,20]. These as TGS2600, TGS2602, TGS2610, TGS2620 is placed into a 60 ml-
techniques rely on finding linear transformations that normalize volume test chamber, where the odorants of interest, in gaseous
the sensor responses across time so that a classifier can be directly form, are to be injected for trials. To generate the required dataset,
applied to the resulting stationary data. For instance, the compo- we connect the said test chamber to a computer-controlled con-
nent correction method presented by Årtusson et al. [4] applies tinuous flow system, which provides versatility for conveying the
the following transformation to the measurement/data matrix chemical compounds of interest at the desired concentrations to
X ← X − (X · c)c , where c is the principal component vector(s) of the the sensing chamber with high accuracy and in a highly repro-
measurements computed using a reference gas that may approx- ducible way while keeping the total flow constant. In particular,
imate the drift direction. The main drawback of these techniques our system utilizes three digital, computed-supervised mass flow
is that they assume the drift direction to be linear in the feature controllers (MFCs) (provided by Bronkhorst High-Tech B.V. [26]),
space and, therefore, a linear transformation of the data suffices each of them with different maximum flow levels (200, 100, and
to correct it. While it is entirely plausible that kernelized versions 20 ml/min, ±1% of accuracy). Such devices connect to different pres-
of component analysis, such as kernel principal component anal- surized gas cylinders, which contain, diluted in dry air, either the
ysis [21], can be applied to account for non-linearities in the drift carrier gas or the chemical analytes to be measured. To maintain
direction, these techniques have not been investigated much in the the moisture level constant at 10% R.H. (measured at 25 ± 1 ◦ C) dur-
chemical sensing community. Also, with the exception of Ref. [20], ing the entire measurement process, we utilize synthetic dry air
these techniques require a reference gas that is used to approximate as background for all measurements, provided by Airgas Inc. [27].
the drift direction by assuming that the reference gas provides the Then, the analytes under analysis (i.e., ammonia, acetaldehyde, ace-
drift direction in all the other gases. tone, ethylene, ethanol, and toluene) are added to this background
In this paper, we take a completely different approach to solve in random order. The total flow rate across the sensing chamber is
the mentioned problem, in which we do not make any of the above- set to 200 ml/min and kept constant for the whole measurement
mentioned assumptions. Instead, we use a supervised machine process. The response of the gas sensor array was measured when
learning method, namely, an ensemble of classifiers to cope with the operating temperature of sensors was fixed at 400 ◦ C, which,
sensor drift. To the best of our knowledge, such a machine learning according to the deterministic one-to-one look-up table provided
approach, that automatically detects and copes with sensor drift, by the manufacturer [12], is attained via a built-in heater that is
has not been applied in the chemical sensing community before, driven by an external DC voltage source set at 5 V. Finally, to ensure
although it has been shown to yield promising results on prob- that reproducible response patterns are acquired during each mea-
lems with drifting concepts in machine learning and data mining surement, the sensors were pre-heated for several days prior the
[22–25]. Utilizing a comprehensive dataset of a multi-component experiment process gets started.
gas classification problem recorded from metal-oxide gas sen-
sors over a course of 36 months, we investigate the feasibility
of our ensemble of classifiers methodology to mitigate the drift 3
The dataset will be made available on the UCI repository upon acceptance of the
effect in chemical gas sensors. It is important to note that the paper.
322 A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329

Fig. 1. Experimental setup used for data acquisition. The sensor responses are recorded in the presence of the analyte in gaseous form diluted at different concentrations
in dry air. The measurement system operates in a fully computerized environment with minimal human intervention, which provides versatility in conveying the odors of
interest (at the desired concentrations) to the sensing chamber with high accuracy, and simultaneously in keeping constant the total flow. Therefore, no changes in the flow
or flow dynamics are reflected in the sensor response (i.e., only the presence of an odorant will be reflected in the sensor response). Moreover, since the system continuously
supplies gas to the sensing chamber (either clean dry air or a chemical component), the amount of gas molecules in the sensing chamber is homogeneously distributed.

The sensor response is read-out in the form of the resistance discriminate the six different analytes regardless of their con-
across the active layer of each sensor; hence each measurement centration. The odor identity and concentration values in
produces a 16-channel time series sequence. The data acquisition parts-per-million by volume (ppmv) are listed in Table 1.
board collects the data from the gas sensors and controls the analog Each of the possible gas type-concentration pairs was sampled
voltage signal to every sensor heater. This voltage is used to con- in no particular order. The resulting dataset consists of 13,910
trol and vary the sensor heater’s operating temperature utilizing a recordings (time series sequences) collected over a period of 36
made-in-home, LabVIEW [28] environment program running on a months. The exact distribution of the number of measurements
PC platform. The experimental setup is illustrated in the diagram per month is shown in Table 2. Notice that some of the months
shown in Fig. 1. shown in the table do not contain any of the measurements for
one or more gases; other gas analytes and/or complex mixtures
2.2. The dataset that are not considered in this study were collected during this
specific period of time utilizing the same array of sensors and exper-
Our dataset consists of a six-gas/analyte classification prob- imental apparatus, which in turn increased the complexity of the
lem dosed at different concentrations, in which the goal is to problem due to interference from these external analytes that may
A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329 323

Table 1
Analytes and concentrations in the dataset.

Analytes Concentrations in ppmv

Ammonia 50, 60, 70, 75, 80, 90, 100, 110, 120, 125, 130, 140, 150, 160, 170, 175, 180, 190, 200, 210, 220, 225, 230, 240, 250, 260, 270, 275, 280, 290, 300, 350,
400, 450, 500, 600, 700, 750, 800, 900, 950, 1000
Acetaldehyde 5, 10, 13, 20, 25, 30, 35, 40, 45, 50, 60, 70, 75, 80, 90, 100, 120, 125, 130, 140, 150, 160, 170, 175, 180, 190, 200, 210, 220, 225, 230, 240, 250, 275, 300,
500
Acetone 12, 25, 38, 50, 60, 62, 70, 75, 80, 88, 90, 100, 110, 120, 125, 130, 140, 150, 170, 175, 180, 190, 200, 210, 220, 225, 230, 240, 250, 260, 270, 275, 280, 290,
300, 350, 400, 450, 500, 1000
Ethylene 10, 20, 25, 30, 35, 40, 50, 60, 70, 75, 90, 100, 110, 120, 125, 130, 140, 150, 160, 170, 175, 180, 190, 200, 210, 220, 225, 230, 240, 250, 275, 300
Ethanol 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 100, 110, 120, 125, 130, 140, 150, 160, 170, 175, 180, 190, 200, 210, 220, 225, 230, 240, 250, 275, 500, 600
Toluene 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100

Table 2
Dataset details. Each row corresponds to samples collected during a period of one month for six gases.

Month ID Number of examples

Ammonia Acetaldehyde Acetone Ethylene Ethanol Toluene Total

month1 76 0 0 88 84 0 248
month2 7 30 70 10 6 74 197
month3 0 0 7 140 70 0 217
month4 0 4 0 170 82 5 261
month8 0 0 0 20 0 0 20
month9 0 0 0 4 11 0 15
month10 100 105 525 0 1 0 731
month11 0 0 0 146 360 0 506
month12 0 192 0 334 0 0 526
month13 216 48 275 10 5 0 554
month14 0 18 0 43 52 0 113
month15 12 12 12 0 12 0 48
month16 20 46 63 40 28 0 197
month17 0 0 0 20 0 0 20
month18 0 0 0 3 0 0 3
month19 110 29 140 100 264 9 652
month20 0 0 466 451 250 458 1625
month21 360 744 630 662 649 568 3613
month22 25 15 123 0 0 0 163
month23 15 18 20 30 30 18 131
month24 0 25 28 0 0 1 54
month30 100 50 50 55 61 100 416
month36 600 600 600 600 600 600 3600

potentially affect the sensor life. Additionally, as observed in complete, divided into 100 s for the gas injection phase and at least
Table 2, the last batch of recordings, which contains 3600 mea- 200 s for the recovery (cleaning) phase. For processing purposes,
surements from the same analytes, was purposely collected five we considered the whole sensor response after subtracting the
months after the sensors had been powered off. This 5-month gap baseline from each record. The sampling rate was set to 100 Hz.
is extremely significant for this study not only because it allows Finally, the measurement process herein described was replicated
us to validate our suggested method on the annotated set of mea- for subsequent measurements.
surements collected five months later, but also because it is during
this period of time that the sensors were prompted to severe con-
2.3. Data processing and feature extraction
tamination since external interferents could easily and irreversibly
get attached to the sensing layer due to the lack of the operating
The Figaro metal-oxide gas sensors are known to have a slow
temperature.
response to a chemical analyte. This response, under tightly con-
To generate the dataset, we followed a measurement procedure
trolled operating conditions (i.e., constant air flow and fixed
consisting of the following steps. First, a constant flow of zero-grade
operating temperature), typically involves a monotonically saturat-
dry air was circulated through the sensing chamber while the gas
ing smooth change in the conductance/resistance across its sensing
sensor array was kept at a stable operating temperature (400 ◦ C).4
layer due to the adsorption/desorption reactions of the chemical
This step was done to measure the baseline steady-state sensor
analyte occurring at the micro-porous surface of the sensor. The
response (i.e., the sensor response in the presence of no chemical
amount and speed of these reactions depend on (i) the analyte iden-
analytes). Afterwards, the desired concentration of the odorant was
tity, (ii) the analyte concentration, (iii) the active layer (i.e., sensor
injected by the continuous flow system into the sensing chamber.
type), and (iv) the surface temperature (i.e., the sensors’ operating
Finally, in the third step (cleaning phase) the vapor was vacuumed
temperature). Since the last two factors are fixed throughout the
away from the sensor array and the test chamber was cleaned
entire measurement procedure of this analysis, the sensor-analyte
with dry air before the concentration phase of a new measurement.
identity/concentration interaction process becomes the only factor
The acquisition time of these measurements took at least 300 s to
that, as a pair, shapes the response profile, and, thus, that defines the
identity of the chemical analyte of interest [29]. Accordingly, fea-
tures reflecting the whole sensing dynamics at the sensor surface
4
We do not have access to the actual sensing surface temperature due to packag-
are of special interest in our drift compensation analysis.
ing, but a look-up table relating it to the heater voltage can be found upon request Feature extraction plays an important role in every chemo-
in Ref. [12]. sensory application [30]; it is defined as a transformation mapping
324 A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329

(a)

Response (Ω)
6000

4000 Steady−State Feature Chemical analyte desorption


Chemical analyte adsorption ΔR=R−R (Cleaning phase)
0
(Gas injection phase)
2000

100 200 300 400 500 600 700 800 900 1000 1100
Features considered in the rising portion Features considered in the decaying portion
of the sensor response of the sensor response
(b) (e)
1 1
Maximum values of the ema

α=0.001
Minimum values of the ema
α=0.001
emamax

min
0 0
max ema

ema
α=0.001
min emaα=0.001

−1 −1
100 200 300 400 500 600 700 800 900 1000 1100
(c) (f)
2 2

emaα=0.01
α=0.01

1 max ema
α=0.01
max

min
0
ema

0 min ema
α=0.01

−1 −2
100 200 300 400 500 600 700 800 900 1000 1100
(d) 2 (g) 2
max emaα=0.1
emaα=0.1

emaα=0.1
max

min

0 0

min ema
α=0.1
−2 −2
100 200 300 400 500 600 700 800 900 1000 1100
Time (s)

Fig. 2. Panel (a), typical response of a metal-oxide based chemical sensor to 30 ppmv of Acetaldehyde. The curve shows the three phases of a measurement: baseline
measurement (made with pure air), test gas measurement (when the chemical analyte is injected, in gas form, to the test chamber), and recovery phase (during which the
sensor again is exposed to pure air; the recovery time is usually much longer that the gas injection phase). Panels (b)–(d), exponential moving average of the rising portion
of the sensor response (gas injection) for ˛ = 0.1, ˛ = 0.01, and ˛ = 0.001. The maximum values of the graphs (i.e., max ema˛ r[k]), represent the features extracted from the
k
chemical sensor in response to the analyte. Panels (e)–(g), exponential moving average of the decaying portion of the sensor response (cleaning phase) for ˛ = 0.1, ˛ = 0.01,
and ˛ = 0.001. The minimum values of the graphs (i.e., min ema˛ r[k]), are the features we extracted to represent the sensor signal during its cleaning phase. Features are
k
marked with red circles in the plot. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of the article.)

the sensor response to a space of lower dimension preserving the On the other hand, we also extract an aggregate of features
most meaningful portion of information contained in the original reflecting the sensor dynamics of the increasing/decaying transient
sensor signal. In this work, we consider two distinct types of fea- portion of the sensor response during the entire measurement pro-
tures that exploit the whole dynamic processes occurring at the cedure under controlled conditions. In particular, we utilize the
sensor surface, including the ones that reflect its adsorption, des- exponential moving average (ema˛ ), a transform borrowed from
orption, and steady-state (or final) responses of the sensor element. the field of econometrics originally introduced to the chemical sen-
On the one hand, we utilize the steady-state feature, which is the sor community in [32] that converts the increasing/decaying and
“gold-standard” for chemo-sensory feature extraction [31]. It is saturating discrete time series r[·] collected from the chemical sen-
defined as the difference of the maximal resistance change and the sor into a real scalar f˛ {r[·]}, by estimating the maximum value (or
baseline, minimum for the decaying portion of the sensor response) of its
exponential moving average transform (ema˛ ), calculated by,
R = maxr[k] − minr[k], (1)
k k y[k] = (1 − ˛)y[k − 1] + ˛(r[k] − r[k − 1]), (3)

and its normalized version expressed by the ratio of the maximal where k = 1, 2, . . ., T, y[0], its initial condition, set to zero (y[0] = 0),
resistance and the baseline values, and the scalar ˛ (˛ ∈ {0, 1}) being a smoothing parameter of the
operator that defines both the quality of the feature f˛ {r[·]} and
maxk r[k] − mink r[k] the time of its occurrence along the time series.5 In this work,
||R|| = , (2) we set three different values for ˛ (˛ = 0.1, ˛ = 0.01, and ˛ = 0.001)
mink r[k]

where r[k] is the time profile of sensor resistance, k is the discrete


time indexing the recording interval [0, T] when the chemical vapor 5
The readers are referred to Ref. [32] for a more detailed analysis and discussion
is present in the test chamber. on this feature.
A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329 325

Table 3 respectively. Let L be the number of classes. We canestimate a set


Features extracted from the time series data. L
of weights {ˇ1c , . . . , ˇtc } for every class c ∈ {1, . . . , } or c ∈ {1,
2
Steady-state features Transient features
. . ., L − 1} by solving (4). Alternatively, if we want to assign weights
Rising portion Decaying portion according to the prediction performance of classifiers on the most
R max ema˛=0.001 (r[k]) min ema˛=0.001 (r[k]) recent batch, we can simply estimate a single set of weights {ˇ1 , . . .,
k k
||R|| max ema˛=0.01 (r[k]) min ema˛=0.01 (r[k]) ˇt } using the multi-class classifier prediction accuracies on every
k k batch. In this case, predictions are made according to a weighted
max ema˛=0.1 (r[k]) min ema˛=0.1 (r[k])
k k majority voting, i.e.,

ht+1 (x) = argmax ˇt . (5)
as already used in our previous work [32] to obtain three differ- y∈{1,...,L}
ent feature values starting from the pre-recorded rising portion of t:ft (x)=y

the sensor response and three additional features with the same
We used this strategy in all our experiments due to its simplic-
˛ values for the decaying portion of the sensor response, cov-
ity and ease of implementation. Most importantly, we can directly
ering thus the entire sensor response. Fig. 2 shows the typical
use the output of existing software—for instance, the widely used
signal response of a chemical sensor in the presence of 30 ppmv
LibSVM [35]—to estimate the weights without the need to solve an
of Acetaldehyde and its ema˛ representation for the three different
additional optimization problem.
˛ values. Finally, as this figure illustrates, by applying the above-
mentioned transform to each of the 16 channels (sensors) in the
pre-recorded time-series, we map the sensor array response into 4. Experimental results
a 128-dimensional feature vector, which resulted from a combina-
tion of the 8 features described above ×16 sensors (see Table 3). In all our experiments, we trained multi-class SVMs (one-vs-
For a more detailed discussion on these features, the readers are one strategy) with RBF kernel using the publicly available LibSVM
referred to Ref. [32]. software [35]. The features in the training and test datasets were
scaled appropriately to lie between −1 and +1. The kernel band-
3. Drift compensation method width parameter  and the SVM C parameter were chosen using
10-fold cross validation by performing a grid search in the range
We use an ensemble of classifiers [22,24,25] to detect and cope [2−10 , 2−9 , . . ., 24 , 25 ] and [2−5 , 2−4 , . . ., 29 , 210 ], respectively.
with sensor drift. Consider a binary classification problem with a set We first established the fact that the sensors are drifting and that
of features x as inputs and a class label (a gas/analyte in our prob- the drift is degrading the performance of classifiers. We trained a
lem) y as output. At every time step t, we receive a batch of examples multi-class classifier on data collected during the first two months
St = {(x1 , y1 ), . . . , (xmt , ymt )} of size mt . We train a classifier ft (x), and tested it on data from the remaining months. Details on the
for example a support vector machine (SVM) [33], using the cur- number of measurements collected during each month for a period
rent batch of examples. The final classifier ht+1 (x) at time step (t + 1) of three years is given in Table 2.
t
is a weighted combination of classifiers, i.e., ht+1 (x) = ˇ f (x),
i=1 i i The classifier’s performance measured in terms of prediction
where {ˇ1 , . . ., ˇt } is the set of classifier weights. Under the assump- accuracy is shown in Fig. 3. We see that the performance gradually
tion that the distribution of examples in the current batch St has not degrades with time, which in turn serves as a clear indicator of
changed much from those in the previous batch St−1 , we use the sensor drift and the way it has affected the accuracy of the classifier.
examples in batch St to estimate the weights {ˇ1 , . . ., ˇt }. There are Notice as well that on month 18 (ID: month18, in Table 2), we have
several ways to estimate these weights. A simple and intuitive way only 3 measurements from class 4 (ethylene) and, therefore, the
is to assign weights to classifiers according to their prediction per- performance suddenly rises to 100%. We consider this issue to be
formance on batch St . Alternatively, we could solve an optimization an exception.
problem such as We then considered four settings as described below:
⎛ ⎞2

mt

t

argmin ⎝ ˇj fj (xi ) − yi ⎠ . (4)


ˇ1 ,...,ˇt
i=1 j=1

It is also possible to minimize a different loss function than the


squared loss used above. For example, if the base classifiers are
SVMs, we can minimize the hinge loss L(f(x), y) = max (0, 1 − yf(x)).
Minimizing the squared loss as shown above has the advantage of
computing the solution {ˇ1 , . . ., ˇt } in closed form. The algorithm
in its most general form is given below.

Algorithm 1. Algorithm to cope with concept drift

1: for t = 1, . . . , T do
2: Receive St = {(x1 , y1 ), . . . , (xmt , ymt )}
3: Train a classifier (SVM) on St
4: Estimate the weights {ˇ1 , . . . , ˇt } using one of the techniques
described in the text
5: end for
6: Output final classifier: {ˇ1 , . . . , ˇT } and {f1 , . . . , fT }

For multiple classes, we can use one-vs-one or one-vs-all strat-


egy [34] to train a classifier for every pair of classes or for every class Fig. 3. Performance of the classifiers when trained on months 1 and 2 and tested on
months 3–36.
326 A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329

Table 4
Data set details. Each row corresponds to months that were combined to form a
batch.

Batch ID Month IDs

batch1 month1, month2


batch2 month3, month4, month8, month9, month10
batch3 month11, month12, month13
batch4 month14, month15
batch5 month16
batch6 month17, month18, month19, month20
batch7 month21
batch8 month22, month23
batch9 month24, month30
batch10 month36

Setting 1 For every month, we trained a multi-class classifier with


data from only the previous month and tested it on the
current month.
Setting 2 For every month, we trained an ensemble of multi-class
classifiers using the method in Algorithm 1. Fig. 4. Performance of the classifiers trained on batches 1–5 and tested on successive
Setting 3 Same as Setting 2 but with uniform weights on the indi- batches. (For interpretation of the references to color in this figure legend, the reader
vidual (base) classifiers. is referred to the web version of the article.)
Setting 4 Same as Setting 1 but with the test sets modified using
the component correction method (PCA) [4].

The SVM trained in Setting 1 is a strong baseline because it sees


the most recent batch of examples which is not corrupted by drifted
data from the past. If we were to train an SVM using the entire data
until a time point t, then the performance would degrade even fur-
ther. Note that the ensemble of classifiers trained in Setting 3 with
uniform weights essentially uses all the data from the past. We
would like to emphasize that our experimental setup is robust in
the sense that the baseline methods are strong. Similar experimen-
tal setup was used in Ref. [36] which was one of the first methods to
address concept drift in the machine learning community. Setting
4 is similar to the experimental setup described in Refs. [19,20].
In order to be able to train classifiers under these settings, we
need sufficient number of examples in each class and month.6 We
therefore combined measurements from 36 months to form 10
batches in such a way that the number of measurements was as
uniformly distributed as possible. Details on the number of mea-
surements in each batch is given in Table 4. Fig. 4 shows the
Fig. 5. Performance of the classifiers trained under Setting 1 (•), Setting 2 (),
performance of an SVM (black line) trained on batch 1 and tested
Setting 3 () and Setting 4 (+) described in the text. The black, continuous line cor-
on batches 2–10. Note that this curve is estimated with the same responds to the setting where a classifier was trained with batch 1 and tested on
SVM model used in Fig. 3 but tested on data from batches instead successive batches. Setting 2 corresponds to our proposed method (Algorithm 1).
of months. (For interpretation of the references to color in this figure legend, the reader is
Once again, we see that the performance of the classifier is referred to the web version of the article.)

degrading with time due to drift. We found similar behaviors when


we trained several SVMs on batches 2–5 and tested them on succes-
an ongoing investigation, we intend to address what concentration
sive batches. These results are again shown in Fig. 4. The complete
levels have to be used to calibrate the gas sensor array. Interestingly,
set of results, i.e., the accuracy of classifiers trained on batches
the classifiers trained under Setting 1 were able to cope with drift
1–9 and tested on successive batches, is given in Table 5. The first
to some extent and, as mentioned above, we believe they are a nat-
five rows in this table correspond to the results plotted in Fig. 4.
ural and strong baseline for any drift-correcting machine learning
These classifiers were eventually used in our ensemble method
algorithm to compare against.
with appropriate weights. Fig. 5 shows the performance of classi-
As shown in Fig. 5, the classifier ensembles were able to per-
fiers under the settings 1, 2, 3, and 4 described above. As expected,
form better than these baseline classifiers when tested on most
classifiers trained under setting 1, i.e., using the most recent batch
of the batches with significant improvements in accuracy on sev-
of examples, perform better than the classifier trained with data
eral batches. From the indicated figure, we can make the following
from only batch 1. We believe the drop in the accuracy when test-
statements:
ing on batches 5 and 6 utilizing the classifiers trained on batches 4
and 5, respectively, is an artefact on the dataset. We suspect that the
concentration of the gases used for training has a high impact on • The classifier ensemble performs better than the SVM trained in
the performance of the classifiers over time. Accordingly, as part of Setting 1 at batches/time points t = 4, 5, 6, 9, and10. The perfor-
mance is comparable at time points t = 3 and t = 8. Note that at
t = 2, we do not have an ensemble and, therefore, every setting is
6
Note that this requirement is not necessary if we train classifiers in a purely essentially the same. The SVM in Setting 1 performs better than
online fashion [24,25], but in this paper we focus only on batch training using SVMs. our approach only at t = 7 . As mentioned above, this SVM trained
A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329 327

Table 5
Performance of the classifiers trained on batches 1–9 and tested on successive batches.

Batch ID Classification accuracy (in %) on batches 2–10

2 3 4 5 6 7 8 9 10

batch1 74.36 61.03 50.93 18.27 28.26 28.81 20.07 34.26 34.48
batch2 87.83 90.68 72.08 44.52 42.46 29.93 59.57 39.69
batch3 90.06 94.92 70.96 73.73 62.59 65.74 38.89
batch4 56.35 27.52 35.40 19.73 17.02 17.56
batch5 42.52 41.32 13.95 21.49 20.11
batch6 83.53 88.44 65.74 49.97
batch7 91.84 69.15 54.28
batch8 62.98 37.69
batch9 22.64

automatically detect and cope with sensor drift. Fig. 6 shows how
the classifier weights used in the ensemble change with time.
• Finally, although the component correction method (Setting 4)
helped to slightly improve the performance of SVM trained in
Setting 1, it performed worse than all the other methods on most
of the batches. Note that we applied the component correction
method six times by treating every one of our six gases as a ref-
erence gas. In Fig. 5, we plot only the results obtained from the
best reference gas, i.e., at every batch/time point, we apply the
component correction method six times and report the best per-
formance in terms of classifier accuracy. Fig. 7 shows the results
for all the reference gases.

As a final remark, we would like to mention that our proposed


method for sensor drift compensation is a supervised learning algo-
rithm. If we have trained a classifier ensemble until a certain point
in time, say T, and would like to use it for future time points, then we
have to repeatedly add classifiers to the ensemble and update their
Fig. 6. Classifier weights used in the ensembles (model 1 through model 9). At
weights so that it can track the drifting direction. To do this, we need
every point on the x-axis (time/batch) the corresponding points in the y-axis are labels for the data since the classifiers are trained in a supervised
the weights of the individual classifiers used in the ensemble. Notice that these manner. In a more realistic scenario like real-time deployment
weights sum up to 1 at every point of time/batch (x-axis) and that the contribution where we may not have labels for data in future time points, then
of an individual classifier to the ensemble gradually decreases with time.
we have to update the classifier ensemble in a semi-supervised way
[37]. For instance, at time T + 1, we may use the classifier ensemble
in Setting 1 is a very strong baseline and, thus, performing better trained until time T to provide labels for the new batch of data, and
than or as well as this setting is a positive result. then we add another classifier to the ensemble using these new
• The classifier ensemble performs better than the classifier trained labels. Under the assumption that the data at time T + 1 has not
in Setting 3 at all the time points, i.e., from t = 3 to t = 10. This result drifted much from the data at time T, this is a reasonable strategy
clearly demonstrates the effectiveness of ensemble methods to to fill in missing labels. We leave the design and investigation of
such semi-supervised learning algorithms [37] for future work.

5. Conclusions

Over a period of 3 years we have collected a comprehensive


dataset using an array of 16 metal-oxide gas sensors to analyze the
problem of sensor drift. The data was collected under tightly con-
trolled conditions for 6 different gases at several concentrations
ranging from 10 to 1000 ppmv. To the best of our knowledge this
is one of the most comprehensive datasets available for the design
and development of drift compensation methods, which will be
available online as a supplementary material of this article, hope-
fully aiding in algorithmic improvements in the future. We have
reported significant benefits using machine learning techniques
based on ensembles of classifiers as a drift correction method for
chemo-sensory applications. As we have demonstrated, the pro-
posed method not only manages to mitigate well the effect of drift
in chemical sensors, but also outperforms competing methods. An
important observation from our sensor drift analysis is that the
compensations made by the proposed method remain valid for long
Fig. 7. Performance of the classifier trained under Setting 4 with component cor-
periods of time. The 6-month gap between the recordings from the
rection. The individual plots correspond to the performance of classifier trained
with batch 1 and tested on batches at subsequent time points after applying the first 30 months and the last recorded month did not invalidate the
component correction method for every one of the six reference gases. compensation of drift on the same task, despite the fact that the
328 A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329

sensors were exposed to poisoning, as they were powered-off dur- micro-hotplate gas sensors: selection and validation of the optimal modulating
ing this period of time. frequencies, Sensors and Actuators B: Chemical 123 (2007) 1002–1016.
[18] J.-E. Haugen, O. Tomic, K. Kvaal, A calibration method for handling the temporal
Finally, the level of generality that the proposed drift counter- drift of solid state gas-sensors, Analytica Chimica Acta 407 (1–2) (2000) 23–39.
action method attains is high from the following perspective. By [19] R. Gutierrez-Osuna, Drift reduction for metal-oxide sensor arrays using canon-
design, the drift counteraction method using classifier ensembles ical correlation regression and partial least squares, in: Proceedings of the 7th
International Symposium On Olfaction & Electronic Nose, 2000.
operates on samples collected on-the-fly in an online fashion which [20] A. Ziyatdinov, S. Marco, A. Chaudry, K. Persaud, P. Caminal, A. Perera, Drift com-
is important for real-time operations. The technique does not make pensation of gas sensor array data by common principal component analysis,
any assumptions about the nature of drift, and it is also agnostic to Sensors and Actuators B: Chemical 146 (2) (2010) 460–465.
[21] B. Schölkopf, A.J. Smola, K.-R. Müller, Nonlinear component analysis as a kernel
the base classifier used in the gas identification task. As a conse-
eigenvalue problem, Neural Computation 10 (5) (1998) 1299–1319.
quence, this solution has the potential to be of use in many other [22] H. Wang, W. Fan, P.S. Yu, J. Han, Mining concept-drifting data streams using
applications where data is collected over an extended period of ensemble classifiers, in: Proceedings of the Ninth ACM SIGKDD International
Conference on Knowledge Discovery and Data Mining, 2003.
time with drifting underlying distributions, and, most importantly,
[23] J.Z. Kolter, M.A. Maloof, Dynamic weighted majority: A new ensemble method
it can be readily translated to more realistic gas sensing applica- for tracking concept drift, in: Proceedings of the International IEEE Conference
tions, including but not limited to the identification and localization on Data Mining, 2003.
of chemical analytes in complex environments (e.g., in a wind tun- [24] J.Z. Kolter, M.A. Maloof, Using additive expert ensembles to cope with con-
cept drift, in: Proceedings of the Twenty-Second International Conference on
nel), gas distribution mapping, and gas plume tracking using robotic Machine Learning, 2005.
platforms. We held this issue as an arguable position here that we [25] J.Z. Kolter, M.A. Maloof, Dynamic weighted majority: An ensemble method
would address in further studies. for drifting concepts, Journal of Machine Learning Research 8 (Dec) (2007)
2755–2790.
[26] Bronkhorst High-Tech B.V, http://www.bronkhorst.com/.
[27] Airgas, Inc., http://www.airgas.com/.
Acknowledgements
[28] The LabVIEW Environment, http://www.ni.com/labview/.
[29] A. Vergara, M.K. Muezzinoglu, N. Rulkov, R. Huerta, Information-theoretic opti-
This work has been supported by U.S. office of Naval Research mization of chemical sensors, Sensors and Actuators B: Chemical 148 (1) (2010)
(ONR) under the contract number N00014-07-1-0741, by Jet 298–306.
[30] A. Pardo, S. Marco, J. Samitier, Nonlinear inverse dynamic models of gas
Propulsion Laboratory under the contract number 2010-1396686, sensing systems based on chemical sensor arrays for quantitative measure-
and by the US Army Medical and Materiel Command and by the ments, IEEE Transactions on Instrumentation and Measurement 47 (3) (1998)
United States Army Research Institute of Environmental Medicine 644–651.
[31] E. Llobet, J. Brezmes, X. Vilanova, J.E. Sueiras, X. Correig, Qualitative and quanti-
(USARIEM), under contract number W81XWH-10-C-0040 in tative analysis of volatile organic compounds using transient and steady-state
collaboration with Elintrix. The authors also thank Joey Reeds and responses of a thick-film tin oxide gas sensor array, Sensors and Actuators B:
Travis Wong, from Elintrix, for the helpful and fruitful discussions Chemical 41 (1–3) (1997) 13–21.
[32] M.K. Muezzinoglu, A. Vergara, R. Huerta, N. Rulkov, M.I. Rabinovich, A. Selver-
during the elaboration of this work as well as Joanna Zytkowicz ston, H.D. Abarbanel, Acceleration of chemo-sensory information processing
for proofreading and revising the manuscript. using transient features, Sensors and Actuators B: Chemical 137 (2) (2009)
507–512.
[33] C. Cortes, V. Vapnik, Support-vector networks, Machine Learning 20 (3) (1995)
References 273–297.
[34] R. Rifkin, A. Klautau, In defense of one-vs-all classification, Journal of Machine
[1] J.W. Gardner, P.N. Bartlett, Electronic Noses: Principles and Applications, Learning Research 5 (2004) 101–141.
Oxford University Press, New York, 1999. [35] C.-C. Chang, C.-J. Lin, LIBSVM: A Library for Support Vector Machines, Software.
[2] K.C. Persaud, G. Dodd, Analysis of discrimination mechanisms in the mam- Available at http://www.csie.ntu.edu.tw/cjlin/libsvm, 2001.
malian olfactory system using a model nose, Nature 299 (1982) 352–355. [36] R. Klinkenberg, T. Joachims, Detecting concept drift with support vector
[3] M. Holmberg, F. Winquist, I. Lundstrom, F. Davide, C. DiNatale, A. D’Amico, machines, in: Proceedings of the International Conference on Machine Learn-
Drift counteraction for an electronic nose, Sensors and Actuators B: Chemical ing, 2000.
36 (1–3) (1996) 528–535. [37] O. Chapelle, B. Schölkopf, A. Zien (Eds.), Semi-Supervised Learning, MIT Press,
[4] T. Årtusson, T. Eklöv, I. Lundström, P. Mårtensson, M. Sjöström, M. Holmberg, Cambridge, MA, 2006.
Drift correction for gas sensors using multivariate methods, Journal of Chemo-
metrics 14 (5–6) (2000) 711–723. Biographies
[5] W. Göpel, K.-D. Schierbaum, Definitions and typical example, in: Chemical and
Biochemical Sensors, Part I, VCH, Weinheim, 1992, pp. 1–28.
[6] F. Davide, C.D. Natale, M. Holmberg, F. Winquist, Frequency analysis of drift in Alexander Vergara (Ph.D., 2006 – Universitat Rovira i Virgili) is a Postdoctoral Sci-
chemical sensors, in: in: Proceedings of the 1st Italian Conference on Sensors entist at the BioCircuits Institute, UC San Diego. His work mainly focuses on the use
and Microsystems, 1996, pp. 150–154. of dynamic methods for the optimization of micro gas-sensory systems and on the
[7] M. Zuppa, C. Distante, P. Siciliano, K.C. Persaud, Drift counteraction with mul- building of autonomous vehicles that can localize odor sources through a process
tiple self-organising maps for an electronic nose, Sensors and Actuators B: resembling the biological olfactory processing. His areas of interest also include sig-
Chemical 98 (2–3) (2004) 305–317. nal processing, pattern recognition, feature extraction, chemical sensor arrays, and
[8] M. Holmberg, T. Artusson, Drift compensation, standards, and calibration machine olfaction.
methods, Handbook of Artificial Olfaction Machines, WILEY-VCH Weinheim,
Shankar Vembu (Ph.D., 2010 – University of Bonn) is a Postdoctoral Researcher at
Germany, 2003, pp. 325–346.
the BioCircuits Institute, UC San Diego. His research interests are in machine learning
[9] A. Hierlemann, R. Gutierrez-Osuna, Higher-order chemical sensing, ACS Chem-
algorithms and their applications.
ical Reviews 108 (2008) 563–613.
[10] A.-C. Romain, J. Nicolas, Long term stability of metal oxide-based gas sensors Tuba Ayhan (M.S., 2010 – Technical University of Istanbul) is a Ph.D. student at the
for e-nose environmental applications: an overview, Sensors and Actuators B: Department of Electronics and Communication Engineering, Technical University of
Chemical 146 (2) (2010) 502–506. Istanbul. Her research interests are embedded systems, FPGA, electronic noses and
[11] A.-C. Romain, P. André, J. Nicolas, Three years experiment with the same tin machine olfaction. Tuba carried out most of her work on this article while visiting
oxide sensor arrays for the identification of malodorous sources in the envi- the BioCircuits Institute at UCSD.
ronment, Sensors and Actuators B: Chemical 84 (2–3) (2002) 271–277.
[12] Figaro USA, Inc., http://www.figarosensor.com/. Margaret A. Ryan (Ph.D., 1987 – University of Massachusetts at Amherst) is an
[13] W. Göpel, New materials and transducers for chemical sensors, Sensors and Associate Research Scientist at the Jet Propulsion Laboratory, California Insti-
Actuators B: Chemical 18 (1–3) (1994) 1–21. tute of Technology. Before coming to JPL in 1989, she was a research scientist
[14] N. Yamazoe, New approaches for improving semiconductor gas sensors, Sen- at the Centre National de la Recherche Scientifique in Bellevue, France, and at
sors and Actuators B: Chemical 5 (1–4) (1991) 7–19. the Solar Energy Research Institute (now National Renewable Energy Lab) in
[15] K. Dobos, R. Strotman, G. Zimmer, Performance of gas-sensitive Pd-gate mosfets Golden, Colorado. Her work in both places included modification of metal oxide
with SiO2 and Si3 N4 gate insulators, Sensors and Actuators 4 (1983) 593–598. and semiconductor electrodes for photoelectrochemical energy conversion, pho-
[16] M. Roth, R. Hartinger, R. Faul, H.E. Endres, Drift reduction of organic coated toelectrochemical processing of solids and photochemistry. She came to JPL in
gas-sensors by temperature modulation, Sensors and Actuators B: Chemical 1989, and has worked primarily in the areas of chemical sensing and thermal-
36 (1–3) (1996) 358–362. to-electric energy conversion. She is the Principal Investigator on the NASA
[17] A. Vergara, E. Llobet, J. Brezmes, P. Ivanov, C. Cane, I. Gracia, X. Vilanova, Electronic Nose Technology Development Task. Her work at JPL has concen-
X. Correig, Quantitative gas mixture analysis using temperature-modulated trated on two primary areas of research: (a) development of chemical sensors
A. Vergara et al. / Sensors and Actuators B 166–167 (2012) 320–329 329

and devices for air quality monitoring, including the JPL ENose, silicon carbide Ramón Huerta (Ph.D., 1994 – Universidad Autónoma de Madrid) is an Associate
hydrocarbon sensors and colorimetric sensors for ozone and other oxidants, and (b) Research Scientist at the BioCircuits Institute, UC San Diego. His areas of exper-
investigations of metals and metal alloys for use in high temperature energy con- tise include dynamic systems, artificial intelligence, and Neuroscience. His work
version devices, including the Alkali Metal Thermal to Electric Converter (AMTEC) deals with the development algorithms for the discrimination and quantifica-
and thermoelectric devices. Amy is now working at the U.S. Department of tion of complex multidimensional times series, model building to understand the
Energy. information processing in the brain, and chemical sensing and machine olfaction
applications based on bio-inspired technology. Ramón has co-authored over 80 arti-
Margie L. Homer (Ph.D., 1993 – University of California Los Angeles) is an Associate cles in peer-reviewed journals at the intersection of computer science, physics, and
Research Scientist at the Jet Propulsion Laboratory, California Institute of Technol- biology.
ogy. Physical Chemist Margie Homer is the Co-Investigator of the Electronic Nose
project at JPL. Her research interest includes chemical sensors.

You might also like