Year: 2019

Abstract:
Decision forests (DF), in particular random forests and gradient boosting trees, have demonstrated state-of-the-art accuracy compared to other methods in many supervised learning scenarios. In particular, DFs dominate other methods in tabular data, that is, when the feature space is unstructured, so that the signal is invariant to permuting feature indices. However, in structured data lying on a manifold—such as images, text, and speech—neural nets (NN) tend to outperform DFs. We conjecture that at least part of the reason for this is that the input to NN is not simply the feature magnitudes, but also their indices (for example, the convolution operation uses “feature locality”). In contrast, naïve DF implementations fail to explicitly consider feature indices. A recently proposed DF approach demonstrates that DFs, for each node, implicitly sample a random matrix from some specific distribution. Here, we build on that to show that one can choose distributions in a manifold aware fashion. For example, for image classification, rather than randomly selecting pixels, one can randomly select contiguous patches. We demonstrate the empirical performance of data living on three different manifolds: images, time-series, and a torus. In all three cases, our Manifold Forest (MORF) algorithm empirically dominates other state-of-the-art approaches that ignore feature space structure, achieving a lower classification error on all sample sizes. This dominance extends to the MNIST data set as well. Moreover, both training and test time is significantly faster for manifold forests as compared to deep nets. This approach, therefore, has promise to enable DFs and other machine learning methods to close the gap with deep nets on manifold-valued data.

heading: 1 INTRODUCTION
text: Decision forests, including random forests and gradient boosting trees, have solidified themselves in the past couple decades as a powerful ensemble learning method in supervised settings (Fernández-Delgado et al., 2014; Caruana & Niculescu-Mizil, 2006), including both classification and regression (Hastie et al., 2001). In classification, each forest is a collection of decision trees whose individual classifications of a data point are aggregated together using majority vote. One of the strengths of this approach is that each decision tree need only perform better than chance for the forest to be a strong learner, given a few assumptions (Schapire, 1990; Biau et al., 2008). Additionally, decision trees are relatively interpretable because they can provide an understanding of which features are most important for correct classification (Breiman, 2001). Breiman originally proposed decision trees that partition the data set using hyperplanes aligned to feature axes (Breiman, 2001). Yet, this limits the flexibility of the forest and requires deep trees to classify some data sets, leading to overfitting. He also suggested that algorithms which partition based on sparse linear combinations of the coordinate axes can improve performance (Breiman, 2001). More recently, Sparse Projection Oblique Randomer Forest (SPORF), partitions a random projection of the data and has shown impressive improvement over other methods (Tomita et al., 2015).
Yet random forests and other machine learning algorithms frequently operate in a tabular setting, viewing an observation ~x = (x1, . . . , xp)
T ∈ Rp as an unstructured feature vector. In doing so, they neglect the indices in settings where the indices encode additional information. For structured data, e.g. images or time series, traditional decision forests are not able to incorporate known continuity between features to learn new features.
For decision forests to utilize known local structure in data, new features encoding this information must be manually constructed. Prior research has extended random forests to a variety of computer vision tasks (Lepetit et al., 2005; Gall et al., 2011; Bosch et al., 2007; Shotton et al., 2011) and augmented random forests with structured pixel label information (Kontschieder et al., 2011). Yet these methods either generate features a priori from individual pixels, and
thus do not take advantage of the local topology, or lack the flexibility to learn relevant patches. Decision forests have been used to learn distance metrics on unknown manifolds (Criminisi et al., 2012), but such manifold forest algorithms are unsupervised and aim to learn a low dimensional representation of the data.
Inspired by SPORF, we propose a projection distribution that takes into account continuity between neighboring features while incorporating enough randomness to learn relevant projections. At each node in the decision tree, sets of random spatially contiguous features are randomly selected using knowledge of the underlying manifold. Summing the intensities of the sampled features yields a set of projections which can then be evaluated to partition the observations. We describe this proposed classification algorithm, Manifold Forests (MORF) in detail and show its effectiveness in three simulation settings as compared to common classification algorithms. Furthermore, the optimized and parallelizable open source implementation of MORF in R and Python is available. This addition makes for an effective and flexible learner across a wide range of manifold structures.

