2009 International Workshop on Nonlinear Circuits and Signal Processing
NCSP'09, Waikiki, Hawaii, March 1-3, 2009

Application of Two-Layer Cellular Neural Networks for Edge Detection
Masakazu KAWAHARA† , Takashi INOUE† and Yoshifumi NISHIO††Tokushima University
2-1 Minami-Josanjima, Tokushima, Japan
Phone:+81-88-656-7470,FAX:+81-88-656-7471
Email: {kawahara, takashi, nishio}@ee.tokushima-u.ac.jp

Abstract
In this research, we propose the new type two-layer cellularneural networks. In our two-layer cellular neural networks,
calculation start time of each layer have difference. In particular, the first layer is calculated in first, and output of the firstlayer is inputted to the second layer. By using diffusion processing in this structure, we expect that the complex image
processing using the CNN is realized. We confirm the characteristics of our two-layer CNN by computer simulation.
1. Introduction
Cellular Neural Networks (CNN) [1] were introduced by
Chua and Yang in 1988. The idea of the CNN was inspired
from the architecture of the cellular automata and the neural networks. The CNN has local connectivity property. Thebasic circuit unit of cellular neural networks is called a cell.
It contains linear and nonlinear circuit elements, which typically are linear capacitors, linear resistors, linear and nonlinear controlled sources. The structure of cellular neural networks is similar to that found in cellular automata. Unlike theconventional neural networks, the CNN has local connectivity property. Namely, any cell in a cellular neural network isconnected only to its neighbor cells. Since the structure of
the CNN resembles the structure of animals’ retina, the CNN
can be used for various image processing application [2]-[4]including medical image processing [5].
Wiring weights of the cells of the CNN are established byparameters called the template. The performance of the CNN
is decided by the template. Usually, the templates of all thecells in the CNN are identical and those values do not change
during the processing. This is good for implementation but
restrict the performance, namely the conventional CNN can
not perform image processing based on the local features ofinput images.
In the previous study, we have proposed improvement of
two-layer CNN for edge detection. In order to improve foredge detection using the CNN, we concentrate on the diffusion template. Diffusion template can diffuse the input image.
Namely, value of all cells converge to one constant value. We

think that this effect is available to the differentiation process.
Hence, differentiation process is capable of edge detection
performance. By using diffusion template in our two-layer
CNN, we obtained the effective edge detection results. However, connection between each layer of our two-layer CNN
in the previous study is only from second layer to first layer.
From structure that the multiple-layer CNN is mutual coupling, we think that connection between each layer of ourtwo-layer CNN in the previous study change to the mutualcoupling.
In this study, we proposed the two layer-CNN for edge
detection with mutual coupling. The behavior of two-layer
CNN becomes complex by mutual coupling, while we expect
the high quality edge detection using our two-layer CNN. Additionally, we apply the threshold types to the coupling template. We show the edge detection results having the certain
region by computer simulation.
In the Sec. 2, we review the basic structure of the standard
CNN. In the Sec. 3, we review the proposed two-layer CNN
model. In the Sec. 4, simulation results using the proposed
two-layer CNN are shown. In the Sec. 5, concludes the article.

2. Cellular Neural Networks [1]In this section, we describe the basic structure of the standard CNN. The CNN has M by N processing unit circuits
called cells. Cells are arranged in a reticular pattern to M lineN row. We represent a cell C(i, j) using a variable i whichdenotes vertical position and a variable j which denotes horizontal position. The cell contains linear and nonlinear circuit
elements. The CNN is an array of cells. Each cell is connected to its neighboring cells according to a template. Usually, the template is the same for all cells except for boundarycells. The CNN has the features of time continuity, spatial
discreteness, nonlinearity and parallel processing capability.
The state equation and the output equation of the cell are
shown as follows.

- 503 -

State equation:
dv xi jdt

= −v xi j +layer at different times. The difference equation is describedas follow.
Difference of output value in the first layer:

j+ri+r X
X

A(i, j;k,l) vykl (t)k=i−r l= j−r+j+r
i+r X
X

B(i, j;k,l) vukl (t) + I.

vu2i j = vy1i j |t=∆τ − vy1i j |t=0 .
(1)

k=i−r l= j−r

Output equation:(4)

In this equation, ∆τ is the time from calculation start of thefirst layer to input the second layer. In this study, ∆τ is set to0.05.

