Using Alpha-Beta Associative Memories to Learn and Recall RGB

0 downloads 0 Views 412KB Size Report
Using Alpha-Beta Associative Memories to Learn and Recall RGB Images. 829. 2 Alfa-Beta Associative Memories αβ associative memories are of two kinds and ...
Using Alpha-Beta Associative Memories to Learn and Recall RGB Images Cornelio Yáñez-Márquez, María Elena Cruz-Meza, Flavio Arturo Sánchez-Garfias, and Itzamá López-Yáñez Centro de Investigación en Computación, Instituto Politécnico Nacional, Laboratorio de Inteligencia Artificial, Av. Juan de Dios Bátiz s/n, México, D.F., 07738, México [email protected], [email protected], {fgarfias, ilopezb05}@sagitario.cic.ipn.mx

Abstract. In this paper, an algorithm which enables Alpha-Beta associative memories to learn and recall color images is presented. The latter is done even though these memories were originally designed by Yáñez-Márquez [1] to work only with binary patterns. Also, an experimental study on the proposed algorithm is presented, showing the efficiency of the new memories.

1 Introduction Basic concepts about associative memories were established three decades ago in [2-4], nonetheless here we use the concepts, results and notation introduced in the Yáñez-Márquez's PhD Thesis [1]. An associative memory M is a system that relates input patterns, and outputs patterns, as follows: x→M→y, whose k-th association is denoted as x k , y k . Associative memory M is represented by a matrix whose ij-th component is mij, which is generated from an a priori finite set of known associations, called the fundamental set of associations. If μ is an index, the fundamental set is represented as: x μ , y μ μ = 1,2,… ,p with p the cardinality of the set. The patterns

(

)

{(

)

}

that form the fundamental set are called fundamental patterns. If it holds that x μ = y μ , ∀μ ∈ {1,2,…, p } , M is auto-associative, otherwise it is heteroassociative. A distorted version of a pattern x k to be recalled will be denoted as ~ x k . If when

feeding a distorted version of xϖ with ϖ = {1,2,…, p } to an associative memory M,

it happens that the output corresponds exactly to the associated pattern yϖ , we say that recall is correct. Among the variety of associative memory models described in the scientific literature, there are two models that, because of their relevance, it is important to emphasize: morphological associative memories which were introduced by Ritter et al. [5], and Alpha-Beta associative memories [1]. In this paper we propose an extension of the binary operators Alpha and Beta, foundation for the Alpha-Beta associative memories [1], which allows memorizing and then recalling k-valued input and output patterns. Sufficient conditions for perfect recalling and examples are provided. D. Liu et al. (Eds.): ISNN 2007, Part III, LNCS 4493, pp. 828–833, 2007. © Springer-Verlag Berlin Heidelberg 2007

Using Alpha-Beta Associative Memories to Learn and Recall RGB Images

829

2 Alfa-Beta Associative Memories αβ associative memories are of two kinds and are able to operate in two different modes. The operator α is useful at the learning phase, and the operator β is the basis for the pattern recall phase. The heart of the mathematical tools used in the AlphaBeta model, are two binary operators designed specifically for these memories. These operators are defined as follows: First, we define the sets A={0,1} and B={00,01,10}, then the operators α and β are defined in tabular form:

α : x 0 0 1 1

β : B× A → A x y β(x,y) 00 0 0 00 1 0 01 0 0 01 1 1 10 0 1 10 1 1

A× A → B y α(x,y) 0 01 1 00 0 10 1 01

[y ⊕ x ]

The ij-th entry of the matrix y ⊕ x t is: fundamental set of patterns: entry of the matrix

( )

yμ ⊕ xμ

t

{(x

is:

μ

)

t

ij

, y μ μ = 1,2,…, p

( )

} where x

(

⎡ y μ ⊕ xμ t ⎤ = α y μ , xμ i j ⎢⎣ ⎥⎦ ij

(

)

∈ An

and

= α yi , x j μ

. If we consider the y μ ∈ Am ,

then the ij-th

).

3 The New Model In this section we show how binary αβ memories can be used to operate with RGB images. Without lose of generality, let us just analyze the case of the Alpha-Beta autoassociative memories of kind V. First, we need to define four operators and prove four propositions derived from them, which will be useful for both phases of the model: learning and recalling. Due to reasons of space, the full proofs of the propositions are omitted here. Definition 1. Let r be a non-negative integer number. The minimum binary string operator k(r) is defined as follows: k(r) has r as input argument and its output is the minimum of the members of the set {x | x=log22k, where k∈ Z+ and 2k > r}. Proposition 1. If x is an integer number such that 0 ≤ x ≤ 255, then k(x) ≤ 8. Definition 2. Let r be a non-negative integer number and k a positive integer number, which make the expression k≥k(r) true. The k-binary expansion operator ε (r, k ) is

