2017 IEEE Asia Pacific Conference on Postgraduate Research in Microelectronics and Electronics (PrimeAsia)

Image Processing by Cellular Neural Networkswith Switching Two Templates
Takahisa Ando, Yoko Uwate and Yoshifumi Nishio
Dept. of Electrical and Electronic Engineering, Tokushima University
2-1 Minami-Josanjima, Tokushima 770–8506, Japan
Email: {ando,uwate,nishio}@ee.tokushima-u.ac.jp

Abstract—Cellular Neural Networks (CNN) were developed byChua and Yang in 1988. The main characteristics of CNN are thelocal connection and the parallel signal processing. CNN consistsof cells connected each other and they are arranged in a lattice.
CNN is applied to the image processing because the its structure
is similar to the image data. The performance of the CNN
depends on the parameters which is called the template. When thetemplate has a good inﬂuence of the processing, CNN can perform
complex processing. In this study, we propose switching twotemplates CNN. The feature of the proposed method is switching
two templates by using the maximum and the minimum output
values surrounding the cell. We consider that cells are placed inthe input image; edge, background, etc. We apply the proposed
method to edge detection and investigate its performance.

II. CELLULAR NEURAL NETWORKS [1]In this section, we explain the structure and the processing
ﬂow of CNN. Basic unit circuit of CNN is called cell. The
cell consists of linear element and nonlinear element. CNN
contains an array in a reticular pattern of many cells. In image
processing of CNN, processing is conducted by making one
cell to one pixel in the image data. We show a two dimensional
array composed of M × N identical cells arranged in M rows
and N columns. The array of CNN and the circuit of cell are
shown in Fig. 1 and 2.

I. I NTRODUCTION
Recently, many information have been existed in our life.
In general, digital circuits are used for information processing.
However, digital circuits cannot process many information inreal time. Therefore, Neural Network was proposed. Neural
Network is based on the nervous system of humans andcan process parallel signals. Then, Cellular Neural Networks(CNN) was introduced by Chua and Yang in 1998 [1]. CNN
is paired Neural Network with the Cellular Automata. Hence,CNN has been successfully used for various high-speed parallel signals processing applications such as image processing,pattern recognition and so on [2].
CNN consists of the cells connected each other and thestructure of CNN resembles the structure of the image data.
Thus, CNN has been suitable for various image processing.
The performance of CNN depends on the parameters whichis called the template. The template represents strength ofconnection between cells. If the template inﬂuences exactly,
CNN can perform complex processing. Additionally, variousapplications for image processing and pattern recognition of
CNN have been reported [3]-[6].
In image processing of CNN, it is difﬁcult to processcomplex parts of the input image; edge, background, etc.
Some researches are reported that it is possible to processcomplex parts by switching two templates which have thedifferent feature. Therefore, we propose, in this study, a new
CNN method of switching two templates; 3 × 3 and 5 × 5
templates by using the maximum and the minimum output
values surrounding the center cell. We apply the proposed
method to edge detection and investigate its performance.

Fig. 1. The structure of CNN.

Fig. 2. The circuit of cell.

A cell couples with only adjacent cells. Adjacent cells interact with one another and the other cells in the neighborhood
have an indirect inﬂuence. The range which some cells have978-1-5386-0524-0/17/$31.00 ©2017 IEEE41

2017 IEEE Asia Pacific Conference on Postgraduate Research in Microelectronics and Electronics (PrimeAsia)

inﬂuenced one cell is deﬁned by neighborhood. State andoutput equation of cell are described as followed.

in combination. In Fig. 5, block diagram of image processingwith CNN is shown.

State Equation :dvx(ij)dt=−vx(ij) +i+r
j+r

A(i,j;k,l) vy(kl) (t)k=i−r l=j−r+i+rj+r

B(i,j;k,l) vu(kl) (t) + T.

(1)

1(|vx(ij) (t) + 1| − |vx(ij) (t) − 1|).
2

(2)

k=i−r l=j−r

Output Equation :vy(ij) (t)=Fig. 5. Block diagram.

vx , vy and vu are state value, output value and input value.
In Eq (1), A, B and T are feedback template, feedforward
template and threshold. These parameters determine theperformance of CNN. In Fig. 3, output equation represents
piece-wise nonlinear function. In image processing of CNN,
output value vy determines output color.

