Bayesian tree aggregation in decision forests to increase detection of rare malware

In one embodiment, a computing device provides a feature vector as input to a random decision forest comprising a plurality of decision trees trained using a training dataset, each decision tree being configured to output a classification label prediction for the input feature vector. For each of the decision trees, the computing device determines a conditional probability of the decision tree based on a true classification label and the classification label prediction from the decision tree for the input feature vector. The computing device generates weightings for the classification label predictions from the decision trees based on the determined conditional probabilities. The computing device applies a final classification label to the feature vector based on the weightings for the classification label predictions from the decision trees.

TECHNICAL FIELD

The present disclosure relates generally to computer networks, and, more particularly, to the dynamic tracking and/or modeling of systems according to risk level.

BACKGROUND

Enterprise networks are carrying a very fast growing volume of both business and non-business critical traffic. Often, business applications such as video collaboration, cloud applications, etc., use the same hypertext transfer protocol (HTTP) and/or HTTP secure (HTTPS) techniques that are used by non-business critical web traffic.

Beyond the various types of legitimate application traffic in a network, some network traffic may also be malicious. For example, some traffic may seek to overwhelm a service by sending a large number of requests to the service. Such attacks are also sometimes known as denial of service (DoS) attacks. Other forms of malicious traffic may seek to exfiltrate sensitive information from a network, such as credit card numbers, trade secrets, and the like. Typically, such traffic is generated by a client that has been infected with malware. Thus, further types of malicious network traffic include network traffic that propagate the malware itself and network traffic that passes control commands to already infected devices.

DESCRIPTION OF EXAMPLE EMBODIMENTS

Overview

According to one or more embodiments of the disclosure, a computing device provides a feature vector as input to a random decision forest comprising a plurality of decision trees trained using a training dataset, each decision tree being configured to output a classification label prediction for the input feature vector. For each of the decision trees, the computing device determines a conditional probability of the decision tree based on a true classification label and the classification label prediction from the decision tree for the input feature vector. The computing device generates weightings for the classification label predictions from the decision trees based on the determined conditional probabilities. The computing device applies a final classification label to the feature vector based on the weightings for the classification label predictions from the decision trees.

Description

2.) Site Type B: a site connected to the network using two MPLS VPN links (e.g., from different service providers), with potentially a backup link (e.g., a 3G/4G/LTE connection). A site of type B may itself be of different types:

2a.) Site Type B1: a site connected to the network using two MPLS VPN links (e.g., from different service providers), with potentially a backup link (e.g., a 3G/4G/LTE connection).

2c.) Site Type B3: a site connected to the network using two links connected to the public Internet, with potentially a backup link (e.g., a 3G/4G/LTE connection).

Notably, shared-media mesh networks, such as wireless networks, etc., are often on what is referred to as Low-Power and Lossy Networks (LLNs), which are a class of network in which both the routers and their interconnect are constrained. In particular, LLN routers typically operate with highly constrained resources, e.g., processing power, memory, and/or energy (battery), and their interconnections are characterized by, illustratively, high loss rates, low data rates, and/or instability. LLNs are comprised of anything from a few dozen to thousands or even millions of LLN routers, and support point-to-point traffic (e.g., between devices inside the LLN), point-to-multipoint traffic (e.g., from a central control point such at the root node to a subset of devices inside the LLN), and multipoint-to-point traffic (e.g., from devices inside the LLN towards a central control point). Often, an IoT network is implemented with an LLN-like architecture. For example, as shown, local network160may be an LLN in which CE-2 operates as a root node for nodes/devices10-16in the local mesh, in some embodiments.

