Summon the AI4U Textbook Mind into your presence with MSIE.

The audRecog Comparator Module of the Mind.Forth AI Breakthrough
by Mentifex

1. Theory of AI Textbook Algorithm Steps: Code the audRecog Mind-Module

   /^^^^^^^^^\  Auditory Recognition of "c-a-t-s"  /^^^^^^^^^\
  /    EYE    \ REACTIVATED                       /   EAR     \
 /             \ CONCEPTS                        /"CATS"=input \
|   _______     |   | | |    SEMANTIC MEMORY    |               |
|  /old    \!!!!|!!!| | |                       |  C     match! |
| / image   \---|-----+ |             ___       |  -A    match! |
| \ fetch   /   |   |c| |            /   \      |    R    stop  |
|  \_______/    |   |a| |           /     \     |     S   drop  |
|               |   |t| |          / Old-  \    |               |
|  visual       |   |s| |         ( Concept )   |  C     match! |
|               |  e| | |          \       /    |  -A    match! |
|  memory       |  a| | |          /\     /!!!!!|!!!!T   match! |
|               |  t| | |   ______/  \___/------|-----S  recog! |
|  reactivation |   | |f|  /      \             |               |
|               |   | |i| ( Parser )            |  C     match! |
|  channel      |   | |s|  \______/             |  -A    match! |
|   _______     |   | |h|      |                |  --T   match! |
|  /old    \    |   |_|_|     _V_________       |  ---S   busy  |
| / image   \   |  /     \   /           \      |      U  drop  |
| \ store   /---|--\ Psi /--( Instantiate )     |       P drop  |
|  \_______/    |   \___/    \___________/      |               |
Decision-Tree of Mind-Design


See http://mind.sourceforge.net/diagrams.html for theory-of-mind diagrams.

Within the audRecog comparator there are both functions and
considerations. The functions are what the comparator does,
and the considerations are guidelines that we mindmakers must
keep in mind as we program the functions into the comparator.

One consideration is that we will use the time-variable "midway"
to limit backwards searches for word-recognition to an arbitrary
length of most recent time, that is, not all the way back to the
moment when the artificial mind began its artificial life -- except
when the AI must summon all its resources and powers of thought,
including an exhaustive search of all possible associations among
all the thoughts and perceptions that the AI has ever experienced.
Then, and only then, will the AI dwell on a save-the-world problem
with infinite patience and with unlimited access to all memories.
Meanwhile, until Armageddon or Goetterdaemmerung, we code an
AI that looks back recently enough to find quick associations.

Another consideration is that, if the comparator finds multiple
engrams of a known word in Aud, the most recent engram should
be good enough for the purposes of pattern recognition.

A further consideration is that, if the most recent word-match
is found, the search may be called off for more distant matches
lying further back in time.

Another consideration is that we want the comparator to be
completely robust and bug-free, so that we may safely program
other parts of the Robot AI Mind, and so that other people may
confidently port the comparator without worrying about bugs.

Another consideration is that we want to "aud-damp" the Aud
array after each word-recognition, so that no left-over activation
may interfere with fresh attempts to recognize words.

The audRecog comparator is called over and over again by the
auditory Short Term Memory (audSTM) just before each auditory
engram is stored in the array of the auditory memory channel.


2. Auditory Recognition is Pattern Recognition

The audRecog auditory recognition module has two main tests.

The first test looks to see if an incoming pho(neme) matches
a stored aud0 engram in a search backwards in time.

In AI more advanced than the original 26.Nov.1994 Mind.Rexx,
we want the comparator to recognize morphemic sub-matches,
that is, partial phonemic strings like the "pre" in the word
unpremeditated -- a substring which may or may not
supremely affect the meaning of the circumambient word,
depending on whether or not the morpheme is accidentally
or adventitiously contained within the word being heard.

For all matches, only "beg=1" initial phonemes will get their
act(ivation) level raised by an arbitrary incremental value.

The second test checks to see if a given stored phoneme has
a positive activation, which indicates a potential match.

Then a string-effect sequence passes the activation on to the
next-in-line character, so that, on the next pass, once again
a match will cause the activation to be strung further along.

The audRecog function is at the heart of the Robot AI Mind
and it has been quite difficult to program in each language.
A good homework assignment for a computer science class or
AI textbook would be to port the audRecog comparator module
into a given programming language; or to improve the audRecog
algorithm to make it faster or more powerful; or to make the
audRecog module capable of learning how to improve itself;
or to implement auditory recognition for specific hardware
devoted to auditory pattern recognition in physical robots.

The comparator in Mind.Forth is an improvement upon 26.Nov.1994
Mind.Rexx, which recognized only complete, entire English words.
The Mind.Forth comparator is designed and coded in such a way
as eventually to permit subtleties and gradations of verbal recognition,
so that the artificial Mind will gradually become better and better
at recognizing a morpheme that meaningfully inhabits a word.


http://mind.sourceforge.net/ai4u_157.html is an overview of Mind.


