A Fuzzy Finite State Machine Implementation Based On A Neural Fu
A Fuzzy Finite State Machine Implementation Based On A Neural Fu
Abstract - The outputs of a feedforward neural and govem the transitions of the FFSM between the
network depend on the present inputs only. Difficulties fuzzy states. The fuzzification of FSM results in data
arise when a solution requires memory in such reduction (less memory to implement the FFSM) as
applications as speech processing, seismic signal well as more robust operation (less susceptible to
processing, language processing, and spatiotemporal system parameter changes or to noise) as stated in [5].
signal processing. For such applications, the outputs
are not only the functions of the present inputs but the Also, with this approach, writing a new program is
present states (or the past inputs and the outputs) as not required since the ANN of NeuFuz is trained with
well. The fuzzy finite state machines can be effectively the state transition table and implementation of a new
used in these applications. The aim of this study is to FFSM is achieved directly with the training data. This
show that a fuzzy finite state machine can be realized increases the reliability. Furthermore, the suggested
using our neural fuzzy system. In a fuzzy finite state approach facilitates the design and implementation of
machine, the output and the next state depend on the a FFSM using a microcontroller.
input and the present state which in turn is a function
of the previous inputs. To accommodate the memory The FFSM concept is introduced in the next
requirement, the feedfonvard structure of the neural section. In Section 3, a brief description of NeuFuz is
fuzzy system is changed to a recurrent architecture by given. An illustrative temporal pattem matching
adding a feedback loop from the output layer to the experiment is carried out in Section 4 to verify the
input layer during the recall mode. The validity of the validity of our approach. Section 5 contains the
approach is verified with a temporal pattern matching conclusions.
experiment.
2. A Fuzzy Finite State Machine
1. Introduction
A FFSM is a synchronous sequential machine and
In our previous works, it has been shown that the it can be defined as a quintuple following the crisp
artificial neural networks (ANN) can be combined FSM definition in [4]:
with fuzzy logic systems to achieve high performance
and low cost solutions [ll-[3]. In this work, the
feedfonvard structure of our neural fuzzy system
(NeuFuz) is changed to a recurrent architecture by where I, 0, and S are finite, nonempty sets of fuzzy
adding a feedback loop from the output layer to the inputs, fuzzy outputs, and fuzzy states respectively,
input layer during the recall mode. With this and f: I X S + S is the state transition function, g is
modification, we demonstrate that NeuFuz can be used the output function such that g: I X S + 0. The
to implement a Fuzzy Finite State Machine (FFSM). Cartesian product I X S contains all pairs of fuzzy
elements (u(t), x(t)). The state transition function f
A FFSM is an extension of a conventional FSM. maps each fuzzy pair (u(t), x(t)) onto a fuzzy next state
The difference is that the inputs, the present states and x(t+l) in S, and the output function g maps each fuzzy
the next states are represented using fuzzy sets in pair (u(t), x(t)) onto a fuzzy output y(t) in 0 in
contrast with the crisp inputs and the states of a accordance with
traditional crisp FSM. The output function and the
state transition function of the FSM are replaced by
the recurrent fuzzy rules which determine the outputs
In general, the state transition function f, and the During the training phase, one input of the ANN is
output function g (given in equations (2) and (3) used for the external input U(t), and another input is
respectively) can be represented using fuzzy rules in used for the present state X(t). The output of the ANN
the following format is used for the next state X(t+l) as shown in Figure 1.
There is no need to use separate outputs for the next
If Input = U t ) and Presentstate = x ( t ) state X(t+l) and the external output Y(t) of the FSM,
1
then Next tate = x( t + 1) (5) since a Moore type of FFSM is implemented.
If Input = u(t) and Presentstate = x ( t ) The output X(t+l) is fed back to the present state
then Output = y ( t ) (6) input X(t) through a unit delay D, once the training is
completed. Thus, the architecture of the neural fuzzy
and the membership functions , px(t), pgt+l)are system is changed from a feedforward structure to a
defined for the fuzzy input u(t), fuzzy present and the recurrent architecture during the recall mode as
next states x(t) and x(t+l) respectively as usual. depicted in Figure 2. There is a comparator at the
output to determine whether the system is at the final
Note that the derivation of the fuzzy rules (given in
equation (5) and (6)) and the associated membership
functions is not trivial. The task is to transform the
crisp FSM into the corresponding FFSM. This requires
the partitioning of the crisp states and the crisp inputs
into the clusters (fuzzy sets) and generate the
associated membership functions using the state
transition table that corresponds to the crisp FSM.
This is achieved by means of the ANN in NeuFuz.
1750
I I7
Legend:
D: Unit Delay
1751
Figure 4: State transition diagram to recognize the temporal pattern in Figure 3.
The next step is the training of the ANN in X(t+l) corresponding to the consecutive next states
NeuFuz. Table 2 contains the procedure to generate and inputs as can be seen in Table 4.
the training data set. Following the procedure, the
numerical values are assigned to the states as listed in The parameters shown in Table 5 are used for the
Table 3. The numerical assignments can be arbitrary. training. It takes 109,286 iterations for the ANN to
However, to facilitate the convergence of the ANN in converge with these parameters. The generated
NeuFuz, the assignment in Table 3 is chosen to membership functions for the input u(t) and the
minimize the variations between the next state values present state x(t), and the fuzzy rules are given in
matrix format in Figure 5a, 5b and Table 6
Table 3: Numerical state assignments respectively. The NeuFuz generates an assembler
program code automatically. The required amount of
memofy to implement this FFSM is 894 bytes (in
National’s COP8 Microcontroller ).
1752
Table 5: Training Mode Parameters
Legend:
E: Tolerated error, LR: Learning rate, I>F:Learning factor, MF:
input, x(t): Fuzzy present state
# MFu
MF x(t)
# Rules 49
1753
signal detection subsystem. Furthermore, the
suggested approach facilitates the design and
implementation of a FFSM using a microcontroller
and provides more robust response (less susceptible to
system parameter changes or to noise) as stated in [5].
The results obtained encourage us to apply our method
to the automotive problems such as airbag deployment
and antilock braking system as well as other
spatiotemporal signal processing applications. Further
studies are underway to determine the applicability of
this approach to speech processing.
Figure 5a: Membership Functions pu(U(t)) for the References
Fuzzy Input u(t)
E. Khan and P. Venkatapuram, "NeuFuz: Neural
1.o
Network Based Fuzzy Logic Design Algorithms,"
0.8 FUZZ-IEE93 Proceedings, vol. 1, pp. 647-654,
San Francisco, California, March 28 - April 1,
0.6 1993.
1754
11-1