In general, traffic analysis process248may execute one or more machine learning-based classifiers to classify traffic in the network for any number of purposes. In one embodiment, traffic analysis process248may assess captured telemetry data regarding one or more traffic flows, to determine whether a given traffic flow or set of flows are caused by malware in the network, such as a particular family of malware applications. Example forms of traffic that can be caused by malware may include, but is are not limited to, traffic flows reporting exfiltrated data to a remote entity, spyware or ransomware-related flows, command and control (C2) traffic that oversees the operation of the deployed malware, traffic that is part of a network attack, such as a zero day attack or denial of service (DoS) attack, combinations thereof, or the like. In further embodiments, traffic analysis process248may classify the gathered telemetry data to detect other anomalous behaviors (e.g., malfunctioning devices, misconfigured devices, etc.), traffic pattern changes (e.g., a group of hosts begin sending significantly more or less traffic), or the like.

Traffic analysis process248may employ any number of machine learning techniques, to classify the gathered traffic data. In general, machine learning is concerned with the design and the development of techniques that receive empirical data as input (e.g., telemetry data regarding traffic in the network) and recognize complex patterns in the input data. For example, some machine learning techniques use an underlying model M, whose parameters are optimized for minimizing the cost function associated to M, given the input data. For instance, in the context of classification, the model M may be a straight line that separates the data into two classes (e.g., labels) such that M=a*x+b*y+c and the cost function is a function of the number of misclassified points. The learning process then operates by adjusting the parameters a,b,c such that the number of misclassified points is minimal. After this optimization/learning phase, traffic analysis248can use the model M to classify new data points, such as information regarding new traffic flows in the network. Often, M is a statistical model, and the cost function is inversely proportional to the likelihood of M, given the input data.

The performance of a machine learning model can be evaluated in a number of ways based on the number of true positives, false positives, true negatives, and/or false negatives of the model. For example, the false positives of the model may refer to the number of traffic flows that are incorrectly classified as malware-generated, anomalous, etc. Conversely, the false negatives of the model may refer to the number of traffic flows that the model incorrectly classifies as normal, when actually malware-generated, anomalous, etc. True negatives and positives may refer to the number of traffic flows that the model correctly classifies as normal or malware-generated, etc., respectively. Related to these measurements are the concepts of recall and precision. Generally, recall refers to the ratio of true positives to the sum of true positives and false negatives, which quantifies the sensitivity of the model. Similarly, precision refers to the ratio of true positives the sum of true and false positives.

In some cases, traffic analysis process248may assess the captured telemetry data on a per-flow basis. In other embodiments, traffic analysis248may assess telemetry data for a plurality of traffic flows based on any number of different conditions. For example, traffic flows may be grouped based on their sources, destinations, temporal characteristics (e.g., flows that occur around the same time, etc.), combinations thereof, or based on any other set of flow characteristics.

As shown inFIG. 3, various mechanisms can be leveraged to capture information about traffic in a network, such as telemetry data regarding a traffic flow. For example, consider the case in which client node10initiates a traffic flow with remote server154that includes any number of packets302. Any number of networking devices along the path of the flow may analyze and assess packet302, to capture telemetry data regarding the traffic flow. For example, as shown, consider the case of edge router CE-2 through which the traffic between node10and server154flows.

In some embodiments, a networking device may analyze packet headers, to capture feature information about the traffic flow. For example, router CE-2 may capture the source address and/or port of host node10, the destination address and/or port of server154, the protocol(s) used by packet302, or other header information by analyzing the header of a packet302. Example captured features may include, but are not limited to, Transport Layer Security (TLS) information (e.g., from a TLS handshake), such as the ciphersuite offered, user agent, TLS extensions, etc., Hypertext Transfer Protocol (HTTP) information (e.g., URI, etc.), Domain Name System (DNS) information, or any other data features that can be extracted from the observed traffic flow(s).

In further embodiments, the device may also assess the payload of the packet to capture information about the traffic flow. For example, router CE-2 or another device may perform deep packet inspection (DPI) on one or more of packets302, to assess the contents of the packet. Doing so may, for example, yield additional information that can be used to determine the application associated with the traffic flow (e.g., packets302were sent by a web browser of node10, packets302were sent by a videoconferencing application, etc.).