heading: 2 BACKGROUND AND RELATED WORK

heading: 2.1 CLASSIFICATION
text: In the two-class classification setting, there is a data set D = {(xi, yi)}ni=1 of n pairs (xi, yi) drawn from an unknown distribution FXY where xi ∈ X ⊂ Rp and yi ∈ Y = {0, 1}. Our goal is to train a classifier h(x;Dn) : X×(X×Y)n → Y based on our observations that generalizes to correctly predict the class of an observed x. The performance of this classifier is evaluated via the 0-1 Loss function L(h(x), y) = I[h(x) 6= y] to find the optimal classifier h∗ = argminh E[L(h(x), y)], which minimizes the probability of an incorrect classification.

heading: 2.2 RANDOM FORESTS
text: Originally popularized by Breiman, the random forest (RF) classifier is empirically very effective (Fernández-Delgado et al., 2014) while maintaining strong theoretical guarantees (Breiman, 2001). A random forest is an ensemble of decision trees whose individual classifications of a data point are aggregated together using majority vote. Each decision tree consists of split nodes and leaf nodes. A split node is associated with a subset of the data S = {(xi, yi)} ⊆ D and splits into two child nodes, each associated with a binary partition of S. Let ej ∈ Rp denote a unit vector in the standard basis (that is, a vector with a single one and the rest of the entries are zero) and τ a threshold value. Then S is partitioned into two subsets given the pair θj = {ej , τ}.
SLθ = {(xi, yi) | eTj xi < τ} SRθ = {(xi, yi) | eTj xi ≥ τ}
To choose the partition, the optimal θ∗ = (e∗j , τ ∗) pair is selected via a greedy search from among a set of d randomly selected standard basis vectors ej . The selected partition is that which maximizes some measure of information gain. A typical measure is a decrease in impurity, calculated by the Gini impurity score I(S), of the resulting partitions (Hastie et al., 2001). Let p̂k = 1|S| ∑ yi∈S I[yi = k] be the fraction of elements of class k in partition S, then the optimal split is found as
I(S) = K∑ k=1 p̂k(1− p̂k)
θ∗ = argmax θ |S|I(S)− |SLθ |I(SLθ )− |SRθ |I(SRθ ).
A leaf node is created once the partition reaches a stopping criterion, typically either falling below an impurity score threshold or a minimum number of observations (Hastie et al., 2001). The leaf nodes of the tree form a disjoint partition of the feature space in which each partition of observations Sk is assigned a class label c∗k corresponding to the class majority.
c∗k = argmax ck ∑ yi∈S I(yi = ck).
A decision tree classifies a new observation by assigning it the class of the partition into which the observation falls. The forest averages the classifications over all decision trees to make the final classification (Hastie et al., 2001). For
good performance of the ensemble and strong theoretical guarantees, the individual decision trees must be relatively uncorrelated from one another. Breiman’s random forest algorithm does this in two ways:
1. At every node in the decision tree, the optimal split is determined over a random subset d of the total collection of features p.
2. Each tree is trained on a randomly bootstrapped sample of data points D′ ⊂ D from the full training data set.
Applying these techniques means that random forests do not overfit and lowers the upper bound of the generalization error (Breiman, 2001).

