Usng Alpha-Beta Assocatve Memores to Learn and Recall RGB Images Cornelo Yáñez-Márquez, María Elena Cruz-Meza, Flavo Arturo Sánchez-Garfas, and Itzamá López-Yáñez Centro de Investgacón en Computacón, Insttuto Poltécnco Naconal, Laboratoro de Intelgenca Artfcal, Av Juan de Dos Bátz s/n, Méxco, DF, 0773, Méxco cyanez@ccpnmx, mcruzm@pnmx, {fgarfas, lopezb05}@sagtaroccpnmx Abstract In ths paper, an algorthm whch enables Alpha-Beta assocatve memores to learn and recall color mages s presented The latter s done even though these memores were orgnally desgned by Yáñez-Márquez [] to work only wth bnary patterns Also, an expermental study on the proposed algorthm s presented, showng the effcency of the new memores Introducton Basc concepts about assocatve memores were establshed three decades ago n [2-4], nonetheless here we use the concepts, results and notaton ntroduced n the Yáñez-Márquez's PhD Thess [] An assocatve memory M s a system that relates nput patterns, and outputs patterns, as follows: x M y, whose k-th assocaton s k k denoted as ( x, y ) Assocatve memory M s represented by a matrx whose j-th component s m j, whch s generated from an a pror fnte set of known assocatons, called the fundamental set of assocatons If s an ndex, the fundamental set s represented as: {( x, y ) =, 2,,p } wth p the cardnalty of the set The patterns that form the fundamental set are called fundamental patterns If t holds that x = y, {,2,, p }, M s auto-assocatve, otherwse t s heteroassocatve A dstorted verson of a pattern x k to be recalled wll be denoted as ~ x k If when ϖ feedng a dstorted verson of x wth ϖ = {,2,, p } to an assocatve memory M, t happens that the output corresponds exactly to the assocated pattern y ϖ, we say that recall s correct Among the varety of assocatve memory models descrbed n the scentfc lterature, there are two models that, because of ther relevance, t s mportant to emphasze: morphologcal assocatve memores whch were ntroduced by Rtter et al [5], and Alpha-Beta assocatve memores [] In ths paper we propose an extenson of the bnary operators Alpha and Beta, foundaton for the Alpha-Beta assocatve memores [], whch allows memorzng and then recallng k-valued nput and output patterns Suffcent condtons for perfect recallng and examples are provded D Lu et al (Eds): ISNN 2007, Part III, LNCS 4493, pp 2 33, 2007 Sprnger-Verlag Berln Hedelberg 2007
Usng Alpha-Beta Assocatve Memores to Learn and Recall RGB Images 29 2 Alfa-Beta Assocatve Memores αβ assocatve memores are of two knds and are able to operate n two dfferent modes The operator α s useful at the learnng phase, and the operator β s the bass for the pattern recall phase The heart of the mathematcal tools used n the Alpha- Beta model, are two bnary operators desgned specfcally for these memores These operators are defned as follows: Frst, we defne the sets A={0,} and B={00,0,0}, then the operators α and β are defned n tabular form: α : A A B β : B A A x y α(x,y) x y β(x,y) 0 0 0 00 0 0 0 00 00 0 0 0 0 0 0 0 0 0 0 0 The j-th entry of the matrx t y x s: t [ y x ] j = α ( y, x j ) fundamental set of patterns: {( x, y ) =,2,, p} entry of the matrx y ( x ) t s: t y ( x ) = α ( y, x ) If we consder the where n and m, then the j-th j j x A y A 3 The New Model In ths secton we show how bnary αβ memores can be used to operate wth RGB mages Wthout lose of generalty, let us just analyze the case of the Alpha-Beta autoassocatve memores of knd V Frst, we need to defne four operators and prove four propostons derved from them, whch wll be useful for both phases of the model: learnng and recallng Due to reasons of space, the full proofs of the propostons are omtted here Defnton Let r be a non-negatve nteger number The mnmum bnary strng operator k(r) s defned as follows: k(r) has r as nput argument and ts output s the mnmum of the members of the set {x x=log 2 2 k, where k Z + and 2 k > r} Proposton If x s an nteger number such that 0 x 255, then k(x) Defnton 2 Let r be a non-negatve nteger number and k a postve nteger number, ε r,k s whch make the expresson k k(r) true The k-bnary expanson operator ( ) defned as follows: ε ( r,k) has r and k as nput arguments and ts output s a bnary k-dmensonal column vector whose components correspond to the k bts bnary expanson of r, wth the least sgnfcant bt n the lower sde
30 C Yáñez-Márquez et al Proposton 2 If x s an nteger number such that 0 x 255, then t s possble to ε x, obtan the -bnary expanson operator ( ) Defnton 3 Let b be a bnary column vector of dmenson n, and k an nteger postve number such that k n The k-bnary nverse expanson operator ε k ( b) as follows: ε k ( b) has as nput argument a bnary k-dmensonal column vector, whose frst k-n components are 0 s, and the last n components concde one to one wth the components of vector b, havng the least sgnfcant bt n the lower sde The output ε b s a non-negatve nteger number r whch s computed through the of ( ) k expresson: = k b k 2 Proposton 3 If b s a bnary column vector of dmenson n, t s possble to ε b, whose output s calculated as: obtan the -bnary nverse expanson operator ( ) = b 2 Defnton 4 Let m be a postve nteger number and r m non-negatve nteger numbers r, r 2,, r m Addtonally, let k be a postve nteger number whose value s compatble wth Defnton 2 for the computaton of the m k-bnary expanson operators ε(r, k), ε(r, k),, ε(r m, k) The ordered concatenaton C of ε(r, k), ε(r, k),, ε(r m, k) s defned as a bnary column vector of dmenson m, made up of the bnary strngs ε(r, k), ε(r, k),, ε(r m, k) put n order from top to bottom Ths ordered concatenatons s denoted by: ε ( r, k) ε ( r2, k) C [ ε ( r, k), ε ( r2, k),, ε ( rm, k) ] = ε ( r k) m, Proposton 4 If x, y, z are three nteger numbers whch make trae these nequaltes: 0 x 255, 0 y 255 and 0 z 255, then the ordered concatenaton C ε ( x, ), ε ( y,),, ε ( z,) s a bnary column vector of 24 bts [ ] The fundamental set for the new model s made up by p color mages n RGB format, where p s a postve nteger number The A set for the new model s formed by RGB trplets, and s denoted as: A = { x x s an RGB trplet } If I represents the -th mage, the fundamental set s represented as: {(I, I )} =, 2,, p} Let us call n=hv to the total number of pxels n each I, where h s the number of horzontal pxels and v s the number of vertcal pxels That s, I s made up by n I A,,2,, n RGB pxels Also, I A n, {, 2,, p} and { }
Usng Alpha-Beta Assocatve Memores to Learn and Recall RGB Images 3 Accordng to the alter paragraph, for each {, 2,, p} and each =, 2,, n, component I has three parts, correspondng to the R, G, and B of that RGB trplet These three parts wll be denoted as R, G, and B, respectvely Just as n the orgnal model of Alpha-Beta assocatve memores, the B set s B = {00, 0, 0} LEARNING PHASE For each =, 2,, p and each =, 2,, n, obtan ε ( R,), ε ( G,), ε (,) and C [ ε ( R,), ε ( G,), ε ( B,)] For each =, 2,, p obtan x =C [ C, C2,, C m ] For each =, 2,, p and each assocaton (x, x ) buld t x ( x ) B, m n Apply the bnary operator to the former matrces n order to obtan p V = x = t ( x ) m n RECALLING PHASE CASE : Recall of a fundamental pattern I A n wth {, 2,, p},, B,, and C For each =, 2,, n obtan ε ( R ), ε ( G ), ε ( ) = C [ ε ( R,), ε ( G,), ε ( B,)] Obtan x =C [ C C,, ] Do operaton VΔ, 2 C n β x The result s a bnary column vector of dmenson m = 24n, wth ts -th component gven by: m ( VΔ β x ) = β ( vj xj ) j=,, Δ = x, xj, xj j= = m p ( V β x ) β α( ) For each =, 2,, n : Form a bnary column vector b of dmenson such that: b j = ( Δβ x ) 24 ( ) j V, for 0 < j j Calculate R = b j 2 j = Form a bnary column vector b of dmenson such that: b j + ( Δ β x ) ( ) j = V, for < j 6 24 +
32 C Yáñez-Márquez et al Calculate G = 2 b j j= j Form a bnary column vector b of dmenson such that: ( Δ β x ) ( ) j 6 b j = V 24 +, for 6 < j 24 j Calculate B = b j 2 j = Create the RGB trplet and assgn t to the -th component of I The recalled pattern s the fundamental pattern I A n CASE 2: Recall of a pattern I ~ whch s a verson of some fundamental pattern I A n, {, 2,, p},altered wth addtve, substractve or mxed nose The steps of the algorthm are smlar to those of the Case, usng I ~ nstead of I 4 Experments wth RGB Images In ths secton the new Alpha-Beta assocatve memores are tested wth ten color mages The mages, shown n the Fgure, are 00 by 75 pxels and 24 bts of depth per pxel, RGB Only the new Alpha Beta autoassocatve memores type V were tested Fg Images of the ten objects used to test the new αβ assocatve memores LEARNING PHASE Each one of all the ten mages was presented to the new Alpha Beta autoassocatve memory type V, followng the learnng phase descrbed n the latter secton RECALLING PHASE All the ten patterns n the fundamental set were perfectly recalled To perform the experments wth altered versons of the fundamental patterns, the mages n the fundamental set were corrupted wth addtve nose Four groups of mages were generated: The frst one wth very weak addtve nose (%), the second one wth weak addtve nose (5%), the thrd one wth medum addtve nose (20%), and the fourth one wth severe addtve nose (50%), a huge amount of nose Forty corrupted mages were obtaned changng randomly some pxel values In all the cases the desred mage was correctly recalled Notce how despte the level of nose ntroduced n the fourth column s too severe (n any system, 50% of nose s a huge amount), all the mages are stll correctly recalled!
Usng Alpha-Beta Assocatve Memores to Learn and Recall RGB Images 33 5 Concluson and Future Work We have shown how t s possble to use bnary Alpha-Beta assocatve memores, to effcently recall patterns made wth color mages, n partcular usng the RGB format Ths s possble because an RGB mage can be decomposed nto bnary patterns It s worth to menton that the proposed technque can be adapted to any knd of bnary assocatve memores whle ther nput patterns can be obtaned from the bnary expansons of the orgnal patterns Currently, we are nvestgatng how to use the proposed approach n the presence of mxed nose and other varants We are also workng toward the proposal of new assocatve memores based on others mathematcal results Acknowledgements The authors would lke to thank the Insttuto Poltécnco Naconal (Secretaría Académca, COFAA, SIP, CIC and ESCOM), the CONACyT, and SNI for ther economcal support to develop ths work References Yáñez-Márquez, C: Assocatve Memores Based on Order Relatons and Bnary Operators (In Spansh) PhD Thess Center for Computng Research, Méxco (2002) 2 Kohonen, T: Correlaton Matrx Memores IEEE Transactons on Computers 2 (4) (972) 353-359 3 Kohonen, T: Self-Organzaton and Assocatve Memory Sprnger-Verlag, Berln Hedelberg New York (99) 4 Hassoun, M H: Assocatve Neural Memores Oxford Unversty Press, New York (993) 5 Rtter, GX, Sussner, P, Daz-de-Leon, JL: Morphologcal Assocatve Memores IEEE Transactons on Neural Networks 9 (99) 2-293