defined as follows: ε (r, k ) has r and k as input arguments and its output is a binary k-dimensional column vector whose components correspond to the k bits binary expansion of r, with the least significant bit in the lower side.

830

C. Yáñez-Márquez et al.

Proposition 2. If x is an integer number such that 0 ≤ x ≤ 255, then it is possible to obtain the 8-binary expansion operator ε ( x,8) . Definition 3. Let b be a binary column vector of dimension n, and k an integer positive number such that k≥n. The k-binary inverse expansion operator ε k−1 (b ) as

follows: ε k−1 (b ) has as input argument a binary k-dimensional column vector, whose first k-n components are 0’s, and the last n components coincide one to one with the components of vector b, having the least significant bit in the lower side. The output of ε k−1 (b ) is a non-negative integer number r which is computed through the k

expression:

∑b • 2 i

k −i

.

i =1

Proposition 3. If b is a binary column vector of dimension n ≤ 8, it is possible to obtain the 8-binary inverse expansion operator ε 8−1 (b ) , whose output is calculated as: 8

∑b • 2 i

8−i

.

i =1

Definition 4. Let m be a positive integer number and rm non-negative integer numbers r1, r2, …, rm. Additionally, let k be a positive integer number whose value is compatible with Definition 2 for the computation of the m k-binary expansion operators ε(r1, k), ε(r1, k), …, ε(rm, k). The ordered concatenation C of ε(r1, k), ε(r1, k), …, ε(rm, k) is defined as a binary column vector of dimension m, made up of the binary strings ε(r1, k), ε(r1, k), …, ε(rm, k) put in order from top to bottom. This ordered concatenations is denoted by: ⎛ ε (r1 , k ) ⎞ ⎟ ⎜ ⎜ ε (r2 , k ) ⎟ C [ε (r1 , k ),ε (r2 , k ),…,ε (rm , k )] = ⎜ ⎟. ⎟ ⎜ ⎜ ε (r , k )⎟ ⎝ m ⎠ Proposition 4. If x, y, z are three integer numbers which make trae these inequalities: 0 ≤ x ≤ 255, 0 ≤ y ≤ 255 and 0 ≤ z ≤ 255, then the ordered concatenation C [ε (x,8),ε ( y,8),…,ε (z,8)] is a binary column vector of 24 bits. The fundamental set for the new model is made up by p color images in RGB format, where p is a positive integer number. The A set for the new model is formed by RGB triplets, and is denoted as: A = { x | x is an RGB triplet }. If Iμ represents the μ-th image, the fundamental set is represented as: {(Iμ, Iμ)} | μ = 1, 2, …, p}. Let us call n=hv to the total number of pixels in each Iμ, where h is the number of horizontal pixels and v is the number of vertical pixels. That is, Iμ is made up by n RGB pixels. Also, Iμ∈An , ∀μ∈{1, 2, …, p} and I iμ ∈ A, ∀i ∈ {1,2,…, n} .

Using Alpha-Beta Associative Memories to Learn and Recall RGB Images

831

According to the alter paragraph, for each μ∈{1, 2, …, p} and each i= 1, 2, …, n, component I iμ has three parts, corresponding to the R, G, and B of that RGB triplet. These three parts will be denoted as Riμ , Giμ , and Biμ , respectively. Just as in the original model of Alpha-Beta associative memories, the B set is B = {00, 01, 10}.

LEARNING PHASE For each μ=1, 2, …, p and each i= 1, 2, …, n, obtain

ε (Riμ ,8) , ε (Giμ ,8) , ε (Biμ ,8) ,

and

]

C [ε (Riμ ,8),ε (Giμ ,8),ε (Biμ ,8)] .