heading: 2.3 SPARSE PROJECTION OBLIQUE RANDOMER FORESTS
text: SPORF is a recent modification to random forest that has shown improvement over other versions (Tomita et al., 2015; Tomita et al., 2017). Recall that RF split nodes partition data along the coordinate axes by comparing the projection eTj xi of observation xi on standard basis ej to a threshold value τ . SPORF generalizes the set of possible projections, allowing for the data to be partitioned along axes specified by any sparse vector a.
SLθ = {(xi, yi) | aTxi < τ} SRθ = {(xi, yi) | aTxi ≥ τ}
Rather than partitioning the data solely along the coordinate axes (i.e. the standard basis), SPORF creates partitions along axes specified by sparse vectors. In other words, let the dictionary A be the set of atoms {a}, each atom a p-dimensional vector defining a possible projection aTxi. In axis-aligned forests, A is the set of standard basis vectors {ej}. In SPORF, the dictionary D can be much larger, because it includes, for example, all 2-sparse vectors. At each split node, SPORF samples d atoms from D according to a specified distribution. By default, each of the d atoms are randomly generated with a sparsity level drawn from a Poisson distribution with a specified rate λ. Then, each of the non-zero elements are uniformly randomly assigned either +1 or −1. Note that the size of the dictionary for SPORF is 3p (because each of the p elements could be −1, 0, or +1), although the atoms are sampled from a distribution heavily skewed towards sparsity.

heading: 3 METHODS

heading: 3.1 RANDOM PROJECTION FORESTS ON MANIFOLDS
text: In the structured setting, the dictionary of projection vectors A = {a} is modified to take advantage of the underlying manifold on which the data lies. We term this method the Manifold Forest (MORF).
Each atom a projects an observation to a real number and is designed with respect to prior knowledge of the data manifold. Nonzero elements of a effectively select and weight features. Since the feature space is structured, each element of a maps to a location on the underlying manifold. Thus, patterns of contiguous points on the manifold define the atoms of A; the distribution of those patterns yields a distribution over the atoms. At each node in the decision tree, MORF samples d atoms, yielding d new features per observation. MORF proceeds just like SPORF by optimizing the best split according to the Gini index. Algorithm pseudocode, essentially equivalent to that of SPORF , can be found in the Appendix.
In the case of two-dimensional arrays, such as images, an observation xi ∈ Rp is a vectorized representation of a data-matrix Xi ∈ RW×H . To capture the relevance of neighboring pixels, MORF creates projections by summing the intensities of pixels in rectangular patches. Thus the atoms of A are the vectorized representations of these rectangular patches.
A rectangular patch is fully parameterized by the location of its upper-left corner (u, v), its height h, and width w. To generate a patch, first the index of the upper left corner is uniformly sampled. Then its height and width are independently sampled from separate uniform distributions. MORF hyperparameters determine the minimum and maximum heights heights {hmin, hmax} and widths {wmin, wmax}, respectively, to sample from. Let unif{α, β} denote the discrete uniform distribution. An atom a is sampled as follows. Note that the patch cannot exceed the
data-matrix boundaries.
u ∼ unif{0,W − wmin} v ∼ unif{0, H − hmin} w ∼ unif{wmin,min(wmax,W − u)} h ∼ unif{hmin,min(hmax, H − v)}
The vectorized atom a yields a projection of the data aTxi, effectively selecting and summing pixel intensities in the sampled rectangular patch.
aT = (0, . . . , 0︸ ︷︷ ︸ W×v , 0, . . . , 0︸ ︷︷ ︸ u ,
(h−1)×W︷ ︸︸ ︷ 1, . . . , 1︸ ︷︷ ︸
w , 0, . . . , 0︸ ︷︷ ︸ W−w , . . . , 1, . . . , 1︸ ︷︷ ︸ w , 0, . . . , 0︸ ︷︷ ︸ W−w , 1, . . . , 1︸ ︷︷ ︸ w , 0, . . . , 0︸ ︷︷ ︸ W−w−u , 0, . . . , 0︸ ︷︷ ︸ W×(H−h−v) )
By constructing features in this way, MORF learns low-level features in the structured data, such as edges or corners in images. The forest can therefore learn the features that best distinguish a class. The structure of these atoms is flexible and task dependent. In the case of data lying on a cyclic manifold, the atoms can wrap-around borders to capture the added continuity. Atoms can also be used in one-dimensional arrays, such as univariate time-series data, in which case hmin = hmax = 1

