\IfFileExists{../../../../../../dpi.inpe.br/banon-pc2@80/2006/11.01.13.53/doc/ISMM2007proceedings.cls}{%
	\documentclass[ams,twocolumn,extendedabstract]{../../../../../../dpi.inpe.br/banon-pc2@80/2006/11.01.13.53/doc/ISMM2007proceedings}
}{%
	\IfFileExists{../../../../../dpi.inpe.br/banon-pc2@80/2006/11.01.13.53/doc/ISMM2007proceedings.cls}{%
		\documentclass[ams,twocolumn,extendedabstract]{../../../../../dpi.inpe.br/banon-pc2@80/2006/11.01.13.53/doc/ISMM2007proceedings}
	}{%
		\documentclass[ams,twocolumn,extendedabstract]{ISMM2007proceedings}
	}
}

\RequirePackage[english]{babel}
\RequirePackage{tabularx}
\RequirePackage{graphicx}
\RequirePackage{subfigure}
\RequirePackage{hyperref}
\RequirePackage{amsrefs}

\newcommand{\R}{\mathbb{R}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\G}{\mathbb{G}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\LL}{\mathbb{L}}
\newcommand{\A}{\mathbf{A}}
\newcommand{\X}{\mathbf{X}}
\newcommand{\FX}{\mathcal{F}(\X)}
\newcommand{\vetx}{\mathbf{x}}
\newcommand{\vety}{\mathbf{y}}
\newcommand{\ima}{\mathbf{a}}
\newcommand{\imb}{\mathbf{b}}
\newcommand{\imc}{\mathbf{c}}
\newcommand{\ims}{\mathbf{s}}
\newcommand{\impulse}{\mathbf{i}_{\mathbf{h},v}}
\newcommand{\PX}{\mathcal{P}(\mathbf{X})}

\newcommand{\bb}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bbb}{\begin{align}}
\newcommand{\eee}{\end{align} }
\newcommand{\benu}{\begin{enumerate}}
\newcommand{\eenu}{\end{enumerate}}
\newcommand{\tr}{\mbox{tr}}
\newcommand{\cao}{\c{c}\~ao }
\newcommand{\coes}{\c{c}\~oes }

\newcommand{\vetw}{{\bf w}}
\newcommand{\vetn}{{\bf n}}
\newcommand{\tn}{\,\mathrm{t}\,}
\newcommand{\sn}{\,\mathrm{s}\,}
\newcommand{\ag}{\,\mathrm{a}\,}
\newcommand{\bpm}{\begin{bmatrix}}
\newcommand{\epm}{\end{bmatrix}}
\newcommand{\thetav}{\mbox{\boldmath$\theta$}}
\newcommand{\lambdav}{\mbox{\boldmath$\lambda$}}
\newcommand{\gammav}{\mbox{\boldmath$\gamma$}}
\newcommand{\varthetav}{\mbox{\boldmath$\vartheta$}}

\def\boxmax{\kern 0em\hbox{\rm \kern .25em\lower.1ex\hbox{\rlap{$\vee$}}\kern -.07em\lower.2ex\hbox{$\square$}\kern.25em}}
\def\boxmin{\kern 0em\hbox{\rm \kern .25em\lower.1ex\hbox{\rlap{$\wedge$}}\kern -.07em\lower.2ex\hbox{$\square$}\kern.25em}}
\def\dualimp{\kern 0em\hbox{\rm \kern .25em\lower.1ex\hbox{\rlap{$\Rightarrow$}}\kern 0em\lower-1.2ex\hbox{$\overline{\hspace{2ex}}$}\kern.25em}}

\def\circmax{\kern 0em\hbox{\rm \kern .25em\lower.1ex\hbox{\rlap{$\vee$}}\kern -.18em\lower-.1ex\hbox{$\bigcirc$}\kern.25em}}
\def\circmin{\kern 0em\hbox{\rm \kern .25em\lower.1ex\hbox{\rlap{$\wedge$}}\kern -.18em\lower-.0ex\hbox{$\bigcirc$}\kern.25em}}

\hypersetup{colorlinks=true,linkcolor=black,citecolor=black,urlcolor=black,filecolor=black}

\begin{document}

\title{Associative memories based on fuzzy mathematical morphology and an application in prediction}

\begin{Authors}
	\Author{Marcos Eduardo Valle}
		\Affil
		[UNICAMP]
		{State University of Campinas (UNICAMP), Brazil \\*
			\email{\{mevalle,sussner\}@ime.unicamp.br}}% institutional e-mail address
	\Author{Peter Sussner}
		\Affilref[UNICAMP]
 \end{Authors}

\section{Introduction}
\label{sec:Introduction}

