scieee AI-readable full text Open interactive document viewer

A new way to obtain homology groups in Binary 2D images using membrane computing

Díaz Pernil, Daniel; Gutiérrez Naranjo, Miguel Ángel; Real Jurado, Pedro; Sánchez Canales, Vanesa

Abstract

Membrane Computing is a computational model inspired in the structure and function of living cells and tissues. In this paper we use Membrane Computing techniques to solve the Homology Groups of Binary 2D Image (HGB2I) Problem. This is a classical problem in Homology Theory which tries to calculate the number of connected components and the representative curves of the holes of these components of a given binary 2D image. To this aim, we use a family of P systems whih solves all the instances of the problem in the framework of Tissue-like P systems with catalysts.

Full text

A NEW WAY TO OBTAIN HOMOLOGY GROUPS IN BINARY 2D IMAGES USING MEMBRANE COMPUTING DANIEL DÍAZ-PERNIL 1 , MIGUEL A. GUTIÉRREZ-NARANJO 2 , PEDRO REAL 1 , AND VANESA SÁNCHEZ-CANALES 1 Abstrat. Membrane Computing is a omputational mo del inspired in the struture and funtion of living ells and tissues. In this paper we use Membrane Computing tehniques to solve the Homology Groups of Binary 2D Image (HGB2I) Problem . This is a lassial problem in Homology Theory whih tries to alulate the numb er of onneted omp onents and the representative urves of the holes of these omp onents of a given binary 2D image. To this aim, we use a family of P systems whih solves all the instanes of the problem in the framework of Tissue-like P systems with atalysts . Introdution Natural Computing studies new omputational paradigms inspired from Nature. It abstrats the way in whih Nature ats , oneiving new omputing mo dels from natural phenomena in physis, hemistry and biology 1 . The eld is growing rapidly and urrently there are many op en researh lines based on Nature, oering solutions to many lassial omputational problems from a new p ersp etive. From this new paradigm, we an ite areas suh as Cel lular Automata [29℄, Geneti algorithms [15℄, Neural Networks [21℄, DNA-based moleular omputing [1℄, Swarm Intel ligene [11℄ or Membrane Computing [24, 25℄ among others. All these omputational paradigms have in ommon the use of an alternative way of eno ding the information, adapted to the bio-inspired substrate and the use of intrinsi parallelism of natural pro esses. In this pap er we use tehniques from Membrane Computing 2 . This new researh area was b orn from the assumption that the pro esses taking plae within the ompartmental struture of a living ell an b e interpreted as omputations [25℄. In partiular, it fo uses on membranes, whih are involved in many reations taking plae inside various ompartments of a ell. Biologial membranes are muh more than mere barriers that dene ompartments. They at as seletive hannels of ommuniation b etween dierent ompartments as well as b etween the ell and its environment [2℄. The omputational devies in Membrane Computing are alled P systems . Roughly sp eaking, a P system onsists of a membrane struture, in the ompartments of whih one plaes multisets of ob jets whih evolve aording to given rules. In the most extended mo del, the rules are applied in a synhronous non-deterministi maximally parallel manner, but some other semantis are b eing explored. Membranes divide the Eulidian spae into regions, whih ontains ob jets. Ob jets evolve aording to lo al reation rules. Suh ob jets an b e desrib ed by symb ols or by 1 An intro dution on Natural Computing an b e found in [16℄. 2 We refer to [25℄ for basi information in this area, to [27 ℄ for a omprehensive presentation and the web site [30℄ for the up-to-date information. 1 2DANIEL DÍAZ-PERNIL 1 , MIGUEL A. GUTIÉRREZ-NARANJO 2 , PEDRO REAL 1 , AND VANESA SÁNCHEZ-CANALES 1 strings of symb ols from a given alphab et. These ob jets an also pass through membranes, under the ontrol of sp ei rules. We will fo us here on a P system mo del alled (b eause of their membrane struture) Tissue-like P systems . This P system mo del has two biologial inspirations (see [20℄): interellular ommuniation and o op eration b etween neurons. The ommon mathematial mo del of these two mehanisms is a net of pro essors dealing with symb ols and ommuni- ating these symb ols along hannels sp eied in advane. The ommuniation among ells is based on symp ort/antip ort rules 3 . Symp ort rules move ob jets aross a membrane together in one diretion, whereas antip ort rules move ob jets aross a membrane in opp osite diretions. Homology theory is a branh of algebrai top ology that attempts to distinguish b etween spaes by onstruting algebrai invariants that reet the onnetivity prop erties of the spae. The eld has it origins in the work of Poinaré. Homology groups (related to the dierent n -dimensional holes, onneted omp onents, tunnels, avities, et.) are invariants from Algebrai Top ology whih are frequently used in Digital Image Analysis and Strutural Pattern Reognition. In some sense, they reets the top ologial nature of the ob jet in terms of the numb er and harateristis of its holes. This is not the rst time in whih life-based metho ds are applied to Algebrai Top ology. In 1996, J. Chao and J. Nakayama onneted Natural Computing and Algebrai Top ology using Neural Networks [7℄ (extended Kohonen mapping). Some years after, K.G. Subramanian et al . presented in [6 , 5℄ two works where Digital Image and Natural Computing were linked. In 2009, Christinal et al . presented in [9℄ a new way to obtain the Betti numb ers of a binary 2D and 3D digital image. In this pap er, we present a new tehnique to get not only the Betti numb ers, we obtain the representative urves of the homology group H1 of a binary 2D digital image to o. The neessary time to alulate the homology groups of 2D digital images with basi P systems dened in Setion 2 is logarithmi with resp et to the input data ( O(n) ). This involves an improvement with resp et to the algorithms development by S. Peltier et al . in [28℄, where they use irregular graphs pyramids with a time omplexity of O(n5/3) . The pap er is organized as follows: rstly, we present our bio-inspired formal framework. Next, we briey reall the Homology Groups of Binary 2D Image (HGB2I) Problem . In the next Setion, we present our solution in the framework of tissue-like P systems with atalysts. Finally, some onlusions are presented. 1. Formal Framework In tissue-like P systems the membrane struture is a general undireted graph. The edges of suh graph are not given expliitly, but they are dedued from the set of rules. From the seminal denition of tissue P systems, several researh lines have b een develop ed and other variants have arisen (see, for example, [3, 4, 14 , 18, 26℄). In this pap er, we endow tissue-like P systems with atalysts. Catalyti P systems were intro dued in [24 ℄. The main feature of these P systems is the presene of ob jets in membranes suh that they are not onsumed by the appliation of the rule, but their presene 3 This way of ommuniation for P systems was introdued in [22℄. A NEW WAY TO OBTAIN HOMOLOGY GROUPS IN BINARY 2D IMAGES USING MEMBRANE COMPUTING3 in the membrane is neessary for the triggering (see, e.g., [12, 13, 19, 17℄. Next we provide the denition of tissue-like P systems with atalysts: Denition 1.1. A tissue-like P system with atalysts of degree q≥1 is a tuple of the form Π = (Γ,E, w1,...,wq,R, i0), where: (1) Γ is a nite alphab et, whose symb ols will b e alled ob jets. (2) E ⊆ Γ is a nite alphab et representing the set of the ob jets in the environment available in an arbitrary large amount of opies. (3) w1,...,wq are strings over Γ representing the multisets of ob jets asso iated with the ells in the initial onguration. (4) R is a nite set of atalyti rules of the following form: (cat |i, u/v, j) for i, j ∈ {0,1,2,...,q}, i 6=j and cat, u, v ∈Γ∗ . The length of a atalyti rule is dened as |u|+|v| . The atalyst cat is mo died by the appliation of the rules and cat and v an b e empty. (5) i0∈ {0,1,2,...,q} denotes the output region, whih an b e the environment ( i0= 0 ) or the region inside a ell ( 1≤i0≤q ). Informally, a tissue-like P system with atalysts of degree q≥1 an b e seen as a set of q ells (eah one onsisting of a single membrane) lab eled by 1,2,...,q . The ells are the no des of a virtual graph, where the edges onneting the ells are determined by the ommuniation rules of the system, i.e., as usual in tissue-like P systems, the edges linking alls are not provided expliitly: If a rule (cat |i, u/v, j) is given, then ells i and j are onsidered linked. The appliation of a atalyti rule (cat |i, u/v, j) onsists on the trade of the multiset u (initially in the ell i ) against the multiset v (initially in j ). The trade an also b e b etween one ell and the environment, lab elled by 0. The rule is applied if in the ell with lab el i the ob jets of the set cat are present (atalyst). If the atalyst is empty, then the rule is alled a ommuniation rule . In our denition, all ob jets in the alphab et an at as atalysts, dep ending on the applied rule. Rules are used as usual in the framework of membrane omputing, that is, in a maximally parallel way (a universal lo k is onsidered). In one step, eah ob jet in a membrane an only b e used for one rule (non-deterministially hosen when there are several p ossibilities), but any ob jet whih an partiipate in a rule of any form must do it, i.e., in eah step we apply a maximal multiset of rules. A onguration is an instantaneous desription of the P system and it is represented as a tuple (w1,...,wq) . Given a onguration, we an p erform a omputation step and obtain a new onguration by applying the rules in a parallel manner as it is shown ab ove. A sequene of omputation steps is alled a omputation . A onguration is halting when no rules an b e applied to it. The output of a omputation is olleted from its halting onguration by reading the ob jets ontained in the output ell. Example 1.2. Let us onsider the following tissue-like P system with atalyst of degree 3, Π = (Γ,E, w1, w2, w3,R, i0) where Γ = {a, b, c, d, e} , E={d} , w1=a , w2=bd and w3=ce . 4DANIEL DÍAZ-PERNIL 1 , MIGUEL A. GUTIÉRREZ-NARANJO 2 , PEDRO REAL 1 , AND VANESA SÁNCHEZ-CANALES 1 The set R has four rules: R1≡(c|2, b/a, 1) R2≡(e|3, c/d, 2) R3≡(3, d/a, 0) R4≡(3, d/b2,0) The output region is i0= 3 . Aording to the set of rules, ell 2 is linked to ells 1 and 3 and ell 3 is linked to the environment. The omputation starts from the initial onguration C0= (w0, w1, w2) . Rule R1 annot b e applied in this initial onguration, sine the atalyst c do es not app ear in ell 2. Rules R3 and R4 annot b e applied, sine ob jet d is not plaed on ell 3. In this initial onguration we only an apply rule 2, sine ob jets e and c are plaed in membrane 3 and d is plaed in membrane 2. After applying this rule we obtain a new onguration. C1= (w′ 0, w′ 1, w′ 2) with w′ 1=a , w′ 2=cb and w′ 3=de . Now, rule 2 an b e applied by interhanging ob jets a and b , b eause the atalyst c is plaed on ell 2. The ommuniation rules 3 and 4 an b e applied, sine d app ears in ell 3 and the environment ontains ob jets a and b , but only one of them an b e applied, and it is non-deterministially hosen. In we ho ose rule 3, then the new onguration is C2= (w′′ 0, w′′ 1, w′′ 2) with w′′ 1=b , w′′ 2=ac and w′′ 3=ae . No more rules an b e applied and the omputation nishes. The output of the omputation is the multiset in ell 3 in the halting onguration w′′ 3=ae . If we ho ose rule 4, the obtained onguration is the same, but w′′ 2=b2e . 2. Calulating Homology Groups In a binary 2D image, the omputation of homology groups an b e redued to a pro ess of blak and white onneted omp onents lab eling. The dierent blak onneted omp onents are the generators of the 0 -dimensional homology group of the blak part of the image whereas the losed blak urves surrounding the dierent white onneted omp onents of the image are the generators of its 1 -dimensional homology group. In order to formalize this problem we will onsider a ordered 4 set of n2 pixels P={(i, j) : 1≤i, j ≤n} . An image on P with olors in the nite set C is a mapping I:P→ C . As usual, suh image an b e written as a set of pairs ((i, j), x) where i, j ∈ {1,...,n} and a=I(i, j) . To simplify we denote aij . As we onsider in this pap er to work with binary images, we take C={b, w} where b o dies blak and w white. The new tehnique for P systems presented in this pap er onsist to assign to eah ob jet o difying a pixel a lab el. So, we our ob jets pass to b e of the form (aij,(i, j)) . We will see b elow how to use these lab els to solve our problem with P systems. From a formal p oint of view we an formulate our problem as follows, Homology Groups of Binary 2D Image (HGB2I) Problem: Given a binary 2D digital image, alulate the numb er of blak onneted omp onents and the representative urves of the holes of these omp onents. We have deide to onsider in this pap er the 4-adjaeny for blak pixels and the 8adjaeny for white pixels. The only one reason to do this hoie is the omputational omplexity from a membrane mo dels p oint of view. It is easier for this typ e of mo dels works with 8-adjaeny for blaks and 4 for whites. Moreover, in this last ase the systems are very similar to the systems show b elow. Then, we have deided to present the membrane solution of HGB2I problem for the 4-adjaeny for blak pixels and the 8-adjaeny for white pixels. 4 We onsider the lexiographi order for N2 in P . A NEW WAY TO OBTAIN HOMOLOGY GROUPS IN BINARY 2D IMAGES USING MEMBRANE COMPUTING5 2.1. A membrane solution of HGB2I Problem. In order to provide a logarithmi- time uniform solution to the our problem, we design a family of tissue-like P systems with atalyst, Π . Given an image I of size n2 , we take the system of the family Π(n) to work with I . The input data (image I ) is o died by a set of ob jets Aij with A=B∨W and 1≤i, j ≤n . The family of P systems is dened as follows: Π(n) = (Γ,Σ,E, ω1, ω2, ω3, ω4,R1,...,R19,{R15,R17}>R10, iin, i0) where: •Γ = {zi: 1 ≤i≤n+ 6} ∪ {Bij, bij, b′ ij,¯ bij, Wij, wij, w′ ij,(bij,(k, l)),(wij ,(k, l)) : 1 ≤i, j, k, l ≤n} ∪ {(pij,(0,0)),(pji,(0,0)) : i= 0, n + 1,0≤j≤n+ 1} ∪ {Aijkl, Zijkl : (1,1) ≤(i, j)<(k, l)≤(n, n)} . •Σ = {bij, wij : 1 ≤i, j ≤n} . • E = Γ −Σ . •ω1=∅ . •ω2={z1} . •ω3={z1,(pij,(0,0)),(pji,(0,0)) : i= 0, n + 1,0≤j≤n+ 1} . •ω4=∅ . • The sets of rules are:  R1≡(1, Aij/aija′ ij,0) for 1≤i, j ≤n . For eah pixel of our input image we generate two opies with these rules.  R2≡(1, aij/λ, 2) for 1≤i, j ≤n .  R3≡(1, a′ ij/λ, 3) for 1≤i, j ≤n . With the last two typ es of rules, the rst opies of our pixels are sent to ell 2 and the seond opies of our pixels are sent to ell 3. From this p oint, we have two parallel pro esses. A pro ess asso iated to ell 2 (to alulate H0 ) and the seond one asso iated to ell 3 (to alulate H1 ):  Rules asso iated to the H0 pro ess: ◦R4≡(2, zi/zi+1,0) for 1≤i≤n+ 1 . These rules generate a ounter that will b e used in the output of the system. ◦R5≡(2, bij/(bij,(i, j)),0) for 1≤i, j ≤n . These rules add lab els to blak pixels in order to work with them. ◦R6≡(2,(bij,(k, l))(bi′j′,(k′, l′))/(bij,(k, l))(bi′j′,(k, l))Aklk′l′,0) for (1,1)≤ (k, l)<(k′, l′)≤(n, n) , 1≤i, j, i′, j′≤n and (i, j) , (i′, j′) adjaent pixels. ◦R7≡(2,(bij,(k, l))(bi′j′,(k′, l′))/(bij,(k′, l′))(bi′j′,(k′, l′))Ak′l′kl,0) for (1,1) ≤(k′, l′)<(k, l)≤(n, n) , 1≤i, j, i′, j′≤n and (i, j) , (i′, j′) adjaent pixels. The two last typ es of rules hange the lab els of adjaent pixels, we need all the adjaent blak pixels to have the same lab el, so we will know that they are all in the same onneted omp onent. ◦R8≡(Aijkl|2,(bi′j′,(k, l))/(bi′j′,(i, j)),0) for 1≤i, j, k, l, i′, j′≤n . In these rules we intro due atalysts, and pro ess b eomes faster. The 6DANIEL DÍAZ-PERNIL 1 , MIGUEL A. GUTIÉRREZ-NARANJO 2 , PEDRO REAL 1 , AND VANESA SÁNCHEZ-CANALES 1 atalyst has b een reated when the pixel lab eled by (k, l) traded its lab el for (i, j) , so (i, j) and (k, l) are adjaent pixels and other pixels with these lab els an b e hanged. ◦R9≡(zn+2|2,(bij,(i, j))/λ, 4) . With these rules we send one pixel for eah onneted omp onent to the ell 2.  Rules asso iated to H1 pro ess: ◦R10 ≡(3, zi/zi+1,0) for 1≤i≤n+ 5 . This rule ounts the numb er of steps of the pro ess. We will use this to start the Deleting Stage after n+ 2 steps, and the Segmenting Stage after n+ 4 steps. ◦R11 ≡(3, wij/(wij,(i, j)),0) for 1≤i, j ≤n . These are the only rules used in the Label Al loation Stage . These rules add lab els to white pixels in order to work with them. ◦R12 ≡(3,(wij ,(k, l))(wi′j′,(k′, l′))/(wij,(k, l))(wi′j′,(k, l))Zklk′l′,0) for (1,1) ≤ (k, l)<(k′, l′)≤(n, n) , 1≤i, j, i′, j′≤n and (i, j),(i,′j′) adjaent pixels. ◦R13 ≡(3,(wij,(k, l))(wi′j′,(k′, l′))/(wij,(k′, l′))(wi′j′,(k′, l′))Zk′l′kl,0) for (1,1) ≤(k′, l′)<(k, l)≤(n, n) , 1≤i, j, i′, j′≤n and (i, j),(i′, j′) adjaent pixels. These two set of rules are used in Label Conversion Stage to ompare two adjaent white pixels, and hange the lab el of one of them. We need all the adjaent white pixels to have the same lab el. ◦R14 ≡(Zijkl|3,(wi′j′,(k, l))/(wi′j′,(i, j)),0) for 1≤i, j, k, l, i′, j′≤n . The atalyst Zijkl ats to b eome the pro ess faster. It has b een reated when the pixel lab eled by (k, l) traded its lab el for (i, j) , so (i, j) and (k, l) are adjaent pixels and other pixels with these lab els an b e hanged. ◦R15 ≡(zn+3|3,(pij,(0,0))(wkl,(k′, l′))/(pij,(0,0))(pkl,(0,0))Z00kl,0) for (i, j),(k, l) 8-adjaent pixels, 0≤i, j ≤n+ 1 , 1≤k, l, k′, l′≤n . These rules are used in Deleting Stage to delete white pixels whih are out of the onneted blak omp onent. By using 8-adjaeny, we b eome outer white pixels into pink pixels, in order to dierentiate them from the interior white pixels (holes). We will refer to the ob jets pij as pink pixels. ◦R16 ≡((Z00ij|3,(wi′j′,(i, j))/(pi′j′,(0,0)),0) for , 1≤i, j, i′, j′≤n . A new atalyst ats in the same way, trading white exterior pixel for pink pixels. In this way, the Deleting Stage takes only 2 step. ◦R17 ≡(zn+5|3,(wij,(i′, j′))bkl/(wij,(i′, j′))¯ bkl,0) for 1≤i′, j′, i, j, k, l ≤n and (i, j),(k, l) 8-adjaent pixels. In the Segmenting Stage a blak pixel is marked if it and a white pixel are 8-adjaent pixels. It starts after n+ 2 steps. ◦R18 ≡(3,¯ bij/λ, 4) for 1≤i, j ≤n . At the end, in the Answer Stage , blak marked pixels are sent to membrane numb er 4, so we obtain whih blak pixels are ontaining the holes. A NEW WAY TO OBTAIN HOMOLOGY GROUPS IN BINARY 2D IMAGES USING MEMBRANE COMPUTING7 ◦R19 ≡(zn+6|3,(wij,(i, j))/λ, 4) for 1≤i, j ≤n . We want to obtain the numb er of holes to o, so these rules send one white pixel for eah hole to membrane numb er 4. •iin = 1 is the input ell. •i0= 4 is the output ell. We will also use priorities among rules. Rules from sets R15 and R17 are applied b efore rules from the set R10 . Figure 1. A simple example of the pro ess to obtain H0 Eah system of the family implements the following stages: (1) Input Stage : When the ob jets Aij (with A=B∨W ) arrive to ell 1 the rst typ e of rules are applied. We hange these ob jets by ob jets aij and a′ ij (with a=b∨w ). In the next step, we send ob jets aij to ell 2 and ob jets a′ ij to ell 3. From this p oint we have two parallel pro esses: The rst pro ess o ur in ell 2, and it is dediated to obtain the numb er of blak onneted omp onents ( H0 ). The seond one is lo ated in ell 3 and is dediated to generate the representative urves of the holes of the blak onneted omp onents. Moreover, system will give us the numb er of these holes ( H1 ). (2) H0 Proess : It b egins when ob jets aij arrive to ell 2. (a) Label Al loation Stage : Cell 3 trades ob jets bij against others with the form (bij,(i, j)) with the environment. The white ob jets are not transformed. (b) Label Conversion Stage : We an ompare the blak adjaent pixels by using atalyst, and we trade the lab el of the greatest pixel against the lab el of the other pixel; i.e. (i, (bij,(i′, j′))(bkl,(k′, l′))/(bij,(i′, j′))(bkl,(i′, j′))Ai′j′k′l′, j) , where (i, j) and (k, l) are adjaent pixels. Moreover, we an see a new ob jet arriving to ell i . It is a atalyst and it is used to o dify if two lab els must b e ompared. Later, they are onneted, and one of them an b e hanged by the other one, as we an see in the Figure 1. () Answer Stage : In the step n+ 2 , the ob jet zn+2 arrives to the ell 1 due to the ounter. It is used by the system as a atalyst, and the ob jets with the form (bij,(i, j)) are sent to the output ell representing eah one to a blak onneted 8DANIEL DÍAZ-PERNIL 1 , MIGUEL A. GUTIÉRREZ-NARANJO 2 , PEDRO REAL 1 , AND VANESA SÁNCHEZ-CANALES 1 omp onent. The P system have used n+ 2 steps to obtain the numb er of blak onneted omp onents of an n2 image. Figure 1 shows a sequene of ongurations of the pro ess to obtain H1 for input data given by the onguration C0 of the piture. Figure 2. Representative ongurations of a simple example to obtain H1 (3) H1 proess : It b egins when ob jets a′ ij arrive to ell 3. (a) Label Al loation Stage : Cell 3 trades ob jets w′ ij against others with the form (wij,(i, j)) with the environment. (b) Label Conversion Stage : We ompare the lab el of two white adjaent pixels, and we trade the lab el of the greatest pixel against the lab el of the other pixel; i.e., we use rules with the form (i, (wij,(i′, j′))(wkl,(k′, l′))/(wij,(i′, j′))(wkl,(i′, j′))Zi′j′k′l′, j) , where (i, j) and (k, l) are adjaent pixels. Moreover, we an see a new ob jet arriving to ell i , Zi′j′k′l′ . It is a atalyst and is used to o dify when two lab els must b e ompared. Then, the lab els are onneted, and one of them an b e hanged by the other one, as we an see in C7 in the Figure 2. () Deleting Stage : Initially, system keeps in ell 1 a set of ob jets o difying the frame of the input image ( p0i, pn+1i, pi0, pin+1 for i= 0,...,n+ 1 ) with the lab el (0,0) asso iated. When the input data is intro dued in the system, the white pixels not ontained inside of blak onneted omp onents are sent to the environment to trade against of ob jets with the form of the frame. We need a linear numb er of steps with resp et to n to eliminate all the p ossible white pixels. We an see the result in C11 in the Figure 2. A NEW WAY TO OBTAIN HOMOLOGY GROUPS IN BINARY 2D IMAGES USING MEMBRANE COMPUTING9 (d) Segmenting Stage : This part b egins when deleting stage nishes due to the ounter zi (rules R1 ). If there are white pixels in ell 1 in this step are in a hole. The P system takes pairs of adjaent pixels, one blak and the other white, adding a mark to the blak pixels of these pairs. Then, we have marked the blak pixels adjaent to a hole. We need a onstant numb er of steps to segment an image with P systems. Figure 2 shows in C12 how the holes of the image are o died. (e) Answer Stage : We send the marked blak pixels to output ell in the following step to b e marked. So, we obtain, the representative urves of the holes in the image I . We also send white pixels whih keep their lab els, there is only one pixel for eah onneted white omp onent, ie, for eah hole in the image. We only need one step more with resp et to the segmenting stage. Figure 3. Initial and fourth onguration 2.2. Example. In this setion we will show with a simple example our tehnique to obtain the homology groups H0 , and H1 of a 2D image by using membrane omputing. Let us onsider the rst image in Figure 3 whih have 9×9 pixels. The blak pixels represent two onneted omp onents, the white pixels represent the exterior of the omp onents and the holes, one in eah onneted omp onent. In the initial onguration we have 4 ells. There is one ob jet Aij (with A=B∨W ) in ell 1 o difying eah pixel. At the b eginning of the pro ess the system dupliates these elements and sends one opy to the membrane 2 on order to alulate H0 , and the other opy to the membrane 3 in order to alulate H1 . These two pro esses are working at the same time, so we obtain a parallel system. The pro ess to alulate H0 is the following one: The ell 1 has the ob jet z1 working as a ounter, it allow us start a dierent stage after the neessary numb er of the steps. In the