2017 RISP International Workshop on Nonlinear Circuits,Communications and Signal Processing (NCSP'17)
Guam, USA, February 28th to March 3rd, 2017

Cellular Neural Networks with Switching Three Templates for Image Processing
Takahisa Ando, Yoko Uwate and Yoshifumi Nishio
Department of Electrical and Electronic Engineering, Tokushima University
2-1 Minami-Josanjima, Tokushima 770–8506, Japan
E-mail: {ando, uwate, nishio}@ee.tokushima-u.ac.jp

Abstract

difﬁcult. On the other hand, processing with 5×5 templateis brady and easy to receive noise effect but the delicate proIn 1998, Cellular Neural Networks (CNN) were developed cess is possible. In simulation results with switching two-type
by Chua and Yang. The main characteristics of the CNN templates, noise effect was observed.
are the local connection and the parallel signal processing.
In this study, we propose switching three templates CNN.
The CNN consists of cells connected each other. The per- In the proposed method, noise removal template is added toformance of the CNN depends on the parameters which is the previous method. In order to conﬁrm the effectiveness ofcalled the template. When the template has a good inﬂuence the proposed method, we perform edge detection.
for processing, the CNN can perform complex processing. In
this study, we propose switching three templates CNN. In theproposed method, 3×3 template, 5×5 template and noise re- 2. CELLULAR NEURAL NETWORKS [2]moval template are switched according to the output values
In this section, we explain the structure and processing ﬂow
around a cell in processing. We investigate the performanceofCNN. Basic unit circuit of CNN is called cell. The cellof the proposed method by some simulations.
consists of linear element and nonlinear element. The CNN
contains an array in a reticular pattern of many cells. We show
1. INTRODUCTION
a two dimensional array composed of M × N identical cells
Recently, many information have been existed in our life. arranged in M rows and N columes. The array of the CNN isIn general, digital circuits are used for information process- shown in Fig. 1. Figure 2 shows the circuit of cell.
ing. However, digital circuits cannot process many information in real time. Therefore, Neural Networks were proposed.
The Neural Networks was based on the human’s nervous system. The Cellular Neural Networks (CNN) is introduced byreplacing neuron with cell. Hence, the CNN has been successfully used for various high-speed parallel signals processing applications such as image processing, pattern recognition and so on [1]. The CNN was paired Neural Networks
with the Cellular Automata by L.O.Chua in 1998 [2]. TheCNN consists of cells connected each other and the structureof CNN resembles the structure of the animal’s retina [3].
Thus the CNN has been suitable for various image processing. The performance of CNN depends on the parameterswhich is called the template. The template represents strengthof connection between cells. If the template inﬂuences exactly, CNN can perform complex processing. Additionally,Figure 1: The structure of CNN.
various applications for image processing and pattern recognition of CNN have been reported.
In previous study, we have proposed the method of switching two-type templates CNN [4]. Two-type templates are
3×3 template and 5×5 template. In CNN processing, 3×3
A cell couples with only adjacent cells. Adjacent cells intemplate and 5×5 template have merit and demerit. Process- teract with one another. Cells which don’t couple with only
ing with 3×3 template is quick but the delicate process is adjacent cells have an indirect inﬂuence. The range which- 257 -

Figure 2: The circuit of cell.
(a)3×3(b)5×5Figure 4: System of neighborhood.
some cells have inﬂuenced one cell is deﬁned by neighborhood. We describe state equation of cell and output equationof cell below.
State Equation :dvx(ij)dt=−vx(ij) +i+rj+r

A(i,j;k,l) vy(kl) (t)k=i−r l=j−ri+r
+j+rincreasing. However, noise works easily. Figure 4 shows thesize of system of neighborhood. Generally, the size which isused for image processing is 3×3. In this study, we use 3×3
and 5×5 in combination. Figure 5 shows block diagram ofimage processing with CNN.

B(i,j;k,l) vu(kl) (t) + T. (1)k=i−r l=j−r

Output Equation :vy(ij) (t)=1(|vx(ij) (t) + 1| − |vx(ij) (t) − 1|). (2)2vx , vy and vu are state value, output value and input value.
State equation is solved by Runge-Kutta method (step sizeh = 0.005). Output equation represents piece-wise nonlinear
function Fig 3.

Figure 5: Block diagram.

3. PREVIOUS METHOD [4]
In this section, we show the previous method. The previous method is switching two-type templates CNN. Two-type
templates are 3×3 and 5×5 templates. Switching templates
is conducted in the way hereinafter prescribed First, we calculate cell’s output value. Second, we calculate cell’s maximum output value vymax and minimum output value vymin in
5×5 neighborhood. Third, we calculate the difference value|vymax − vymin |. Figure 6 shows this process which calculates the difference value |vymax − vymin |. In the end, 3×3
and 5×5 templates are switched according to the output values around cells in processing. This process is conducted for
all cells every number of calculation 10. Switching condition depends on the difference value between the maximum
Figure 3: Piece-wise nonlinear function.
and minimum output values vymax and vymin of each 5 × 5In Eq (1), A is feedback template, B is feedforward template, neighborhood and is given as follows :T is threshold. These value determine performance of CNN.
|vymax − vymin | ≤ aWhen we process the image with CNN, we should deter(3)|vymax − vymin | > a.
mine the size of system of neighborhood. When this size isbig, the amount of information in system of neighborhood is- 258 -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 −1Figure 6: Process of calculation |vymax − vymin |.
We ﬁx a certain value a as threshold about switching template. When the top inequality of (3) is satisﬁed, 3 × 3 template is used. In the other case, 5 × 5 template is used.

00000

⎤00 ⎥
⎥
0 ⎥
⎥,
0 ⎦0−1 −100
16000−1 −1⎤−1−1 ⎥⎥−1 ⎥⎥ , T = −1. (6)−1 ⎦−1

Noise removal template:⎡⎤
0 1 0
A = ⎣ 1 2 1 ⎦,0 1 0
⎡
⎤
0 0 0
B = ⎣ 0 0 0 ⎦ , T = 0.
0 0 0

(7)

4. PROPOSED METHOD
In this section, we show the proposed method. In the proposed method, noise removal template is added to the previous method. Switching condition is given as follows.
⎧⎪⎨ |vymax − vymin | > a(4)b ≤ |vymax − vymin | ≤ a⎪⎩|vymax − vymin | < b.
When the top inequality of (4) is satisﬁed, 5 × 5 template isused. When the middle inequality of (4) is satisﬁed, 3×3 template is used. When the bottom inequality of (4) is satisﬁed,
noise removal template is used. For all cells, this switchingprocess is conducted every 10 repetition of the Runge-Kutta
method.

(a)

(b)

(c)

(d)

5. SIMULATION RESULTS
In this section, we show simulation results of the edge
detection by using the proposed method and threshold value
a is deﬁned to obtain results which can be observed edge line
and noise effect. We show two examples. Using templatesof the edge detection and noise removal are described asfollows.
Edge detection template :3 × 3 template :
⎡A

B==

⎤
0 0 0
⎣ 0 1 0 ⎦,0 0 0⎡⎤−1 −1 −1
⎣ −1 8 −1 ⎦ , T = −1.
−1 −1 −1(e)(5)

Figure 7: Simulation results 1. (a) Input image. (b) Simulation result of
the 3 × 3 CNN. (c) Simulation result of the 5 × 5 CNN. (d) Switching twotype (3×3 and 5×5) templates CNN (a = 0.6). (e) The proposed method (a= 0.6, b = 0.5).

- 259 -In one example, Fig. 7 shows images which are processedwith CNN. Figure 7(a) shows an input image. The input image has the indistinct portions. Indistinct portions are the pillar of the left-side and an outline of a woman’s face. Figure 7(b) shows the simulation result of the 3 × 3 CNN. The
3 × 3 CNN cannot detect edge lines of indistinct portions.
Figure 7(c) shows the simulation result of the 5 × 5 CNN.
The 5 × 5 CNN can detect edge lines of indistinct portions,however output image receives the noise effect. Figure 7(d)shows the simulation result of switching two-type templates
CNN (a = 0.6). Switching two-type templates CNN can detect edge lines of indistinct portions and receive less noise
effect compared to Fig. 7(c). Figure 7(e) shows the simulation result of switching three templates CNN (a = 0.6, b =0.5). In Fig. 7(e), dots which are caused by noise effect arerarely found, especially woman’s hat compared to Fig. 7(d).

(a)

(b)

lines of woman’s face. Figure 8(c) shows the simulation result of the 5 × 5 CNN. The 5 × 5 CNN can detect edge linesof woman’s face, however output image receives the noiseeffect. Figure 8(d) shows the simulation result of switching
two-type templates CNN (a = 0.6). In Fig. 8(d), switcing
two-type templates CNN can detect edge lines of woman’sface and receive less noise effect compared to Fig. 8(c). Figure 8(e) shows the simulation result of switching three templates CNN (a = 0.6, b = 0.4). In Fig. 8(e), dots which arecaused by noise effect are rarely found compared to Fig. 8(d).
From the simulation results, the proposed method is more effective than the conventional CNN and the previous method.
6. CONCLUSION
In this study, we proposed a new method of switching threetemplates CNN. Three templates are 3×3 template, 5×5 template and noise removal template. 3×3 template, 5×5 template noise removal template are switched by the thresholda and b. In order to conﬁrm the effectiveness of the proposed method, we tried the proposed method as a method ofedge detection. In output image, the proposed method hasdetected edge of indistinct portions in the input image. Moreover, noise removal effect can be observed compared to theconventional CNN. As a result, the proposed method is more
effective than the conventional CNN and the previous method
in edge detection.
Acknowledgment
This work was partly supported by JSPS Grant-in-Aid for
Scientiﬁc Research 16K06357.
References

(c)

(d)

[1] Z. Yang, Y. Nishio and A. Ushida,“Image processing of twolayer CNNs applications and stability,” IEICE Trans. Fundamentals, vol. E85-A, no. 9, pp. 20522060, 2002.
[2] L. O. Chua and L. Yang, “Cellular Neural Networks Theory,” IEEE Trans. Circuits
Syst., vol. 35, no.10, pp. 1257-1272, 1988.

(e)
Figure 8: Simulation results 2. (a) Input image. (b) Simulation result of
the 3 × 3 CNN. (c) Simulation result of the 5 × 5 CNN. (d) Switching twotype (3×3 and 5×5) templates CNN (a = 0.6). (e) The proposed method (a= 0.6, b = 0.4).
We process another image for edge detection with the proposed method. Figure 8(a) shows an input image. The input
image is woman’s face. Figure 8(b) shows the simulation result of the 3 × 3 CNN. The 3 × 3 CNN cannot detect edge

[3] M. Hnggi and G. S. Moschytz, “Cellular Neural Networks Analysis, Design and Optimization,” Kluwer
Academic Publishers Norwell, 2000.
[4] T. Ando, Y. Uwate and Y. Nishio, “Cellular Neural Networks with Switching Two-Type Templates for Image Processing,” Taiwan and Japan Conference on Circuits and Systems, p. S1B.5, 2016.

- 260 -