heading: 3.2 FEATURE IMPORTANCE
text: One of the benefits to decision trees is that their results are fairly interpretable in that they allow for estimation of the relative importance of each feature. Many approaches have been suggested (Breiman, 2001; Lundberg & Lee, 2017) and here a projection forest specific metric is used in which the number of times a given feature was used in projections across the ensemble of decision trees is counted. A decision tree T is composed of many nodes k, each one associated with an atom a∗k and threshold that partition the feature space according to the projection a ∗ k · xi. Thus, the indices corresponding to nonzero elements of a∗k indicate important features used in the projection. For each feature j, the number of times πj it is used in a projection, across all split nodes and decision trees, is counted.
πj = ∑ T ∑ k∈T I(a∗kj 6= 0)
These normalized counts represent the relative importance of each feature in making a correct classification. Such a method applies to both SPORF and MORF , although different results between them would be expected due to different projection distributions yielding different hyperplanes.

heading: 4 SIMULATION RESULTS
text: To test MORF , we evaluate its performance in three simulation settings as compared to logistic regression (Log. Reg), linear support vector machine (Lin. SVM), support vector machine with a radial basis function kernel (SVM), k-nearest neighbors (kNN), random forest (RF), Multi-layer Perceptron (MLP), and SPORF (SPORF). For each experiment, we used our open source implementation of MORF and that of SPORF . All decision forest algorithms used 100 decision trees on the simulations. Each of the other classifiers were run from the Scikit-learn Python package (Pedregosa et al., 2011) with default parameters. Additionally, we tested against a Convolutional Neural Network (CNN) built using PyTorch (Paszke et al., 2017) with two convolution layers, ReLU activations, and maxpooling, followed by dropout and two densely connected layers. The CNN results were averaged over 5 runs for the simulations and training was stopped early if the loss plateaued.

heading: 4.1 SIMULATION SETTINGS
text: Experiment (A) is a non-Euclidean example inspired by Younes (2018). Each observation is a discretization of a circle into 100 features with two non-adjacent segments of 1’s in two differing patterns: class 1 features two segments of length five while class 2 features one segment of length four and one of length six. MORF chose one-dimensional rectangles in this setting as the observations were one-dimensional in nature. These projection patches had a width between one and fifteen pixels and each split node of SPORF and MORF considered 40 random projections. Figure 1(A) shows examples from the two classes and classification results across various sample sizes.
In experiment (B) consists of a simple 28× 28 binary image classification problem. Images in class 0 contain randomly sized and spaced horizontal bars while those in class 1 contain randomly sized and spaced vertical bars. For each sampled image, k ∼ Poisson(λ = 10) bars were distributed among the rows or columns, depending on the class. The distributions of the two classes are identical if a 90 degree rotation is applied to one of the classes. Projection patches were between one and four pixels in both width and height and each split node of SPORF and MORF considered 28 random projections. Figure 1(B) shows examples from the two classes and classification results across various sample sizes.
Experiment (C) is a signal classification problem. One class consists of 100 values of Gaussian noise while the second class has an added exponentially decaying unit step beginning at time 20.
x (0) t = t
x (1) t = u(t− 20)e(t−20) + t t ∼ N (0, 1)
Projection patches were 1D with a width between one and five timesteps. Each split node of SPORF and MORF considered the default number of random projections, the square root of the number of features. Figure 1(C) shows examples from the two classes and classification results across various sample sizes.
4.2 CLASSIFICATION ACCURACY
In all three simulation settings, MORF outperforms all other classifiers, doing especially better at low sample sizes, except the CNN for which there is no clear winner. The performance of MORF is particularly good in the discretized circle simulation for which most other classifiers perform at chance levels. MORF also performs well in the signal
classification problem although all the classifiers are close in performance. This may be because the exponential signal is prevalent throughout most of the time-steps and so perfect continuity is less relevant.

