Method for constructing tree structured classifiers

Abstract: Disclosed is a method for assigning features to nodes of a tree structured classifier and for determining terminal nodes in response to a training set of objects, each of such objects being determined by a plurality of features. The method comprises the steps at each node of the tree of: (1) determining a selected characteristic, such as a cost function based on the minimum description length, of the plurality of features unused at prior nodes along the path from the root to the present node; (2) assigning a feature to the node having a preferred value for the selected characteristic relative to the other features; (3) creating child nodes in response to the assigned fea­ ture; (4) for each child node, determining the selected charac­ teristic for the plurality of features unused at prior nodes and assigning a feature to the child node having a preferred value for the selected characteristic relative to the other features; (5) generating a combination of the values for the selected characteristics of the assigned features for the child nodes of the node; and (6) classifying the node as a terminal node in response to a comparison of the combination of values for the features assigned to the child nodes and the value for the feature assigned to the node.

Description: The present invention relates to constructing decision trees for classification of objects by their measured features as are commonly used in character and image recognition systems. Classification problems arise naturally in a variety of fields ranging from engineering and medicine to physics, chemistry, and biology. In most of the problems the number of the observed features may exceed hundreds or even thousands. Hence, it is inevitable that these features contain information which is either redundant or irrelevant to the classification task. Since the classifier is constructed from a finite training-set, which is often small, it is important to base the classifier only on those features whose relevance to the classification task has been clearly demonstrated by the training-set. If less relevant features are included, the danger is that the classifier will be too finely tuned to the training-set, and as a result its performance on future data will drastically deteriorate. Also there is a need to select a minimum number of relevant features motivated by economical and practical reasons; the smaller the number of features selected, the smaller is the number of measurements to be made, stored, and processed, and hence the less costly and complicated will be the classification procedure. The problem of choosing the best subset of features has been extensively investigated (see e.g. Kanal, L. (1974): "Patterns in Pattern Recognition," IEEE Trans. on Information Theory, Vol. 20, pp. 697-722). It is well known that the optimal selection rule involves an exhaustive search over all the possible feature subsets. A direct search or even more sophisticated searches using techniques such as branch and bound, Narendra, P.M. and and Fukunaga, K. (1977): "A Branch and Bound Algorithm for Feature Subset Selection," IEEE Trans. on Computers, Vol. 26, pp. 917-922, or dynamic programming, Chang, C.Y. (1973): "Dynamic Programming as Applied to Subset Selection in Pattern Recognition Systems," IEEE Trans. on Systems, Man and Cybernetics, Vol. 3, pp. 166-171, are beyond the capabilities of present day computers even for a moderate number of features. For this reason, suboptimal search procedures have been proposed. In these schemes, the best feature subset is constructed sequentially by updating the current feature subset by only one feature at a time until a chosen criterion is minimized. If the starting point is the empty set the method is referred to as "bottom up", while if the starting point is the complete set of features, the method is referred to as "top down". It should be emphasized, however, as pointed out by Elashoff, J.D., Elashoff, R.M. and Goldman, G.E. (1967): "On the Choice of Variables in Classification Problems with Dichotomous Variables," Biometrika, Vol. 54, pp. 668-670; Toussaint, G.T. (1971): "Note on Optimal Selection of Independent Binary-Valued Features for Pattern Recognition," IEEE Trans. on Information Theory, Vol. 17, p. 617; and Cover, T.M. (1974): "The Best Two Independent Measurement Are Not the Two Best," IEEE Trans. on Systems, Man and Cybernetics, Vol. 4, pp. 116-117, that sequential selection cannot guarantee optimality of the feature subset even if the features are statistically independent. Moreover, as pointed out by Cover, T.M. and Van Campenhout, J.M.V. (1977): "On the Possible Ordering in the Measurement Selection Problem," IEEE Trans. on Systems, Man and Cybernetics, Vol. 7, pp. 657-661., it is theoretically possible that these suboptimal schemes will yield even the worst possible set of features. However, such extreme cases are undoubtedly rare, and sequential approaches appear to work quite well. One sequential "bottom up" approach that leads to a very simple classification scheme is based on a decision tree. In this tree structured classification scheme, a sequence of tests, determined by a path in the tree that starts at the root, is performed. The path taken at each node depends on the result of the test performed at that node. When a terminal node is reached the object is assigned the class associated with that node. Three major problems are encountered in constructing a tree structured classifier. The first problem is how to grow the tree; that is, how to choose the features to be used for "splitting" the nodes. The second problem is how to prune the tree; that is, how to choose the terminal nodes of the tree. The third and the easiest problem is how to choose the class-tag to be associated with each terminal node. Various approaches to the construction of a tree structured classifier exist. All of them solve the last problem identically: the training-set is run through the tree and the number of samples from each class that reach the terminal nodes is counted. The class-tag assigned to a terminal node is the one with the largest count at that node. The first two problems, namely, the growing and pruning of the tree, are far more subtle and do not have a single clear-cut solution. The growing is usually done by different measures such as entropy, Lewis, P.M. (1962): "The Characteristic Selection Problem in Recognition Systems," IRE Trans. on Information theory, Vol. 8, pp. 171-178, and Casey, R.G. and Nagy, G. (1984): "Decision Tree Design Using Probabilistic Model," IEEE Trans. on Information Theory, Vol. 30, pp. 191-199, and Gini index, Breiman, L., Friedman, J.H., Olshen, R.A. and Stone, C. (1984): Classification and Regression Trees, Wadsworth, International Group, Belmont, CA, while the pruning is done by estimating the misclassification error, Mabbet, A., Stone, M. and Washbrook, K. (1980): "Cross-Validatory Selection of Binary Variables in Differential Diagnosis," Appl. Statist., Vol. 29, pp. 198-204, and Breiman et al (supra, 1984). There is no prior art method which both determines features for growing a tree and when to prune the tree. So there is always a different criteria for pruning a tree required than the criteria for growing the tree. The entropy based method selects a feature for a node that minimizes the "entropy" of the information to be stored at the node. This entropy method never indicates when it is desirable to prune the tree. The Gini index tends to find the split making the probability at nodes close to equal. It is a merely intuitive approach to growing a tree with no provable properties. Further the Gini index provides no pruning criteria. The prior pruning techniques operated by building a complete decision tree using all of the features that are measured and then collapsing the tree by examining each node and minimizing the number of misclassification errors, plus a fudge factor that is subjectively assigned to the problem most often based on the size of the tree. Subjectively assigned fudge factors must be selected by experts in the classification problem involved in order to obtain good results in most cases. Another problem with this prior approach to pruning is that predictive estimates of misclassification error cannot be obtained from the same training sample that was used to construct the tree. Thus a fresh sample is needed to determine reasonable pruning characteristics. Often this was approached in the prior art by splitting a training sample into two parts, a first part used to construct the tree and a second part to test the tree for pruning. Thus, not only is the prior approach expensive, requiring expert attention to the selection of fudge factors, but it is wasteful of statistics. The present invention provides a single criterion based upon the features in the training set for both growing and pruning the tree. The inventive method objectively grows and prunes a calssification tree based upon a training-set for any classification problem presented using in one aspect a characteristic defined as the minimum description length or, in another aspect, the related predictive minimum description length. The minimum description length and predictive minimum description length principles are described in detail in Rissanen, J, 'Minimum Description Length Principle', Encyclopaedia of Statistical Sciences , Vol V, S Kotz and N L Johnson, editors, (John Wiley and Sons, 1985, New York), pp 523 - 527; and Risannen, J, 'Stochastic Complexity and Modelling' IBM Research Report, No RJ 5002 (1986). The invention as defined in the claims can be characterised as a method of recognising characters or images by the use of a tree structured classifier wherein measured features are assigned to nodes of said tree structured classifier and terminal nodes are determined in response to a training set of objects, each of such objects being characterised by a plurality of features. The method comprises the steps at each node of the tree of: (1) for each node, determining a selected characteristic being a cost function based on minimum description length and calculated from N and NO where N equals the number of elements of the training set reaching that node, and NO equals the number of elements of these of a selected class; (2) creating a set of child nodes in response to each feature of at least a subset of the plurality of features unused at prior nodes; (3) for each child node created with respect to a feature, determining the same characteristic with respect to the numbers of elements reaching said child node; (4) generating a combination of the values for the cost function for all child nodes of the node created with respect to a feature; (5) assigning a feature to the node having a preferred value for the combination relative to the other features; and (6) when a feature has been assigned to a node, classifying the node as a terminal node in response to a comparison of the combination of values for the characteristics of the child nodes and the value for the characteristic of the node. The invention will now be more closely described with reference to the accompanying drawings, where FIGS 1A and 1B are flow charts illustrating the feature assignment and pruning methods respectively of a preferred embodiment of the present invention, FIG 2 shows two compositve digitsed fonts of the letter g used to illustrate the present invention, and FIG 3 is a chart showing a tree structured classifier. With reference to Figs 1A, the method according to the present invention of assigning features to nodes of a classification tree is described. The algorithm reads the nodes of an infinite binary tree in the following order: First the root, the the left son, the right son, the left son of the left son, the right son of the left son, etc. Notations used in describing the preferred algorithm are as follows: NODE is the current (father) node; N= # of elements reaching that node; NO = # elements of these whose class is 0. A selected characteristic, termed a cost function, having a value C for a feature used in splitting a node is defined by the following equation (1) based on the minimum description length for the feature at the node: (1) C = N h(NO/N) + (1/2)log((2N*3)/(N(N-N0)), where N*3 is the third power of N, and h(p) = - plogp - (l-p)log(l-p) . The feature assignment algorithm is initialized at a root node. The steps are outlined below as illustrated in FIG. 1A. 1. Read next feature not already assigned to nodes along the path from the current node to the root, and read its value for all elements in training sample (Block 101). 2. Determine whether there are additional features to be tested (Block 102). If none exist, then go to the next node in tree and go to Block 101 (Block 103). 3. Let NL and NR denote the number of elements in the training sample whose feature value is 0 (for left) and 1 (for right), respectively. Compute CL and CR from formula (1) with N and NO replaced by NL and NLO, respectively, and NR and NRO, respectively, and take the sum of CL + CR (Block 104). 4. Is CL + CR smallest so far found (Block 105)? 5. If yes, assign to NODE the current feature (Block 106). Return to Block 101 (Block 107). 6. If no, return to Block 101 (Block 107). The pruning algorithm for nodes of the tree to which a feature has been assigned is outlined below with reference to FIG. 1B. 1. Determine C according to equation (1) (Block 201). 2. Is C > CL + CR (Block 202)? 3. If no, make the node a leaf (prune). Go to Block 205 (Block 203). 4. If yes, go to Block 205 (Block 204). 5. Pick the next node. Go to Block 201 (Block 205). Alternatively, the cost function given by equation (1) may be replaced by the cost function given by the following equation (2) based on the predictive minimum description length for the node: (2) C = log ((N+1)!/(N0!(N-N0)!)). Because the cost C given by equations (1) and (2) is much greater than the the cost of describing features assigned to the nodes, the feature cost may be ignored in these approaches. There is a natural cost function, C(x t+1 ,x and t+1 ), called the risk, which is defined to be O, if the classification is correct; i.e. if x t+1 = x t+1 , and 1, otherwise. Hence, for the entire training sample the risk with some decision tree is the number of misclassifications that have been made. Technically, the risk function can still be represented as a predictive code length (predictive minimum description length) for a special distribution or as true prediction error, so that the first feature assignment algorithm described above applies with the modification that the cost function C no longer can be calculated from a formula but it has to be evaluated recursively at each node for each examined element in the training sample that reaches that node. (Actually, this is the way even the second of the above given cost functions (equation (2)), involving the factorials, is preferrably evaluated.) However, the numerical value of the risk is generally speaking a lot smaller than the other cost functions. This involves a complication in the pruning algorithm, because it is no longer justified to ignore the cost of encoding the features themselves that were assigned to the nodes, as was done with the previous cost functions. As a result, we shall describe a new algorithm that does the job of both of the growing and pruning algorithms. But first, we must describe the classification rule x and t+1 (x t ), where x t = x₁ , ... , x t denotes the sequence of the class tags of the past elements. We take it as the majority rule: x t+1 (x t ) = 0 if the number of 0 tags in the past sequence, n₀(x t ), satisfies the following condition: either n₀(x t ) > t/2 or in case n₀(x t ) = t/2 if n₀(x t-1 ) > t/2. Otherwise, x t+1 (x t ) = 1 . At each node we describe the recursive computation of a cost as a function of that portion x of the training sample that has so far arrived at this node. Let the feature f split x into the substring w(f), whose feature value is "white", say, and the remaining substring b(f), whose feature value under f is "black". Let z denote the next sample arriving at the node. Its feature value f(z) is either white or black depending on f. In the former case we may call the substring w(f) its "past" relative to f, and in the latter case b(f) is its past. The past of z is important, because we can use the errors that would have been made to predict the past as an indication of how well we can predict z itself. In fact, let C(w(f)) and C(b(f)), respectively, denote the risk, determined by the above described majority prediction classification rule, when the past of z is predicted, and let f* be the feature which minimizes this risk. We now define C*(xz) = C*(x) , if the prediction of the class of z is correct when the prediction is done based upon its past, determined by the winning feature f*. Otherwise, C*(xz) = C*(x) +1 . The feature assigned to the node in question is the last winning feature f* when the entire training sample has been processed. The pruning is done by the rule: Prune the tree at the first node along each path from the root where C*(X) > C(X). Here, X refers to that portion of the training sample that reaches this node. Both risks are defined above. In particular, C(X) at the root node is the risk resulting when the training sample is predicted without using any features. At the other nodes it is the risk resulting from prediction when the best feature f* is applied to its father node. Some experimental results obtained by applying the classification scheme based on equation (1) described above to an automatic character recognition problem will now be presented. We want to distinguish between two different fonts of the character g. The training-set consists of 40 scanned black-and-white images of each font, each image consisting of 1536 picture-cells (pels). Figure 2 shows a superposition of the 20 images of each font. The integers indicate the relative frequency that a given pel is black in the forty training samples of that font. Asterisks show positions which are black in all of the samples, blanks correspond to all white. Zeros stand for relative frequencies in the range of 0 to 0.1. The set of features for the classification task was defined as the binary valued content of the individual pels. The application of the splitting and pruning criteria, given in equation (1), resulted in the tree structured classifier shown in FIG. 3. The number below the interior nodes designated by circles indicate which pel is the assigned feature to be tested at the node. The number below the terminal nodes designated by squares indicate the class-tag assigned to the leaf. The numbers inside the nodes indicate the number of training samples that reached the node from each of the two classes, with the upper value indicating class 1 and the lower value indicating class 2. Using this tree to classify a new batch of 40 characters, 20 of each font, resulted in an error rate of 6.25 percent, which is rather low in view of the high variability of the samples. The present invention provides a new way to design tree structured classifiers. Unlike the existing techniques, where the node splitting and pruning rules are derived from a more or less ad hoc basis, the rules according to the preferred embodiment of the present invention result from the application of the intuitively appealing minimum description length MDL principle. According to this, the classification tree is regarded as a model, where the number of parameters grows with the number of nodes. When such a model is used to "explain" the regular features in the training set, formalized by means of the coding of the data, the complexity of the model must be included. This, then, leads to the simple nodewise criterion: compare the total code length needed to describe the class-tags at a node with the shortest combined code length of the son-nodes. If it is smaller, prune the tree at the node; otherwise, split it. The new pruning scheme is computationally simpler than the cross-validatory pruning methods of Mabbet et al (supra 1980) and Brieman et al (supra 1984). Even if one wishes to perform the pruning only after the tree has been grown to its maximum size, so as to have some look-ahead capabilities, the procedure is still simpler both conceptually and computationally. One has only to compare the code length of any internal node to the sum of the code lengths of its leaves; if it is smaller the tree is pruned at that node. This comparison can be done efficiently using the postorder data structure, wherein a node's sub-trees are inspected before the node itself is. The extension of the splitting and pruning criteria to the case of multiple classes is straightforward. Nevertheless, when the number of classes is large, the "twoing" method described in Brieman et al (supra 1984), at least for the top part of the tree, is preferred because of its efficient implementation. At each node, this scheme finds the two superclasses which in some sense are most dissimilar as well as the best split according to these two superclasses. In fact, the conglomeration of classes into superclasses is very well justified from the MDL principle point of view. Notice that the code length of the parameters grows linearly with the number of classes while the code length of the data does not necessarily decrease in such a rate. Thus, in general, it seems that the total code length is minimized if classes are grouped to superclasses. Indeed, one could even use the MDL principle to find the best superclasses.

