scieee AI-readable full text Open interactive document viewer

Geometrical models for time series analysis

Pardo Fernández, Àlex

Abstract

In this work, a new approach to one class classification is proposed using geometrical models. The proposal is based on the kernelization of a technique of Approximate Polytope Ensemble (APES). It is named Kernel Approximate Polytope Ensemble (KAPE).

Full text

Geometrical models for time series analysis ` Alex Pardo Fern´andez Advisor: Oriol Pujol Vila PhD. Matem`atica Aplicada i An`alisi Master in Artificial Intelligence GEOMETRICAL MODELS FOR TIME SERIES ANALYSIS ` Alex Pardo Fern´andez 18 ECTS thesis submitted in partial fulfillment of a Magister Scientiarum degree in Artificial Intelligence Advisor Oriol Pujol Vila PhD. Faculty Representative Oriol Pujol Vila PhD. Faculty of Mathematics University of Barcelona Barcelona, October 2015 Geometrical models for time series analysis Geometrical models for T.S. 18 ECTS thesis submitted in partial fulfillment of a M.Sc. degree in Artificial Intelligence Copyright c 2015 ` Alex Pardo Fern´andez All rights reserved Faculty of Mathematics University of Barcelona Gran Via, 585 08007 Barcelona, Barcelona Spain Telephone: 93 402 08 53 Bibliographic information: ` Alex Pardo Fern´andez, 2015, Geometrical models for time series analysis, M.Sc. thesis, Faculty of Mathematics, University of Barcelona. Keywords: Geometrical, Time series, Kernel, Ensemble, One-class, Multi-class Barcelona, Spain, October 2015 Special thanks to my advisor Oriol Pujol. Thanks also to Sergio Escalera, Albert Clap´es and all my family that contributed in one way or another in the development of this work. Also thanks to the projects that supported this work: MINECO RETOS (RTC-2014-2148-1), RECERCAIXA2011-REMEDI, IMSERSO2012-MEDIMINDER, and VICYCLE (TIN2013-43478-P). Abstract Geometrical models are intuitive and allow us to easily understand how a data set is structured and which is the best way to classify it. On the other hand, one class problems present a totally different perspective from the classical classification approach to supervised machine learning. This kind of problems are specially challenging due to the fact that only positive data is used in order to train the model. In this work, a new approach to one class classification is proposed using geometrical models. The proposal is based on the kernelization of a technique of Approximate Polytope Ensemble (APES)[1]. This method allows us to achieve state of the art results using an intuitive, simple and easy to be represented model, named Kernel Approximate Polytope Ensemble (KAPE). In addition we purpose an extension of the original APE, which will be used afterwords in KAPE, that allows to measure the confidence of the membership of a point to the model. Finally we study the problem of gesture recognition using Inertial Movement Units (IMUs). To this end, a new dataset of actions and interactions is presented, recorded in the wild with elder people. In this work a study of the data given by a wearable sensor in the wrist of the users is presented, exposing the main problems and how can they be mitigated. KAPE is applied in this scenario of variable length gesture sequences with very promising results. 1 Contents 1 Introduction 3 1.1 Contributions................................ 4 1.2 Publications................................. 5 1.3 Structure .................................. 5 2 Background 6 2.1 Approximate Polytope Ensembles . . . . . . . . . . . . . . . . . . . . . 6 2.1.1 Powerfulness of random projections . . . . . . . . . . . . . . . . 6 2.1.2 Approximate Polytope Ensembles (APE) . . . . . . . . . . . . 6 2.1.3 Non-convex extension . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 Introduction to kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3 Dynamic Time Warping . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4 Reference Methods for Data modeling and Classification . . . . . . . . 10 2.4.1 Probability Density-based . . . . . . . . . . . . . . . . . . . . . 11 2.4.2 Distance-based ........................... 11 2.4.3 Kernel-based ............................ 11 3 Kernel Approximate Polytope Ensembles 13 3.1 CoreandMembership ........................... 13 3.2 KernelAPE................................. 15 3.3 Convex Hull enlargement/shrinking . . . . . . . . . . . . . . . . . . . . 18 3.4 Outlierselection .............................. 18 3.5 Computational performance . . . . . . . . . . . . . . . . . . . . . . . . 19 3.6 Classifying data with KAPE . . . . . . . . . . . . . . . . . . . . . . . . 19 3.7 Working with sequences . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4 Experiments and Results 21 4.1 Behavior of the method . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1.1 Case study: Analysis of Ying-Yang dataset . . . . . . . . . . . 24 4.2 Datasets................................... 27 4.3 Settings ................................... 28 4.4 Results.................................... 29 5 Gesture recognition 37 5.1 Methodology ................................ 37 5.2 Data..................................... 37 5.3 Featureselection .............................. 40 5.4 Settings ................................... 45 5.5 Results.................................... 45 6 Conclusions and future work 49 6.1 Conclusions................................. 49 6.2 Futurework................................. 50 2 1 Introduction Pattern recognition is a field of machine learning that tackles the problem of finding the model that better explains a set of data. Essentially, for a given input, the system is able to predict the expected label after a training phase. For doing so, an algorithm or computational procedure is needed. In this Master Thesis, the proposed method is a geometrical model, which is a branch of the pattern recognition field. Those algorithms form a discipline called computational geometry, which comprehends the problems related to the geometrical properties of a set of points in a Rnspace. Some example problems are: closest pair of points, delaunay triangulation or convex hulls. In [2], authors propose a geometric framework for binary data classification using large-margin classifiers by applying two different geometrical models. The geometric interpretation of SVM classifier is used in [3] in order to propose a geometric algorithm for both separable case (using Convex Hulls) and non-separable cases (using Reduced Convex Hulls). Finally, [4] presents the Nearest Convex Hull classifier, a geometric approach to SVM that uses the distance to the convex hull representing a class as the decision function. Some other articles make use of geometrical methods in order to improve other techniques. For instance, [5] uses the geometrical interpretation of Support Vector Machines and kernel functions in order to improve some algorithms (e.g. shape reconstruction). One important property of computational geometry problems is their complexity in time. Most of them have efficient algorithms able to reduce complexity to O(nlog n) [6], but it is a must tot say that these algorithms usually scale exponentially with the dimensionality (d) of the space. In our specific case, we explore methods based on the Convex Hull structure. The convex hull is the smallest convex polytope (or polygon in arbitrary dimensionality) that encloses a set of points. The computational complexity of this algorithms is O(nlog n) in R2[7]. Among all the problems pattern recognition deals with, we are going to focus on anomaly detection (also referred as one-class modeling or classification). This kind of problems have the particularity that we only have information of one of the classes (the one we have to model). Usually, in binary classification, information of both classes is available so finding the boundary can be defined as a minimization problem in which the error given by a certain classification function should be reduced. In the case of anomaly detection, the information available is related to the objective class. The common approach is to define some of the points as outliers (anomalies) and try to fit a model able to distinguish between inliers and outliers. The number of outliers can be viewed as a regularization factor. One-class problems arise when it is easy to obtain target data, but negative samples are impossible or difficult to collect. Examples of this problems are machine failure prediction (it is not an option to make machines to fail in every possible way) and banknote verification (there are numerous ways of reproduce them). In [8], a survey on one-class problems is presented, in which several methods are detailed. Authors in [9], also compare some methods for outlier detection. The work explained in [10], tackles the problem of high-dimensional spaces in distance-based classifiers and proposes the use of projections in order to find outliers in spaces in which distances are distorted by the curse of dimensionality. Finally, [11] presents a solution for one-class classification in the information retrieval context by using two different One-Class SVM approaches. This master thesis follows the work of [1] in which the target class is modeled by means of combining Convex Hulls in several random projections. In particular we devise a kernelized version of the method that allows to implicitly and efficiently model non-convex problems using Approximate Polytope Ensembles (APE). Additionally, we explore a new formulation of the basic APE that is able to convey information about the confidence of the membership of a point to the model. Finally, we apply the 3 proposed method in a real problem of gesture recognition. In this problem, we explore the use of Kernel-APE in a real dataset of gestures in which, each of them is a multidimensional sequence with different length. Moreover, it is known to have a large intra and inter-class variability, which increases the complexity of the problem. In order to be able to tackle this problem, we have to transform our one-class classifier into a multi-class one. An interesting point of the Convex Hull approach for tackling anomaly detection is that it is easy to apply it to multi-class classification. The extension to the multiclass case is done by using the notion of confidences (one of the contributions of this thesis) and selecting the model with maximum confidence. Then, by using confidences given by the proposed improvements, we are able to define a hyperplane separating the classes. The method used to deal with gesture recognition tasks totally depends on the data input. Basically, there are two trends: images and wearable signal. In the first case, methods such as optical-flow [12] are applied. The second case, the one we deal with, is typically solved by using Hidden Markov Models (HMM) [13], or even with Artificial Neural Networks (ANN) [14]. In this work we use a the proposed kernelized version of APE with a dynamic time warping kernel to deal with sequence alignment and gesture modeling. 1.1 Contributions This work is based on APE and tries to improve it by adding some features to the method. Next, the most important contributions are detailed. •In this work we introduce the notion of confidence in the original APE implementation, including the notion of membership to the class. This will be crucial for assessing if a point is member of the class. •The most important contribution in this work is the application of Kernels to the original APE. This will increase the ability to fit non-convex sets without increasing the computational cost of the method. Also, Kernels will empower the method to use any other types of structured input data. •As it has been said before, the notion of confidence enables the method to model multi-class problems without any modification of the method. It will be explained how it is approached. •The one-class classifier will be tested against methods found in literature in order to be able to compare their performances. •Finally, in order to demonstrate the powerfulness of the proposed modifications, it will be used for a gesture recognition task, using a multi-class approach with inertial movement signals as input. 4 2.4.1 Probability Density-based First, we introduce Probability Density-based methods which are a generative approach that tries to model the data by means of Probability Density Functions (PDF), representing the target data as a statistical distribution. We focus on parametricmethods. The density function learned might be thresholded in order to define a boundary which acts as a frontier between those points that are part of the underlaying probability distribution and those which are not. Both Gaussian Models and Gaussian Mixture Models can be used in One-class and in Multi-class approaches. The latter implies treating each of the classes separately and then fusing the models. Gaussian Models The simplest approach are Gaussian Models (GM). In this case, we suppose a Normal distribution in our data. Then, we model the class space with a single Gaussian by learning the parameter σ. It is obvious that for in non-normally distributed sets, the model will not be representative enough and then, will led us to misclassifications and low performance rates. Another disadvantage is that is not suitable for on-line learning since the σneeds to be learned for each new sample in the system. Even though this technique is not very common, it has been used [21] until the formulation of Gaussian Mixture Models. Gaussian Mixture Models Gaussian Mixture Models (GMM) are an extension of GM in which the data is represented by a weighted mixture of Normal distributions. Basically, we set the number of Gaussians we want to represent our data and set one center (mean) for each of them, then, using an iterative process we tune the parameters until we reach a (sub) optimal point. Then, we are able to set a threshold in order to define a boundary for our class. This models are widely used [22] because of its simplicity and usefulness. 2.4.2 Distance-based This type of algorithms use distance metrics in order to classify each of the points. K-Nearest Neighbors K-Nearest Neighbors (K-NN) is based in the assumption that the difference between outlier and non-outlier points is that the former are far from the latter. So, if we sample a point and it is far from the labeled ones, we can say it is an outlier. To do so we have to define a minimum radius at which we can say points laying there are outliers. Setting the minimum distance and the percentage of nearest neighbors are critical parameters with a difficult computation. This simple approach is used [23] because of the lack of learning in all the process and the good results it could achieve. In the case of multi-class classification, the classical K-NN is used, in which for a new sample, we get the label of the K nearest neighbors and set the new label using a certain policy (e.g. voting) 2.4.3 Kernel-based Kernel-based methods can be interpreted as a non-linear projection (see Section 2.2) in order to make data linearly separable. 11 Support Vector Machines Support Vector Machines (SVM) is a linear classifier that takes profit of a Kernel in order to separate linearly problems that are not linearly separable in the original space. In the case of One-class problems, a boundary is computed by considering some of the training points as outliers, in such a way that most of the inliers will be well classified. This technique is well known for giving competitive results and is applied to several areas. In the case of novelty detection its use [24] is based on its usefulness is highlighted by the fact of maximizing the margin between classes and the use of kernels. On the other hand we have multi-class (i.e. two classes) approach in which a soft margin is maximized in order to have the minimum amount of misclassified points. 12 3 Kernel Approximate Polytope Ensembles Approximate Polytope Ensembles as described in the original implementation is a useful tool for modeling some one-class problems. However, it does not work with non-convex sets. The N-APE extension is able to deal with this problem but highly increasing the computational cost of the method. In our proposal, the kernelized version of APE will be able to deal with non-convexities while preserving the computational costs closer to the APE implementation. A CH is the part of the space formed by a convex combination of points, which is a positive weighted linear combination of points where the sum of the weights is one: CH(X) = N X i αixi;xi∈X αi≥0,∀i∈[0, N] N X i αi= 1 As it has been explained in Section 2, the set of convex hulls from randomlyprojected points forms an APE. By using them, we create a region in which the points of the target class lay. Next, we define some new concepts related to APEs that will lead us to the final formulation of the Kernel-APE. 3.1 Core and Membership Defining the concept of Core. In APE, the membership of a certain point to the class is binary, so it is part or not, but there is no degree of membership. In this original implementation, all the points of the set are used in order to construct the polytopes, for this reason it makes sense to define this type of membership: if the target class is modeled using all the data available, it is sensible to suppose that any new point will behave the same way. However, this approach does not take into account the case in which an actual member point is out of some projections due to some distortions generated by the projection. Moreover, by considering all the points in the training set we can end with a bad model in the case the positive set contains outliers. In order to increase the robustness of methods in front of outliers, it is common in literature to use some re-sampling techniques, such as bagging, in which training data is a randomly chosen (uniformly and with replacement) subset of the input points. This kind of techniques are used, for instance, in decision trees and are known to control overfitting while improving stability and accuracy. In our case, we would implement a similar technique for each of the polytopes. By doing so we expect outliers to be selected in few projections. It is important to notice that in the original bagging algorithm, samples are taken uniformly and with replacement. In our case, since it can generate strange situations (when computing the polytope of a set with repeated points), replacement is not allowed. Thus, instead of using a bootstrapping technique we will use a resampling technique. By including this modifications in the construction of the polytopes, we get that all the convex hulls will be built on a different set of points, in other words, every point will be found inside a certain percentage of polytopes. With this consideration in mind, emerges the concept of Core. Then, given a set of points and a set of convex hulls constructed from those, we define the core as the space in which all the convex hulls, intersect. 13 Let Xbe the set of point we want to model. We consider ηrandom subsets of X, Π = {Π0,Π1, ..., Πη}, where Πi⊂X. The core under the set of random samplings Π, ΘΠis defined as the intersection of all the convex hulls of the sets, i.e. Θ = η \ i=1 CH(Πi) The concept of core, defines the region of the space where all convex hulls agree. Complementary to this definition we may define the concept of membership of a point to the model as the proportion of CH where the point lies inside the hull. Let zbe an unseen point, we define the confidence of it of being part of the class of Xas: ν(z) = Pη i=0(1 |z∈CH(Πi)) η In Figure 4 one can observe how the core is constructed, the cores is only the part inside the membership= 1 contour. Notice the fact that it is a region in the original space that is represented by its different projections. Given that the intersection of the convex hulls is difficult to compute since are defined in different spaces, the intersection is computed by assessing the membership of each of the points and generating the polytopes using the subset with full membership. The core is denoted in each of the polytopes by a red polygon inside it. 3 4 5 6 7 8 −5 −4 −3 −2 −1 0 0.000 0.200 0.500 0.800 1.000 Figure 4: Figure showing the membership of the space and the core (membership = 1) It is important to understand that this changes the basic decision function of the APE. In the original formulation of APE a point is considered to be an outlier if it is outside of at least one convex hull, and a member of the model if it can not be rejected. In our new formulation this definition no longer holds. The membership to the model is defined by an additional parameter, a threshold on the confidence of belonging to the model. This parameter has to be tuned. 14 3.2 Kernel APE The non-convex extension explained on Section 2.1.3 is a great improvement over APE, but it will only work with vectorial data. Moreover, for each space modeled a full APE is computed and the number of APEs needed increase when reducing the radius parameter; these APEs will have large intersections and this implies a low efficiency of the algorithm. In order to avoid these limitations, we propose the use of a kernelized version of the APE. A convex combination of a set of points Xis defined as CS(X) = N X i αixi(3) with: αi≥0,∀i N X i αi= 1 The convex hull for CS is the smallest polytope formed by the points in the vertices that bounds the convex set. We want to use a certain space of large-dimensionality in order to better represent the space. Let us consider a transformation φ(x) : Rd→Rd0of the original space into an arbitrary space. The convex combination of the points in this new space is defined as follows, CS(X) = N X i αiφ(xi) (4) subject to α≥0Xαi= 1 In the transformed space any point inside the convex hull can be represented by the convex combination of the vertices. Let us define the reconstruction error of a point by a convex combination of points as = (φ(x)− N X i αiφ(xi))2 subject to αi≥0; Xαi= 1 (5) For any point inside the convex hull the reconstruction error = 0. We can rewrite Equation (5) as: φ(x)φ(x)−2 N X i αiφ(xi)φ(x) + N X i αiφ(xi) N X j αjφ(xj) = (6) By definition, the kernel k(x,y) can be written as the inner product < φ(x), φ(y)>. This yields the following equation, k(x, x)−2 N X i αik(xi, x) + N X i,j αiαjk(xi, xj) = (7) 15 Given that k(x, x) = 1 by definition and changing the last term into a vector-matrix form as follows, N X i,j αiαjk(xi, xj) = αTKα Equation (7) can be rewritten as: 1 + αTKα −2 N X i αik(xi, x) (8) subject to αi≥0; Xαi= 1 Notice the only part of the equation that depends on the input data is PN iαik(xi, x). Analogous to the standard convex hull, we can define the the convex hull in the kernel space in order to assess the membership of a point to the interior of the convex hull. Note that although the the computed hull is convex in the kernel space, it represents an arbitrary transformation of the input space and thus can represent non-convex shapes in the original space. CH(X) = N X i αik(xi, x) αi≥0,∀i(9) N X i αi= 1 Since we are working in the RKHS, K matrix is positive semidefinite; given that, K can be associated to a metric. We must assume that a class is defined as those points that are close to each other (at least in some dimensions), so using the kernel matrix K introduces the notion of distance between points into the working space. Recall the projection strategy used by the APE algorithm and shown in the following equation: Xt={Ptx|x∈X}(10) In order to apply a kernel function Kto the training points, we reformulate the projection process from the original APE shown in Equation (10) to the kernel version as in Equation (11) in which Xsis uniformly drawn from Xwith a probability τand Kis applied to every point in the training set before projecting it into the lower dimensional space. Xt={PtK(xi, x)|xi∈Xs} K(x, y) = exp(γkx−ykp) (11) The kernel used is an exponential of a distance as stated in Equation (11). The parameter γwill control the coverage of the function, cutting off the value at a maximum distance. Choosing the optimal γ, ensures a local view of the dataset, as N-APE does with the radius. Having a low coverage will result on K≈I, so the algorithm will over-fit on train data since it will not be able to generalize. On the contrary, if we set a large coverage, the kernel matrix will be uniform (all the points will be considered close due to the large range) and will under-fit data due to its incapability to represent the pattern. 16 An optimal γwill lead us to a situation in which those points that are far from the population (i.e. outliers) will have a nearly-zero norm (the computation of the kernel will be zero if points are far from each other). This means that, when projecting into the random space in R2, we will have a point close to (0,0). Following the same logic, a point that is close to a large number of points will have a norm close to 1. This means that when applying the random projection, it will lay in the borders of the convex hull computed in this space. The Kernel will generate a hypersphere (a convex set) in which, those points with zero norm will be the ones far from the population in the original set, and those with maximum norm, will tend to be centers of mass. The fact that every point with lower norm is mapped close to 0,0 is, in fact, a good property, since we only have to model the singularity generated by the definition of the kernel in order to get rid of this points. We define an exclusion zone in the center of the hull (close to 0,0) in which every point that lays inside is considered to be out of the convex hull. However, in the One-class problem, only outliers will lay into this space. In the case of classification, it will be different. This problem will be tackled later. By using the kernel approach, we reduce the complexity of the N-APE algorithm to the original APE plus a Kernel computation. Additionally, we add the confidence level defined in Section 3.1. Data:X={x1, ...xn} ∈ Rd, η, p, γ, τ Result: A model Mcomposed by τprojection matrices and their corresponding Convex Hulls and the kernel matrix Kfor the given input data M=∅ K(xi, xj) = exp(γkxi−xjkp)∀xi, xj∈X;i6=j for n= 1...τ do Ks=subsample(K, η)/* Get the subset of points from the kernel */ Pt∼U(0,1) /* Generate a random projection from a uniform distribution */ Xp={PtKs(xj, x)|xj∈Ks}/* Project the training points in the kernel */ v=conv(Xp)/* Obtain the vertices of the Convex Hull */ M=MS(P, v)/* Store the projection and the vertices */ end Algorithm 3: K-APE training algorithm As it is detailed in Algorithm 3, the procedure is not very different from the original APE formulation, but only the kernel function and the sub-sampling technique have been introduced. The testing Algorithm 4, goes as follows: for a new point, we project it into the kernel space and count in how many hulls it lays inside. The greater this number is, 17 the larger will be the confidence of being part of the class. Data: Test point x∈Rd, the Model M, the kernel matrix K Result: The membership of the point Count = 0 xk=Kx /* Project the test point over the kernel */ for t= 1...τ do xt=Ptxk/* Project the test point over the kernel */ if xt∈conv(vt)then Count += 1 end end Membership = Count /τ Algorithm 4: K-APE testing algorithm This Kernel approach enables us to use any input data (vectors, text, sequences, images, etc.) since the data is modeled from the kernel, increasing the usefulness of the method. The lower-dimensionality projections maintains the expressiveness of the model, as it has been demonstrated before, while reducing its complexity. 3.3 Convex Hull enlargement/shrinking Even that in the Kernel-APE algorithm, it is possible to enlarge or shrink the polytopes as in the original APE, the introduction of the notion of core and consequently the membership, makes the enlargement/shrinking redundant. In the exposed approach, the membership acts as the shrinking parameter does. By selecting a certain threshold, we are reducing or increasing the coverage of the convex hull. The variation of this membership threshold, goes from the polytope given by the union of all the convex hulls, where points only have to lay in one of the polygons, until the intersection of all of them, where points have to lay in every convex hull. The proposed approach has a further benefit when compared with the original APE. The shrinking procedure is done by selecting a center of the hull, e.g. analytic center, center of mass, etc. The selection of the best center is still an open problem. The membership proposal avoids this problem. 3.4 Outlier selection In the One-Class problem, we model a single class, so it is easy to overfit our model. In order to avoid this, we can say that a certain amount of points (say 10%) are outliers or do not represent our class. One first approach to do that is by taking the Kernel matrix and computing the average similarity of each row: Si= n X j=0 K(i, j)∀i∈0, n Then, we order the values and exclude a certain percentage of them. This approach will work as expected if the samples of the model are in a single cluster. In data -sets with more than one cluster, we will be removing random points (the average of each row will be almost the same due to the large number of zeros). The concept of reducing the training samples by eliminating those that are in the boundaries is almost the same as the shrinking of the convex hulls. In fact, we can join both concepts in an efficient fashion that will led us to better results in multi-clustered sets. 18 This approach consists on fixing a certain amount of points we want to consider as outliers, then we reduce the convex hull until we have the desired number of samples outside our model. By doing so, we are able to solve the case of multiple clusters and simplify the training phase. 3.5 Computational performance In our case, in the training phase we only have to include the cost of computing the kernel matrix O(n2) and the cost of projecting a new point in the kernel space O(η n d), giving a global complexity of O(τ(η n log η n) + n2). The cost of testing every point using a Ray-Casting algorithm is O(τ e) where τis the number of projections and e the number of edges of the polytope, setting the testing complexity at O(τ(n d +e)). However, the most expensive algorithm, the kernel computation, can be computed for each of the projections instead for all the input set. In this case, the cost will be O(τ(η n)2). Setting a low ηwill compensate the cost of computing it for each of the projections, thus, this approach will be more efficient. Notice that the cost of the N-APE algorithm is O(C(τ(m log m)n2)), where C is the number of centers needed to model the shape and mthe number of points in the radius rfrom each center and n2is the cost of obtaining the mpoints within the radius. Compared to the cost of the K-APE, this second is more expensive considering that a large C will be needed. It is exactly Ctimes slower than KAPE. 3.6 Classifying data with KAPE One of the best well-known linear classifiers that take advantage by using kernels is SVM. Basically, it is a linear classifier that, by means of applying a kernel is able to linearly separate data that is not linearly separable. As [25] demonstrates, computing an SVM classifier is the same as computing the convex hull for each of the sets and then, finding the hyperplane that maximizes the distance to them. The same procedure can be followed when working with nonseparable cases, by applying a soft margin. In our case, we have a method that is able to model data in a convex and nonparametric way. If we want to classify data by means of geometrical models, we have to, as [25] suggests, compute the separation between the sets. For the sake of simplicity, we are going to consider that we only have two classes in our problem. All the arguments are valid for higher numbers of classes. •The separable case in which classes do not intersect, implies a first step of computing the KAPE for each of the classes, so we have a clear idea of its coverage in the space. Since we have that classes do not intersect and that there is a kernel that convexifies the data, we can guarantee that we would be able to separate both classes. In this case, since a confidence has been defined, we would be able to asses the proximity or the membership to any of the classes. At the end, for classifying as a class or another, the largest confidence is taken as the predicted class. •The non-separable case in which classes are intersecting, is a much more difficult task. We can not guarantee that all the points will be well classified. In some cases, this intersection is due to uninformative features, so classes only intersect in some of the dimensions. In this case, we can take advantage by using a kernel and random projections in order to solve this problem. In the case of sets that intersect in more dimensions, we will never be able to solve this situation, due to the fact that the same point is part of both classes so it is present in both convex sets. But, since we have a confidence on each of the models, we are able to assess a soft margin in which misclassifications 19 appear because of the shape of the sets. The soft margin is created when the two classes intersect. In the places in where the confidence is different, we are able to choose one class or another, but it might be a space in which both confidences are the same so we are not able to asses the final label (the decision will be taken randomly). Having a soft margin implies that for this area, there is an uncertainty because of the mixing of both classes. However, since we are modeling the classes independently from the other, it would not affect to the confidences. That is, even if we have an intersection, the confidence in this place will be the same as if there is no other class. As it has been said before, the approach followed works as a SVM would do, so the behavior in seprable/non-separable cases is the same. The only difference in our implementation is that we compute a confidence so we are able to deal easily with uncertainties, reducing the area in where we do not know the labels to a reduced one (i.e. the place in where both confidences are the same). 3.7 Working with sequences Most of the state of the art on data modeling is about numerical datasets. However, there are several applications that are less explored and that have an additional degree of difficulty. We are talking about sequences, in particular, sequence classification. In this particular case, we are going to deal with a gestural dataset (deeply explained in Section 4.2), acquired in the wild using Inertial Movement Units (IMUs). The gestures are from four classes: taking a pill, drinking from a glass, eating from a dish and reading a book. The subjects were 13 elder people. The recording has been made with minimal external intervention, so they were free to perform as they wanted. The result is a challenging dataset with large intra and inter-class variability and a small number of samples. All the gestures have been previously segmented by using the ground-truth. Each of the sequences has a different length. In order to adapt our method to a new input, we only have to modify the preprocessing step, that is the Kernel computation. Since an exponential kernel is basically the exponential of the euclidean distance between pair of points, we can apply any other distance metric. We selected Dynamic Time Warping algorithm (see Section 2) to compute alignment costs and use them as distances between sequences. We redefine the RBF kernel in order to use DTW instead of L2 norm and be able to deal with gestures. The kernel will be the following: K(xi, xj) = exp(DTW(xi, xj) + DT W(xj, xi) −4σ2) We average both DTW distances in order to make the kernel matrix symmetric, since DTW has not the symmetry property. Then, we can apply any algorithm that uses a kernel in the learning process, getting rid of the sequences and their different lengths. Notice that the same procedure could be applied to images, text, categorical features or even structures, enabling the algorithm to deal with any kind of input data. The procedure for modeling or classifying the data will be the same explained before. 20 Figure 13: Probability histograms of Gaussian Mixture Model and Kernel-APE Conclusions. From this experiment the reader may observe that, while OCSVM is not behaving well with a small number of training samples and GMM is able to model complex shapes at the cost of using a large amount of components, KAPE is using key concepts of each of them and using it to geometrically represent the underlaying distribution of the data, using a non parametric approach and behaving well when using a small set of training points. 4.2 Datasets State-of-the-art datasets. In order to compare the behavior of the method against other one-class approaches, we are going to use several datasets commonly used in literature. In Table 1, the details of each of the dataset are shown. Observe 27 that these data sets are meant for classification. In the one-class setting we will model one of the classes disregarding all the information from the other class. This information will only be used later in the experiments for assessing the performance of the methods. The number of features use to be an important specification of the input data. Here we have a range of values from 2 to 60. In our case it is not so important because of the use of Kernels. Finally, we decided to choose an small number of samples in order to be able to increase the combinations of parameters for each of the methods. However, we cover the range that goes from about 200 to more than 7000. Additionally, those datasets with more than two classes will be split using a oneversus-all strategy, increasing the number of datasets. Name Features Classes Samples heart 13 2 270 mg 6 2 1385 Ying-Yang 2 2 787 fourclass 2 2 862 australian 14 2 690 segment 19 7 2310 diabetes scale 8 2 768 Table 1: Details of the used datasets 4.3 Settings One class problems have some particularities in terms of how training is performed. The main problem when training a classifier using a single class is the parameter selection. It is easy to overcome with a trivial solution that would not be able to generalize well. This will result in poor test accuracy rates. This is due to the fact of not having negative samples in the training phase. Almost all the methods have two parameters we have to tune: •KNN: Number of neighbors and Distance threshold •K-APE: Sigma and Threshold •GMM: Number of components and Threshold •OCSVM: νand γ •Gauss: Threshold We train and test using all the combinations. Then we define a percentage of training points we want to reject (i.e. we consider them outliers). With the obtained results, we find the best combination that gives the closest rate of outlier rejection. For doing so we used a nested cross validation strategy to select the best parameter and finally assess an accuracy value. Threshold parameter is tunned again in the testing phase selecting the one that corresponds to the crossing of test and outlier curves. This is known as the Equal Error Rate. Fixed parameters. Some of the parameters of the K-APE method have been fixed. After analyzing the behavior of the method, we decided to fix the percentage of subsampling (η) to two thirds and the number of projections (τ) to 300, since we consider their behavior is not critical when setting non-limit values. 28 Parameters range. The parameters that require a validation are: threshold ν and RBF-Kernel σ. The resolution of the threshold is directly related to the number of projections. That is, since the threshold νshows the proportion of polytopes in which a point lays inside, the step size of this parameter is 1/η and bounded in the interval (0,1]. Since every dataset is standarized, σis bounded in the interval (0,3] and we will use 20 different values. 4.4 Results In this section, the results obtained by the proposed method are compared to the ones given by the state of the art presented in Chapter 2. Two comparisons will be made, first of all, both kernel methods (OCSVM and KAPE) will be compared. Next, KAPE will compete against other non-kernel methods. In order to compare kernel methods, one may look at Tables 2 and 3, first and last columns. These results show that KAPE outperforms OCSVM in almost all the tested datasets. Comparing KAPE with the rest of the methods, it is found to be be in third position. Observe that the difference between the three first methods, both in EAR and in AUC, is not statistically significant. If we look at the EAR, KNN is the best method, followed by GMM and KAPE. On the other hand when looking at the AUC, GMM is the best of the five followed by KNN and KAPE. If we take a closer look at the results, we find different behaviors of KAPE. If we check the plots of the EAR Figures 14-16, one can observe that KAPE converges in all the datasets except for segment 0. Notice also that KNN and GAUSS fail to converge in several datasets. In Figure 16, one may observe that KAPE is not able to achieve good results on diabetes scale dataset. Moreover, in Figure 19 it is evident that the classifier is not working properly in this dataset. This is due to the number of convex hulls used. Augmenting this value, will improve the expressivity of the model, yielding a better result. One may observe the difference between Figure 15 and 18. The model is achieving good results in this dataset but, the ROC curve shows that more parameters should be tested in order to achieve a correct result. Observe also in Table 2, that this dataset is achieving large performances in other methods and actually, one of the lowest values is the one achieved by KAPE. It is important to mention the case of mg (Figure 17) in which the difference between KAPE and OCSVM is notable. As one may observe in Table 4, KNN is the best of the methods, and KAPE performs five out of seven times better than OCSVM. However, KAPE is not performing better than GMM and draws against Gauss. Dataset KAPE KNN GMM GAUSS OCSVM heart 0.68 0.66 0.68 n/a 0.63 mg 0.73 0.75 0.75 0.79 0.61 Ying-Yang 0.91 0.91 0.82 0.75 0.73 fourclass 0.98 1.00 0.90 0.66 0.76 australian 0.69 0.68 0.74 0.76 0.63 segment 0 0.93 0.97 0.98 0.93 0.95 diabetes scale 0.48 0.58 0.57 0.61 0.57 Average 0.77 ±0.17 0.79 ±0.15 0.78 ±0.13 0.65 ±0.28 0.70 ±0.12 Table 2: Results showing Equal Accuracy Rate 29 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier HEART MG YINGYANG Figure 14: Equal Accuracy Rates (in red) for positive (blue) and negative (green) data points of the test set 30 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier FOURCLASS AUSTRALIAN SEGMENT_0 Figure 15: Equal Accuracy Rates (in red) for positive (blue) and negative (green) data points of the test set 31 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KAPE test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. KNN test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GMM test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. GAUSS test outlier 0.0 0.2 0.4 0.6 0.8 1.0 TH. 0.0 0.2 0.4 0.6 0.8 1.0 ACC. OCSVM test outlier DIABETES_SCALE Figure 16: Equal Accuracy Rates (in red) for positive (blue) and negative (green) data points of the test set 32 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.740 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.727 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.735 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.761 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.686 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.811 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.832 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.842 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.862 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.678 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.971 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.950 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.894 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.827 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.812 HEART MG YINGYANG Figure 17: Receiver Operating Characteristic (ROC) curve for each of the datasets and each of the models and the computed Area Under the Curve (AUC) 33 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.983 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.999 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.966 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.737 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.832 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.749 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.724 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.810 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.774 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.678 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.933 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.969 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.984 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.979 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.978 FOURCLASS AUSTRALIAN SEGMENT_0 Figure 18: Receiver Operating Characteristic (ROC) curve for each of the datasets and each of the models and the computed Area Under the Curve (AUC) 34 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KAPE AUC=0.483 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR KNN AUC=0.628 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GMM AUC=0.607 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR GAUSS AUC=0.644 0.0 0.2 0.4 0.6 0.8 1.0 FPR 0.0 0.2 0.4 0.6 0.8 1.0 TPR OCSVM AUC=0.590 DIABETES_SCALE Figure 19: Receiver Operating Characteristic (ROC) curve for each of the datasets and each of the models and the computed Area Under the Curve (AUC) 35 Dataset KAPE KNN GMM GAUSS OCSVM heart 0.740 0.727 0.735 0.761 0.686 mg 0.811 0.832 0.842 0.862 0.678 Ying-Yang 0.971 0.950 0.894 0.827 0.812 fourclass 0.983 0.999 0.966 0.737 0.832 australian 0.749 0.724 0.810 0.774 0.678 segment 0 0.933 0.969 0.984 0.979 0.978 diabetes scale 0.483 0.628 0.607 0.644 0.590 Average 0.810 0.833 0.834 0.798 0.751 Table 3: Results showing Area Under the Curve KAPE KNN GMM GAUSS OCSVM KAPE - 2/1/4 2/1/4 3/1/3 5/0/2 KNN 4/1/2 - 3/1/3 4/0/3 7/0/0 GMM 4/1/2 3/1/3 - 4/0/3 6/1/0 GAUSS 3/1/3 3/0/4 3/0/4 - 4/0/3 OCSVM 2/0/5 0/0/7 0/1/6 3/0/4 - Table 4: Results showing Wins/Draws/Loses in EAR values 36 (a) Inter-subject (b) Intra-subject Figure 30: Raw accelerometer + Sorted accelerometer + Complementary filter (a) Inter-subject (b) Intra-subject Figure 31: Raw accelerometer + Sorted accelerometer + Jerk (a) Inter-subject (b) Intra-subject Figure 32: Sorted accelerometer + Complementary filter + Jerk 43 (a) Inter-subject (b) Intra-subject Figure 33: Raw accelerometer + Sorted accelerometer + Complementary filter + Jerk 44 5.4 Settings In the case of the SARQuavitae Claret dataset, we would use a multi-class approach. In this case, we are only going to test K-APE and SVM due to the need of using a custom kernel (input sequences have different lengths). We are going to use a Onevs-ALL strategy. In the case of K-APE, one K-APE will be modeled per class. Then, for each test sample, the membership to each of the models will be assessed and the label will be assigned taking into account its maximum value. In the case of SVM, the classic One-vs-ALL approach will be used. 5.5 Results In this section we would analyze the results obtained on SARQuavitae Claret using SVM and KAPE methods, in a multi-class approach. In Table 6, one can observe the values obtained for each of the classes. It is important to mention that, even that KAPE achieves lower average accuracies rates, it improves the results obtained by SVM in two of the classes. Even that, it is patent that KAPE is not able to differentiate some of the classes. In particular, Drink class works specially bad. In Figures 34, 35 and 36 the confusion matrix for each of the methods is shown. Notice that, in those cases in which KAPE is below SVM accuracies, there is a confusion against one of the other classes. It is important to mention that this confusion is only with one class, which suggests that the problem might be related with the volume of data available. Notice also that SVM is behaving as it was described for KAPE in those cases in which it has low accuracy rates. Notice the difference between SVM (multi-class approach) and OC-SVM (one-class approach). It its important to highlight that even that KAPE is designed for oneclass problems, is able to generalize to multi-class problems, achieving competitive performance rates. Moreover, the difference between KAPE and OCSVM proves the versatility of KAPE in contrast to the behavior of OC-SVM. SVM KAPE OCSVM Take-pill 6/12 (0.33%) 11/7(0.61%) 0/18 (0%) Drink 26/13 (0.67%) 12/27 (0.33%) 17/22 (0.43%) Turn-page 23/10 (0.69%) 26/7(0.79%) 1/32 (0.03%) Spoonful 57/10 (0.85%) 44/23 (0.52%) 1/66 (0.01%) Total 112/45 (0.71%) 93/64 (0.59%) 19/138 (0.12%) Table 6: Gesture dataset results, correct classifications in green, misclassifications in red and accuracy is indicated in brackets 45 Spoonful Drink Turnpage Takepill Predictedlabel Spoonful Drink Turnpage Takepill Truelabel 6.0 0.0 1.0 11.0 0.0 26.0 0.0 13.0 2.0 3.0 23.0 5.0 0.0 6.0 4.0 57.0 SVMConfusionmatrix Figure 34: Gesture dataset confussion matrix for SVM 46 Spoonful Drink Turnpage Takepill Predictedlabel Spoonful Drink Turnpage Takepill Truelabel 11.0 0.0 3.0 4.0 17.0 12.0 2.0 8.0 6.0 1.0 26.0 0.0 19.0 0.0 4.0 44.0 KAPEConfusionmatrix Figure 35: Gesture dataset confussion matrix for KAPE 47 Spoonful Drink Turn-page Take-pill Predicted label Spoonful Drink Turn-page Take-pill True label 0.0 18.0 0.0 0.0 8.0 17.0 14.0 0.0 1.0 31.0 1.0 0.0 3.0 43.0 20.0 1.0 OCSVM Confusion matrix Figure 36: Gesture dataset confussion matrix for OCSVM 48 6 Conclusions and future work 6.1 Conclusions In this work, we first present a study of the geometrical method Approximate Polytope Ensemble (APE) and the derived Non-Convex-APE (NAPE). In these methods, a one-class problem is modeled by means of random projections in 2-dimensions. We introduce the concept of core (the region at which all the convex hulls intersect) and thus, the concept of membership to the class, which accounts for the proportion of convex hulls in which a test data point, lays in. Following the approach applied in Support Vector Machines, in which a kernel function is used in order to enable a linear classifier to model non-linearly separable data and, in order to improve the original implementations of APE and NAPE, a kernel function has been introduced to the original APE formulation. Moreover, the addition of a kernel function in the formulation of our method, enables us to use any input data, increasing the utility of the model. This leads us to the implementation of Kernel-Approximate Polytope Ensembles, which is one of the main proposals of this work. In order to compare the performance of KAPE and the one of the classifiers used in literature, we have chosen a bunch of commonly used datasets. In an effort to show the utility of the kernel function by enabling us to use any type of input data, we designed and generated a dataset of actions and interactions in the wild, with elder people. This dataset has been recorded giving maximum freedom to the subjects that were collaborating, yielding a challenging dataset. With the application of the proposed method to the recorded data, we prove the generalization of KAPE to multi-class problems and to any kind of input data. With the results obtained in the one-class approach, the reader may observe that the outcomes are not statistically diffrerent from the ones given by the state of the art methods in most of the datasets. This leads us to the conclusion that the method is working as expected. The case of the Ying-Yang dataset explained in this work, is very illustrative and enables us to understand the behavior of KAPE compared to GMM and OCSVM. Intuitively, it is easy to notice that our method is approximating a complex shape by means of the intersection of polygons, yielding a polytope that bound the target class. Given some complex shapes (as the one proposed), GMM is not able to approximate correctly the shape of the target class. Moreover, OCSVM tries to model the boundary but it is not able to finally achieve the target shape. The main weak point of the proposed method is the fact of needing to store the Gramm matrix in order to test any test data point, that decreases the efficiency of the method in terms of memory storage. However, if the proposed thesis, that states that only the vertices will need to be stored in order to project new points to the kernel space, holds, this problem will be solved, improving the memory allocation of the model. Even that the proposed method has some weak points, advantages overcome them. First of all, as any geometrical model, its functioning is intuitive and easy to understand. The fact of using low-dimensional projections (2D), makes it suitable for plotting and enables us to trace any point and visually understand what is happening. Moreover, it is computationally efficient and improves the performance of NAPE and is far more efficient than SVM (O(n3)) and is close to K-NN (O(n2)). However, it is far from GMM which complexity is O(nk3) and Gaussian Model, O(n). Another advantage is that KAPE is non-parametric because the convex hull (the base method) only needs a set of points, which makes it easier to validate. It has been demonstrated in Chapter 4 the robustness of the method when varying the parameters. Thus, most of them can be fixed and the validation process is reduced even more. Finally, as it has been explained before, any input data could be given to the method. We can conclude that Kernel-APE is a method with a large potential and capac- 49 ity of improvement, given the points detailed before and the proposals described in Chapter 6.2. The study of One-class problems has been useful for accounting for different types of problems, with certain particularities and very interesting challenges, not common in literature. Even that, One-class approaches are often needed in actual problems. Moreover, the creation of a gesture dataset in the wild, enabled us to understand the particularities of this type of data. The fact of participating in all the process, from the very beginning, in the initial study, until the end, in the recordings and the labeling, gives us a wide view of the problem we are working with, helping to understand the key reasons of any problem we can found in the use of this dataset. Finally, I must say that the experience of developing this work explained here, makes me feel like I have become enriched as a junior researcher and helped me to discover other fields and methods that were unknown for me. I have also improved my expertise in writing scientific documents with the help of the related articles I have written and this particular work. 6.2 Future work The work presented in this Master Thesis is a first approach to the kernelized version of the Approximate Polytope Ensemble method. Even that lots of aspects have been studied and analyzed, there are some others that, due to a lack of time and an interest in focusing in other interesting points, have not been tackled. For instance, we could, in order to improve test performance, project new data points in the subspace formed by the vertices of the convex hull. This approach will help us to improve the efficiency of the method and, probably, achieve the same results. The intuition behind this approach is that, any point inside a convex hull, is a convex combination of the vertices. The multi-class approach proposed shows the multi-class behavior of Kernel-APE. In contraposition to other one-class targeted methods, KAPE is able to model a multiclass problem, achieving reasonably good performance rates and even improving SVM. For this reason, this approach should be studied and tested against other kind of datasets. Moreover, different kernels could be used in order to take profit of the intrinsic properties of the datasets being tested. 50 References [1] P. Casale, O. Pujol, and P. Radeva, “Approximate polytope ensemble for oneclass classification,” Pattern Recognition, vol. 47, no. 2, pp. 854–864, 2014. [2] X. Peng and Y. Wang, “Geometric algorithms to large margin classifier based on affine hulls,” Neural Networks and Learning Systems, IEEE Transactions on, vol. 23, no. 2, pp. 236–246, 2012. [3] S. Theodoridis and M. Mavroforakis, “Reduced convex hulls: A geometric approach to support vector machines,” IEEE Signal Processing Magazine, vol. 24, no. 3, pp. 119–122, 2007. [4] G. Nalbantov, P. Groenen, and C. Bioch, “Nearest convex hull classification,” Tech. Rep. EI 2006-50, 2006. [5] M. Eigensatz and M. Pauly, Insights into the Geometry of the Gaussian Kernel and an Application in Geometric Modeling. PhD thesis, Master thesis, Swiss Federal Institute of Technology Zurich, 2006. [6] C. B. Barber, D. P. Dobkin, and H. Huhdanpaa, “The quickhull algorithm for convex hulls,” ACM Trans. Math. Softw., vol. 22, pp. 469–483, Dec. 1996. [7] S. Ramaswami, “Convex hulls: Complexity and applications (a survey),” 1993. [8] M. A. Pimentel, D. A. Clifton, L. Clifton, and L. Tarassenko, “A review of novelty detection,” Signal Processing, vol. 99, pp. 215–249, 2014. [9] V. Hodge and J. Austin, “A survey of outlier detection methodologies,” Artificial Intelligence Review, vol. 22, no. 2, pp. 85–126, 2004. [10] C. C. Aggarwal and P. S. Yu, “Outlier detection for high dimensional data,” SIGMOD Rec., vol. 30, pp. 37–46, May 2001. [11] L. M. Manevitz and M. Yousef, “One-class svms for document classification,” J. Mach. Learn. Res., vol. 2, pp. 139–154, Mar. 2002. [12] M. Holte, T. Moeslund, and P. Fihl, “View-invariant gesture recognition using 3d optical flow and harmonic motion context,” Computer Vision and Image Understanding, vol. 114, no. 12, pp. 1353 – 1361, 2010. Special issue on Time-of-Flight Camera Based Computer Vision. [13] T. Starner, J. Weaver, and A. Pentland, “A wearable computer based american sign language recognizer,” in Assistive Technology and Artificial Intelligence, pp. 84–96, Springer, 1998. [14] G. Bailador, D. Roggen, G. Tr¨oster, and G. Trivi˜no, “Real time gesture recognition using continuous time recurrent neural networks,” in Proceedings of the ICST 2Nd International Conference on Body Area Networks, BodyNets ’07, (ICST, Brussels, Belgium, Belgium), pp. 15:1–15:8, ICST (Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering), 2007. [15] W. B. Johnson and J. Lindenstrauss, “Extensions of lipschitz mappings into a hilbert space,” Contemporary mathematics, vol. 26, no. 189-206, p. 1, 1984. [16] F. P. Preparata and M. Shamos, Computational geometry: an introduction. Springer Science & Business Media, 2012. [17] E. Kreyszig, Introductory functional analysis with applications, vol. 81. wiley New York, 1989. [18] J. Shawe-Taylor and N. Cristianini, Kernel methods for pattern analysis. Cambridge university press, 2004. [19] O. Chapelle, “Training a support vector machine in the primal,” Neural Computation, vol. 19, no. 5, pp. 1155–1178, 2007. 51 [20] B. Sch¨olkopf, A. Smola, and K.-R. M¨uller, “Kernel principal component analysis,” in Artificial Neural Networks—ICANN’97, pp. 583–588, Springer, 1997. [21] F. E. Grubbs, “Procedures for detecting outlying observations in samples,” Technometrics, vol. 11, no. 1, pp. 1–21, 1969. [22] L. Tarassenko, P. Hayton, N. Cerneaz, and M. Brady, “Novelty detection for the identification of masses in mammograms,” pp. 442–447, IET, 1995. [23] K. Ismo et al., “Outlier detection using k-nearest neighbour graph,” pp. 430–433, IEEE, 2004. [24] B. Sch¨olkopf, R. C. Williamson, A. J. Smola, J. Shawe-Taylor, and J. C. Platt, “Support vector method for novelty detection.,” in NIPS, vol. 12, pp. 582–588, 1999. [25] K. P. Bennett and E. J. Bredensteiner, “Duality and geometry in svm classifiers,” in ICML, pp. 57–64, 2000. 52