The networking device that captures the flow telemetry data may also compute any number of statistics or metrics regarding the traffic flow. For example, CE-2 may determine the start time, end time, duration, packet size(s), the distribution of bytes within a flow, etc., associated with the traffic flow by observing packets302. In further examples, the capturing device may capture sequence of packet lengths and time (SPLT) data regarding the traffic flow, sequence of application lengths and time (SALT) data regarding the traffic flow, or byte distribution (BD) data regarding the traffic flow.

As noted above, one potential machine learning-based approach to traffic classification (e.g., to detect malware, etc.) leverages the use of a random decision forest to assess an input feature vector of one or more characteristics of the network traffic. Generally, a random decision forest comprises a plurality of uncorrelated decision trees, whereby nodes in a given tree represent decisions/conditions that are applied to the input feature(s). Thus, a path of a decision tree represents a set of applied decisions/conditions that, once applied, can be used to predict outcomes given the input feature(s).

FIG. 4illustrates an example random decision forest classifier400, according to various embodiments. In some embodiments, traffic analysis process248may use the random decision forest classifier400to determine a classification label for observed traffic in the network based on an input feature vector of the characteristics of the traffic. In a simplistic case, the classification labels may simply be “benign” or “malicious.” However, more complicated, multi-class classifiers may also be used, e.g., to distinguish between different types of malware, etc.

As shown, random forest classifier400may comprise any number of decision trees404(e.g., a first through nthdecision tree) each configured to generate classification label predictions406based on input402. More specifically, as would be appreciated by one skilled in the art, nodes in decision trees404may correspond to different decisions/conditions that can be applied to input402. Probabilities can then be assigned, based on the results of these decisions/conditions.

Training of decision trees404may be achieved using a technique referred to as ‘bagging.’ In particular, given a training dataset, each tree may be trained using a random subset of the training dataset that is sampled from the training dataset. Doing so increases the independence of the individual decision trees404. The portion of the training dataset that is not used to train a given decision tree404is referred to as the ‘out of bag (OOB)’ dataset, which is typically different for each decision tree400.

As each decision tree404generates its own classification label predictions406based on input402, random decision forest400may also include a ‘voting’ process408. During execution, voting process408may determine a final classification label410for input402, based on the classification label predictions406from the individual decision trees404.

More formally, the prediction406of the ithdecision tree404in the forest of N-number of trees may be denoted as ti(x), where x is the data object to be classified from input402. Further, let Y={y1, y2, . . . , yK} be the set of K-number of possible classification labels that forest400may apply, where K=|Y|. An additional notation that may be used to formally describe random decision forest400is I( ) which denotes an indicator function that equals one if the condition in argument is true and zero, otherwise. In many cases, voting process408is configured to use majority voting among the classification label predictions406from decision trees404. Using the notation above, this can be expressed as the formula:
argmaxy∈YΣi=1NI(ti(x)=y))  (Equation 1)
That is, input data feature vector x is classified with the classification label that received the most ‘votes’ from the ensemble of trees404(e.g., from classification label predictions406).

Majority voting and other similar voting mechanisms for random decision forests, such as soft voting, do not take into account the prevalence of specific classes in the data and the possibility that the classes are imbalanced. Both issues are often present in the context of intrusion and malware detection, where the proportion of benign traffic to malware-related traffic is strongly imbalanced. By using an approach such as majority voting in these situations, it has been found that the resulting classifier suffers considerably in terms of recall.

One potential alternative to majority voting would be to use thresholding to determine the final classification label. In this approach, the classification label predictions that receive a number of votes above a predefined threshold will be used as the final classification label. However, this approach is often limited to two-class classifiers and becomes increasingly more difficult to implement in higher order classifiers.

Bayesian Tree Aggregation in Decision Forests to Increase Detection of Rare Malware