III. PROPOSED METHOD
In this section, we explain the proposed method. The featureof the proposed method is switching two templates by using
the maximum and the minimum output values (vymax : cell’smaximum output value, vymin : cell’s minimum output value)surrounding the center cell. The concept of the proposed
method is shown in Fig. 6. The processing steps of theproposed method are described as followed.

Fig. 3. Piece-wise nonlinear function.

Fig. 6. Proposed CNN.

(a)3×3(b)5×5
Step 1 : First, decide the center cell. Then, ﬁnd the vymax ,and vymin from the 7 × 7 neighborhood.

Fig. 4. System of neighborhood.

Step 2 : Secondly, determine if the center cell has themaximum or the minimum output value.

In image processing of CNN, the size of system of neighborhood must be determined. In Fig. 4, cell of system ofneighborhood is shown. Generally, the size which is used forimage processing is 3×3. In this study, we use 3×3 and 5×5

Step 3 : Thirdly, state and output equation are describedas follows in the proposed method.

42

2017 IEEE Asia Pacific Conference on Postgraduate Research in Microelectronics and Electronics (PrimeAsia)

State equation with the 3 × 3 template :dvx(ij)dt=i+r1−vx(ij) +j+r
1

A1 (i, j; k, l)vx(kl) (t)k=i−r1 l=j−r1+j+r
1i+r
1

B1 (i, j; k, l)vu(kl) (t) + T1

k=i−r1 l=j−r1(|i − k| ≤ r1 , |j − l| ≤ r1 ).

(3)

(a)

(b)

(c)

(d)

State equation with the 5 × 5 template :dvx(ij)dt=i+r
2−vx(ij) +j+r
2A2 (i, j; k, l)vx(kl) (t)k=i−r2 l=j−r2+i+r
2j+r
2

B2 (i, j; k, l)vu(kl) (t) + T2

k=i−r2 l=j−r2(|i − k| ≤ r2 , |j − l| ≤ r2 ).

(4)

Output equation :vy(ij) (t) =1(|vx(ij) (t) + 1| − |vx(ij) (t) − 1|).
2(5)Step 4: In case that the center cell has the maximum orthe minimum output value, it is applied 5 × 5 template. In theother case, it is processed by using 3 × 3 template.
These processing steps are applied to all cells in the input
image and repeated every 0.005 [τ ].

(e)Fig. 7. Simulation results 1. (a) Input image. (b) Simulation result of the 3×3
CNN. (c) Simulation result of the 5 × 5 CNN. (d) The proposed method. (e)The difference between (c) and (d).

IV. SIMULATION RESULTS
In this section, we show simulation results of the edge detection by using the proposed method. We show two examples
and using templates of the edge detection templates [7]-[8].

In one example, Fig. 7 shows the input image and simulation
results by using only 3 × 3 template, only 5 × 5 template, theproposed method and the difference between 5 × 5 CNN andthe proposed method. The defocused parts of the input image
are the left-side pillar and the woman’s silhouette. Therefore,
it is difﬁcult to detect the edge lines of these parts clearly. InFig. 7(b), the defocused parts are not detected by using 3 × 3template. On the other hand, in Fig. 7(c), the defocused parts
are detected by using 5 × 5 template. However, some noise
remains at woman’s hat and silhouette and edge lines are thick.
In Fig. 7(d), the edge lines such as the pillar, and woman’ssilhouette can be detected clearly and thinly. In addition,
noise is removed especially woman’s hat and silhouette. Edge
detection of using the 3×3 template can detect thin edge lines
and insusceptible to noise effect. Hence, the proposed method
could detect thin edge lines and removed noise by switching
two templates.
Figure 8 shows the simulation results for another input
image. The input image is boat and the defocused parts aretext and rope. In Fig. 8 (b), edge lines are not detected clearlyusing the 3×3 template. On the other hand, in Fig. 8 (c), edgelines of the defocused parts can be detected using the 5 × 5template. However, edge lines are thick such as the defocusedparts. In Fig. 8 (d), the proposed method can detect thin edge

Edge detection templates :3 × 3 template :
⎡

⎤
0 0 0
A = ⎣ 0 1 0 ⎦,0 0 0⎡⎤−1 −1 −1B = ⎣ −1 8 −1 ⎦ , T = −1.
−1 −1 −1

