2008 International Symposium on Nonlinear Theory and its Applications
NOLTA'08, Budapest, Hungary, September 7-10, 2008

Edge Enhancement of Color Image by Three-Layer Cellular Neural Network
Considering Three Primary Colors
Takashi Inoue and Yoshifumi Nishio
Department of Electrical and Electronic Engineering, Tokushima University,
2-1 Minami-Josanjima, Tokushima 770-8506, Japan
Email: {takashi, nishio}@ee.tokushima-u.ac.jp
Abstract—In this study, we propose the three-layer cellular neural network considering three primary colors. Inour propose three-layer cellular neural network, the connections between the three layers play an important role.
Namely, the three layers do not operate independently but
all the outputs influence to the other layers. In this research,
we show some edge enhancement more eﬀectively than theoriginal cellular neural networks by computer simulation.
1. Introduction

In this study, we concentrate on the edge enhancementof color images. Preparing the edge detection template foreach layer of the RGB-CNN, we confirm that the RGBCNN can enhance the edges of color images more eﬀectively than the regular processing by using the originalCNN.
In Sec. 2, we propose the RGB-CNN. In Sec. 3, we show
the algorithm using the RGB-CNN for the edge enhancement of color images. In Sec. 4, we show some computer
simulated results. Section 5 concludes the article.
2. RGB-CNN

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. Unlike the conventional neural networks, theCNN has local connectivity property. Since the structureof the CNN resembles the structure of animals’ retina, theCNN can be used for various image processing application [2]-[4] including character extractions [5][6]. Further,
the CNN can be utilized to produce some kinds of patterngeneration [7][8].
The humans retina have an ability distinguishing colors
and consist of three types of cells called “cone” responding to the three primary colors and a cell called “rod” responding to the amount of light. The humans can recognize
colors by the function of the cone cells. Roska et al. haveproposed a concept using a three-layer CNN processing thethree primary colors in [9]. They have confirmed that thethree-layer CNN could produce half-toned images of color
images. However, after their pioneering work, there havenot been many researches on the CNN dealing with three
primary colors of the image eﬀectively.
In this study, we propose the three-layer cellular neural network considering three primary colors (RGB-CNN).
Before the processing, a color image is divided into three
primary colors and they are converted to three gray-scale
images corresponding to red value, green value, and bluevalue. This preprocess corresponds to the function of thecone cells of the retina. These three images are inputted tothe proposed three-layer cellular neural networks. In ourRGB-CNN, the connections between the three layers play
an important role. Namely, the three layers do not operate independently but all the outputs influence to the otherlayers.

In the original CNN, color images are converted to grayscale images before the processing. The gray-scale images
do not have color information. Therefore, the conventional
CNN is impossible to consider color information. The proposed RGB-CNN is the three-layer CNN considering thethree primary colors of light.
2.1. Red-Green-Blue
The Red-Green-Blue is called the three primary colors oflight and all colors can be represented by combining thesethree colors. The mechanism of the three primary colors oflight is shown in Fig. 1. In Fig. 1, “R”, “G” and “B” represent red, green and blue, respectively. The color becomes
black when all Red-Green-Blue values are minimum. Also,
the color becomes white when all Red-Green-Blue values
are maximum.

Figure 1: Mechanism of three primary colors of light.
2.2. Three-layer CNN
Figure 2 shows the structure of the proposed three-layer
CNN. The three-layer CNN consists of three single-layer
CNNs. Each layer is coupled to another layer with the connection template (CR, CG, CB). Because of these connection templates, the red layer has a direct influence to the- 540 -green layer. Also, the green layer has a direct influence tothe blue layer, and the blue to the red. We can say that alllayers have mutual influences each other.

(2) Three output equations:
vyR,i j (t) =1(|v xR,i j (t) + 1| − |v xR,i j (t) − 1|)
2

(4)