heading: 4.3 RUN TIME
text: All experiments were run on a single core CPU. MORF has train and test times on par with those of SPORF and RF and so is not particularly more computationally intensive to run. The CNN, however, took noticeably longer to run—especially in terms of training, but also in testing—in two of the three simulations. Thus its strong performance in those settings comes at an added computational cost, a typical issue for deep learning methods (Livni et al., 2014).

heading: 5 REAL DATA RESULTS

heading: 5.1 CLASSIFICATION ACCURACY
text: MORF’s performance was evaluated on the MNIST dataset, a collection of handwritten digits stored in 28 by 28 square images (Lecun et al.), and compared to the algorithms used in the simulations. 10,000 images were held out for testing and a subset of the remaining images were used for training. The results are displayed in Figure 3. All three forest algorithms were composed of 500 decision trees and MORF was restricted to use patches up to only 3 pixels in height and width. MORF showed an improvement over the other algorithms, especially for smaller sample sizes. Thus, even this trivial modification can improve performance by several percentage points. Specifically, MORF achieved a better (lower) classification error than all other algorithms besides CNNs for all sample sizes on this real data problem.

heading: 5.2 FEATURE IMPORTANCE
text: To evaluate the capability of MORF to identify importance features in manifold-valued data as compared to SPORF and RF. All methods were run on a subset of the MNIST dataset: we only used threes and fives, 100 images from each class.
The feature importance of each pixel is shown in Figure 4. MORF visibly results in a smoother pixel importance, a result most likely from the continuity of neighboring pixels in selected projections. Although Tomita et al. (2015) demonstrated empirical improvement of SPORF over RF on the MNIST data, its projection distribution yields scattered importance of unimportant background pixels as compared to RF. Since projections in SPORF have no continuity constraint, those that select high importance pixels will also select pixels of low importance by chance. This may be a nonissue asymptotically, but is a relevant problem in low sample size settings. MORF , however, shows little or no importance of these background pixels by virtue of the modified projection distribution.

heading: 6 DISCUSSION
text: The success of sparse oblique projections in decision forests has opened up many possible ways to improve axis-aligned decision forests (including random forests and gradient boosting trees) by way of specialized projection distributions. Traditional decision forests have already been applied to structured data, using predefined features to classify images or pixels. Decision forest algorithms like that implemented in the Microsoft Kinect showed great success but ignore pixel continuity and specialize for a specific data modality, namely images (Shotton et al., 2011).
We expanded upon sparse oblique projections and introduced a structural projection distribution that uses prior knowledge of the topology of a feature space. The open source implementation of SPORF has allowed for a relatively easy implementation of MORF, creating a flexible classification method for a variety of data modalities. We showed in various simulated settings that appropriate domain knowledge can improve the projection distribution to yield impressive results that challenge the strength of deep learning techniques on manifold-valued data. On the MNIST data set MORFshowed modest improvements over the other algorithms besides CNNs and smoother importance plots than the other decision forest algorithms. This is in spite of the the data set’s low resolution images which are harder for the modified projection distributions to take advantage of.
Research into other, task-specific convolution kernels may lead to improved results in real-world computer vision tasks. Such structured projection distributions, while incorporated into SPORF here, may also be incorporated into other state of the art algorithms such as XGBOOST (Chen & Guestrin, 2016).