The techniques herein introduce a new aggregation mechanism that is particularly suited for use in random decision forest classifiers with imbalanced classes. This is often the case with respect to intrusion/malware detection in a network. However, such situations may also occur in other endeavors such as the diagnosis of rare diseases, telecommunications, web analysis, ecology and biology modeling, and in any other field in which the number of objects of interest is in the minority. In certain aspects, the techniques herein change the functioning of a random decision forest by employing voting weightings based on the posterior prediction probabilities of the decision trees. These posterior prediction probabilities can be estimated, for example, by leveraging the OOB datasets for the trees, which is typically ignored with other voting mechanisms.

Specifically, according to one or more embodiments of the disclosure as described in detail below, a computing device provides a feature vector as input to a random decision forest comprising a plurality of decision trees trained using a training dataset, each decision tree being configured to output a classification label prediction for the input feature vector. For each of the decision trees, the computing device determines a conditional probability of the decision tree based on a true classification label and the classification label prediction from the decision tree for the input feature vector. The computing device generates weightings for the classification label predictions from the decision trees based on the determined conditional probabilities. The computing device applies a final classification label to the feature vector based on the weightings for the classification label predictions from the decision trees.

Illustratively, the techniques described herein may be performed by hardware, software, and/or firmware, such as in accordance with the traffic analysis process248, which may include computer executable instructions executed by the processor220(or independent processor of interfaces210) to perform functions relating to the techniques described herein.

Operationally, and referring again toFIG. 4, the techniques herein introduce a voting mechanism for the aggregation of predictions of individual decision trees in a decision forest classifier. Preliminary testing has shown these techniques to be very well suited for multi-class classification and for datasets with imbalanced classes (e.g., the number of samples/objects in each class varies significantly). However, the voting mechanism can also be used to aggregate any predictions from a collection of independent classifiers, in further implementations.

In one aspect of the techniques herein, the conditional probability may be computed of the true label y given the predictions of the individual decision trees404. Using the formulation above, this means that the sample x is now classified as having the class label with maximal probability expressed by formula:
argmaxy∈YP(y|t1(x), . . .tN(x))  (Equation 2)
Note that instead of computing the probability of the class label given the sample/object x itself, the system may instead compute the posterior given the prediction ti(x) obtained from the ithdecision tree404.

Using Bayes' theorem, Equation 2 can be transformed into the following:

Note that the denominator in Equation 3 is constant, which means that it does not depend on the true label y. Since only the value for which Equation 3 is maximized is of interest, the denominator of Equation 3 can be ignored, leading to the following expression to be maximized:
argmaxy∈YP(y)*P(t1(x), . . .tN(x)|y)  (Equation 4)

Independence is also assumed between decision trees404. This is a fair assumption as the bagging training process also constructs decision trees404in a manner that greatly reduces correlation between individual trees. If such an assumption is made, Equation 4 can be written as follows:
argmaxy∈YP(y)*Πi=1NP(ti(x)|y)  (Equation 5)

As in a Naïve Bayes classifier, in order to prevent arithmetic underflows, Equation 5 can be adjusted to instead compute the sum of logarithms as follows:
argmaxy∈YlogP(y)+Σi=1Nlog(P(ti(x)|y))  (Equation 6)

In various embodiments, the above probabilities can be computed from the training dataset used to train decision trees404. Such a process can be performed either on the device executing random decision forest400, or elsewhere, to populate a lookup table accessible by voting process408. More specifically, the probability P(y) is the prevalence of the class with label y and equals the fraction of objects with label y related to all the objects in the training dataset. Note that the higher the number of independent predictors given Equation 6, the lower the influence of the prior.

In some embodiments, P(ti(x)|y) may be computed leveraging the OOB dataset from the training dataset. For example, once a given decision tree404is trained using a randomly selected portion of the training dataset, that decision tree can then be used to classify those portions of the training dataset that were not used to train that tree (e.g., OOB dataset). Knowing the true labels for the training dataset, a confusion matrix can then be computed from these results, which indicates the misclassifications by that decision tree.

