Pattern recognizing method and apparatus

Abstract: A pattern recognizing apparatus comprises a feature vector extractor to extract a feature vector of an input pattern; a converting unit to convert the feature vector extracted by the feature vector extractor into the feature vector which is effective for selection between categories; a classification processing unit for calculating an inner product with a predetermined basic vector for the converted vector after the conversion was performed by the converting unit; and a category selecting unit for selecting and outputting a category group to which the input pattern belongs with reference to a predetermined category table on the basis of the result of the calculation by the classification processing unit.

Description: The present invention relates to a pattern recognition apparatus and method having a function such that for an unknown input vector, by outputting a group of categories to which the input vector belongs, the number of candidate categories to which the input vector belongs can be reduced. In a conventional pattern recognition apparatus, in the case where the number of categories as targets for recognition is very large, for an input vector, it is not compared with all of the standard patterns as candidates but there are executed processes such that a predetermined arithmetic operation of a small amount of calculations is executed first and a group of categories which can be determined such that the input vector belongs to such a category group are selected with reference to a table in accordance with the values of the results of the arithmetic operations and the categories included in the category group are output as candidates. Such processes are generally called a narrow-down or classification of the candidates. Since the number of candidate categories is reduced by such a classification process, the whole processing time can be reduced. Examples of such a classification will now be described in detail hereinbelow. Fig. 8 shows a construction of a conventional apparatus for recognizing characters. In the diagram, reference numeral 71 denotes an input unit for converting a document image as a target for recognition into an electric signal; 72 a feature extractor for extracting a feature that is peculiar to a character from an input signal from the input unit 71 every character and for producing a feature vector; 75 to 78 portions to execute a classification process; 76 a parameter memory in which parameters for the classification process have been stored; 75 a classification processing unit; 78 a category table; 77 a category table reference unit for referring to the category table 78 from the result of the classification process; 80 a dictionary in which standard patterns of all of the candidate categories as targets for recognition have been stored as mean vectors; 79 a comparator for selecting the category, as a recognition result, which gives the smallest distance between the standard vector in the dictionary 80 and the input vector; and 81 an output unit for outputting the candidate category which was finally selected by the comparator 79. It is an object of the classification to reduce the number of categories which can become the candidates by a small calculation amount as small as possible. However, in general, even in case of samples which belong to the same category, they are distributed so as to have a certain degree of variance. Fig. 9 is a diagram schematically showing a state of each category distribution in the case where the number of dimensions of the feature vector is set to 2. The sampling data is distributed to an area around the category mean vector while having variances such as C1, C2, .... To narrow down the number of categories, there is considered a case of dividing the category by planes which perpendicularly cross in a space of Fig. 9 (generally, assuming that the number of dimensions of the feature vector is set to N, N-dimensional hyperplane). When considering the case of separating by the hyperplane, it is efficient to set the plane that is perpendicular to a direction such that the variance is as large as possible. Therefore, the main component is first analyzed for the mean vector of each category and the upper L eigenvectors among the eigenvectors which are obtained as a result of the analysis are set to basic vectors e i (i = 1, 2, ..., L) of the hyperplane. The above eigenvectors have the same values as those of the eigenvectors of an inter-category covariance matrix S B . The definition of the inter-category covariance matrix S B is given by the following equation. X ( k ): mean vector of a category k X T : whole mean vector of all samples prime('): transposition value In the example of Fig. 9, four spaces E 1 , E 2 , E 3 , and E 4 are obtained by the upper two basic vectors e 1 and e 2 (Fig. 10). The space to which each sample belongs is previously examined with respect to all of the study samples. In the case where even a small number of study samples are included in each space, it is regarded that the category to which the study samples belong is included in such a space, so that each space and the category to which the study samples belong are registered into a table. For the input of an unknown feature vector X , a scalar product operation with the basic vectors e i is performed by the classification process in the classification processing unit 75, the space to which X belongs is examined, and the above table is referred, so that the categories can be narrowed down. Only the categories which were narrowed down are compared with the dictionary 80 by the comparator 79. The optimum category is output by the output unit 81. In the conventional method as mentioned above, however, there are drawbacks such that the intra-category covariance matrix is larger as compared with the inter-category covariance matrix and an anisotropy of the intra-category covariance matrix is strong, the number of categories included in each divided space is large, so that the number of categories cannot be efficiently narrowed down. Fig. 11 is a schematic diagram showing an example in such a case. Since the overlap between the categories is large, it is difficult to efficiently separate those categories by the hyperplane. It is an object of the present invention to provide a pattern recognition method and an apparatus which can efficiently narrow down the number of categories even in cases in consideration of the above problem. According to the present invention, as set forth in the accompanying claims, a feature vector is extracted and is converted to effect separation between categories, a scalar product operation with a predetermined basic vector is executed and a category table is then referred to. Due to this, the foregoing conventional problems can be solved and, even in a case as shown in Fig. 11, the number of categories can be efficiently narrowed down. In an embodiment of the invention, after a conversion such that a mean distribution matrix S w of each intra-category covariance matrix becomes a unit matrix has been performed, the categories are separated by a hyperplane. Therefore, only the categories which are presumed such that an input vector belongs can be efficiently narrowed down from a number of candidate categories, so that there is an effect such that a pattern can be recognized by a smaller calculation amount. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing a construction of a pattern recognition apparatus of the first embodiment of the present invention; Fig. 2 is a flowchart for the first embodiment of the invention; Fig. 3 is a diagram for explaining the normalization of a character image; Fig. 4 is a memory map showing a structure of a category table in Fig. 1; Fig. 5 is a conceptual diagram for explaining a state of conversion in the first embodiment; Fig. 6 is a schematic diagram for explaining the separation of categories according to the first embodiment; Fig. 7 is a constructional block diagram of the pattern recognition apparatus of the embodiment; Fig. 8 is a block diagram showing a construction of a conventional pattern recognition apparatus; Fig. 9 is a schematic diagram for explaining the separation of categories in the conventional apparatus; Fig. 10 is a schematic diagram for explaining the separation of categories in the conventional apparatus; and Fig. 11 is a schematic diagram showing an example in the case where it is difficult to separate categories. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of the present invention will be described in detail hereinbelow with reference to the drawings. Fig. 1 shows a construct on of a pattern recognition apparatus of an embodiment of the invention. In the diagram, reference numeral 11 denotes an input unit for converting a document image as a target for recognition into an electric signal; 12 a feature extractor for extracting a feature that is peculiar to a character from an input signal from the input unit 11 every character and for producing a feature vector; 13 a conversion unit for acting a predetermined conversion matrix on an input vector, thereby converting; 14 a conversion matrix memory to store the conversion matrix; 15 to 18 portions for performing a classification process; 16 a parameter memory in which parameters for the classification process have been stored; 15 a classification processing unit; 18 a category table; 17 a category table reference unit for referring to the category table 18 from the result of the classification process; 20 a dictionary in which standard patterns of all candidate categories as targets for recognition have been stored as mean vectors; 19 a comparator for selecting the category which gives the smallest distance between the standard vector in the dictionary 20 and the input vector as a recognition result; and 21 an output unit for outputting the candidate category which was finally selected by the comparator 19. First, a method of obtaining the conversion matrix and parameters for a classification process will be described. In a case as shown in Fig. 10, since the intra-category covariance matrix is larger as compared with the inter-category covariance matrix and an anisotropy of the intra-category covariance is strong, according to the conventional technique, it is difficult to separate each category by a hyperplane. According to the embodiment, therefore, after a conversion such that the mean covariance matrix S w of each intra-category covariance matrix becomes a unit matrix has been performed, the categories are separated by using a hyperplane. The distribution of the category k is approximately expressed by a covariance matrix of the following equation. X ( k ): mean vector of the category k n( k ): the number of study samples of the category k On the other hand, for a covariance matrix S k ( k = 1, ..., C: C denotes the number of categories) of the category k , an intra-mean category covariance matrix S w , is defined by the following equation. S W = (1/C) k=1 c S k Now, assuming that the number of dimensions of X is set to N, the following conversion is executed. A = UM -1/2 U' (in this instance, A' = A) dot (·): value after conversion prime ('): transposition value M and U denote an eigenvalue matrix and an eigenvector matrix of S w , respectively. That is, assuming that the eigenvalues of the intra-mean category covariance matrix S w , are set to µ 1 , ..., µ N and their eigenvectors are set to  1 , ...,  N , respectively, M = diag (µ 1 , ··· , µ N ) M -1/2 = diag (1/ µ 1 , ··· , 1/ µ N ) U = ( 1 , ··· ,  N ) In this instance, it is defined by M -1/2 = diag (1/ µ 1 , ··· , 1/ µ N ) From the definitions of the eigenvalue matrix and the eigenvector matrix, S w = UMU' is obviously obtained. At this time, S w = A'S w A = UM -1/2 U'S w UM -1/2 U' = UM -1/2 U' UMU'UM -1/2 U' = UM -1/2 MM -1/2 U' = UU' = I It will be understood that, after the conversion of (1), the intra-mean category covariance matrix becomes a unit matrix as shown in Fig. 5. Fig. 6 is a schematic diagram showing a state after completion of the conversion by A. It will be understood that since a grouping degree of each category is good, the separating process by the hyperplane can be more efficiently executed. The normalization itself of the covariance matrix to the unit matrix is a well-known technique called a white coloring or "whitening" process (reference literature: Noriyuki Ohtsu, "The Mathematical Study About the Feature Extraction in the Pattern Recognition", Study Report of The Electric Overall Laboratory, July, 1981; Gala, B.E. "A data clustering algorithm for feature extraction and unsupervised learning" IEEE Proc. of the Conf. on Computer Graphics Pattern Recognition and Data Structure, 14 May 1975, Long Beach, CA, pages 323-332. The conversion matrix A is written into the conversion matrix memory 14. After all of the study samples have been converted by the conversion matrix A, the whole mean vector X ˙, and the basic vectors e i , indicative of the hyperplane to divide the space, are obtained. The basic vectors e i are determined in substantially the same manner as in the conventional method. That is, the main component is analysed for the mean vector of each category and the upper L eigenvectors among the eigenvectors which are obtained as a result of the analysis are set as the basic vectors e i (i = 1, 2, ..., L) of the hyperplane. It is efficient to set the value of L to a large value in order to reduce the number of candidate categories. However, as the value of L is large, the size of a category table, which will be explained hereinlater, increases. Therefore, L is experimentally set to an appropriate value. As an appropriate value of L in this instance, it is satisfactory to set L to a value in a range from 1/d to 1/(d+10) of the number of dimensions of the feature vector, d being any integer. The values of e i and X ˙ obtained as mentioned above are written into the parameter memory 16. On the other hand, to which one of the divided spaces all of the study samples after the conversion belong is also previously examined. In the case where even a small number of study samples are included in each space, it is regarded that the category to which the study samples belong is included in such a space. Such a relation is registered into the category table 18. Fig. 7 is a constructional block diagram of a pattern recognition apparatus as an example to embody the present invention. Reference numeral 101 denotes a CPU to control the processes of the whole apparatus. The CPU 101 executes the processes on the basis of a control program stored in an ROM 102. The control program of the flowchart of Fig. 2, the dictionary, and other data are stored in the ROM 102. An RAM 103 is used as a working memory to store data during the execution of each process. Reference numeral 104 denotes an interface for controlling the communication between another pattern recognizing apparatus and a terminal of a computer for performing image input from another apparatus, the output of the recognition result, and the like. Reference numeral 105 denotes a scanner to optically read the original image as a target for recognition; 106 an input unit such as a keyboard, or a pointing device, or other device which can input commands for starting, interruption, and instructions of various kinds of processes; and 107 a display such as a CRT or a liquid crystal display panel, for displaying an image input from a scanner or other input device, recognition results and messages issued during the recognition process. A flow of processes in the embodiment will now be described with reference to the flowchart of Fig. 2. In step S201, the document image is read by the scanner 105 and the image data is converted into binary digital image data. In step S202, a character extracting process for extracting an area of every character is executed from the read-out image data. In step S203, the image data of one character is normalized into a predetermined size. For this purpose, a buffer memory for storing the normalized image data in which a predetermined length 64 is set to one side is prepared and the image data of one character is normalized and stored. Explanation will now be made specifically with reference to Fig. 3. The data of one character of the original image is expressed by a(i, j) (0 ≤ i < w, 0 ≤ j < h). A height of character is set to h and a width is set to w. a(i, j) has a value of 1 for the black pixel and has a value of 0 for the white pixel. Now, assuming that the data after the normalization is set to b(i, j) (0 ≤ i, j < 64), it is calculated by b(i, j) = a(64 x i/w, 64 x j/h) (for all of the values of i and j which satisfy the relation of (0 ≤ i, < j 64)) After the character image has been normalised to the square in which a length of one side is equal to 64, the features are extracted in accordance with a predetermined algorithm in step S204. In the embodiment, the normalized character image is divided into (8 x 8) small areas, the number of black pixels is collected every small area, and a histogram is obtained. Since the number of black pixel is calculated for every 64 small areas, the 64-dimensional feature vector X is produced as a whole. In step S205, the conversion matrix mentioned above is operated on the extracted feature vector X , thereby obtaining the converted feature vector . In step S206, by executing the following scalar product operation to the feature vector after completion of the conversion, values p 1 , p 2 . ..., P L to search the category table are obtained. The value γ to refer to the category table is calculated by using p i as a result of the above scalar product operation in accordance with the following equation. γ = i=1 L p i ·2 i-1 γ has the values of 0 to 2 L-1 indicative of the space to which belongs. In step S207, the category table is searched by using γ. Fig. 4 shows a memory construction to explain the category table 18 in Fig. 1. From the value of γ, an address table AT[γ] is first referred. From the value of the address table AT[γ], a position 41 of a category table CT[0] is referred and the categories stored after the position 41 are set to the candidate categories. A number of m is stored at the first position 41. Subsequently, (m) codes indicative of the candidate categories are sequentially stored after a position 42. The number (m) is not constant but differs in dependence on each group. In the construction of Fig. 1, the address table AT is also stored in a predetermined area in the category table 18. The categories included in the category table CT are previously obtained by computing the reference value γ for the Study samples and by examining the space to which the value of γ belongs. Only for the (m) narrowed-down candidate categories, the feature vector is compared with the standard patterns stored in the dictionary in step S208. The category which gives the smallest distance is finally selected as a candidate category and is output in step S209. As a second embodiment, there is a method of using only the elements of a high efficiency as a classification among the elements of the original feature vector as a conversion matrix. For the 64-dimensional feature vector similar to that in the first embodiment, a degree R (j) of a sole classification efficiency of a feature axis j is defined by the following equation. R (j) = σ (j) B /σ (j) W where, σ (j) / B and σ (j) / w denote an inter-category variance by only the component of the feature axis j and an intra-mean category variance, respectively. σ (j) B = (1/C) k=1 C (X (j) (k) - X (j) T ) 2 σ (j) W = (1/C k=1 C σ (j) W (k) σ (j) W (k) = (1/n (k)) i=1 n (k) (X (j) i (k) - X (j) (k)) 2 X (j) (k) = (1/n (k)) i=1 n (k) X (j) i (k) A new feature vector is formed by only the upper L feature amounts from a larger value of R (j) . The process to calculate the scalar product by using and subsequent processes are substantially the same as those in the first embodiment. The present invention is intended as a means to narrow down the number of possible categories to which the input feature vector might belong and is not limited by the kind of input vector or category. The invention, therefore, can be applied to various recognition fields such as character, voice, or image.

Claims: A pattern recognition apparatus (11-21; 101-107) comprising: input means (11;104,105) for inputting pattern data; feature vector extraction means (12;101-103) operable upon said pattern data to extract a feature vector (X); conversion means (13,14;101-103) operable upon said feature vector (X) to produce a converted feature vector (X ˙), which conversion means uses a conversion matrix (A) chosen such that it converts an intra-mean covariance matrix (S w ) into a unit matrix (S ˙ w , I), which intra-mean covariance matrix (S w ) is determined from a plurality of covariance matrices (S k :k=1 to C) representing the covariance between the pattern recognition candidates in one (k) of the plurality of categories (1 to C) of pattern recognition canditates and a mean vector ( X (k)) for that category (k); classification processing means (15,16; 101-103) for determining the scalar products (e i .X ˙: i = 1 to L) between said converted feature vector (X ˙) and a plurality of basic vectors (e i : i = 1 to L), which basic vectors are eigenvectors (Φ 1 ,....,Φ L ) of said intra-mean covariance matrix (S w ) determined in choosing said conversion matrix (A); and category selecting means (17,18; 101-103), including a category table (18), for selecting at least one category of pattern recognition candidates from said category table (18) on the basis (γ, p i : i = 1 to L) of the determined scalar products (e i :X ˙ : i - 1 to L), wherein the category table (18) indicates which regions (E 1 ,...E N ) of hyperspace divided by hyperplanes defined by said basic vectors (e i ) overlap onto categories converted by said conversion matrix (A). Apparatus according to claim 1 which also includes: comparison means (19,20; 101-103), including a pattern dictionary (20) of pattern recognition candidates, for comparing said feature vector (X) with those candidates of the at least one selected category selected by said category selecting means, and recognising the input pattern represented by said feature vector; and output means (21;104,107) for outputting the result of comparison performed by said comparison means (19,20). Apparatus according to either of claims 1 or 2 wherein said input means (11;105) comprises a scanner (105) for inputting character text or image pattern data. Apparatus according to any of claims 1 to 3 wherein said input means (11;104) comprises means (104) of inputting voice pattern data. Apparatus according to any preceding claim, wherein said feature vector extraction means (12), said conversion means (13,14), said classification processing means (15,16), and said category selecting means (17,18) are all implemented by a programmed microcomputer (101-103). A pattern recognition method performed by: inputting pattern data; extracting a feature vector (X) from said pattern data; converting said feature vector (X) to a converted feature vector (X ˙) by matrix conversion using as conversion matrix (A) one chosen such that it converts an intra-mean covariance matrix (S w ) into a unit matrix (S ˙ w ,I), which intra-mean conversion matrix (S w ) is determined from a plurality of covariance matrices (S k : k=1 to C) representing the covariance between the pattern recognition candidates in one (k) of the plurality of categories (1 to C) of pattern recognition candidates and a mean vector ( X (k)) for that category (k); classifying said feature vector (X) by determining the scalar products (e i .X: i= 1 to L) between said converted feature vector (X) and a plurality of basic vectors (e i : i = 1 to L), which basic vectors are eigenvectors (Φ 1 ,...Φ L ) of said intra-mean covariance matrix (S w ) determined in choosing said conversion matrix (A); and selecting at least one category of pattern recognition candidates from a category table (18) on the basis of the determined scalar products, which category table indicates which regions (E 1 ,E 2 ,...) of hyperspace divided by hyperplanes defined by said basic vectors (e i ) overlap onto categories converted by said conversion matrix (A). A method according to claim 6 including a step of comparing the extracted feature vector (X) with standard pattern candidates stored in a pattern dictionary (20) for those candidates of the at least one selected category selected on the basis of said determined scalar products. A method according to either of claims 6 or 7 wherein the step of inputting pattern data is performed by optically reading character text or an image by using a scanner. A method according to either of claims 6 or 7 wherein the step of inputting pattern data is performed by inputting voice pattern data. A method according to any of claims 6 to 9 wherein said steps of extracting the feature vector, converting the feature vector, classifying the feature vector, and selecting the at least one category of pattern recognition candidates, are performed by running a program on a programmed microcomputer (101-103) comprising a microprocessor (101) and a read only memory storage medium (102). A storage medium (102) storing instructions for controlling a microprocessor (101) to carry out the method of claim 10.

Inventors: NIKI TORU, NIKI, TORU, NIKI, TORU, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1994
Main classification: G06K9
IPC codes: G06K9