3. JavaScript free Seed AI source code with free User Manual
// audRecog() (auditory recognition) comparator is called
// from audSTM() to recognize words by matching input phonemes
// against memory and reporting back an associative tag.
// Anyone may code gusRecog; olfRecog; tacRecog; or visRecog().
function audRecog() {  // ATM 12aug2002; or your ID & date.
  psi = 0;   // Safety measure.
  for (i=spt; i>midway; i--) {  // Search back to midway.
    audMemory[i].audExam();   // Examine the "aud0" phoneme.
    if (aud0 == pho) {  // If incoming pho matches stored aud0;
      if (aud1 == 0) {  // if matching aud0 has no activation;
        if (aud3 == 1) {  // if beg=1 on matching no-act aud engram;
          if (aud4 == 1) {  // If beg-aud0 has ctu=1 continuing,
            j = (i + 1)     // target the next-in-line time-point.
            audMemory[j].audExam();  // Fetch audNode at i+1
            aud1 = (aud1 + 8);  // Activate next-in-line char,
              // so that match-up may continue past first char.
            audMemory[j] = new audNode(aud0,aud1,aud2,aud3,aud4,aud5);
            psi = 0;  // Revoke any assignment of a matching psi-tag.
            j = 0;  // reset for safety
          }  // end of test for continuation of beg-aud0
          else monopsi = aud5;  // A tentative match-up.
        }  // end of test for a beg(inning) non-active aud0
      }  // end of test for matching aud0 with no activation
      audMemory[i].audExam();  // Again examine the "aud0" phoneme.
      if (aud1 > 0) {  // If matching aud0 has activation,
        psi = 0;       // zero out any previous psi-tag,
        // because obviously the match-up is not complete. 
        if (aud4 == 1) {  // If act-match aud0 has ctu=1 continuing;
          psi = 0;  // because match-up is not yet complete
          j = (i + 1) // target the next-in-line time-point.
          audMemory[j].audExam();  // Fetch audNode at t = i+1
          aud1 = (aud1 + 8);  // Activate the next-in-line character.
          audMemory[j] = new audNode(aud0,aud1,aud2,aud3,aud4,aud5);
          j = 0;  // Reset for safety.
        }  // End of test for active-match aud0 continuation.
        audMemory[i].audExam();  // Again examine the "aud0" phoneme.
        if (aud4 == 0) {  // If matching word-engram now ends,
          psi = aud5;     // fetch the potential psi-tag,
            // which may be a valid recognition if the input stops,
            // but will otherwise be discarded during Audition()
            // for lack of an immediately following SPACE 32 char.
        break;          // Accept the first match going backwards.
        } else { 
          if (monopsi > 0) {  // If found above, use
            psi = monopsi;    // a single-character word.
            monopsi = 0;      // Zero out as a precaution.
          }  // End of test for a lurking one-letter word.
          else psi = 0;  // No match if the stored word does not end.
        }  // End of test for final character that has a psi-tag.
      }  // End of test for matching aud0 with activation.
    }  // End of test for a character matching "pho".
  }  // End of looping backwards from "spt".
  if (psi == 0) {       // If no multi-char recognition,
    if (monopsi > 0) {  // but if a one-char was found,
      psi = monopsi;    // use the one-letter recognition.
      monopsi = 0;      // Reset monopsi to zero.
    }                   // End of inner test.
  }                     // End of test for no recognition.
}  // End of audRecog(); return to short term memory audSTM().