Formulaically, let cklbe the element of the confusion matrix for tree i, where k refers to the true class label and l is the prediction label. Then, ck,lequals the number of objects that were classified as class l but their true label is class k, giving the following expression:

Because the probabilities computed from the confusion matrices are merely estimates of the true underlying probabilities, it is reasonable to set the lower bound for the probability estimate to a small non-zero value if the computed probability is zero. Otherwise, if this is not done, there would be a multiplication by zero in Equation 5 and a single prediction from a single decision tree404would cause the whole expression for the class y to be zero.

By way of example, consider the following confusion matrix for a single decision tree404, with three possible classes, as follows:

The rows in the confusion matrix shown in Table 1 above represent the true classification label and the columns represent the classification label predictions from the decision tree under analysis. The probabilities P(ti(x)|y) given in Equation 7 above are computed as follows:
P(1|1)=1/(1+10+2)=0.077
P(1|2)=10/(10+300+5)=0.032
P(1|3)=5/(5+20+1)=0.192
P(2|1)=10/(1+10+2)=0.769
P(2|2)=300/(10+300+5)=0.952
P(2|3)=20/(5+20+1)=0.769
P(3|1)=2/(1+10+2)=0.153
P(3|2)=5/(10+300+5)=0.016
P(3|3)=1/(5+20+1)=0.038

The first column in the confusion matrix of Table 1 represents the number of objects from classes 1, 2 and 3, but classified by the decision tree as being from class 1. In simple terms, P(1|3), for example, expresses how probable it is to see a prediction ti(x)=1 predicted by the ithtree if the true class is y=3.

By applying the estimated probabilities P(1|1), P(1|2), P(1|3) to Equation 5, it can be seen that the class with the highest weight is the class number 3, even if most of the objects predicted as class 1 come from the class 2. That is, these probabilities do not depend on the number of samples in a class. The reasoning for this, in the case of imbalanced classes, is that the probability of seeing an object from a class with minority of samples is lower, as well as the posterior probabilities P(y|x) commonly predicted by the decision trees404. Thus, the aggregation effectively removes the imbalance since each prediction is related to the object counts in a class. Note that if the number of objects in each class is balanced, class with highest number of objects (y=2) would be preferred and the mechanism would behave as expected.

The class prior probabilities can be also computed from the confusion matrix as:
P(1)=(1+10+2)/(5+20+1+10+300+5+1+10+2)=0.037
P(2)=(10+300+5)/(5+20+1+10+300+5+1+10+2)=0.890
P(3)=(5+20+1)/(5+20+1+10+300+5+1+10+2)=0.073

As an example, if forest400has a single decision tree404, evaluation of Equation 5 would result in the following for each class probability:
y=1:P(1)*P(1|1)=0.037*0.077=0.003
y=2:P(2)*P(1|2)=0.890*0.032=0.028
y=3:P(3)*P(1|3)=0.073*0.192=0.014

Here, the maximum weighting value occurs for class y=2, because there is only one predictor and the influence of the prior is strong.

In another example, the situation changes if the number of trees404(independent predictors) in forest400increases. For simplicity, assume that forest400has ten decision trees404, each with the same confusion matrix predicting the same class. In such a case, evaluation of Equation 5 would result in the following:
y=1:P(1)*P(1|1)10=0.037*0.07710=5.35E-13
y=2:P(2)*P(1|2)10=0.890*0.03210=1.00E-15
y=3:P(3)*P(1|3)10=0.073*0.19210=4.97E-09

That is, since there are now more independent predictors (e.g., decision trees404), the prior P(y) is of less importance and the final prediction changes to class y=3.