1STEP 3: The calculated value in step 2 is inputed to the sec(|v xi j (t) + 1| − |v xi j (t) − 1|).
(2)
ond layer. The state equation of the cell in the second layer2
where v x , vy and vu represent a state, an output and an input described as follow.
State equation of the second-layer :of cell, respectively. In the equation (1), A is the feedback
template and B is the control template. These and bias I are
j+ri+r XX
dv x2i jcollectively called general template.
= −v x2i j +A2 (i, j; k, l)v x2kl (t)dtk=i−r l= j−rvyi j (t) =3. Structure of Two-Layer CNN with Mutual Coupling
In this section, we describe the structure of the proposed
two-layer CNN with mutual coupling. The first feature of theproposed two-layer CNN with mutual coupling model is thatthe calculation start time of each layer have difference, in particular, first layer is calculated in first, and output of first layer
is inputted to the second layer. Namely, calculation time ofthe second layer later than that of the first layer. By applying this effect, we can realize the differentiation processing inCNN, consequently, edge detection performance using CNN
is improved. The second feature is the mutual coupling of theproposed two-layer CNN. This means that the behavior of theproposed two-layer CNN becomes complex, whereas we expect that the image processing performance is improved. The
third feature is that the using template in the proposed twolayer CNN is simple templates.
The processing structure of the proposed two-layer CNN isdescribed as follow.
STEP 1: Firstly, we input an image to the first layer. The statevalue calculate in the first layer. The state equation of the cellin the first layer described as follow.
State equation of the first-layer :dv x1i jdt= −v x1i j +j+ri+r X
X

A1 (i, j; k, l)v x1kl (t)k=i−r l= j−r+j+r
i+r X
XB1 (i, j; k, l)vu1kl (t)k=i−r l= j−r+j+r
i+r X
XC1 (i, j; k, l)vy2kl (t) + I1 .

+j+ri+r X
X

B2 (i, j; k, l)vu2kl (t)k=i−r l= j−r+j+r
i+r X
XC2 (i, j; k, l)vy1kl (t) + I2 .

(5)

k=i−r l= j−rwhere C2 is coupling template from first layer to second layer
Finally, the first layer and second layer in the proposed ourtwo-layer CNN are influenced each other.
4. Simulation Results
In this section, we show the simulation results using theproposed two-layer CNN. In this simulation, we use the diffusion template. Diffusion template is shown as follow.
Diffusion Template: 0 0
 0.1 0.15 0.1 

00.15  , B =  0 0A =  0.15

0 00.1 0.15 0.1

0 

0  , I = 0.(7)0

By using this template, input image is diffused withoutlimit.
Next, the edge detection template in the proposed twolayer CNN is shown as follow.
Edge Detection Template in Two-Layer CNN:
The first layer template 0 0 0 
 0.1 0.15 0.1 

00.15  , B1 =  0 0 0  , I1 = 0A1 =  0.15



0 0 0
0.1 0.15 0.1(3)

k=i−r l= j−rwhere C1 is coupling template from second layer to first layer.
The term of C1 is 0 until the second layer calculation start.
STEP 2: We calculate difference of the output value in the first- 504 -The second layer template 0 0 1 1 1 
A2 =  1 3 1  , B2 =  0 0



0 0
1 1 1


0 

0  , I2 = −0.10

Coupling template 0.05 0.05 0.05 

