4.1. Formal Definition of Ar2p-Text
A pattern recognition module is defined in Ar2p by a 3-tuple, which is similarly used by Ar2p-Text [
9]. Γ
ρ notation is used to represent the module that recognizes the
ρ pattern (
ρ: shapes, letters, and words, etc.).
where
E is an array defined by the 2-tuple
E = <S, C> (see
Table 1),
S = <Signal, State> is another array of the set of signals of the pattern recognized by Γ with its states,
C is another array with information of the pattern described by the 3-tuple
C = <D, V, W>, and D are the descriptors of Γ, V is the vector with the possible values of each descriptor in D, and W is the relevance weight of the descriptors in the pattern
ρ. Additionally, there is a threshold vector U used by the module (Γ) to recognize the pattern.
Table 1 constitutes one artificial neuron, which is a neocortical pattern recognition module according to the PRTM theory. In the Ar2p neural model, each neuron/module can acknowledge and observe every aspect of the input pattern
s() and how the different parts of the data of the input pattern may or may not relate to each other.
Two types of thresholds were used: ΔU1 for the recognition using key signals and ΔU2 for the recognition using total or partial mapping. The ΔU1 threshold is stricter than ΔU2 because the process based on key signals uses few signals. Finally, each module generates an acknowledgment signal or a request signal to the lower levels (So). So as a request signal is the input signal s() of the modules of the lower levels. So, as an acknowledgment signal, is sent to its higher levels to modify their states of the signal to “true”.
Thus, a pattern is represented as a set of lower-level sub-patterns that conform to it (N descriptors), and in turn, it also serves as a sub-pattern of a higher-level pattern. N depends on the descriptors of the pattern to recognize. W is normalized [0,1], and ΔU1 or ΔU2 are thresholds that must be overcome in order to recognize the pattern. These values are defined according to the domain of application.
The previous definitions have been defined for the neural model Ar2p [
10], but they are maintained for the case of Ar2p-Text. In the context of Ar2p-Text, the main patterns to recognize (
ρ) are letters, words, special signs, and numbers.
4.4. Computational Model of Ar2p-Text
Again, Ar2p-Text follows the same general computational process of the Ar2p model [
9], but it introduces certain modifications for the specific case of text analysis. Next, the algorithm of Ar2p-Text is presented with these modifications. This algorithm has two processes: A first process, the bottom-up process, for the atomic patterns, such that the output signals of the recognized patterns go to the modules of which they are part of the top levels to activate them if they pass a recognition threshold [
9]. The other process is a top-down one for the input pattern by decomposition. The top-level module uses the modules of recognition of the lower level, and then they recursively do the same.
The algorithm works as follows: The input text is received (y = s(): sentences and word (s)). Then, this input is broken down into sub-patterns that are stored in L (e.g., if it is a sentence, then it is decomposed into words, and so on for the rest). The level of depth of decomposition depends on the level of detail and analysis with which the pattern is recognized. Once the pattern has been simplified, then the Xi level of the hierarchy is determined (this is performed through a metric that relates the input pattern to some level, see [
11]), where the recognition of the input pattern (
y) should start and end. Subsequently, L requests that patterns for recognition of (
y) are created. At this point, the process of recognition and correction can continue through two possible paths: a bottom-up or a top-down process. If the input pattern is made up of lower-level signals (i.e., sub-patterns of the lower level) or it has atomic signals recognized (i.e., all the lower levels are Xi = 1), then a bottom-up process occurs, otherwise, it is a top-down process. In the case of the bottom-up process, the recognition of (y) is calculated using the strategies defined above (see Equations (1)–(3)). If the calculation was successful by any strategy and the recursive recognition process is already at the level of the initial input pattern s(), then it sends an
So of recognition (y) as the final output of the system. If it is not yet in the Xm level of the initial input pattern, then an
So is created and sent to the immediately higher level. If the sub-patterns of the pattern have not yet been recognized (letter, word, etc.), then the top-down process starts and L requests that acknowledgment from (y) to the lower levels is sent. Then, it generates recursive calls. Next, it receives the L responses of the lower levels, and the recognition of the (y) is calculated. If the calculation is successful by any strategy and it is the last level of the hierarchy Xm, then it sends an
So recognition (y) like the system output. Otherwise, it continues going down with the recognition.
To understand the process better, next, we explain how the algorithm works in a more elaborate way. But first it is important to clarify that Ar2p-Text for text analysis can receive as input shapes, words, letters, numbers, special characters, sentences, etc. The input will depend on the hierarchy level where the neuron is. For example, in the lower levels, it will receive shapes, letters, numbers, or special characters and in the upper levels, it will receive words, sentences, or more elaborate texts.
Suppose we need to recognize the word “Casa/House” (see
Figure 2). In this case, Ar2p-Text receives “Casa” as the input and should return as recognition output (y = Casa).
Figure 2 schematically shows the levels of Ar2p-Text (and its recognition modules) that intervene during the recognition process. Specifically, there are three levels in the hierarchy; The first level (X
1) has the modules (Γ
j1) that recognize the atomic patterns (curves or lines) that will be used to construct the letters (that is, they are indivisible patterns). The second level (X
2) has modules (Γ
k2) that recognize letter patterns (for example, “a”, “e”, “C”, “s”, “M”, and “z”). Finally, the top level (X
3) contains the word pattern recognition modules Γ
l3 (e.g., “Casa/House” and “Manzana/Apple”).
As we can see in the example above, our approach could be used on handwritten or printed texts. In the case of handwritten texts, level 1 would have the figures used by individuals to write their letters, and in the case of printed text, level 1 would have the figures that describe the different fonts of the letters used (for example, in the case of words, for fonts such as Calibri and Arial). Thus, it can recognize different handwriting (people who write very differently) or print written with different fonts. The instantiation of the “Casa” pattern recognition module in the top level is shown in
Table 2.
The algorithm receives y = s() = ”Casa”. It decomposes the word “Casa”: <”C”, “a”, “s”, “a”>. Then, it defines the Xi level of the hierarchy to start the recognition process for (y). For this example, Xi=3. When the initial patterns are atomic (i.e., of the level Xi=1), then the bottom-up process starts. But as y is not an atomic pattern (level Xi=3), L requests acknowledgment of y, and <y1 = C, y2 = a, y3 = s, y4 = a> are sent at the lower level Xi=2. At this point, the recursive process of recognition starts, such that each yi of the list L becomes the input signal to the level Xi=2.
For
y1 =
C, the algorithm begins the process of recognition of
s() = (“C”) for the X
m=2 level. Again, the letter “C” is decomposed in its sub-patterns. In this case, “C” will be divided into two parts to facilitate its interpretation (<
y1 = volute and
y2 = base) (see
Figure 3). In the case of “A”, it will be divided into two parts (<
y1 = stick and
y2 = base).
Then, the level of the hierarchy to start the process of recognition for this pattern is defined, which is (X2). The algorithm sends the L requests it determined for y1 and y2, and waits.
When shapes such as y1 = ”|” (i.e., the stick) are recognized, the algorithm identifies an atomic pattern (of the level X1), and the bottom-up process is carried out. When a successful calculation is determined (i.e., a Γ recognizes “|”) and it is not the last level of the hierarchy, the algorithm sends an output (So) to indicate the recognition to the top level (X2). It is the same for the rest of the atomic patterns (in this case, y2). If all atomic patterns are recognized (y1 = s() = “stick” and y2 = s()- = “base”), the responses ascend into the hierarchy and modify the states of the corresponding signals. These signals are received in X2 to calculate the recognition of their patterns.
With a successful recognition of the letter “A” at level X2, the algorithm creates and sends a signal So of recognition to its upper level X3. The same procedure is followed for the rest of the patterns of this level. If all the patterns of level 2 are recognized, the last level receives the recognized signals and calculates the recognition.
To understand this sub-process better, next, we explain how the algorithm works in a more elaborate way. Suppose ΔU1 = 0.8, and three of the four signals are recognized in X
1. Then, according to Theorem 1, we must define the active key signals (see Equation (1)). The key signals are 1, 2, and 3. Now, Equation (2) defines if the pattern is recognized with these signals. They overcome the threshold (0.83 < 0.8), and if it is the last level, it carries out reinforcement learning (see [
9] for more details) and generates the output signal S
o that is the output signal of the system “recognized pattern <Casa>”.