FIG. 5illustrates an example plot500of class imbalances among a training dataset. To test the efficacy of the techniques herein, several experiments were conducted with multi-class classification of network traffic for purposes of malware detection. In particular, 86 different malware classes were defined, ranging from spam tracking, to ad injectors, to fraudulent data extractors. A further class was defined to represent the benign network and this was by far the majority class with an imbalance ratio of at least 1:100. In other words, there were at least 100 times more benign traffic requests than malware requests. The class imbalance between positive classes can be clearly seen in plot500, with the y-axis of plot500being on a logarithmic scale.

The training dataset was formed from traffic proxy logs recorded over the span of three days and included 3,359,466 objects (note: the benign/negative set was down-sampled). Test data was then collected thereafter on a single day and included 10,895,786 objects. Using the training dataset, a random decision forest with twenty decision trees was trained and evaluated against the test set. For each class, precision and recall was computed individually. The average precision and recall over all of the malware classes was then computed using a soft voting mechanism and again using a mechanism that employs the Bayesian tree techniques herein, as shown below:

Thus, as shown in Table 2, preliminary results indicate that the techniques herein provide a significant increase in recall (7%), with only a slight decrease in the precision. It is possible that some of the incorrect classifications can still originate from malware, but further investigation of these misclassifications was not performed. Therefore, the precision can be viewed as the lower bound.

FIG. 6illustrates an example simplified procedure for classifying an input feature vector using a random decision forest, in accordance with one or more embodiments described herein. For example, a non-generic, specifically configured device (e.g., device200) may perform procedure600by executing stored instructions (e.g., process248). The procedure400may start at step605, and continues to step610, where, as described in greater detail above, the computing device may provide a feature vector as input to a random decision forest. In various embodiments, the decision forest may comprise a plurality of decision trees trained using a training dataset. Each decision tree in the forest may generally be configured to output a classification label prediction for the input feature vector.

At step615, as detailed above, the computing device may determine, for each of the decision trees, a conditional probability of the decision tree based on the true classification label and the classification label prediction from the decision tree for the input feature vector. In various embodiments, the computing device may determine such values by performing a lookup of a lookup table. Such a table may be populated, for example, by evaluating, for each of the decision trees, the portion of the training dataset that was not used to train that decision tree. In other words, the out of bag (OOB) dataset may be leveraged to determine reasonable estimates of these probabilities.

At step620, the computing device may generate weightings for the classification label predictions from the decision trees based on the determined conditional probabilities, as described in greater detail above. In particular, rather than employing an equal weighting, such as in the case of majority voting, the predictions from the different decision trees can be weighted according to their estimated posterior prediction probabilities determined from their OOB datasets.

At step625, as detailed above, the computing device may apply a final classification label to the feature vector based on the weightings for the classification label predictions from the decision trees. For example, in the case of detecting malware, the computing device may classify a traffic flow or set of traffic flows as indicative of a particular type of malware. Procedure600then ends at step630.

The techniques described herein, therefore, introduce a voting/aggregation mechanism for a decision forest that is able to take into account the class imbalance during the prediction aggregation. In some aspects, the mechanism naturally incorporates the prior probability, which is used as a trade-off between recall and precision in situations when the number of predictors is low. Further, the techniques herein leverage information from the OOB datasets, to estimate the posterior prediction probabilities and increase recall of the classifier. The techniques herein are also better able to handle multi-class problems versus score/prediction thresholding, which require manual threshold adjustments. Further, no misclassifications costs have to be set in order to treat the imbalance classes. The techniques also work without any modifications for balanced classes and can also work with any ensemble model.

While there have been shown and described illustrative embodiments that provide for a voting/aggregation mechanism for a decision forest, it is to be understood that various other adaptations and modifications may be made within the spirit and scope of the embodiments herein. For example, while certain embodiments are described herein with respect to using certain models for purposes of malware detection, the models are not limited as such and may be used for other functions, in other embodiments. In addition, while certain protocols are shown, such as HTTP and HTTPS, other suitable protocols may be used, accordingly.