{\em Fuzzy associative memories} belong to the class of fuzzy neural networks that employ fuzzy operators such as
fuzzy conjunctions, disjunctions, and implications in order to store associations of fuzzy patterns.
Fuzzy associative memories are generally used to implement fuzzy rule-based systems. 
Applications of FAMs include backing up a truck and trailer, target tracking, human-machine interfaces, robot
control, and voice cell control in ATM networks \cites{kosko92}.

Recently, we observed that many well-known FAM models perform elementary operations of fuzzy mathematical morphology at every node \cites{valle07fuzz,nachtegael01}. Therefore, many FAM models 
%such as the {\em max-min and max-product FAMs} of Kosko, the {\em max-min FAM with threshold} of Liu, and the {\em fuzzy logical bidirectional associative memory} of Belohl{\'a}vek, 
can be viewed as fuzzy morphological neural networks or - more precisely - as fuzzy morphological associative memories (FMAMs). 

Fuzzy morphological neural networks and FMAMs, in particular, involve concepts from the areas of mathematical morphology, fuzzy set theory, and artificial neural networks. We intend to provide a detailed analysis of FMAMs in the near future. In particular, we plan to explore the mathematical morphology aspects of FMAMs by developping a more general recording strategy for FMAMs that is based on the notion of adjunction. 

%After providing a brief introduction to FMAMs, we apply a certain FMAM model called Lukasiewicz FMAM or Lukasiewicz IFAM
%to the problem of monthly streamflow prediction of the hydo-electric plant Furnas that is located in southeastern
%Brazil. In this experiment, the Lukasiewicz FMAM outperformed the statistical method PARMA, a multi-layer perceptron,
%and a certain neuro-fuzzy network.


%Recently, Valle and Sussner noticed that the most widely known FAM models are close related to fuzzy mathematical morphology \cite{valle07fuzz}. This observation led to the development of a subclass of FAM models, called {\em fuzzy morphological associative memories} (FMAMs). 

\section{Basic concepts of fuzzy morphological associative memories}\label{FMAMs}

Morphological neural networks are equipped with {\em morphological neurons}, i.e. neurons  that perform either a dilation, an erosion, a anti-dilation, or an anti-erosion \cites{deng02,nachtegael01,sussner05sib}. In the fuzzy case, we simply
speak of {\em fuzzy morphological neurons}.

Fuzzy morphological neurons can be defined in terms of fuzzy conjunctions, fuzzy disjunctions, or fuzzy implications \cite{sussner05sib}. Due to page constrainst, we will only introduce max-$C$ morphological neurons since they represent the most important types of fuzzy neurons that occur in FMAM models and since other types of fuzzy morphological neurons can be obtained by means of a duality relationship such as adjunction or negation \cite{valle07fuzz}.

Recall that a {\em fuzzy conjunction} is an increasing mapping $C:[0,1] \times [0,1] \rightarrow [0,1]$ that satisfies $C(0,0)  =  C(0,1) = C(1,0) = 0$ and $C(1,1) = 1$. 
Examples of fuzzy conjunctions include the following operators: $C_M (x,y) = x \wedge y$ (minimum), $C_P(x,y) = x y$ (product), and $C_L (x,y) = 0 \vee (x+y-1)$ (Lukasiewicz fuzzy conjunction). Note that $C_M$, $C_P$, and $C_L$ also represent continuous t-norms.

If $x_1,\ldots,x_n$ are the fuzzy inputs, $w_{1},\ldots,w_{n}$  are the fuzzy synaptic weights, and $\theta \in [0,1]$ is the bias of a {\em max-$C$ neuron} then we compute the output $y \in [0,1]$ as follows:
\bb y = \left[ \bigvee_{j=1}^n C(w_j,x_j) \right] \vee \theta \,. \label{maxC} \ee
We may speak of a {\em max-$C $ morphological neuron} if and only if $C (x,\cdot)$ is a dilation for every $x \in [0,1]$ \cite{deng02}. In this case, Equation \ref{maxC} corresponds to a fuzzy dilation \cites{sussner05sib}. 
%Examples of max-$C$ morphological neurons include max-$C_M$, max-$C_P$,  and max-$C_L$ neurons.

A FMAM that consists of max-$C_L$ neurons is called a Lukasiewicz FMAM. This FMAM model can be trained using
{\em Lukasiewicz implicative learning} and in this case the Lukasiewicz FMAM coincides with the Lukasiewicz IFAM \cite{sussner06fs}. In general, the implicative learning scheme can be described as follows.

Suppose that we want to record the fundamental memory set $\{
\left( \vetx^\xi, \vety^\xi \right): \xi=1,\ldots,k \}$, where
$\vetx^\xi \in[0,1]^n$ and $\vety^\xi \in [0,1]^m$ by means of a
synaptic weight matrix $W=(w_{ij}) \in [0,1]^{m \times n}$.
The implicative fuzzy learning scheme consists in synthesizing the weight matrix $W$ as follows.
\bb w_{ij} = \bigwedge_{\xi = 1}^p 
I_R(x_j^\xi, y_i^\xi) \,. \ee
Here, $I_R$ denotes the $R$-implication that corresponds to a certain continuous t-norm.



%Fuzzy morphological associative memories open a new field of research. These models can be explored from different perspectives since they unite mathematical morphology, fuzzy set theory, and artificial neural networks. For instance, we intent to develop an efficient encoding recipe to store patterns based on the adjunction relationship deeply explored in mathematical morphology. From the fuzzy systems theory point of view, FMAMs allow for the storage and the recall of fuzzy patterns (or fuzzy sets). Thus, they can be used to represent fuzzy rule-based systems \cite{kosko92}. In particular, FMAMs can be used to forecast time series as shown in the next section \cite{sussner06fs}.

\section{An application in prediction}\label{Application}

In this section, we applied the Lukasiewicz FMAM to the problem of
forecasting the average monthly streamflow of a large hydroelectric
plant \cite{magalhaes04}. 
%The Lukasiewicz FMAM is a single layer feedforward ANN with max-$C_L$ morphological neurons, i.e., morphological neurons based on the Lukasiewicz fuzzy conjunction $C_L$. Consequently, a Lukasiewicz FMAM with $m$ neurons corresponds to a fuzzy dilation that associates a pattern $\vetx^\xi \in [0,1]^n$ to a pattern $\vety^\xi \in [0,1]^m$, for $\xi=1,\ldots,k$ \cite{valle07fuzz}.

The time series prediction problem considered can be stated as follows: Given samples of the time series, $s_\xi$ for $\xi=1,\ldots,q-1$, we would like to obtain an estimate $\hat s_q$ for the correct streamflow $s_q$ based on a subset of the past values $s_1,\ldots,s_{q-1}$. The seasonality of the monthly streamflow suggests the use of 12 different models, one for each month of the year \cite{magalhaes04}. Furthermore, our FMAM based model only uses a fixed number of three antecedents. For example, the values of  January, February, and March were taken into account to predict the streamflow of April.

The predictor based on the Lukasiewicz FMAM stores associations $(\vetx^\xi,\vety^\xi)$, for $\xi=1,\ldots,k$, where $\vetx^\xi$ and $\vety^\xi$ are fuzzy sets that comprise some relevant information concerning the past values of the time series. 
%Roughly speaking, a association $(\vetx^\xi,\vety^\xi)$ represent fuzzy rules such as ``IF the streamflows of the past three months were {\em large}, THEN the streamflow is {\em large}''.
Given an input $\vetx^q$ that takes into account the last three samples of the time series, the FMAM produces an output pattern $\vety^q$. A defuzzification of $\vety^q$ yields $\hat s_q \approx s_q$.  

In this experiment, we employed the {\em subtractive clustering method} \cite{chiu94} to determine fuzzy sets $\vetx^\xi$ and $\vety^\xi$ with Gaussian-type membership functions from streamflow data from 1931 to 1990 \cite{magalhaes04}. For computational reasons, $\vetx^q$ was modeled as a discrete Dirac-$\delta$ function. A defuzzification of $\vety^q$ using the center of mass yielded $\hat s_q$.

Figure \ref{fig:prediction} shows the forecasted streamflows estimated
by the prediction model based on the FMAM for the Furnas reservoir from 1991
to 1998. The continuous line corresponds to the actual values and the dashed line corresponds to the predicted values. Table \ref{prediction} compares the errors that were generated by the FMAM model and several other models \cite{magalhaes04}. In contrast to the FMAM-based model, the MLP, NFN, and FPM-PRP models were initialized by optimizing the number of the parameters for each monthly prediction. For example, the MLP considers $4$ antecedents to predict the streamflow of January and $3$ antecedents to predict the streamflow for February. Moreover, the FPM-PRP model also takes into account slope information which requires some additional ``fine tuning". We experimentally determined a variable number of parameters (including slopes) for the FMAM model such that MSE = $0.88 \times 10^5$, MAE = $157$, and MPE =  $15$. 

\begin{figure}
\begin{center}
$\includegraphics[width=1.05\columnwidth]{prevFMAM.jpg}$
\caption{The streamflow prediction for the Furnas reservoir from 1991 to
1998.} \label{fig:prediction}
\end{center}
\end{figure}

\vspace{-2mm}

\begin{table}
\begin{center}
\caption{Mean Square, Mean Absolute, and Mean Relative Percentage
Errors.} \label{prediction}
{\renewcommand{\baselinestretch}{1.2}% for tabular environment
\small
\begin{tabular}{lccc}
\hline 
{\em Methods} & MSE {\footnotesize ($\times 10^5$)} & MAE {\footnotesize ($m^3/s$)} & MPE {\footnotesize ($\%$)} \\ \hline
FMAM & $1.38$ & $221$ & $21$\\
PARMA  & $1.85$ & $280$ & $28$ \\
MLP & $1.82$ & $271$ & $30$ \\
NFN & $1.73$ & $234$ & $20$ \\
FPM-PRP & $1.20$ & $200$ & $18$ \\
 \hline
\end{tabular}}
\end{center}
\end{table}

\section*{Acknowledgments}
This work was supported in part by CNPq under grants n.\ 142196/03-7, 303362/03-0, and 306040/06-9, and FAPESP under grant n.\ 2006/06818-1.

%\bibliography{/home/marcos/refs}
% \bib, bibdiv, biblist are defined by the amsrefs package.

\begin{bibsection}
\begin{biblist}[\resetbiblist{9}]

\bib{chiu94}{article}{
      author={Chiu, S.},
       title={Fuzzy model identification based on cluster estimation},
        date={1994 Sept.},
     journal={Journal of Intelligent and Fuzzy Systems},
      volume={2},
      number={3},
	  pages={267\ndash 278},
}

\bib{deng02}{article}{
      author={Deng, T.Q.},
      author={Heijmans, H.J.A.M.},
       title={Grey-scale morphology based on fuzzy logic},
        date={2002 Mar.},
     journal={Journal of Mathematical Imaging and Vision},
      volume={16},
      number={2},
       pages={155\ndash 171},
}

% \bib{hassoun93}{book}{
%       editor={Hassoun, M.~H.},
%        title={Associative neural memories: Theory and implementation},
%    publisher={Oxford University Press},
%      address={Oxford, U.K.},
%         date={1993},
% }
% 
% \bib{kohonen84}{book}{
%       author={Kohonen, T.},
%        title={Self-organization and associative memory},
%    publisher={Springer Verlag},
%         date={1984},
% }

\bib{kosko92}{book}{
      author={Kosko, B.},
       title={Neural networks and fuzzy systems: A dynamical systems approach
  to machine intelligence},
   publisher={Prentice Hall},
     address={Englewood Cliffs, N.J.},
        date={1992},
}

\bib{magalhaes04}{inproceedings}{
      author={Magalh{\~{a}}es, M.},
      author={Ballini, R.},
      author={Gon{\c{c}}alves, R.},
      author={Gomide, F.},
       title={Predictive fuzzy clustering model for natural streamflow
  forecasting},
        date={2004},
   booktitle={Proceedings of the IEEE international conference on fuzzy
  systems},
     address={Budapest, Hungary},
       pages={390\ndash 394},
}

\bib{nachtegael01}{article}{
      author={Nachtegael, M.},
      author={Kerre, E.E.},
       title={Connections between binary, gray-scale and fuzzy mathematical
  morphologies},
        date={2001 Nov.},
     journal={Fuzzy Sets and Systems},
      volume={124},
      number={1},
       pages={73\ndash 85},
}

% \bib{gomide98}{book}{
%       author={Pedrycz, W.},
%       author={Gomide, F.},
%        title={An introduction to fuzzy sets: Analysis and design},
%    publisher={MIT Press Complex Adaptive Systems},
%         date={1998},
% }

\bib{sussner05sib}{inproceedings}{
      author={Sussner, P.},
      author={Valle, M.~E.},
       title={A brief account of the relations between gray-scale mathematical
  morphologies},
        date={2005 Oct.},
   booktitle={Proceedings of the Brazilian symposium on computer graphics and
  image processing (SIBGRAPI)},
     address={Natal, Brazil},
       pages={79 \ndash  86},
}

\bib{sussner06fs}{article}{
      author={Sussner, P.},
      author={Valle, M.~E.},
       title={Implicative fuzzy associative memories},
        date={2006-12},
     journal={IEEE Transactions on Fuzzy Systems},
      volume={14},
      number={6},
       pages={793\ndash 807},
}

\bib{valle07fuzz}{inproceedings}{
      author={Valle, M.~E.},
      author={Sussner, Peter},
       title={Fuzzy associative memories from the perspective of mathematical
  morphology},
        date={2007 July},
   booktitle={Proceedings of the IEEE international conference on fuzzy systems
  (FUZZ-IEEE 2007)},
     address={London, United Kingdom},
       pages={829 \ndash  834},
}

\end{biblist}
\end{bibsection}


\end{document}