1
(|v xG,i j (t) + 1| − |v xG,i j (t) − 1|) (5)21vyB,i j (t) = (|v xB,i j (t) + 1| − |v xB,i j (t) − 1|) (6)2where v x , vy , and vu represent a state, an output and aninput of cell, respectively. In the equations (1), (2) and (3),
A is the feedback template and B is the control template.
These and bias I are collectively called general template.
In addition, C are the connection templates introduced tocouple the three layers.
Figure 3 shows the structure of the RGB-CNN. Before
the processing, a color image is divided into three primarycolors and they are converted to three gray-scale images
corresponding to red value, green value and blue value.
These three images are inputted to the three-layer CNN asvuR , vuG , and vuB , Finally, we can obtain three possible output images from the three-layer CNN.
vyG,i j (t) =Figure 2: Structure of three-layer CNN.
The dynamical system equations associated with thethree-layer CNN are described by the following equations:(1) Three first-order state diﬀerential equations:dv xR,i jdt=j+ri+r ∑∑−v xR,i j +AR(i, j;k,l) vyR,kl (t)k=i−r l= j−r+j+ri+r ∑∑BR(i, j;k,l) vuR,kl (t)k=i−r l= j−r+j+ri+r ∑∑CB(i, j;k,l) vyB,kl (t) + IR

(1)
Figure 3: Structure of RGB-CNN.

k=i−r l= j−r

dv xG,i jdt=j+ri+r ∑∑−v xG,i j +AG(i, j;k,l) vyG,kl (t)3. Edge Enhancement Using RGB-CNN

k=i−r l= j−r+j+ri+r ∑∑BG(i, j;k,l) vuG,kl (t)k=i−r l= j−r+j+ri+r ∑∑CR(i, j;k,l) vyR,kl (t) + IG(2)k=i−r l= j−r

dv xB,i jdt=j+ri+r ∑∑−v xB,i j +3.1. Edge Detection Template in Conventional CNN
AB(i, j;k,l) vyB,kl (t)k=i−r l= j−r+j+ri+r ∑∑BB(i, j;k,l) vuB,kl (t)k=i−r l= j−r+j+ri+r ∑∑k=i−r l= j−r

In this section, we design the RGB-CNN for edge enhancement of color images. For the edge detection of acolor image, we sometimes face the diﬃculty if we process
the task after converting the image to a gray-scale image.
Because some edges enhanced by the diﬀerence of the colors may disappear by the conversion.

CG(i, j;k,l) vyG,kl (t) + IB

(3)

The template (7) is the convectional edge detection template. By using the template (7), edges in binary images
can be detected. However, edges in color images cannot bedetected suﬃciently.
 0 0 0  −1 −1 −1 
−1  , I = −1. (7)A =  0 1 0  , B =  −1 8
0 0 0−1 −1 −1- 541 -3.2. Edge Enhancement Template in RGB-CNN
The template (8) is the edge enhancement template forRGB-CNN.
 0 0 0 AR = AG = AB =  0 1 0 0 0 0(a)(b) −1 −1 −1 
−1 
BR = BG = BB =  −1 8−1 −1 −1 0 0 0 
CR =  0 b 0 
0 0 0
 0 0 0 
CG =  0 b 0 
0 0 0
 0 0
CB =  0 b

0 0
0 

