Abstract:
A pattern recognition apparatus includes a pattern input unit inputting pattern data and learning data, and a neural network system including a plurality of neural networks, each of the plurality of neural networks being assigned a corresponding one of a plurality of identification classes and having only two output units of a first unit (Uo1) and a second unit (Uo2). Learning for each of the plurality of neural networks is performed by using the learning data. The image recognition apparatus also includes judgment unit judging which one of the identification classes the pattern data input from the image reading unit belongs to on the basis of output values A and B from the two output units (Uo1) and (Uo2) of all neural networks.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a pattern recognition apparatus using a neural network system. This pattern recognition apparatus identifies patterns such as handwritten characters. 
     Technology relating to a pattern recognition apparatus using a neural network system has been disclosed in &#34;Character recognition system using a neural network&#34; (Yamada et. al.: Electronics Information Communications Association Bulletin PRU 88-58, pp. 79-86). This type of conventional technology uses a neural network of the layered type. This layered type of neural network has an input layer, an intermediate layer and an output layer. The output layer has the same number of output units as there are identification classes and each of the output units corresponds to one identification class. The identification class (also known as simply a &#34;class&#34;) is information that specifies a pattern that can be identified. The learning for this neural network is performed so that when the neural network receives a predetermined learning pattern corresponding to each of identification classes, only the output unit corresponding to the identification class outputs &#34;1&#34; and the other output units output &#34;0&#34;s. In such a layered type of neural network, when an unknown pattern is applied, output values within a range of &#34;0&#34; or more and &#34;1&#34; or less appear in each output unit. Then, the identification class corresponding to the one of those output units in which the greatest output value appears, is the result of recognition with respect to that unknown pattern. 
     As has been described above, in a conventional pattern recognition apparatus using a layered type of neural network in which the output layer has a number of output units equal to the number of identification classes, increasing the number of identification classes (the number of patterns to be recognized) has the following disadvantages. 
     First, the total number of links in the neural network increases to make learning difficult. 
     Second, even output values differ greatly from the values that are desired, those output values are used as the basis for the judgment. 
     In addition, the identification class to which an input pattern belongs is judged by the greatest value for the output values appearing in each of the output units and so judgment to the effect that &#34;the input pattern does not belong to any identification class&#34; must be performed on the basis of a threshold value. Furthermore, when the number of identification classes increase, it is difficult to determine the threshold value. 
     In addition, in &#34;Towards the construction of a large-scale neural network&#34; (Mori; Electronics Information Communications Association Bulletin PRU 88-59, pp. 87-94), is proposed other technology relating to pattern recognition using a neural network. 
     In this conventional technology, a plural number of small-scale neural networks (sub-nets) and a neural network (a super-net) which inputs the outputs of these sub-nets are linked in layers. Then, the output layer of the super-net has a number of output units which is the same as the number of identification classes. As has been described above, conventional pattern recognition using a neural network that is the layered linking of a super-net and sub-nets as has been described above, has the following disadvantages. First, the information that is to be output from each of the sub-nets must be determined so that the desired values are obtained from the super-net. Second, the super-net becomes very large when the number of identification classes is increased and this makes learning of the super-net difficult. 
     Accordingly, it is currently difficult to configure a high-performance and large-scale neural network. 
     In addition, the performance of pattern recognition in accordance with the output values of a super-net and judgments such as &#34;the input pattern does not belong to any identification class&#34; must be performed on the basis of a threshold value, as has been described above. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is a general object of the present invention to provide a novel and useful pattern recognition apparatus using a neural network in which the problems described heretofore are eliminated. 
     A more specific object of the present invention is to provide a pattern recognition apparatus in which the learning of the neural network is faciliated. 
     Another object of the present invention is to provide a pattern recognition apparatus that can accurately identify classes to which an input pattern relates. 
     Still another object of the present invention is to provide a pattern recognition apparatus that can determine whether or not the judgment for a class to which an input pattern relates is possible, and without such being dependent upon the use of threshold values. 
     The above objects of the present invention is achieved by a pattern recognition apparatus comprising pattern input means for inputting pattern data and learning data a neural network system including a plurality of neural networks each receiving the pattern data from the pattern input means, each of the plurality of neural networks being assigned a corresponding one of neural networks being assigned a corresponding one of a plurality of identification classes and having only two output units of a first unit (Uo1) and a second unit (Uo2), learning for each of the plurality of neural networks being performed by using the learning data belonging to one of the identification classes so that when each of the neural networks receives the learning data belonging to the corresponding one of the identification classes an output value A from the first unit (Uo1) equals to a first value V1 and an output value B from the second unit (Uo2) equals to a second value V2, when each of the neural networks receives learning data belonging to one of the identification classes other than said corresponding one of the identification classes the output value A from the first unit (Uo1) equals to the second value V2 and the output value B from the second unit (Uo2) equals to the first value V1, and judgment means for judging which one of the identification classes the pattern data from the pattern input means belongs to one the basis of output values A and B from the two output units (Uo1) and (Uo2) of all neural networks. 
     Other objects and further features of the present invention will be apparent from the following detailed description when read in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram indicating an embodiment of the pattern recognition apparatus according to the present invention; 
     FIG. 2 is a flow chart indicating an example of the processing of the pattern recognition apparatus according to the present invention; 
     FIGS. 3 through 6 are diagram indicating numerals that are the object of recognition; 
     FIG. 7 is a flow chart indicating another example of the processing of the pattern recognition apparatus according to the present invention; 
     FIG. 8 is a block diagram indicating another embodiment of the pattern recognition apparatus according to the present invention; 
     FIG. 9 is a diagram indicating the relationship between pixel patterns and direction codes; 
     FIG. 10A is a diagram indicating an example of normalized image data; 
     FIG. 10B is a diagram indicating direction codes corresponding to the image data indicated in FIG. 10A; 
     FIG. 11 is a block diagram indicating yet another embodiment of the pattern recognition apparatus according to the present invention; 
     FIG. 12 is a functional block diagram describing learning in accordance with the back propagation method; 
     FIG. 13 is a flow chart indicating relearning processing. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A description will be given of a pattern recognition apparatus according to the present invention with reference to FIGS. 1 through 5. This pattern recognition apparatus can recognize the handwritten numerals from &#34;0&#34; through &#34;9&#34;. Accordingly, the identification classes are expressed as C 0 , C.sub., . . . and C 9  corresponding to the numerals &#34;0&#34; through &#34;9&#34;. 
     FIG. 1 indicates the basic configuration of the pattern recognition apparatus according to the present invention. 
     A data input unit 11 has a scanner 12 and a preprocessing block 13. The scanner 12 optically reads patterns (numerals) written on a sheet, and outputs image data corresponding to the patterns read. The preprocessing block 13 normalizes the image data from the scanner 12 and extracts feature vectors. These feature vectors are output from the scanner 12 as data of the n&#39;th dimension. A neural network system 10 is provided with a layered type of neural network (NET i ) Each of the neural networks (NET i ) corresponds to the one of the classes C i  (i=0, 1, 2, . . . ). These neural networks (NET i ) operate in parallel and as a whole configure a single neural network system. The input layer of each of the neural networks (NET i ) has a number of input units U I1 , U I2 , . . . and U In  that is the same as the number of dimensions (n) of the feature vector output from the data input unit 11. The output layers of each of the neural networks (NET i ) has two output units U 01  and U 02 . The structure of the intermediate layer of each of the neural networks (NET i ) is determined arbitrarily and correspondingly the input layer to U In ) and output layer 1, U 02 ). The feature vector from the data input unit 11 inputs in parallel to each of the input layer of the ten neural networks NET 0 , NET 1  . . . , and NET 9 . Each of the neural networks (NET i ) has functions to judge whether or not an input feature vectors belongs to a class C i  corresponding to the neural network (NET i ). Learning for each of the neural networks (NET i ) is performed so that if predetermined learning data belongs to a class C i , the output values (A i , B i ) from the output units (U 01 , U 02 ) are (1, 0) if the learning data does not belong to the class Ci, the output values (Ai, Bi) from the output units (U o1 , U o2 ) are (0, 1). Then, if the feature vector (input data) of an image input to each of the neural networks (NET i ) has a high probability of belonging to a class C i   corresponding to that neural network (NET i ), then the relationship between the output values is A i  &gt;B i . The value for A i  is larger for the greater that probability is. The ranges of the output values A i  and B i  are 0≦A i  ≦1 and 0≦B i  ≦1. 
     A judgment unit 14 judges according to a predetermined algorithm, of the class of a numeral pattern specified by the extracted feature vector on the basis of the ten sets of output value (A i , B i ) from the neural network system 10. In addition, this judgment unit 14 also performs the &#34;the input numeral pattern does not belong to any of the ten identification classes&#34; judgment. This judgment result is termed &#34;rejection&#34;. A recognition results output unit 15 has a printer and a CRT display for example, and prints and outputs the judgment results of the judgment unit 14. 
     The following is a description of the processing relating to pattern recognition, with reference to the flow chart indicated in FIG. 2. 
     The numerals written on a sheet are read by the data input unit 11 and the data input unit 11 outputs the feature vectors corresponding to the read characters. Then, the neural network system 10 and the judgment unit 14 perform the processing in accordance with the flow chart indicated in FIG. 2. 
     In FIG. 2, in step 100, the feature vectors data from the data input unit 11 is input to each of the neural networks (NET 0 , NET 1 , . . . NET 9 ). Then, in processing step 101, each of the neural networks (NET i ) perform calculation and the output values (A i , B i ) from the output units (U 01 , U 02 ) of each of the neural networks (NET i ) are obtained. Then, in processing step 102, the judgment unit 14 uses the output values from the ten neural networks (NET i ) as the basis for selecting the class C i  corresponding to neural networks (NET i ) for which A i  ≧B i  as the candidates. Furthermore, in processing step 103, the judgment unit 14 determines the class C id  corresponding to the neural network (NET) for which the value of A i  is greatest, from those classes C i  that have been selected as candidates. Then, in processing step 104, the judgment unit 14 outputs the class C id  that has been selected as described above, as the recognition results. 
     In processing step 102, if there is only one class C i  that is selected as the candidate, then, that candidate class C i  is the recognition result. In addition, in processing step 102, if no class C i  has been selected as the candidate, then in processing step 104, the judgment unit 14 makes a rejection judgment and outputs a predetermined rejection code. 
     For example, in the case for where the feature vector of the image data for the numerals written as indicated in FIG. 3 is input into the neural network system 10, then the output values (A i , B i ) of each of the neural networks (NET i ) are as indicated in TABLE 1. 
     
                       TABLE 1______________________________________A.sub.0 = 0.000         B.sub.0 = 1.000A.sub.1 = 0.000         B.sub.1 = 1.000A.sub.2 = 0.000         B.sub.2 = 1.000A.sub.3 = 0.000         B.sub.3 = 1.000A.sub.4 = 0.000         B.sub.4 = 0.999A.sub.5 = 0.000         B.sub.5 = 1.000A.sub.6 = 0.000         B.sub.6 = 1.000A.sub.7 = 0.303         B.sub.7 = 0.700A.sub.8 = 0.000         B.sub.8 = 1.000A.sub.9 = 0.000         B.sub.9 = 1.000______________________________________ 
    
     In this case, the output values (A i , B i ) of all of the neural networks (NET i ) are A i  ≦B i . Accordingly, not even one candidate is selected, and the judgment unit 14 outputs the rejection code since the none of the numerals from &#34;0&#34; through &#34;9&#34; is seen as the image indicated in FIG. 3. 
     In addition, for example, in the case for where the feature vector of the image data for the handwritten numbers indicated in FIG. 4 are input to the neural network system 10, the output values (A i , B i ) of each of the neural networks (NET i ) are as indicated in TABLE 2. 
     
                       TABLE 2______________________________________A.sub.0 = 0.000         B.sub.0 = 1.000A.sub.1 = 0.000         B.sub.1 = 1.000A.sub.2 = 0.000         B.sub.2 = 1.000A.sub.3 = 0.415         B.sub.3 = 0.515A.sub.4 = 0.000         B.sub.4 = 1.000A.sub.5 = 0.827         B.sub.5 = 0.173A.sub.6 = 0.001         B.sub.6 = 0.999A.sub.7 = 0.000         B.sub.7 = 0.000A.sub.8 = 0.000         B.sub.8 = 1.000A.sub.9 = 0.000         B.sub.9 = 1.000______________________________________ 
    
     In this case, when i=5, A i  &gt;B i  and so the judgment unit 14 judges that the image indicated in FIG. 4 belongs to class C 5 . This is to say that the judgment unit 14 judges that the handwritten image is the number &#34;5&#34;. 
     Furthermore, for example, when the feature vector of the handwritten numerical image data indicated in FIG. 5 are input to the neural network system 10, the output values (A i , B i ) of each of the neural networks (NET i ) is as indicated in TABLE 3. 
     
                       TABLE 3______________________________________A.sub.0 = 0.000         B.sub.0 = 1.000A.sub.1 = 0.917         B.sub.1 = 0.003A.sub.2 = 0.000         B.sub.2 = 1.000A.sub.3 = 0.000         B.sub.3 = 1.000A.sub.4 = 0.000         B.sub.4 = 1.000A.sub.5 = 0.000         B.sub.5 = 1.000A.sub.6 = 0.000         B.sub.6 = 1.000A.sub.7 = 0.624         B.sub.7 = 0.305A.sub.8 = 0.000         B.sub.8 = 1.000A.sub.9 = 0.000         B.sub.9 = 1.000______________________________________ 
    
     In this case, A i  &gt;B i  when i=1 and i=7, and so the judgment unit 14 selects class C 1  and C 2  as the candidates. Then, A 1  (0.917)&gt;A 7  (0.624) and so the judgment unit 14 selects the class C 1  as the judgment result. This is to say that the handwritten image indicated in FIG. 5 is judged to be the numeral &#34;1&#34;. 
     FIG. 7 indicates an example of the other processing relating to pattern recognition. 
     In this processing, as described earlier for the other processing, the feature vectors output from the data input unit 11 are input to each of the neural networds (NET i ) (in processing step 100) and each of the neural networds (NET i ) perform calculations to obtain the output values (A i , B i ) from the units (U 01 , U 02 ). 
     Then, in processing step 112, the judgment unit 14 selects the output value of those output values (A i , B i ) from the ten neural networks (NET i ), for which A i  &gt;B i . Then, when that selected output value (A i , B i ) is one, in processing step 113, the judgment unit 14 selects the class C i  corresponding to the neural network (NET i ) having that output value, as the recognition result. Then, in processing step 114, the judgment unit 14 outputs the class C i  that was determined. In processing step 112, if there are no output values (A i , B i ) for which A i  &gt;B i  or if it has been judged that two or more exist, then in processing step 115, the judgment unit 14 performs the rejection judgment and outputs a predetermined rejection code. 
     As has been described above, it is judged as a rejection when there are two or more output values (A i , B i ) for which A i  &gt;B i  so as to prevent the erroneous judgment of a vague character that differs greatly from the learning patterns. 
     The following is a description of another embodiment of the pattern recognition apparatus according to the present invention, with reference to FIGS. 8 through 10B. In this embodiment, when two or more candidates of an identification class have been selected, one of the above classes is selected as the recognition result by a separate recognition system that identifies the smaller class. 
     In FIG. 8, the same numerals are used to described like parts with FIG. 1. 
     The data input unit 11 applies feature vector data corresponding to the read image to the neural network system 10. Each of the neural networks (NET i ) in the neural network system 10 supply output values (A i , B i ) to the judgment unit 14. The candidate selection block 21 in the judgment unit 14 selects sets of output values (Ai, Bi) in which Ai&gt;Bi as candidates from sets of output values output from ten neural networks (NETi). Then, if single set of output values (A i , B i ) is selected, then the judgment unit 14 outputs the class C i  corresponding to the neural net (NET i ) which outputs the output values (Ai, Bi), as the recognition results. In addition, if there are no output values (A i , B i ) that satisfy the condition of A i  &gt;B i , then the judgment unit 14 performs the rejection judgment. 
     Furthermore, if the candidate selection block 21 selects two or more candidates, then the processing starts by two-character recognition system 20. This two-character recognition system 20 has a contour tracing block 22, a direction code array extraction block 23, a matching block 24 and a dictionary 25. The character image data that has been normalized by the normalization block 13a inside the pre-processing block 13 of the data input unit 11 is inputs to the contour tracing block 22. The contour tracing block 22 performs sequential tracing of the contour of the character image. This contour of the character image is a continuous trace of white pixels in contact with black pixels. For example, in the character image &#34;1&#34; indicated in FIG. 10A, a trace of white picture elements on the outside of a closed line is the contour of the image &#34;1&#34;. The direction code array extraction block 23 supplies direction codes with respect to each of the pixels of the contour of the above described character image. This direction code is, as indicated in FIG. 9, a code indicating the direction of alignment (inclination) of the black pixels in contact with the white pixel. The eight types of direction code of &#34;1&#34; through &#34;8&#34;  are predetermined. The direction code array extraction block 23 extracts the direction code array which expresses the arrangement of the direction codes. For example, the direction code indicated in FIG. 10B is obtained with respect to the image data indicated in FIG. 10A. Then, in the case that there is only one isolated code, that code is eliminated as noise, and codes for which there are two or more are collected. The arrangement of direction codes that is obtained as the result is the direction code array. Pairs of characters that are easily mistaken are made beforehand, for example, for the cases of (1,7), (0,6) and the like. Identification rules are stored in the dictionary 25 beforehand, which are determined on the basis of the direction code arrays with respect to the pairs of those characters (numerals). In the case of numerals, differences in the shape on the left and right enable the differences between the characters to be clearly seen. Accordingly, for example, in the case of the pair of numbers &#34;0&#34; and &#34;6&#34;, attention is placed on the difference in the shape on the right-hand side so that the dictionary is created so as to relate to the direction code arrays of the right sides. The matching block 24 compares the direction code array obtained from the image data with the identification rules in the dictionary 25 and determines whether or not the character image corresponds to one of the paired numbers. The processing results of the matching block 24 are applied to the recognition results output unit 15 as the recognition results. 
     If two candidates are selected by the candidate selection block 21, then the above described two-character recognition system 20 performs processing with respect to those two candidates. In addition, if the candidate selection block 21 selects three or more candidates, then pairs of two candidates (numerals) are made and processing by the two-character recognition system 20 is performed each of the pairs of candidates. Then, when the results of processing with respect to pairs of two candidates by the two-character recognition system 20 are the same (i.e. they are the same character), the result is output as the recognition result. In addition, if the results of processing by the two-character recognition system 20 are different, then the rejection judgment is performed. 
     In the embodiment described above, when two or more candidates have been selected, the two-character recognition system 20 performs the final recognition processing but this final recognition processing can also be performed by another recognition system such as a recognition system using a neural network system. 
     The following is a description of yet another embodiment of a pattern recognition apparatus according to the present invention, with reference to FIGS. 11 through 13. This embodiment is a pattern recognition apparatus that performs the appropriate relearning for the neural network unit system 10. 
     FIG. 11 is a block diagram indicating the fundamental configuration of a pattern recognition apparatus. In the same manner as the pattern recognition apparatus indicated in FIG. 1, this pattern recognition apparatus is provided with the data input unit 11, the neural network system 10, the judgment unit 14 and a recognition results output unit 15. The data input unit 11 has the scanner 12 and the preprocessing block 13. 
     This pattern recognition apparatus is also provided with a error data memory 27 in which image data that is erroneous or in which the rejection judgment has been performed are registered. This error data memory 27 has a memory region (ERR i ) corresponding to each of the neural networks (NET i ). These memory regions (ERR i ) are referred to hereinafter as memories (ERR i ). 
     Learning for the neural networks (NET 0 ) through (NET 9 ) is performed beforehand using predetermined learning data. FIG. 12 indicates a functional block relating to the learning. A description will now be given of the learning for the neural network (NET 0 ) corresponding to the class C 0  expressing the numeral &#34;0&#34;. 
     Image patterns including all of the numbers from &#34;0&#34; to &#34;9&#34; as the learning data are stored beforehand in the learning data buffer 30. The teacher data corresponding to the learning data is stored in a teacher data buffer 31. The teaching data is (1, 0) if the learning data is &#34;0&#34;, and is (0, 1) if the learning data is not &#34;0&#34;. The learning data read from the learning data buffer 30 is supplied to the neural network output calculation block 10&#39;. The neural network output calculation block 10&#39; (NET 0 ) uses the link weight inside the link weight memory 34 to calculate the output values (A i , B i ) from the learning data. The error calculation block 32 calculates the root deviation using the teacher data and the output values (A i , B i ) from the neural network output calculation block 10&#39;. The changing amount calculation block 33 uses the root deviation from the error calculation block 32 to change the link weight in accordance with the general δ rule. Then, the link weight that is newly stored in the link weight memory 34 is used to calculate the output value with respect to the following learning data. 
     The processing that is described above is repeatedly performed with respect to each of the learning data and the learning for the neural network NET finishes when the learning data can be practically correctly recognized. The learning for the other neural networks NET 1  through NET 9  is performed in the same manner as has been described above. 
     The learning method described above is called the error back propagation method. 
     Furthermore, this pattern recognition apparatus performs re-learning. This re-learning is performed in accordance with the flow chart indicated in FIG. 13. 
     N number of data for recognition testing are prepared beforehand. 
     In processing step 120, a loop counter provided inside the pattern recognition apparatus is initialized to j=1. The j&#39;th data for recognition testing is recognized (in processing step 121) using the neural network for which learning has been performed as described above. Judgment is then performed for whether those recognition results are correct or not (in processing step 122). In the judgment of processing step 122, if the recognition results are either erroneous recognition or rejection, then the neural network (NET r ) that was the cause of the erroneous recognition or rejection is specified (in processing step 123). Then, data for recognition testing is stored in the memory (ERR r ) corresponding to that neural network (NET r ). 
     After that, the loop counter is incremented (in processing step 125) and the following data for recognition testing is used to perform processing in the same manner. Then, the processing of steps 121, 122, 123 and 126 is performed until the count value j of the loop counter becomes j=N (processing step 126), that is to say, for all of the data for recognition testing. 
     For example, the output of each of the neural networks (NET i ) with respect to the feature vectors of an image (a handwritten numeral &#34;2&#34;) indicated as an example in FIG. 6, is as indicated in the following TABLE 4. 
     
                       TABLE 4______________________________________A.sub.0 = 0.000         B.sub.0 = 1.000A.sub.1 = 0.000         B.sub.1 = 1.000A.sub.2 = 0.000         B.sub.2 = 1.000A.sub.3 = 0.000         B.sub.3 = 1.000A.sub.4 = 0.000         B.sub.4 = 1.000A.sub.5 = 0.000         B.sub.5 = 1.000A.sub.5 = 0.000         B.sub.5 = 1.000A.sub.6 = 0.000         B.sub.6 = 1.000A.sub.7 = 0.044         B.sub.7 = 0.956A.sub.8 = 0.000         B.sub.8 = 1.000A.sub.9 = 0.000         B.sub.9 = 1.000______________________________________ 
    
     In this case, the judgment is that of rejection. The cause of this rejection is because an erroneous output value (A 2  &lt;B 2 ) appeared in the neural network NET 2 . Accordingly, the image data indicated in FIG. 6 is stored in the memory ERR 2 . 
     When the above described processing is completed with respect to all of the data for recognition testing, relearning is performed with respect to the neural networks (NET r ) that become the causes of erroneous recognition or rejection (processing step 127). This relearning is performed using the learning data and the data stored in the memory (ERR r ). This re-learning is performed in accordance with the above described back propagation method, for example. When this relearning has been completed, the neural network system 10 is re-edited by the new neural networks (NET r ). 
     As has been described above, according to the present invention, a neural network is provided with respect to each identification class, and the output layer of each of those neural network has only two output units and so the learning is easier than a conventional neural network having many output units. In addition, the relearning may be performed only for the neural networks corresponding to classes that have much erroneous recognition. Furthermore, by combining small-scale neural networks, the accuracy of recognition can be improved for each of the neural networks. As a result, the recognition ratio increases for the entire neural network. Still furthermore, neural networks are provided with respect to each class and so the rejection judgment can be performed without using appropriate threshold values. 
     In addition, data that has been judged as erroneous or rejected data is stored in a memory corresponding to the neural network that caused that error or rejection and so the data that is stored in the memory can also be included in the relearning so that the re-learning can proceed definitely. 
     Further, the present invention is not limited to these embodiments, but various variations and modifications may be made without departing from the scope of the present invention.