C1 =  0.05 −0.4 0.05  ,
0.05 0.05 0.05
 0 0 0  (a=3
C2 =  0 a 0 a=0
0 0 0i f vy1i j ≥ Thotherwise .

(8)

We set that the template of the first layer in our two-layer
CNN is “Diffusion” template as template (8), furthermore
template of the second layer in our two-layer CNN have theeffect that the grayscale image is converted to the binary image. Moreover, we describe the coupling templates C1 andC2 , and the coupling template C2 is threshold type. Thismeans that if output value of the first layer Vy1i j is larger thana threshold value T h, a becomes 3, if Vy1i j is smaller than thethreshold value T h, a becomes 0, namely, the first layer has
not influence to the second layer.
Next, in order to compare the original CNN with the proposed two-layer CNN in edge detection performance, we
carry out the edge detection processing using original CNN.
The “Edge Detection” template is shown as follow.
Edge Detection Template in original CNN: −1 −1 −1  0 0 0 
A =  0 1 0  , B =  −1 8 −1  , I = −1. (9)−1 −1 −10 0 0
By using this template, edge of input binary image is detected.
Figure 1 shows the simulation results using “Diffusion”
template (7) and “Edge Detection” template (9) in original
CNN. Figure 1(a) is an input image. This input image haveindistinct portion of the edge. Figures 1(b) and (c) shows thesimulation results using “Diffusion” template (7) and “EdgeDetection” template (9) in the original CNN. We can see inFig. 1(a), input image have indistinct portion of the edge.
Also, we can see in Fig. 1(c), indistinct portion of the edge asbuilding of background can not be detected in original CNN.
Figures 2(a) and (c) shows the simulation results using“Edge Detection” template (8) in first layer of the proposed
two-layer CNN. While Figs. 2(b) and (d) show the simulation
results using the template (8) in second layer of the proposed
two-layer CNN. In Fig. 2, edge of input image as Fig. 1(a)is detected more effective than the edge detection result asFig. 1(c) using original CNN. Moreover, certain domain inoutput image as Fig. 2 becomes black. This certain domain
is depend on the threshold value T h. In particular, when thethreshold value T h is 0.2 as Figs. 2(a) and (b), face of human in the input image as Fig. 1(a) become black. While thethreshold value T h is 0.8 as Figs. 2 (c) and (d), face of human in the input image as Fig 1(a) become white. By this effect, we obtained the edge detection result having the certain

(a)

(b)

(c)

Figure 1: Simulation results using templates (7) and (9) inoriginal CNN. (a) Input image (Cameraman). (b) Diffusion result using “Diffusion” template (7) in original CNN.
(c) Edge detection result using “Edge Detection” template (9)in original CNN.

region using the proposed our two-layer CNN. Additionally,
background of output image as Figs. 2(a) and (c) have certaindensity. This density represent to the diffused color of background in the input image as Fig 1(a). From these results, wecan obtained the two type output images by influencing eachother, first type output image have the effects of edge detection having certain region and diffusion performance, second
type output image have the effect of the edge detection having
the certain region. Namely, first type output image have some
information more than second type output image. Therefore,
we decided that the conclusive output image from the proposed two-layer CNN is first type output image (output imagein the first layer of the proposed two-layer CNN).
Figure 3 shows the simulation results for different input
image with the same “Edge Detection” template. Similar tothe case of the previous results, we can obtain the two types
output images.
5. Conclusions
In this research, we have proposed the new type two-layer
cellular neural networks. In our two-layer cellular neural net-- 505 -

(a)

(b)

(a)

(b)

(c)

(d)

(c)

(d)

Figure 2: Simulation results using template (8) in the proposed two-layer CNN. (a) Output image of the first layer
in the proposed two-layer CNN (Th=0.2). (b) Output image of the second layer in the proposed two-layer CNN(Th=0.2).(c) Output image of the first layer in the proposed
two-layer CNN (Th=0.8). (d) Output image of the secondlayer in the proposed two-layer CNN (Th=0.8).

Figure 3: Simulation results using template (8) in the proposed two-layer CNN. (a) Input image (Balloon). (b) Edge
detection result using “Edge Detection” template (9) in original CNN. (c) Output image of the first layer in the proposed
two-layer CNN (Th=0.2). (d) Output image of the second
layer in proposed two-layer CNN (Th=0.2).

Recognition,” Proc. of IJCNN’06, pp. 4716-4721, Jul.
works, calculation start time of each layer have difference. In2006.
particular, first layer is calculated in first, and output of firstlayer is inputted to the second layer. By using diffusion pro- [4] H. Koeppl and L.O. Chua, “An Adaptive Cellular Nonlinear Network and its Application,” Proc. of NOLTA’07,
cessing in this structure, we obtained the two type output impp. 15-18, Sep. 2007.
ages from the proposed two-layer CNN, and conclusive output image have the edge of input image and certain region.
[5] R. Perfetti, E. Ricci, D. Casali, and G. Costantini “CelWe feel that the output image using the proposed two-layer
lular Neural Networks With Virtual Template Expantion
CNN is available to the region extraction.
for Retinal Vessel Segmentation,” IEEE Trans. Circuits
Syst., vol. 54, pp. 141-145, Feb. 2007.
References[1] L.O. Chua and L. Yang, “Cellular Neural Networks:Theory,” IEEE Trans. Circuits Syst., vol. 32,pp. 1257-1272, Oct. 1988.
[2] F. Dirk and T. Ronald, “Coding of Binary Image Data
using Cellular Neural Networks and Iterative Annealing,”
Proc. of ECCTD’03, vol. 1, pp. 229-232, Sep. 2003.
[3] M. Namba and Z. Zhang, “Cellular Neural Network for
Associative Memory and Its Application to Braille Image- 506 -