[

For each μ=1, 2, …, p obtain x μ = C C1μ , C 2μ ,…, C mμ .

( )

t For each μ=1, 2, …, p and each association (xμ, xμ) build ⎡x μ ⊗ x μ ⎤ . ⎥⎦ m×n ⎢⎣ Apply the binary operator ∨ to the former matrices in order to obtain

V=

⎡x μ ⊗ (x μ ) ⎤ ∨ ⎢⎣ ⎥⎦ μ p

t

=1

. m×n

RECALLING PHASE CASE 1: Recall of a fundamental pattern Iω∈An with ω∈{1, 2, …, p}. For each i= 1, 2, …, n obtain ε Riω ,8 , ε Giω ,8 , ε Biω ,8

(

[ε (R ,8),ε (G ,8),ε (B ,8)] . Obtain x = C [C , C ,…, C ] .

ω

Ci = C

ω

ω

i

ω

ω

i

)

(

)

(

)

,

and

i

ω

ω

1

ω

2

n

Do operation VΔ β xω .

The result is a binary column vector of dimension m = 24n, with its i-th component given by:

( VΔ β xω ) = ∧β ( vij , xωj ) , m

i

( VΔ

j =1

m ⎫⎪ ⎤ ⎪⎧ ⎡ p ω = x β α xiμ , x μj ) ⎥ , xωj ⎬ . ) ( ⎨ β ⎢ ∧ ∨ i j =1 ⎩ ⎪ ⎣ μ =1 ⎦ ⎭⎪

For each i= 1, 2, …, n : Form a binary column vector b of dimension 8 such that: b j = VΔ β xω 24 (i −1)+ j , for 0 < j ≤ 8.

(

Calculate Riω =

8

∑b

j

)

• 28 − j .

j =1

Form a binary column vector b of dimension 8 such that: b j = VΔ β xω 24(i −1)+ j −8 , for 8 < j ≤ 16.

(

)

832

C. Yáñez-Márquez et al.

Calculate Giω =

8

∑b

j

• 28 − j .

j =1

Form a binary column vector b of dimension 8 such that: b j = VΔ β xω 24(i −1)+ j −16 , for 16 < j ≤ 24.

(

Calculate Biω =

8

∑b

j

)

• 28 − j .

j =1

Create the RGB triplet and assign it to the i-th component of I iμ . The recalled pattern is the fundamental pattern Iμ∈An . CASE 2: Recall of a pattern ~I which is a version of some fundamental pattern Iω∈An, ω∈{1, 2, …, p},altered with additive, substractive or mixed noise. The steps of the algorithm are similar to those of the Case 1, using ~I instead of Iμ.

4 Experiments with RGB Images In this section the new Alpha-Beta associative memories are tested with ten color images. The images, shown in the Figure 1, are 100 by 75 pixels and 24 bits of depth per pixel, RGB. Only the new Alpha Beta autoassociative memories type V were tested.

Fig. 1. Images of the ten objects used to test the new αβ associative memories

LEARNING PHASE Each one of all the ten images was presented to the new Alpha Beta autoassociative memory type V, following the learning phase described in the latter section. RECALLING PHASE All the ten patterns in the fundamental set were perfectly recalled. To perform the experiments with altered versions of the fundamental patterns, the images in the fundamental set were corrupted with additive noise. Four groups of images were generated: The first one with very weak additive noise (1%), the second one with weak additive noise (5%), the third one with medium additive noise (20%), and the fourth one with severe additive noise (50%), a huge amount of noise. Forty corrupted images were obtained changing randomly some pixel values. In all the cases the desired image was correctly recalled. Notice how despite the level of noise introduced in the fourth column is too severe (in any system, 50% of noise is a huge amount), all the images are still correctly recalled!

Using Alpha-Beta Associative Memories to Learn and Recall RGB Images

833

5 Conclusion and Future Work We have shown how it is possible to use binary Alpha-Beta associative memories, to efficiently recall patterns made with color images, in particular using the RGB format. This is possible because an RGB image can be decomposed into binary patterns. It is worth to mention that the proposed technique can be adapted to any kind of binary associative memories while their input patterns can be obtained from the binary expansions of the original patterns. Currently, we are investigating how to use the proposed approach in the presence of mixed noise and other variants. We are also working toward the proposal of new associative memories based on others mathematical results.

Acknowledgements The authors would like to thank the Instituto Politécnico Nacional (Secretaría Académica, COFAA, SIP, CIC and ESCOM), the CONACyT, and SNI for their economical support to develop this work.

References 1. Yáñez-Márquez, C.: Associative Memories Based on Order Relations and Binary Operators (In Spanish). PhD Thesis. Center for Computing Research, México (2002) 2. Kohonen, T.: Correlation Matrix Memories. IEEE Transactions on Computers 21 (4) (1972) 353-359 3. Kohonen, T.: Self-Organization and Associative Memory. Springer-Verlag, Berlin Heidelberg New York (1989) 4. Hassoun, M. H.: Associative Neural Memories. Oxford University Press, New York (1993) 5. Ritter, G.X., Sussner, P., Diaz-de-Leon, J.L.: Morphological Associative Memories. IEEE Transactions on Neural Networks 9 (1998) 281-293

Suggest Documents