0 
0{{{b=2b=0i f vyRi j ≥ 0otherwise

b=2b=0i f vyG,i j ≥ 0otherwise

b=2b=0i f vyB,i j ≥ 0otherwise

IR = IG = IB = − 1.

(c)(d)(e)Figure 4: Example of conversion of color image to grayscale images. (a) Color image. (b) Gray-scale image.
(c) Gray-scale image for red value. (d) Gray-scale imagefor green value. (e) Gray-scale image for blue value.

(8)

In Eq. (8), A, B and I are the same as those in Eq. (7).
For the connection template CR, CG and CB, we consider
the nonlinear (threshold-type) function to make the eﬀectof each layer more significantly. Namely, for CR, if theoutput value of the red layer is lager than zero, b becomes
2 and the output influences to the green layer. By using thisnonlinear template, the outputs of the three layers enhanceeach other. It should be mentioned that the three output
images of the three layers become the same, although threeoutputs of the three-layer CNN usually diﬀerent.
4. Simulation Results
In this section, we show some eﬀective edge enhancement results using RGB-CNN. Figure 4 shows an exampleof the conversion of a color image to gray-scale images.
Figures 4(a) and (b) are the original color image and thegray-scale image converted from the color image directly.
Also Figs. 4(c), (d) and (e) are the gray-scale images corresponding to the red, green and blue values of the color
image, respectively.
4.1. For Fruit Image
Figure 5 shows the simulation results for the fruit image
in Fig. 4. Figure 5(a) shows the result for the input image
in Fig. 4(b). We cannot detect the edges eﬀectively. Figures 5(b), (c) and (d) show the results for the input images
in Figs. 4(c), (d) and (e). We can see that the edge on thebanana can be detected by using the red color while theedge on the persimmon can be detected by using the bluecolor. Even if we combine these three outputs, the edges
are not visible clearly as Fig. 5(e). On the other hand,the proposed edge-detection RGB-CNN produce the output image in which all the edges are enhanced and also theshaded area remains as like a half-toned image.
4.2. For Monster Image
Figure 6 shows the simulation results for monster image. We can see that the proposed RGB-CNN can detect
the edges of the image more eﬀectively than the conventional CNN.
4.3. For Castle Image
Figure 8 shows the simulation results for castle image.
In this result, we can obtain the output image in which theshaded area is enhanced as well as all the edges can bedetected. We feel that this eﬀect is useful for that humanrecognize the edges in color input images.
5. Conclusions
In this study, we have proposed the three-layer CNN
considering the three primary colors. By computer simulations of edge detection tasks for a color image, we haveconfirmed that the RGB-CNN could enhance the edges ofcolor images more eﬀectively than the regular processing
by using the original CNN. We feel that the RGB-CNN isavailable to various image processings.
Also, we can see that output images using RGB-CNN
have the eﬀect of half-toning. In the future work, we should
investigate about this eﬀect.

- 542 -(a)

(a)

(b)

(c)

Figure 6: Simulation result for monster image. (a) Input
image (color). (b) Output image using the conventional
CNN for the input converted to gray-scale image. (c) Output image using the edge-enhancement RGB-CNN.
(b)

(c)

(d)

(a)

(e)

(b)

(c)

Figure 7: Simulation result for castle image. (a) Input image (color). (b) Output image using the conventional CNN
for the input converted to gray-scale image. (c) Output image using the edge-enhancement RGB-CNN.
(f)
Figure 5: Edge enhancement of fruit image. (a) Output
image using the conventional CNN for the input image inFig. 4(b). (b) Output image using the conventional CNN
for the input image in Fig. 4(c). (c) Output image using theconventional CNN for the input image in Fig. 4(d). (d) Output image using the conventional CNN for the input imagein Fig. 4(e). (e) Output image combining the outputs inFigs. 5(b), (c) and (d). (f) Output image using the edgeenhancement RGB-CNN for the input image in Fig. 4(a).

Nonlinear Network and its Application,” Proc. ofNOLTA’07, pp. 15-18, Sep. 2007.
[5] 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.
[6] J. Kishida, C. Rekeczky, Y. Nishio and A. Ushida,“Feature Extraction of Postage Stamps Using an Iterative Approach of CNN,” IEICE Trans. on Fundamentals, vol. E79-A, no. 10, pp. 1741-1746, Oct.
1996.

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 BrailleImage Recognition,” Proc. of IJCNN’06, pp. 47164721, Jul. 2006.

[7] K.R. Crounse and L.O. Chua, “Methods for Image
Processing and Pattern Formation in Cellular NeuralNetworks: A Tutorial,” IEEE Trans. Circuits Syst.,
vol. 42, no. 10, pp. 583-601, Oct. 1995.
[8] K.R. Crounse, L.O. Chua, P. Thiran and G. Setti,“Characterization and Dynamics of Pattern Formationin Cellular Neural Networks,” International Journal ofBifurcation and Chaos, vol. 6, no. 9, pp. 1703-1724,
1996.
[9] T. Roska, A. Zarandy and L.O. Chua, “Color Image
Processing by CNN,” Proc. of ECCTD’93, pp. 57-62,
Aug. 1993.

[4] H. Koeppl and L.O. Chua, “An Adaptive Cellular- 543 -