heading: 7 APPENDIX
text: Algorithm 1 Learning a Manifold Forest decision tree. Input: (1) Dn: training data (2) d: dimensionality of the projected space, (3) fA: distribution of the atoms, (4) Θ: set
of split eligibility criteria Output: A MORF decision tree T
1: function T = GROWTREE(X,y, fA,Θ) 2: c = 1 . c is the current node index 3: M = 1 . M is the number of nodes currently existing 4: S(c) = bootstrap({1, ..., n}) . S(c) is the indices of the observations at node c 5: while c < M + 1 do . visit each of the existing nodes 6: (X′,y′) = (xi, yi)i∈S(c) . data at the current node 7: for k = 1, . . . ,K do n(c)k = ∑ i∈S(c) I[yi = k] end for . class counts (for classification) 8: if Θ satisfied then . do we split this node? 9: A = [a1 · · ·ad] ∼ fA . sample random p× d matrix of atoms 10: X̃ = ATX′ = (x̃i)i∈S(c) . random projection into new feature space 11: (j∗, t∗) = findbestsplit(X̃,y′) . Algorithm 2 12: S(M+1) = {i : aj∗ · x̃i ≤ t∗ ∀i ∈ S(c)} . assign to left child node 13: S(M+2) = {i : aj∗ · x̃i > t∗ ∀i ∈ S(c)} . assign to right child node 14: a∗(c) = aj∗ . store best projection for current node 15: τ∗(c) = t∗ . store best split threshold for current node 16: κ(c) = {M + 1,M + 2} . node indices of children of current node 17: M = M + 2 . update the number of nodes that exist 18: else 19: (a∗(c), τ∗(c), κ∗(c)) = NULL 20: end if 21: c = c+ 1 . move to next node 22: end while 23: return (S(1), {a∗(c), τ∗(c), κ(c), {n(c)k }k∈Y} m−1 c=1 ) 24: end function
Algorithm 2 Finding the best node split. This function is called by growtree (Alg 1) at every split node. For each of the p dimensions in X ∈ Rp×n, a binary split is assessed at each location between adjacent observations. The dimension j∗ and split value τ∗ in j∗ that best split the data are selected. The notion of “best” means maximizing some choice in scoring function. In classification, the scoring function is typically the reduction in Gini impurity or entropy. The increment function called within this function updates the counts in the left and right partitions as the split is incrementally moved to the right. Input: (1) (X,y) ∈ Rp×n × Yn, where Y = {1, . . . ,K} Output: (1) dimension j∗, (2) split value τ∗
1: function (j∗, τ∗) = FINDBESTSPLIT(X,y) 2: for j = 1, . . . , p do 3: Let x(j) = (x(j)1 , . . . , x (j) n ) be the jth row of X. 4: {mji}i∈[n] = sort(x(j)) . m j i is the index of the i
th smallest value in x(j) 5: t = 0 . initialize split to the left of all observations 6: n′ = 0 . number of observations left of the current split 7: n′′ = n . number of observations right of the current split 8: if (task is classification) then 9: for k = 1, . . . ,K do
10: nk = ∑n i=1 I[yi = k] . total number of observations in class k 11: n′k = 0 . number of observations in class k left of the current split 12: n′′k = nk . number of observations in class k right of the current split 13: end for 14: end if 15: for t = 1, . . . , n− 1 do . assess split location, moving right one at a time 16: ({(n′k, n′′k)}, n′, n′′, ymjt ) = increment({(n ′ k, n ′′ k)}, n′, n′′, ymjt ) 17: Q(j,t) = score({(n′k, n′′k)}, n′, n′′) . measure of split quality 18: end for 19: end for 20: (j∗, t∗) = argmax
j,t Q(j,t)
21: for i = 0, 1 do ci = mj ∗
t∗+i end for 22: τ∗ = 12 (x (j∗) c0 + x (j∗) c1 ) . compute the actual split location from the index j∗ 23: return (j∗, τ∗) 24: end function

Review summaries:
This paper proposed a new method called manifold forest to improve decision forest (DF) classification results. It is motivated by that, natural data is often in some manifold but not randomly distributed. It showed how to use the 2D spatial structures of natural images by constructing structured atoms. Results on 3 toy examples and MNIST showed the better performance than standard RF and SPORF.

The goal of the paper is clear. However, the proposed method has only a very incremental novelty compared to SPORF and the previous approaches in computer vision (e.g., Shotton et al., 2011). Although the authors claim the method can take advantage of structure in all kinds of data, the only conducted experiment is on the image data which is fairly limited.