2018 International Symposium on Nonlinear Theory and Its Applications,NOLTA2018, Tarragona, Spain, September 2-6, 2018

Cellular Neural Networks with Two Templates
Switched by Local Features of Input Images
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—In 1988, Cellular Neural Networks (CNN)
was introduced. A different point from the conventional
Neural Network is that CNN has local connectivity property. The performance of CNN depends on the parameterswhich are called the template. CNN consists of cells whichcontain analog circuit and each cell connects to only its
neighboring cells according to the template. In this study,
we focus on the local features of the input image and propose a CNN method of switching two templates. We apply
the proposed method to some simulations and investigate
its performance.
1. Introduction
In recent years, our life teems with information by
growth of high information society. In order to conductparallel signal and flexible processing like human, Neural
Network was proposed. Neural Network is devised basedon the nervous system of human. Additionally, Neural Network can perform expression of nonlinear operating characteristics. Then, Cellular Neural Networks (CNN) wasintroduced by L. O. Chua and L. Yang in 1988 [1]. The
idea of CNN was inspired from the architecture of the cellular automata and Neural Network. Different points from
Neural Network are that CNN has local connectivity property and its structure resembles the retina. CNN has beensuccessfully used for various high-speed parallel signals
processing applications such as image processing, patternrecognition and so on [2]. CNN is composed of the basic
analog circuit units called cell and each cell is connected toits neighboring cells according to the template. The performance of CNN depends on the parameters which are called
the template. Each cell is influenced and its value is updated by neighboring cells. Additionally, various applications for image processing and pattern recognition of CNN
have been reported [3]-[6].
In image processing of CNN, it is difficult to processcomplex parts of the input image; edge, background, etc. In
order to process complex parts of the input image, we haveproposed a CNN method of using two templates whichhave different features [7]. Cell needs to obtain the information from neighboring cells to process complex parts. Inthe conventional CNN, the information that cell can obtainfrom its neighboring cells is limited. There is an approachof extending size of the template to increase informationfrom neighboring cells. However, this approach has the potential to collapse the local connectivity property of CNN
by uniformly using that template .
In this study, in order to keep the local connectivity property of CNN, two templates are applied to each cell according to the feature of cell in the neighborhood. We focus on
the local features of the input image and two templates areswitched. In the proposed method, appropriate template ischosen for the cell and two templates are switched by maximum and minimum output values of cell in the neighborhood. We apply the proposed method to some simulations
and investigate its performance.
2. Cellular Neural Networks
In this section, we show the conventional CNN. Basic
unit circuit of CNN is called cell. The cell consists of linear element and nonlinear element. CNN contains an arrayin a reticular pattern of many cells. In Fig. 1, we show atwo dimensional array composed of M × N identical cells
arranged in M rows and N columns.

Figure 1: The structure of CNN.
Each cell is coupled to its neighboring cells according
to the template. In image processing of CNN, cells correspond to pixels of the input image. State and output equation of cell are described as follows.
State Equation :- 110 -dv x(i j)dt=−v x(i j) +j+ri+r XX

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

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

(1)

Output Equation :1(|v x(i j) (t) + 1| − |v x(i j) (t) − 1|).
(2)
2
v x , vy and vu are state value, output value and input value.
vy(i j) (t) =In Eq. (1), A, B and T are feedback template, feedforward
template and threshold. Each cell updates the values by thegiven template. The output equation is piece-wise linear as
shown in Fig. 2.

Step 3 : Thirdly, in case that the center cell has themaximum or the minimum output value, it is applied 2ndtemplate. In the other case, 1st template is applied to thecenter cell. Then, the value of the cell is updated by thegiven template.
State equation with 1st template :dv x(i j)dt= −v x(i j) +j+r1
i+r1 XX

A1 (i, j; k, l)v x(kl) (t)k=i−r1 l= j−r1+j+r1
i+r1 XX

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

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

(3)

State equation with 2nd template :dv x(i j)
dt= −v x(i j) +j+r2
i+r2 XX

A2 (i, j; k, l)v x(kl) (t)k=i−r2 l= j−r2

Figure 2: Piece-wise linear function.
+j+r2
i+r2 XX

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

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

3. Proposed Method
In this section, we show the algorithm of the proposedmethod. We define center cell as the cell which is applied
to the template. Each cell has output value. We use two
templates which are switched by using the maximum andminimum output values (vymax : maximum output value ofcell, vymin : minimum output value of cell) in the n×n neighborhood including the center cell. In the neighborhood including the center cell, if cell has vymax or vymin , that cell has
possibility which represents feature of the input image. In
the proposed method, when center cell has that possibility,
we use the template which can conduct complex processing. The algorithm of the proposed method are describedas follows.

(4)

These steps are applied to all cells and repeated every
0.005 [τ].
4. Simulation Results
In this section, we show some simulation results of theconventional CNN and the proposed method.
4.1. Texture Analysis
In this subsection, we show simulation results of texture
analysis and using templates are described as follows [8].
Texture analysis templates :3 × 3 template (1st template) :A=B =Figure 3: Concept of the proposed method.

 0.86
0.94
2.11−2.81
−1.33 −2.58
 0.16 −1.56
 −2.89 1.09
4.06
4.69


3.75 

3.75  ,

−1.02

1.25 

−3.2  , T = 1.8.

3.75

(5)

5 × 5 template (2nd template) :Step 1 : First, find the vymax , and vymin from the n×nneighborhood including the center cell.
Step 2 : Secondly, determine if the center cell has themaximum or the minimum output value.

- 111 -A= 4.21 −1.56
 −2.89 4.53
 2.65
2.18

1.56
 3.98−3.75 −2.18

