• No se han encontrado resultados

REPOSICION DE CERTIFICADO

D E S EGUNDA P UBLICACIÓN ACEPTACION DE HERENCIA

REPOSICION DE CERTIFICADO

In this section, we recall background aspects that we use in this chapter. Firstly, we first introduce the electrical quantities considered. Secondly, we

1

Security and Privacy Threats on Mobile

Devices through Side-Channels Analysis R. Spolaor

explain the time series segmentation. Then, we briefly describe some ma- chine learning and data mining concepts. Finally, we illustrate the filtering of noisy signals. We point interested reader to references cited in this section for a more in depth study of specific concepts.

Electrical quantities: A wall-socket smart meter is able to measure the energy consumption of the plugged appliance. Such appliances drain AC from the electrical system of the household. In particular, such device mea- sures several electrical quantities. The electrical quantities listed below are the ones used in this chapter:

• Active Power (P ), also referred with real power, is expressed in watt (W).

• Reactive Power (Q) is often measured in reactive volt-amperes (var).

• RMS Current (I) is the root mean square of the alternate current, measured in amperes (A).

• Phase Angle (φ) between the current and the voltage in the AC do- main.

In this chapter, we consider wall-socket smart meters able to measure (at least) the values of these four electrical quantities for each sampling period. Hence, an energy trace consists of a multivariate time series of electrical values of sequential samples.

Time series segmentation: We consider a time series T = {xk =

[x1, x2, ..., xn]|1 6 k 6 N } as a finite set of N samples indexed by time points

t1, ..., tN [3], and a segment as a set of consecutive time points S(a, b) = a 6

k 6 b, xa, xa+1, ..., xb. Hence, the segmentation of the time series T into c

non-overlapping intervals can be formulated as STc = {Se(ae, be) | 1 6 e 6 c},

were a1 = 1, bc = N and ae = be−1 + 1. In order to use a time series as

a pattern, the series can be represented by Piecewise Linear Representa- tion (PLR), which consists in segmenting a series with K straight segments. Since PLR results in an approximation of T , its fidelity can be expressed by error metrics (e.g., max err, total error ) which can consider multiple units of the PLR: from individual segments to the entire segmented series. In gen- eral, researchers propose three segmentation approaches [103] that produce a representation of a time series T given: (i) the number K of segments; (ii) a max err threshold, which stands for the error bound a single segment cannot exceed; and (iii) a total error threshold among all segments of T . In this chapter, we applied the second approach to segment the time series obtained by laptop energy traces.

The bottom-up segmentation is a batch approach based on a maximum error per each segment. This approach starts from approximating with a

linear interpolation the n-length time series by n/2 segments. The algorithm then calculates the cost of merging each pair of adjacent segments until a stopping criteria is met. Approximation is given by a straight line that can be computed by linear interpolation or by regression. The linear interpola- tion consists in connecting each point present in the subsequence T [a : b], while the regression takes into account the best fitting line in the least square sense. Although the regression can generally achieve higher approximation quality, as Euclidean distance, it takes linear time in the length of the seg- ment. The linear takes a constant time so it is preferable in contexts where computing power is critical (e.g., computer graphic). In order to evaluate the fitting quality of a candidate segment, the algorithm needs a method function that we formalize as cost(S(a, b)). It represents the distance (e.g., sum of squares) between a simple function (linear or polynomial) fitted to the actual values of each segments [3]. Possible distance metric can be sum of squares, distance between the best fit line and data point furthest away in the vertical direction, or any other measure.

Supervised learning: Supervised machine learning algorithms acquire knowledge about a specific context through examples. After the training phase, where such algorithms make up their knowledge from past experi- ence, they produce an inferred model able to classify new un-labeled in- stances. In an optimal test scenario, the algorithm determines properly the class labels for unseen instances. In this chapter, we employ three classifica- tion methods: Random Forest (RF) ensemble classifier, k -Nearest Neighbors (KNN) and Support Vector Machine (SVM). The KNN classifier computes the distances between the test example and each member of the training set. Then, the trained KNN classifier predicts the class label as the same of the nearest k training set members. Differently, SVM classifier uses weighted vectors for defining decision boundaries between classes. SVM classifies ex- amples by summing the outputs of a similarity function, taking into account the weights of the vectors, between the support vectors and the unseen in- stance. Then, the trained SVM classifier predicts the class with the largest sum, relative to a bias. A comprehensive reading about these classifiers is available in [31].

Savitzky-Golay filter: In the sampling of an analog signal, sensors may produce noisy readings. With high frequency fluctuations, this error is more likely to grow and the segmentation could end in meaningless chunks. For this reason, a sampled signal could be smoothed using a low-pass filter with- out harming the original signal structure. Savitzky-Golay [174] is a low-pass filter very effective in smoothing out highly noisy signals characterized by a wide frequency spectrum. It considers the frame size as a parameter, and it must be tuned considering the degree of variance and noise [182]. Savitzky-Golay filters are optimal as low-pass because they preserve the

Security and Privacy Threats on Mobile

Devices through Side-Channels Analysis R. Spolaor

Data Collector Data pre-processing Segmentation Feature extraction User 1 User N Dataset User 2

Figure 4.1: MTPlug framework overview. Each user plugs her laptop into the corresponding labeled smart meter.

high-frequency content of the signal and they minimize the amount of noise reduction intended as the fitting least-squares error.