Javier Echanobe, Ines del Campo and Guillermo Bosque
Department of Electronics, University of the Basque Country, Spain
Intelligent environments, Embedded systems, Neuro-Fuzzy, FPGA.
Intelligent Environments are endowed with a large number of non-intrusive, embeded electronic systems, such
as sensors, microprocessors, actuators, etc. These electronic systems must exhibit intelligent abilities in order
to learn and adapt from the users’ habits and preferences. In this paper, we propose a Neuro-Fuzzy electronic
embedded system to control several ambient parameters of an intelligent environment, such as temperature,
illumination, volume of the sound, and aroma. In particular the PWM-ANFIS model has been selected which
provides learning/adaptation features and also fuzzy reasoning. The system is implemented on a reconfigurable
device (i.e., FPGA) leading to a small, compact and very efficient electronic system.
An Intelligent Environment, also known as Ambi-
ent Intelligence Environment, is characterized by
its ubiquity, transparency and intelligence (ISTAG,
2001)(ESTO, 2003)(ISTAG, 2005). It must be ubiq-
uitous in the sense that the environment is endowed
with a multitude of embedded electronic systems such
as sensors, microprocessors, communication devices,
actuators, etc. It must be also transparent so the users
do not note the presence of the electronic infraestruc-
ture in question. Finally, the system requires intelli-
gent abililties in order to process - in a smart way - the
large amount of information coming from the sensors,
to be aware of the context, and also to learn and adapt
from the habits and necessities of the users.
Neuro-Fuzzy Systems are a class of systems pro-
vided with some intelligent features. In particular, the
Neuro-Fuzzy System model known as ANFIS (Adap-
tive Neuro-Fuzzy Inference System) (Jang, 1993) has
been widely used in different application scopes such
as Robotics, Control Systems, Automotive, Pattern
Recognition, etc. (Jang, 1993) (Jang and Sun, 1995),
providing quit good results. The main feature of
an ANFIS system relies on its ability to integrate in
an efficient way knowledge representation, reasoning,
and learning. That is, on the one hand it is able to
describe a problem by means of linguistic rules of
the form ”IF-THEN” and to perform reasoning using
fuzzy logic. On the other hand, it also exhibit learn-
ing performances typical of Neural-Networks. Hence,
an ANFIS system can adapt its behaviour (i.e., its re-
sponse) from a set of learning samples in order to han-
dle new different siuations. Both reasoning and learn-
ing attributes constitute the powerful characteristics
of Neuro-Fuzzy systems to be used in Intelligent En-
On the other hand, reconfigurable devices like FP-
GAs are a class of efficient electronic devices which
are widely used in an increasing number of areas.
Moreover, they are usually the main component of
many embedded systems. They provide both high
performance because they are hardware based and
high flexibility because they can be easily reconfig-
ured in order to modify or improve their functional-
ity. In addition, the increasing complexity and in-
tegration of electronic devices have led to powerful
new FPGA device families with a huge amount of re-
sources, able to accommodate all the components of a
typical embeddedsystem (e.g., processor cores, mem-
ory blocks, peripherals, dedicated hardware, etc.), on
a single chip, commonly referred to as system-on-
a-programable-chip (SOPC). Hence, FPGA are ap-
propiate devices to be used in Intelligent Environ-
ments where there could be a great number of such
systems integrated in all the space in a non-intrusive
In this paper, we propose the development over
reconfigurable devices (i.e., FPGAs) of an embedded
electronic system for the intelligent control of an in-
Echanobe J., del Campo I. and Bosque G. (2009).
In Proceedings of the International Joint Conference on Computational Intelligence, pages 559-564
DOI: 10.5220/0002321105590564
habited environment. In particular, an ANFIS-like hy-
brid Neuro-Fuzzy architecture has been designed and
implemented. The system is provided with adaptation
and learning features so it can fit the necessities and
preferences of the users of the environment, including
changes that can arise after a long period of time.
The rest of the paper is organised as follows: Sec-
tion 2 introduces the proposed ANFIS-like neuro-
fuzzy system. Section 3 shows an eficient hetero-
geneous hardware-software architecture to implement
the PWM-ANFIS system. In Section 4, an embed-
ded system intended for an Intelligent Environment is
showed. Section 5 shows the implementation of the
system which has been carried out on a FPGA de-
vice. Some details about the HW/SW requirements
and also the performance of the system are presented
here. Finally, some conclusions and future works are
An ANFIS system (Jang, 1993) is a Fuzzy Infer-
ence System whose parameters (membership func-
tions, strength of the rules, consequents, ...) are
trained by means of Neural Network algorithms. The
system can be viewed as a particular Neural Network
that is functionally equivalent to a Fuzzy Inference
System. Hence, it exhibits both the linguistic knowl-
edge representation of fuzzy systems and the learn-
ing abilities of Neural Networks. On the other hand,
note that as Neural Networks exhibit a notable par-
allelism in their structure, very efficient implementa-
tions can be achieved for ANFIS systems by means
of hardware solutions (e.g. FPGAs based implemen-
tations (Omondi and Rajapakse, 2006)(del Campo
et al., 2008)). Let us describe the structure of an AN-
FIS system:
Consider a rule based n-input fuzzy system with
m antecedent functions per dimension. There are m
rules where the j-th rule can be expressed as:
: IF x
is A
and ...and x
is A
THEN f is
... j
where x = (x
, x
, . . . , x
), x R
is the input vec-
tor; A
, . . . A
are linguistic labels associated with
the membership functions µ
) (i.e., antecedents of
the rules), y is the output variable, and c
... j
is a crisp consequent (i.e. a singleton). If the center
of gravity defuzzification method is adopted, the out-
put of the system is given by (1) being w
= A
) ·
) · · · · · A
f =
This fuzzy system can be represented by a neu-
ral network (Figure 1) where the first layer computes
the membership functions; the second layer computes
the values w
(1 j m
); the third layer normal-
izes these values; the fourth layer computes w
(1 j m
). Finally the output of the network is pro-
vided by the fifth layer which aggregates the overall
output as the summation f =
. It can be easily
shown that this network performs the same function
as the fuzzy system (Jang, 1993). Regarding the com-
putational cost, it is required 1 division, m
· (n + 1)
products, 2 · m
sums and m · n membership evalua-
tions to perform an inference.
Figure 1: ANFIS Network structure.
To train the above network, a hybrid algorithm has
been proposed (Jang, 1993). The algorithm is com-
posed of a forward pass which is carried out by a
Least Squares Estimator (LSE) process, followed by
a backward pass which is carried out by a back prop-
agation (BP) algorithm. The LSE computes the con-
sequents and the back propagation adjusts the param-
eters of the antecedents. Although the back propaga-
tion algorithm could train the network alone, the train-
ing process can be accelerated with the LSE. This is
possible due to the fact that the output of the network
is linear in the consequent parameters.
Due to the huge amount of information and the
large number of parameters that are involved in an
Intelligent Environment, we have used a modified
model called PWM-ANFIS (PieceWise Multilinear
ANFIS) which we have proposed (del Campo et al.,
2008) (Echanobe et al., 2008) to reduce the computa-
tional requirements in high dimensionality systems.
In particular, we have shown how, by introducing
some restrictions on the membership functions (i.e.,
antecedents), a much more simplified system can be
obtained with hardly any loss of the learning and ap-
proximation capabilities. These restrictions basically
involve the use of normalized triangular membership
IJCCI 2009 - International Joint Conference on Computational Intelligence
functions overlapped by pairs. As a result, it is only
required 2
(2n+ 1) + n products and 2
+ 2n sums to
perform an inference. As we can see, this cost is dras-
tically less than the initial one and it does not depend
on the number of membership functions m. More-
over, as n and m increase, the difference between the
two costs becomes huge.
Neural Networks contain two types of algorithms: On
the one hand there are training algorithms (e.g. BP,
LSE) that exhibit high irregularity, require high preci-
sion arithmetics and demand high computational cost.
On the other hand, we have the computation of the
network itself, which provides the network output for
a given input (i.e., the inference of the rules in the
ANFIS). This process implies regular and repetitive
calculations which are suitable to be performedin par-
Taking into account these two different algorithms
we propose an heterogeneous HW/SW architecture
to implement the PWM-ANFIS (see Figure 2). HW
implementations can exploit the parallel nature of
the algorithms, therefore the computation of the net-
work output will be implemented in the HW parti-
tion. Moreover, as it is shown in Figure 2, many
PWM-ANFIS subsystems may be implemented all at
once because many parameters must be simultane-
ously controlled in an Intelligent Environment. On
the other hand, the training algorithms are imple-
mented clearly better in software and hence they will
be addressed in the microprocessor-based system. In
fact, an analysis in detail of the hybrid training al-
gorithm (LSE+BP) shows that a hardware implemen-
tation would be highly complex. The control of the
global process and the input-output data handling is
also carried out by this software partition. Although
all the process can be developpedin software, the ben-
efits of the hardware parallelism are huge. For exam-
ple, if we observe the complexity expresions in the
previous section, we have that it is required 56 prod-
ucts and 14 sums to perform an inference in a 3-input
system. The hardware partition can perform all these
operations in parallel consuming many few clock cy-
cles whereas a microprocessor would spent at least 70
(56+14) cycles. Moreover, if several systems are im-
plemented simultaneously the difference is outstand-
ing. In next sections, we will show the implementa-
tion of 4 systems in the same FPGA.
In particular we will develop our implementation
over an FPGA device that integrates together with the
uProcessor system
PLB (Peripheral Local Bus)
2 inputs
2 inputs
3 inputs
3 inputs
4 inputs
4 inputs
Figure 2: Architecture of the proposed system.
reconfigurable hardware one (or more) micropocessor
core. Hence, the Software partition will be addressed
in this core while the HW partition will use the rest of
the FPGA. Therefore, all the system is integrated on
a single device with the corresponding advantages in
size, power, and cost.
An Intelligent Environment can be understood as a
collection of distributed devices (i.e., sensors and ac-
tuators) linked with one or more electronic control
units (ECUs) (Schoitsch and Skavhaugh, 2006) (i.e.,
microprocessors, microcontrollers, FPGAs, ...) en-
dowed with robust algorithms which implies ”smart”
or ”intelligence” capabilities. In this work, we have
carried out the design, implementation and verifica-
tion of an embedded electronic system for one of this
ECUs, following the architecture described in the pre-
vious section. We assume that some ambiental pa-
rameters values are provided by external sensors and
that we can modify some others via actuators. In par-
ticular, we deal with 6 input parameters of a room
or salle: External Temperature, Internal occupancy
(i.e., persons inside the room), Internal Noise, Exter-
nal Light level, External Humidity and External Pol-
lution. The output variables of the system are: In-
ternal Temperature, Internal Light Level, Volume of
the Sound (if music is being heard) and Intensity of
an Air-Freshener or a Fragance. The control of these
four variables are achieved by 4 PWM-ANFIS sub-
systems whose dependence on the input variables is
showed in Table 1. Thus, we have two 2-input sub-
systems and two 3-input sub-systems. The choice of
these variables, their dependences and the behaviour
of the environment have been provided by an expert
from an architecture and environment-design com-
pany. In particular, this knowledge has been ex-
pressed by means of linguistic rules of the form ”IF-
THEN”. From this set of rules a Fuzzy System has
been built up and from it, a collection of input-output
data has been generated to train the PWM-ANFIS.
Table 1: Dependence between input and ouput environment
parameters in the 4 PWM-ANFIS Subsystems.
Subs.1 Subs.2 Subs.3 Subs.4
Inputs Temp. Light Volum. Aroma
Occupancy X X X
Ext. Light X X
Ext. Temp. X
Pollution X X
Int. noise X
Humidity X
In order to verify that the PWM-ANFIS system
preserves good approximation capabilities despite the
restrictions imposed on the antecedent functions, we
have compared the output surfaces obtained a) by the
PWM-ANFIS system and b) by using the target func-
tion derived from the set of linguistic rules (i.e., from
the constructed fuzzy system). Also the training error
curves have been represented to analyze the learning
process. Two of the four sub-systems described above
are showed here: A 2-input system and a 3-input sys-
tem. In the following section we present these results.
4.1 2-Input PWM-ANFIS
As an example of a 2-input system, we show here
the results obtained with the first sub-system of Ta-
ble 1: the control of the internal Temperature with
respect to the occuppancy and to the External Light
Level. To train this system, 121 input-output data
pairs ((x
, x
), f) are collected by taking 11 equally
distributed values for both the Occupancy (x
) and
the External Light Level (x
), and computing the In-
ternal Temperature values ( f) by the fuzzy system
as we have already commented. The number of an-
tecedent functions per input variable has been set to
5 so we obtain a total of 25 rules and consequents.
Figure 3 shows the output surfaces for this example
(all the variables have been normalized to the interval
[0,1]): a) The target function to be approximated; b)
The approximated function obtained with the PWM-
ANFIS system once it has been trained. We can see
how the approximated surface is quite similar to the
target one. On the other hand, Figure 4 shows the re-
sults of the learning procedure. It can be seen how
the shape and position of the triangular membership
functions (antecedents) have been modified from an
initial symetric distribution to fit the training data. On
the other hand the evolution of the error value - during
the training phase - between the PWM-ANFIS output
and the target function is shown. As we can see, a
very small value is obtained even after few iterations,
so the learning ability is still quite good.
Figure 3: Output surfaces for Internal Temperature y1 re-
garding the Occupancy level (x1) and the External Light
level(x2). Target surface (up) and PWM-ANFIS surface
4.2 3-Input PWM-ANFIS
To illustrate a 3-input system we show here the sub-
system used to control the Internal Illumination with
respect to the External Illumination (x
) , External
Temperature (x
), and the External Pollution (x
Again, 11 equally distributed values are taken for ev-
ery input variable so a total of 1331(11x11x11)input-
output data pairs are collected to train the system.
In addition, five antecedents are set per dimension,
leading to a total of 125 rules. Figure 5 shows the
ouput surfaces for a fixed value of the External Pol-
lution (i.e., so it can be represented). Again we can
see that both surfaces are quite similar so the system
also presents here good approximation performances.
With regard to the learning process, the results are
IJCCI 2009 - International Joint Conference on Computational Intelligence
Figure 4: Example 1: triangular antecedents after training
(up) and training error evolution (down).
also satisfactory and again a very small error value is
obtained after a small number of iterations (see Figure
These two examples show the good approxima-
tion capability of the PWM-ANFIS. Obviously, the
generic ANFIS (i.e., unrestricted gaussian member-
ship functions) provides, general speaking, better ap-
proximation capability. However, the degree of ap-
proximation can be arbitrarily set in our system by
taking a higher number of antecedents per dimension,
m. Moreover, higher m does not increase the com-
plexity of the system as it was shown in Section 2.
The system has been implemented in a XILINX’s
FPGA, in particular over a XC2VP30 device from
the VIRTEX-II Pro familly. Such a device is an in-
termediate one in the VIRTEX-II Pro familly and
integrates a PowerPC-based microprocessor system,
13.696 Logic Blocks (Slices), 136 multipliers, em-
bedded memory and some other resources. In addi-
tion, the ISE and EDK design tools, also from XIL-
!" !#
!" !#
Figure 5: Output surfaces for Internal Illumination y2 re-
garding the External Illumination (x3) and the External
Temperature (x4), for a fixed pollution value. Target sur-
face (up) and PWM-ANFIS surface (down).
INX, have been used to design, synthetise, simulate
and verify the implementation. The device resources
used by the implementation are the following: On the
one hand, each one of the two 2-input PWM-ANFIS
subsystems requires 137 Slices (1%) and 10 multi-
pliers (7%). On the other hand, each one of the two
3-input PWM-ANFIS subsystems requires 828 Slices
(6 %) and 35 multipliers (25%). The complete sys-
tem - including the HW/SW interface and the RAM
memory for the software partition - makes use of
1375 Slices (10%), 40 multipliers (29%) and 64 RAM
blocks (47%). The operation frequency of the system
is 100MHz both for the microprocessor and for the
clock of the hardware partition. Moreover, due to the
high parallel degree achievedfor the hardware design,
the evaluation of every PWM-ANFIS (i.e., the infer-
ence of the rules for a given input) is achieved in just
seven clock cycles (70ns). If these inferences were
performed solely in software it would be necessary at
least 196 cycles (152 products and 44 sums), as it is
derived from expresions in Section 2.
Concerning the precision of the computations, the
system provides its responses in a 32-bit signed data
Figure 6: Example 2: triangular antecedents after training
(up) and training error evolution (down).
format which is sufficient precision for this kind of
An efficient Embedded Electronic System for Intelli-
gent Environments has been developped. The system
is intended for the control of some environment pa-
rameters inside a room such as temperature, illumina-
tion etc. The system is based on a Neuro-Fuzzymodel
which provides features such as learning, adapting
and fuzzy information processing. In particular a
PWM-ANFIS Neuro-Fuzzy model has been adopted
which is a computational-efficient version of the well
known ANFIS model. First, some numerical simula-
tions were carried out in order to validate the model,
and the results obtained show an appropiate response.
Finally, an efficient heterogeneous HW/SW imple-
mentation has been realised and tested. Training al-
gorithm is excuted in software due to its irregularity
and the required precission while the neural network
computation is addressed in hardware to exploit its in-
herent parallelism. This implementation is performed
over an FPGA device (i.e., a XILINX’s VIRTEX-II
Pro) and integrates in the same device four PWM-
ANFIS models, each one controllingone environment
parameter. It also integrates a microproccesor sub-
system which executes the learning procedure and the
input-output data handling. The whole design works
at a frequency of 100MHz and all the four PWM-
ANFIS systems perform simultaneously the rule in-
ferences in just 70ns. To improve even more the ef-
ficiency of the proposed system, future work will be
devoted to make use of the Dynamic Partial Recon-
figuration techniques so that the size and the power
consumption of the systems can be optimized.
This work was supported in part by the Basque Coun-
try Government under Grants GIC07/138-IT-353-07
and S-PE08UN49.
del Campo, I., Echanobe, J., Bosque, G., and Tarela, J.
(2008). Neuro-fuzzy modeling and control. IEEE
Transactions on Fuzzy Systems, 16(3):761–778.
Echanobe, J., del Campo, I., Bosque, G., and Tarela., J.
(2008). An adaptive neuro-fuzzy system for efficient
implementations. Information Sciences, 178:2150–
ESTO (2003). Science and Technology Roadmapping: Am-
bient Intelligence in Everyday Life (AmI@Life). Eu-
ropean Science and Technology Observatory (ESTO).
ISTAG (2001). Scenarios for Ambient Intelligence in 2010.
IST Advisory Group (ISTAG), European Commission
Community Research.
ISTAG (2005). Ambient Intelligence: from vision to reality.
IST Advisory Group (ISTAG), European Commission
Community Research.
Jang, J. . R. (1993). Anfis: Adaptive-network-based fuzzy
inference system. IEEE Trans. Systems, Man, and Cy-
bernetics, 23(3):665–685.
Jang, J. . R. and Sun, C.-T., M. (1995). Neuro-fuzzy model-
ing and control. Proceedings of the IEEE, 83(3):378–
Omondi, A. R. and Rajapakse, J. C. (2006). FPGA Imple-
mentations of Neural Networks. Springer.
Schoitsch, E. and Skavhaugh, A. (2006). Embedded intelli-
gence. ERCIM News, 67:14–15.
IJCCI 2009 - International Joint Conference on Computational Intelligence