1.56
3.36
−0.23 3.12
−4.68 −3.43−1.17 −3.12
3.28
2.19


0.62 

−2.89 

−2.81  ,
−3.2 −0.62

B =T = −5.



−5
0.39
2.11 −1.87 
 4.06
 3.9
0.31 −1.95 4.84 −0.31 
 0−4.06 0.93 −0.31 0.46  , −0.62−5
2.34
0.62 −1.87 
3.59 −0.93 0.15
2.81 −1.87
(6)

(a)

(c)

B =


 −1 −1−1−18−1−1 
−1  , T = −1.
−15 × 5 template (2nd template) : 0 0 0 0 0 
 0 0 0 0 0 
A =  0 0 1 0 0  , 0 0 0 0 0 
0 0 0 0 0 −1 −3 −4 −3
 −3 060

B =  −4 6 20 6
 −3 060
−1 −3 −4 −3


−1 

−3 
−4  , T = −1.
−3 
−1(7)

(8)

(b)

(a)

(b)

(c)

(d)

(d)

Figure 4: 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 (n = 7).

Figure 4 shows the input image and simulation results byusing only 3 × 3 template, only 5 × 5 template, the proposed
method. We define 1st template as the “3×3 Texture analysis” template and 2nd template as the “5 × 5 Texture analysis” template. In Fig. 4(b), characterizing the regions of theinput image according to the texture content is conductedby using 3 × 3 template. However, the boundary of the regions is defocused. In Fig. 4(c), same characterization canbe observed by using 5×5 template. In addition, the boundary of regions of the input image is indistinct. In Fig. 4(d),the proposed method, the boundary of the regions is clear
and the texture content is characterized differently. In theproposed method, two templates are switched and applied
to cells according to the features of texture contents.
4.2. Edge Detection
In this subsection, we show simulation results of edge
detection and using templates are described as follows[8][9].
Edge detection templates :3 × 3 template (1st template) : 0 0 0 
A =  0 1 0  ,

0 0 0

Figure 5: Simulation results 2. (a) Input image. (b) Simulation result of
the 3 × 3 CNN. (c) Simulation result of the 5 × 5 CNN. (d) The proposed
method (n = 7).

Figure 5 shows the input image and simulation results
by using only 3 × 3 template, only 5 × 5 template, the proposed method. The defocused parts of the input image are
the left-side pillar and the woman’s silhouette. Therefore,
it is difficult to detect the edge lines of these parts clearly.
In Fig. 5(b), the defocused parts are not detected by using
3 × 3 template. On the other hand, in Fig. 5(c), the defocused parts are detected by using 5 × 5 template. However,noise effect is observed at woman’s hat and silhouette anddetected edge lines are thick. In Fig. 5(d), the edge lines ofthe defocused 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 detectthin edge lines and insusceptible to noise effect. According
to switching two templates, thin edge lines are detected andnoise effect is reduced compared to the conventional CNN.
We evaluate the performance of the proposed method detection for general image in edge detection. We compare- 112 -the proposed method and the conventional CNN with four
input images which include gradient region. In each input
image, boundary of two parts become defocused as it goes
top of the image. In Fig. 6, we show input images.

References[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, “Image processing of twolayer CNNs applications and stability,” IEICE Trans. Fundamentals, vol. E85-A, no. 9,
pp. 2052-2060, 2002.

(a)

(b)

(c)

(d)

Figure 6: Input images. (a) Gradient (white to whitishgray) and white. (b) Gradient (black to blackish gray) andblack. (c) Gradient (gray to whitish gray) and gray. (d) Gradient (gray to blackish gray) and gray.

We define the range from the bottom to the top of the image boundary is 0[%] to 100[%] and evaluate the proposed
method by detected boundary line. In Tab. 1, we show detection rate of each input image.
Table 1: Detection Rate [%].

Figure 6(a)Figure 6(b)Figure 6(c)Figure 6(d)Proposed method47615560

3×3 CNN
25343434

5×5 CNN
7382
8084

Ideal edge is assumed as a 1-pixel-wide line on theboundary of two regions. From Tab. 1, detection rate byusing 5 × 5 template is high and it can detect boundary linein each case. However, detected edge line is thick line as
2-pixel-wide. On the other hand, we have confirmed thatdetection rate of the proposed method is improving compared with the performance of 3 × 3 template.
5. Conclusion[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, “ImageProcessing of two-layer CNNs -applications andstability-,” IEICE. Trans. Fundamentals, vol. E85A, no. 9. pp. 2052-2060, Sep. 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. 707712, 1995.
[7] T. Ando, Y. Uwate and Y. Nishio, “Image Processing by Cellular Neural Networks with Switching Two Templates,” Proc. of PrimeAsia’17, pp. 4548, Oct. 2017.
[8] L. Kek, K.Karacs and T. Roska, “Cellular Wave
Computing Library (Templates, Algorithms, and Programs), Version 2.1, ” Cellular Sensory Wave Computers laboratory, Hungarian Academy of Sciencesk,
Budapest, Hungary, 2007.
[9] Y. Kato, Y. Uwate and Y. Nishio, “Cellular Neural
Networks with Effect from Friend Having Most Different Values and Its Friends,” Proc. of APCCAS’12,
pp. 495-498, Dec. 2012.

In this study, we applied the proposed method to somesimulations and investigate its performance. In the proposed method, we focus on the local features of the input
image and two templates were switched by local features of
the input image. From the simulation results, we confirmedthat the proposed method could process more effective thanthe conventional CNN. In the future works, we would liketo investigate the performance of the proposed method forother simulations and combine to digital processing.
Acknowledgment
This work was partly supported by collaborative research project with Hitachi.

- 113 -