5 × 5 template :⎡0 0 0⎢ 0 0 0⎢A = ⎢⎢ 0 0 1⎣ 0 0 00 0 0⎡−1 −1⎢ −1 0⎢B = ⎢⎢ −1 0⎣ −1 0−1 −1⎤
0 00 0 ⎥
⎥
0 0 ⎥
⎥,
0 0 ⎦
0 0−1 −100
16000−1 −1(6)⎤−1−1 ⎥⎥−1 ⎥⎥ , T = −1. (7)−1 ⎦−1432017 IEEE Asia Pacific Conference on Postgraduate Research in Microelectronics and Electronics (PrimeAsia)

boundary is 0[%] to 100[%] and evaluate the proposed method
by detected boundary line. In Tab. 1, we show detection rateof each input image.
TABLE ID ETECTION R ATE [%].

(a)Figure 9(a)Figure 9(b)Figure 9(c)Figure 9(d)

(b)

(c)

Proposed method
6264
75
70

3×3 CNN2534
34
34

5×5 CNN7382
80
84

Ideal edge is assumed as a 1-pixel-wide line on the boundaryof two regions. From Tab. 1, the detection rate by using 5 × 5
template is high and it can detect boundary line in each case.
However, detected edge line is a heavy line as 2-pixel-wide.
Then, the detection rate will decrease considering this point.
On the other hand, we have conﬁrmed that detection rate of
the proposed method is improving about twice compared with
CNN with using 3 × 3 template.
From these simulation results, the proposed method is more
effective than the conventional CNN for edge detection.

(d)V. C ONCLUSIONSIn this study, we have proposed a new CNN method ofswitching two templates. In the proposed method, the 3 × 3and 5× 5 templates were switched by using the maximum andthe minimum output values containing the center cell in the7 × 7 neighborhood. We applied the proposed method to edge
detection. From the simulation results, the proposed method
could detect thin edge lines of the defocused parts in the input
image. Therefore, the proposed method is more effective thanthe conventional CNN for edge detection. In the future works,
we would like to investigate the performance of the proposed
method for another image processing.

(e)Fig. 8. Simulation results 2. (a) Input image. (b) Simulation result of the 3×3CNN. (c) Simulation result of the 5 × 5 CNN. (d) The proposed method. (e)The difference between (c) and (d).

lines such as the defocused parts clearly and receive less noise
effect. Hence, the 5 × 5 template is applied to the defocusedparts of the input image and the 3 × 3 template is applied tothe periphery of cells.
We have conﬁrmed that the proposed method could perform
edge detection for general image. The proposed method could
detect most edge including the defocused parts. Then, we evaluate performance of the proposed method for edge detection.
We compare the proposed method and the conventional CNN
with input images which contain a gradient region. In each
input image, boundary of two parts become defocused as itgoes top of the image. In Fig. 9, we show input images.

(a)

(b)

(c)

R EFERENCES[1] L. O. Chua and L. Yang, “Cellular Neural Networks: Theory,” IEEE
Trans. Circuits Syst., vol. 35, pp. 1257-1272, Oct. 1988.
[2] Z. H. Yang, Y. Nishio and A. Ushida,“Imageprocessing of twolayer CNNs applications and stability,” IEICE Trans.
Fundamentals, vol. E85-A, no. 9, pp. 2052-2060, 2002.
[3] M. Hänggi and G. S. Moschytz, “Cellular Neural Networks Analysis, Design and Optimization.” Kluwer Academic Publishers.
[4] 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.
[5] Z. H. Yang, Y. Nishio and A. Ushida, “Image Processing of twolayer CNNs -applications and stability-,” IEICE. Trans. Fundamentals, vol. E85-A, no. 9. pp. 2052-2060, Sept. 2002.
[6] T. Kozek, K. R. Crounse, T. Roska and L. O. Chua, “Smart Image Scanning Algorithms for the CNN Universal Machine,” Proc. of NOLTA’95,
vol. 2, pp. 707-712, 1995.
[7] L. Kek, K.Karacs and T. Roska, “Cellular Wave Computing Library(Templates, Algorithms, and Programs), Version 2.1, ” CellularSensory Wave Computers laboratory, Hungarian Academy of Sciencesk,
Budapest, Hungary, 2007.
[8] Y. Kato, Y Ueda, Y Uwate and Y Nishio, “Cellular Neural Networkswith Switching Two Types of Templates,” Proc. of IJCN’ 11,pp. 14231428, Jun. 2011.

(d)Fig. 9. Input images. (a) Gradient (white to whitish gray) and white.
(b) Gradient (black to blackish gray) and black. (c) Gradient (gray to whitishgray) and gray. (d) Gradient (gray to blackish gray) and gray.

We deﬁne the range from the bottom to the top of the image44