4. Mind.Forth free artificial general intelligence with User Manual
\  audRecog (auditory recognition) comparator is called from audSTM
\  to recognize words by matching input phonemes against memory.
\  Anyone may code gusRecog, olfRecog, tacRecog, or visRecog.
:  audRecog  \ ATM 3aug2002; or your ID & date.
  0  psi !   \ Safety meaure.
  midway @  spt @ DO    \ Search from blank time back to midway.
    I 0 aud{ @ pho @ = IF  \ If incoming pho matches stored aud0;
      I 1 aud{ @ 0 = IF    \ if matching engram has no activation;
        I 3 aud{ @ 1 = IF  \ if beg=1 on matching no-act aud engram;
        \ Presence or absence of aud5 does not matter in next code
        \ because it can only involve a one-letter beg=1 match:
        \ I 5 aud{ @ psi !  \ fetch any aud5 as a potential psi.
          I 4 aud{ @ 1 = IF   \ If beg-aud has ctu=1 continuing,
            8 I 1+   1 aud{ ! \ activate the N-I-L character,
            \ so that match-up may continue past first char.
            0 psi !  \ Revoke any assignment of a match.
          ELSE       \ From JavaScript AI code.
          I 5 aud{ @  monopsi !  \ A tentative match-up.
          THEN   \ end of test for continuation of beg-aud
        THEN   \ end of test for a beg(inning) non-active aud0
      THEN   \ end of test for matching aud0 with no activation
      \ The following can happen only with non-initial chars
      \ and could also be expressed with an ELSE statement:
      I 1 aud{ @ 0 > IF  \ If matching aud0 has activation,
        0 psi !          \ zero out any previous psi-tag,
        \ because obviously the match-up is not complete.
        I 4 aud{ @ 1 = IF   \ If act-match aud0 has ctu=1 continuing,
          0 psi !           \ because match-up is not yet complete,
          8 I 1+   1 aud{ ! \ activate the N-I-L character.
        THEN    \ end of test for active-match aud0 continuation
        I 4 aud{ @ 0 = IF   \ If matching word-engram now ends,
          I 5 aud{ @ psi ! \ fetch the potential psi-tag, 
          \ which may be a valid recognition if the input stops.
          LEAVE            \ Accept first match going backwards.
        ELSE
          0 psi !  \  No match if the stored word does not end.
          monopsi @ 0 > IF   \ but if a one-char was found,
            monopsi @ psi !  \ use the one-letter recognition.
            0 monopsi !      \ Reset monopsi to zero.
          THEN               \ End of inner test.
        \  0 psi !  \  No match if the stored word does not end.
        THEN   \ End of test for final char that has a psi-tag.
      THEN     \ End of test for matching aud0 with activation.
    THEN       \ End of test for a character matching "pho".
  -1 +LOOP     \ End of looping backwards from "spt".
   psi @ 0 = IF         \ If no multi-char recognition,
     monopsi @ 0 > IF   \ but if a one-char was found,
       monopsi @ psi !  \ use the one-letter recognition.
       0 monopsi !      \ Reset monopsi to zero.
     THEN               \ End of inner test.
   THEN  \ From JavaScript AI Mind code.
;  \ End of audRecog; return to short term memory audSTM.

http://mind.sourceforge.net/m4thuser.html is the Mind.Forth User Manual.

http://mind.sourceforge.net/variable.html explains the Seed AI variables.


5. Analysis of the Modus Operandi

The audRecog module recognizes words by initiating a match
with all auditory engrams that start out with the same phoneme
as the current input and that continue to match the input in
an unbroken chain. The audRecog module falls within the
Sensorium namespace of general AI modules to be coded in the
implementation of speech technology for robot AI on the Web.

Beyond the full-word Robot AI Mind namespaces suggested at
http://www.cpan.org/authors/id/M/ME/MENTIFEX/mind.txt
the following composite-word modules are open for coding:
audRecog -- auditory Recognition for a sense of hearing;
gusRecog -- gustatory Recognition for a sense of taste;
olfRecog -- olfactory Recognition for a sense of smell;
tacRecog -- tactile Recognition for a sense of touch;
visRecog -- vision Recognition for any sense of vision.


6. Troubleshooting and Robotic Psychosurgery

For either a human brain or a robot brain such as Mind.Forth,
recognizing a word means activating the concept named by the word.
In the software code of the AI Mind, the underlying concept of
a word is designated by a variable such as psi or "monopsi".
Therefore a first step in troubleshooting a malfunction of the
audRecog module may well be to insert a diagnostic line of code
that tracks the numeric value of the "psi" variable at the end
of each cycle of pattern-recognition of a word being recognized.
However, since early, proof-of-concept versions of the AI Mind
recognize only complete words (i.e., followed by a space or CR
carriage-return), the final "psi" setting in auditory memory
for a recognized word is determined only retroactively when
the Audition mind-module has detected either a space (gap) in
the input stream or a carriage-return (CR) as the end of input.
Therefore it becomes necessary to troubleshoot all three modules
simultaneously -- audRecog, audSTM and Audition -- since these
modules all work together to "hear" a word, recognize the sounds,
and to store an engram of the word in the auditory memory channel.

As versions of the AI Mind grow more advanced, they may have to
recognize not just complete words but rather individual morphemes
encapsulated as carriers of meaning within words. Troubleshooting
a morphemic audRecog module will be extremely tricky and arduous.
When a robotic AI Mind begins to use actual speech recognition
instead of the keyboard entry of characters comprising words,
ausRecog troubleshooting will involve vastly different problems.


7. Auditory Recognition Resources for Seed AI Germination and Evolution



The audRecog mind-module is the subject of Chapter 27
in your POD (print-on-demand) AI4U textbook,
as worthily reviewed and intellectually evaluated
by Mr. Christopher Doyon of the on-line Turing Store; and
by Prof. Robert W. Jones of Emporia State University.
A search on eBay may reveal offerings of AI4U and
a catalog search for hardbound and paperback copies
may reveal libraries beyond the following where students
of artificial intelligence may borrow the AI4U textbook:
  • Hong Kong University Call Number: 006.3 M981
  • North Carolina State University (NCSU) Call Number: Q335 .M87 2002
  • Texas A&M University
    Consider http://www.bookcrossing.com as a way to
    circulate and track your wandering copy of AI4U.
    At your own library you may submit a request for
    the acquisition of AI4U with ISBN 0595654371.


    Return to top; or to sitemap; or to
    C:\Windows\Desktop\Mind.html
    [For the above link to work, copy to your local hard disk
    http://mind.sourceforge.net/Mind.html
    and name it Mind.html in the C:\Windows\Desktop\ directory.]

    SourceForge Logo