Claims: A method of recognising characters or images by the use of a tree structured classifier wherein measured features are assigned to nodes of said tree structured classifier and terminal nodes are determined in response to a training set of objects, each of such objects being characterised by a plurality of features, comprising the steps at each node of the tree of: for each node, determining a selected characteristic being a cost function based on minimum description length and calculated from N and NO where N equals the number of elements of the training set reaching that node, and NO equals the number of elements of these of a selected class; creating a set of child nodes in response to each feature of at least a subset of the plurality of features unused at prior nodes; for each child node created with respect to a feature, determining said characteristic with respect to the numbers of elements reaching said child node; generating a combination of the values for the cost function for all child nodes of the node created with respect to a feature; assigning a feature to the node having a preferred value for the combination relative to the other features; and when a feature has been assigned to a node, classifying the node as a terminal node in response to a comparison of the combination of values for the characteristics of the child nodes and the value for the characteristic of the node. The method of claim 1, wherein the selected characteristic comprises a cost function C defined as follows: C = N h(N0/N) + (1/2)log((2N*3)/(N(N-N0))), where N*3 is the third power of N, and h(p) = -plogp - (1-p)log(1-p), where p equals N0/N . The method of claim 1, wherein the selected characteristic is a cost function based on predictive minimum description length. The method of claim 3, wherein the selected characteristic is a cost function C defined as follows: C = log ((N+1) !/(NO!(N-NO)!)), where '!' indicates the factorial operation. The method of claims 1 and 3 comprising the steps at each node of: creating child nodes in response to each feature of at least a subset of the plurality of features unused at prior nodes; for each child node, determining a prediction error; generating a sum of the prediction errors for all of the child nodes for the node with respect to one feature; assigning a feature to the node having a small sum of the prediction errors relative to the other features; determining the prediction error of the node; and classifying the node as a terminal node if the sum of the prediction errors for all of the child nodes is greater than the prediction error for the node. The method of claim 1 comprising the steps at each node of: creating child nodes in response to each feature of at least a subset of the plurality of features unused at prior nodes; for each child node, determining a minimum description length; generating a sum of the minimum description lengths for all of the child nodes for the node with respect to one feature; assigning a feature to the node having a small sum of the minimum description lengths relative to the other features; determining the minimum description length of the node; and classifying the node as a terminal node if the sum of the minimum description lengths for all of the child nodes is greater than the minimum description length for the node.

Inventors: RISSANEN JORMA JOHANNES, WAX MATI, RISSANEN, JORMA JOHANNES, WAX, MATI
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1987
Main classification: G06K9
IPC codes: G06K9, G06F7, G06T7