PATTERN RECOGNITION

Abstract: Input values are digitally represented (10) and the bits used to address memories (12). A composite (e.g. the sum) of the memory outputs is formed, and update control (13) is used during ''learning'' to modify the memory contents. The digital representation is formed by an encoder (14) which encodes input values using a redundant code, which preferably has a Hamming distance to signal distance relationship which has a relatively steep initial slope and is closer to being monotonic than is the relationship for a simple binary code.

Description: PATTERN RECOGNITION The present invention is concerned with pattern recognition devices. Such devices commonly receive, in digital form, an input pattern of bits which is then processed to produce a scalar value, or a number of such values, which are regarded as a vector. These may then be subjected to a thresholding operation to provide an output indicating the nature of an unknown pattern supplied to the device. Many such devices are learning devices, in that they are not constructed to recognise particular patterns but are, before use, supplied with training patterns, the output of the device being compared with information as to the nature of the pattern, or identifying a class to which it belongs, and the comparison result used as feedback to vary parameters stored within the device. It is convenient to view such systems in terms of an input space and an output space. For example, one which receives a set of five scalar values and produces two scalar values may be considered as performing a mapping from a point in a five-dimensional input pattern space to a point in a two-dimensional output space. One form of recognition device which has been proposed is the perceptron, which forms one or more weighted sums of a set of input values, the weighting factors being varied adaptively during the learning process. The main disadvantage of these is their inability to perform non-linear mappings from the input space to the output space, so that they cannot learn such apparently simple functions as the exclusive-or function. A solution to this problem is the multi-level percepton, where the output of a first layer of perceptrons supplies the input to a second layer; however, large amounts of training are required in order to learn quite simple non-linear mappings (i.e. convergence is slow), and this has made the application of multi-layer perceptions to real problems such as speech recognition very difficult. Another form of recognition device is described in our European patent application serial no. 0183389B, and US patent no. 4782459. This, as shown in Figure 1, has an input store 1 in which an input vector having sixteen elements of 8-bits each are stored. Groups ("n-tuples") of bits are taken to form n-bit addresses for each of a number of random access memories 2, and the contents of the memory locations thereby addressed are added in an adder 3 to form a scalar output. During training, this output is compared in a subtractor 4 with the desired output input thereto, and the difference used to control updating of the memory contents. One application of the arrangement shown is as an echo canceller for telecommunications applications where the store 1 is in the form of a shift register receiving successive digitally coded temporal samples of a transmitted signal, the object of the device being to learn a mapping which models the echo characteristics of a transmission path. As will be explained in greater detail below, the ability of such a recognition device to generalise from examples given in training depends to some extent upon the form in which the input data within the store 1 is coded. It is of course conventional to employ binary coding to represent digital values of a signal, but (as discussed in "Guide to pattern and recognition using random-access memories" - Aleksander and Stonham, computers and digital techniques, February 1979, Vol 2 No 1, Page 36 "6.3 coding of physical data") this is not particularly suitable for this class of pattern recognition devices since signal values which are quite close in signal space are disproportionately far apart in Hamming distance. The authors there propose a Gray code (which employes the same number of bits as the binary code) to overcome this problem but note that this can lead to spurious results as widely differing input signal levels can be close in Hamming distance. They point out that the most suitable coding is a 1-in-N code (hereinafter referred to as a bar code), in which as many bits as there are signal levels are employed. This code suffers from neither of the above drawbacks. It is, however, very inefficient and can require a large amount of input space; for example, for input data having 256 levels (ie. the typical output of an 8 bit digital to analog converter), a 256 bit wide input buffer is required - which is clearly impractical (the binary and Gray code versions require only 8 bits, of course). The present invention therefore provides in a first aspect a pattern recognition apparatus comprising: - an input for receiving a set of digital values representing a pattern to be recognised; a plurality of memories each having at least one address line for addressing locations therein, the address lines being connected to receive bits from a digital representation of the set of values; and means for producing a composite output dependent on data read from the addressed locations of the memories; wherein the apparatus includes means for encoding the input values to form the said digital representation employing a redundant code which has a normalised Hamming distance to normalised signal distance relationship having a mean slope greater than 1 for signal distances up to a predetermined level of at least 10% of the maximum signal distance. Another aspect of the present invention provides a pattern recognition apparatus comprising: an input for receiving a set of digital values representing a pattern to be recognised; - a plurality of memories each having at least one address line for addressing locations therein, the address lines being connected to receive bits from a digital representation of the set of values; and means for producing a composite output dependent on data read from the addressed locations of the memories; wherein the apparatus includes means for encoding the input values to form the said digital representation using a code employing a number of bits which is: i) greater than that which a binary code would require to represent an equal number of signal levels; and ii) less than that number of signal levels; and being selected to have a higher monotonicity (as herein defined) than would such a binary code, irrespective of the magnitudes of said values. As will be discussed below, the first aspect of the invention provides a pattern recogniser which has similar properties to a bar code recogniser but is physically practical to construct. The second aspect of the invention, (which preferably employs a coding which as above uses a realistically small number of bits) provides a recognition device which can learn complex mapping functions (as discussed below) yet maintains the good generalization properties of the bar code type recogniser. Also provided according to the invention is a method of training an n-tuple recogniser using redundant coding of the above types. Other preferred features are as recited in the claims. Some embodiments of the invention will now be described, by way of example, with reference to the accompanying drawings, in which; Figure 1 as discussed above, shows a known form of pattern recognition device; Figure 2 shows generally a pattern recognition device according to the invention; Figure 3 illustrates the concept of an interpolation kernel; Figures 4a and 4b illustrate 1-in-N or bar coding; Figure 5a illustrates the kernel function of the coding of Figure 4 in the apparatus of Figure 2; Figures 5b and 5c show the kernel functions correspondingly obtained employing simple binary coding and Gray coding respectively; Figure 5d illustrates an example of a kernel obtained employing a code according to the present invention; Figure 6 illustrates the concept of "badness" employing a first measure; Figure 7 illustrates a different measure of badness; Figures 8a and 8b illustrate Hamming distance versus signal distance plots for binary and Gray codes, respectively; Figures 8c and 8d illustrate corresponding plots for embodiments of the invention; and Figure 8e illustrates a corresponding plot for a bar code Referring to Figure 2 there is shown a pattern recognition device having an input for receiving a time-varying signal in the form of digital samples. These are divided into frames of (for example) sixteen samples x l ■ " x 15 ^ or ' "" n vector notation, X) and stored in a store 10. To avoid confusion, it may be stated that a frame may be regarded as a sixteen element vector (viz. a one-dimensional array or pattern of samples) representing a point in a notional 16-dimensional input space. Note that the case of a one-dimensional array is by way of example; multi-dimensional arrays (e.g. for image recognition) are equally possible. Although, in the example, the input is a one-dimensional array, it is convenient to view the store 10 as two-dimensional since it must accommodate a number of bits for each sample. N-tuple connection lines 11 are, as in Figure 1, connected to the store to form address lines for several banks 12 of memories. The connections are distributed over the bits of the store - i.e. their assignment is uncorrelated with the x-y organisation of the data. Preferably, the assignments are made at random. The memories of the first bank are "Vι designated RAH, , ... RAl^ Q and those of the N bank RAH N , ... RAIL, „, there being memories in each bank. The outputs of the memories of a bank are added in a respective adder S, ... S^ to form an output y, ... y N (which may be regarded as an output vector Y). The system is trained by applying a vector X to its input. This causes a specific set of n-tuple addresses to be generated, which access corresponding contents in each of the memories. The summation of the output of each bank of memories produces the elements of the output vector Y. This vector is compared in a control unit 13 with a desired output or target vector T and the result used to update the contents of the memory locations C.. of those memory locations addressed by the n-tuple lines (C.. being the content of the addressed location within the j memory of the i bank). Repeated applications of different training vectors allows the system to learn the required input-output mapping Y = f(X). It is important to notice that with appropriate choice of n-tuple order and number of memories per bank, the system can estimate the best function f(X) to fit a rather sparse training set. That is, it is not necessary to expose the machine to all possible input-output vector pairs because it is able to interpolate the required function between training points. This property will be discussed in more detail later. Once trained, the device should respond to receipt of an unknown input vector X by producing the desired output vector Y. It will be seen that one difference between the device shown in Figure 2 and that of Figure 1 is the provision of multiple banks to enable a multi-element output vector to be generated. In addition, however, the device includes an encoder 14 for determining the bits representative of the input samples which are to be entered into the store. Before discussing the form of this in detail, the question of interpolation will be introduced. A supervised learning machine is required to learn a mapping function Y = f(X); however, in a practical system, it is not generally possible to expose it to all possible input vectors X, and therefore satisfactory results will be obtained only if the system can interpolate between the training examples which it has been given, i.e. produce the desired response to an input vector which is not one of those used in training. This view of the training results as being a sampled version of the required continuous function leads one to regard the latter as the convolution of the sampled function, and an interpolation kernel. This is illustrated in Figure 3 for the case of a one-dimensional function. The form of interpolation kernel produced by the device of Figure 2 depends strongly on the way in which the input vector X is coded. Consider a device for which the input vectors X have only two elements; this is easy to visualise as the input pattern space is two-dimensional. Suppose now (for the purposes of illustration) that each element of X is encoded in bar-chart form - i.e. the encoder 14 produces an output bit for every increment of every dimension of X. A typical content of the store 10 for the case of an 8-level signal is shown in Figure 4a for x, = 5 and x 2 = 3; and the corresponding pattern space in Figure 4b. If three memory address lines are connected to the bits shown, then a change in the value in any of those bits causes a change in the address, and hence a change in the contribution of the associated memory to the output of the device. This effectively partitions the input space, as illustrated by the dotted lines in Figure 4b; crossing a threshold line can cause a change in the output Y. Connection of further address lines causes smaller and smaller regions of the pattern space to be delineated. For this simple two-dimensional case, the interpolation kernel can be plotted as the response of the device when it has been iteratively trained on a single input vector X. Figure 5a shows the output y, of a device for all points in the pattern space, when trained on a single point in the centre. The device used = 24 quantisation levels for each dimension, with 4-tuple (n = 4) address connections disposed randomly over the input store. The width of the kernel is large for practical values of n and the number of dimensions in the pattern space, and therefore the complexity of the mapping function that can be learned is quite low. Bar-chart coding produces a large number of coded bits and therefore the size of the input store and the number of memories increases rapidly with the number of input dimensions, so that it is not satisfactory unless the number of input dimensions is low or the desired mapping function is very simple. Figures 5b and 5c similarly show the interpolation kernel for the case where X is encoded in 5-bit simple binary and a Gray code respectively. The irregularity of the kernel is evident, though the centre of the kernel is much narrower than the bar-chart case. The output from the device is, as one moves within the pattern space, influenced by the number of memories which are still receiving the original address produced by the training pattern. Loosely speaking, the probability of the n-tuple address changing value is proportional to the Hamming distance between the current input vector and the original training vector. It is believed that bar-chart coding gives a regular interpolation kernel because the relationship between signal distance (i.e. the difference between the actual values represented) and the Hamming distance between the corresponding encoded values is monotonic, whereas this is not so for simple binary (see Figure 5b), or Gray code, although the latter is better than the former in that the Hamming distance changes only by 1 for every unit change in input value. Perfect monotonicity in the relationship between Hamming and signal distance can be obtained only by the use of highly redundant codes (such as bar-chart coding) having one bit for each signal level represented. The encoder 14 aims to provide an improved interpolation kernel by encoding the input values using a redundant code which is, however, shorter than with the bar code. Typically, the encoder is a ROM device, to the address lines of which the input signal bits are applied and from the data lines of which the codeword, stored at the address corresponding to that combination of input bits, may be read. One simple way of doing this is to use a code which represents each input value, by the concatenation of several shifted versions of a Gray code, thereby causing some averaging of the irregularities. One possible composite code is set out below in Table 1. TABLE 1 SIG CODE 0 000000010011 1 000100110010 2 001100100111 3 001001100111 4 011001110101 5 011101010100 6 010101001100 7 010011001101 8 110011011111 9 110111111110 10 111111101010 11 111010101011 12 101010111001 13 101110011000 14 100110000000 15 100000000001 The kernel function obtained using this code for the two-element vector case is shown, in the same format as previously, in Figure 5d. It is believed that the reason that the use of bar chart coding results in a large kernel width is that, in that code, which (assuming linear steps between signal levels) has a linear relationship between Hamming distance and signal distance, the slope of the relationship is relatively low. In the binary code, on the other hand, the slope is relatively steep and the kernel width is small. Suppose we define a normalised Hamming distance as d where d. is the actual Hamming distance and d, is the maximum Hamming distance for the code under consideration (i.e. the number of bits in the code) and the normalised signal distance as d S = -~S ~-S em IΪlχclX V where dS is the signal distance an(3 i s the maximum signal distance for that code. For a 16-level (linear) system, the maximum signal distance is 15; however, for purposes of comparison, it may be preferable to assume the maximum to be 16 (i.e. the number of levels). Thus the mean slope (as opposed to the instantaneous I I slope) at any point is c /d s - It follows from the above that the slope, for small signal levels (e.g. up to 10%, or preferably 15% or even 20 or 25% of the maximum signal distance) is in excess of unity, thereby representing an improvement over the bar-chart case. In general, the Hamming distance (and hence slope) is not a unique function of signal distance, in that it depends on which signal level one starts from. The above criterion may be taken to indicate that the slope obtained by taking the average of the mean slopes of all possible starting points (in both directions of signal distance) is greater than unity; more preferably, however, the mean slope for each starting point is greater than unity. It is also postulated that the 'noise' remote from the centre of the kernel plots shown in Figures 6 to 9 is a result of the non-monotonicity of the Hamming distance/signal distance relationship. It is thus preferable to use codes having a high monotonicity. Before considering this point, we will consider possible ways in which departure from monotonicity can be measured. Figure 6 shows a hypothetical graph of Hamming distance versus signal distance, starting from some arbitrary signal level. Any point on the plot which has a normalised Hamming distance less than its previous maximum is indicative of a departure from monotonicity, and one possible measure of badness would be the sum of these departures, shown by the dotted lines in Figure 6. One also takes into account signal levels lower than the starting level, as indicated by the left hand half of the graph. The average of these sums, taken over all starting points, is referred here as "Badness 2". This is similar to considering the hatched area in Figure 6 (which may be a viable alternative measure). Alternatively, one could sum the departures from the previous minimum, proceeding in the negative direction (see chain-dot lines within the cross-hatched area in Figure 10) - or the mean of this and Badness 2. Another, similar, approach would be to take the sum (Badness 1) of the differences from the immediately preceding point if the latter is higher - i.e. the distances shown dotted in Figure 7. The possibility of upper and lower measures does not arise in this case, since the two would always give the same value. A further option is to weight the significance of these departures (on the basis that a "kink* of given absolute size may be more significant at low distances than at high ones) by dividing each difference by the signal distance, before summations, thereby forming a "weighted badness". To summarise the above, the badness measures may be defined mathematically as Badness 1 = Weighted Badness 1 = SUBSTITUTE SHEET Badness 2 = Weighted Badness 2 = Where d h '(i,j) is the normalised Hamming distance between the codes representing signal levels i and j; j , 1 (ir ) is the maximum normalised Hamming distance between the code j and any code prior (in the direction of summation) to code j; dsmax is the maximum signal distance (equal to the number of signal levels minus one); and the triangular brackets indicate that negative values are taken to be zero (i.e. <x>~ 0 for x$0). Loosely speaking, monotonicity here has its usual meaning. Where, in the following, exact values are quoted, we define monotonicity as being the reciprocal of the badness. The following table indicates Badness 1 and Badness 2 figures for a number of 16-level codes. These figures are not normalised, but those having more than four bits are scaled to four bits. TABLE 2 Bl B2 Four-bit binary 3.125 5.6875 Four-bit Gray 2.75 5.1875 Eight-bit Concatenated Gray (odd shift) 0.875 2.469 Seven-bit Lloyd no.1 1.107 1.750 Twelve-bit Concatenated Gray (1,3) 1.2085 2.5835 Twelve-bit Concatenated Gray (+l,+7) 1.1666 2.479 Note that the results for concatenated Gray codes depend on the shift(s) used. For the 8-bit code, the results obtained with an odd shift are significantly better than with an even shift. These figures show that 4-bit Gray code has a better monotonicity than binary. The 12-bit concatenated Gray code (with shifts of (+l,+7) - which were found to give the highest monotonicity figure for that code) is significantly better, though not as good as the 8-bit concatenated Gray code. The 7-bit Lloyd code was designed (manually) to achieve a good monotonicity, discarding the cyclic property of the Gray code which is not needed for present purposes. It is slightly better or slightly worse than the 8-bit concatenated Gray code, according to which measure one considers. Note that this code is entirely monotonic (with a linear Hamming/signal distance relationship) for signal distances (from any starting value) up to 3 (i.e. 20% of the maximum signal distance of 15). With a small modification (1111011 for signal level 12) this limit is increased to 4. The codes are set out below (Table 3). TABLE 3 BINARY 4-BIT(Fiq.8a) GRAY(Fig.8b) SIG CODE SIG CODE 0 0000 0 0000 1 0001 1 0001 2 0010 2 0011 3 0011 3 0010 4 0100 4 0110 5 0101 5 0111 6 0110 6 0101 7 0111 7 0100 8 1000 8 1100 9 1001 9 1101 10 1010 10 1111 11 1011 11 1110 12 1100 12 1010 13 1101 13 1011 14 1110 14 1001 15 1111 15 1000 CONCATENATED (8 BIT)GRAY(Fig.8c) LLOYD (Pig.βd) SIG CODE SIG CODE 0 00000001 0 0000000 1 00010011 1 0000001 2 00110010 2 0000011 3 00100110 3 0000111 4 01100111 4 0001111 5 01110101 5 0001110 6 01010100 6 0011110 7 01001100 7 0011100 8 11001101 8 0111100 9 11011111 9 0111000 10 11111110 10 1111000 11 11101010 11 1111001 12 10101011 12 1111101 13 10111001 13 1111111 14 10011000 14 1110111 15 10000000 15 1110110 Figures 8a-8d illustrate these codes as (normalised) Hamming distance against Signal distance (from 0) plots. The bar code is also illustrated for comparison (Figure. 8e) In general, the monotonicity of the code used is greater than that of the binary code representing the same number of signal levels; preferably, it is at least 1.5 or twice that figure. It is expected that a concatenation of shifted binary codes will have poor monotonicity and that the codes used preferably exceed to the desired extent that of such a code. The means adopted by the control unit - for adaptively adjusting the contents of the memories - during the learning phase will now be discussed. The adaptation of the RAH memory contents to develop the required mapping function may be done using a gradient descent procedure. It can be shown that the gradient is very easily calculated and that the error surface for the system is quadratic thereby indicating that convergence is always possible. Each memory in the system is addressed by an n-tuple address whose value depends on the input vector X. Thus, the output of each memory in the system depends in some complex way on X, and in general the output of the j memory in the i bank can be expressed as C..(X). The output of the 1th bank is then: " • Y i = 2_ C i;j (X) ... (1) j=i where Q is the number of memories per bank. Let the target output vector when X is input be T = [t, ... t j .]. The mean square output error of the system can then be expressed as: ( ( y yi<-- v t,r ... (2) Substituting (1) into (2) gives an expression for the mean square error in terms of the contents of the memories: Equation 3 shows that the highest power term involving CJJ(X) in the expression for mean square error is two. This indicates a single minimum, quadratic surface, and so convergence to a global optimum is guaranteed using a gradient algorithm. The gradient descent algorithm operates on the currently addressed memory contents such that: where k(k^l) is a constant determining the rate of convergence. The gradient term required in (4) is simply calculated from (3) as: where e. is the difference between the output of the i bank and its target value. So, the algorithm for modifying the contents becomes: eg 1 (X) = cjj (X) + 2k. (y r t ) ... (5) if a sufficiently large number of training patterns is available, a single exposure to each may be sufficient. In practice, however, it will usually be necessary to expose the system repeatedly to the training set, until convergence to a desired level of error is obtained. it may be found advantageous to vary, in successive passes, the order in which the training patterns are presented.

Claims: CLAIHS 1. A pattern recognition apparatus comprising: - an input for receiving a set of digital values representing a pattern to be recognised; - a plurality of memories each having at least one address line for addressing locations therein, the address lines being connected to receive bits from a digital representation of the set of values; and - means for producing a composite output dependent on data read from the addressed locations of the memories; wherein the apparatus includes means for encoding the input values to form the said digital representation employing a redundant code which has a normalised Hamming distance to normalised signal distance relationship having a mean slope greater than 1 for signal distances up to a predetermined level of at least 10% of the maximum signal distance. 2. An apparatus according to claim 2, in which the slope is at least 1.5. 3. An apparatus according to claim 3, in which the slope is at least 2. 4. An apparatus according to claims 2, 3 or 4, in which the predetermined level is 15%. 5. An apparatus according to claims 2, 3 or 4, in which the predetermined level is 20%. 6. An apparatus according to claims 2, 3 or 4, in which the predetermined level is 25%. 7. An apparatus according to any one of the preceding claims in which the code employs a number of bits which is: i) greater than that which a binary code would require to represent an equal number of signal levels; and ii)less than that number of signal levels; and has a higher monotonicity (as herein defined) than would such a binary code. 8. A pattern recognition apparatus comprising: an input for receiving a set of digital values representing a pattern to be recognised; a plurality of memories each having at least one address line for addressing locations therein, the address lines being connected to receive bits from a digital representation of the set of values; and - means for producing a composite output dependent on data read from the addressed locations of the memories; wherein the apparatus includes means for encoding the input values to form the said digital representation using a code employing a number of bits which is: i) greater than that which a binary code would require to represent an equal number of signal levels; and ii)less than that number of signal levels; and being selected to have a higher monotonicity (as herein defined) than would such a binary code. 9. An apparatus according to claim 7 or 8, in which the monotonicity is at least 1.5 times that of a binary code. 10. An apparatus according to claim 9, in which the monotonicity is at least twice that of a binary code. 11. An apparatus according to any one of the preceding Claims, in which the means for producing a composite output comprise a plurality of combining circuits, each connected to a different plurality of the said memories, each being arranged to produce a scalar output in dependence upon the data read from the addressed locations of those memories to which it is connected, the composite output being a vector including said scalar outputs. 12. A method of training a pattern recognition device which is arranged to receive a set of digital values representing a pattern to be recognised, comprising the step of encoding said values employing a redundant code which has a normalised Hamming distance to normalised signal distance relationship having a mean slope greater than 1 for signal distances up to a predetermined level of at least 10% of the maximum signal distance. 13. A method of training a pattern recognition device which is arranged to receive a set of digital values representing a pattern to be recognised, comprising the step of encoding said values using a code employing a number of bits which is i) greater than that which a binary code would require to represent an equal number of signal levels; and ii)less than that number of signal levels; and being selected to have a higher monotonicity (as herein defined) than would such a binary code.

Inventors: TATTERSALL GRAHAM DAVID, TATTERSALL, GRAHAM, DAVID
Applicants: BRITISH TELECOMM, BRITISH TELECOMMUNICATIONS PUBLIC LIMITED COMPANY
Application year: 1990
Main classification: G06K9
IPC codes: G06F15, G06K9, G06N1, G06T7, H04B3