You are on page 1of 9

International Research Journal of Computer Science (IRJCS)

Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

Edge detection based on Single layer CNN simulator Using


RK6(4)
Osama H. Abdelwahed1,2 and M. El-Sayed Wahed2
1Mathematics Department, Faculty of Science, Suez Canal University, Egypt
2Department of Computer Science, Faculty of Computers and Informatics, Suez Canal University, Egypt
Abstract-- We proposed RK6(4) as a new method to make an efficient single layer CNN simulator to improve the
computation time and to detect the edges of an input image. Choosing an adaptive step size using RK6(4) has a good
impact to get better results for edge detection and to obtain a faster algorithm. Experimental results and comparisons are
introduced.
Index Terms -- Cellular neural network; Image processing; Single layer CNN simulator; Edge detection; RK6(4)
1. INTRODUCTION
Edge detection is used in several fields such as image processing. It is useful especially, in the areas of feature detection and
feature extraction. Different techniques have been proposed to detect the edges of an input image. Chua and Yang presented
Cellular Neural Network (CNN) in 1988 [2]. CNN has many advantages such as its capability for parallel processing and
continuous time dynamics. The applications in image processing include edge detection, noise removal and image
segmentation especially in the medical fields such as mass detection in mammograms. Different numerical integration
methods have been proposed in designing a single layer CNN simulator for edge detection. V. Murugesh and K. Kyung [5]
modified the single layer CNN simulator [4] using RK-Gill [12] and RK-Butcher [1, 7, 8]. But the problem in their work is
that edge detection results need to be improved since the edges are not accurately determined. In addition, the computation
time cost is a little high. So our proposed method is presented to improve the quality and the accuracy of the edge detection
and to save the computation time needed for detecting the edges of an input image.
There are two types of cellular neural networks. The first type is a single layer cellular neural network in which there is only
one single state variable in each cell. The second type is a multilayer cellular neural network in which there are several state
variables in each cell of CNN. The concept of multilayer cellular neural network implies that the interactions among the state
variables of the same layer should be occurred [2]. However, in our work, our proposed method is based on using a single
layer cellular neural network which has several applications in image processing.
One of the most effective methods for analyzing the convergence properties of cellular neural networks is the lyapunov's
method. It is only a function of the input function and output function of CNN. From the properties of the function which
represent lyapunov's method, the properties of steady state variables of CNN can be easily derived. The lyapunov's method
always converges to a local minimum where CNN produces the desired output. We proposed the numerical integration
algorithm RK6(4) which improved the edge detection results and saved the CPU time or the computation time. Our proposed
method is based on using the adaptive selection step size algorithm to minimize the simulation time for single layer CNN
simulator. This paper is organized as follows: in section (2) the CNN technique was explained. Section (3) presented single
layer CNN simulator. In section (4) the numerical integration algorithms in the related work and our algorithm were
presented. Results were discussed in section (5). In section (6) conclusion was presented.
2 CELLULAR NEURAL NETWORKS
CNN is a mechanism used to process its nearby elements in parallel as in neural networks. CNN can be represented in a
regular matrix form as shown in Fig. (1). It is composed of M x N elements. The elements of CNN are called cells. Cells
which have indirectly connections can be affected with each other due to the properties of CNN [2].
Fig. (1) shows a 2D-CNN with size equal to four. Each cell c(i; j) has interactions with its nearest neighbors. CNN can be
modeled by means of three parameters: A , B , and Z. The parameters A and B specify the interaction among CNN cells and
Z is the bias value. Any image of size M _N pixels is typically CNN with size M _N. Each pixel is corresponding to a cell in
CNN.

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -17

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

Figure 1: A two dimensional CNN with 4 x 4 cells


The r-neighborhood of a cell, nm(i; j) with radius m is:

Since r is a number greater than 0. Frequently, The expression "3 _ 3 neighborhood" is used for r = 1, " 5 _ 5 neighborhood"
is used for r = 2, "7 _ 7 neighborhood" is used for r = 3, etc.
According to [2] , CNN is represented by the following equation:

Figure 2: The output function


The output of the cell yij is set by the current source Iyx as illustrated in the following equation:

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -18

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

The output function f is illustrated in Fig. (2).


The output voltage yij = IyxRy has the following form:

C and Rx represent the parameters of the circuit. takes values from 10-8 -10-5 seconds. This parameter has impact on the
behavior of CNN. To measure the time in units, we set = CRx = 1. Zij = Iij / C represents the bias of the cell. The state
equation can be abbreviated as in the following equation:

Equation (6) represents the general equation of the standard CNN dynamics.
The output equation depends mainly on the state values, the input values and the bias value. So the system of differential
equations of CNN is controlled by the templates {A(i; j; k; l), B(i; j; k; l), Zij }.
A and B are represented as in the following form:

The concepts of space-invariant templates are exploited in CNN. This means that A(I, j; i + 1, j) is the same for all (I, j)
coordinates. The values of the template A and the template B in addition to the bias value Z are nineteen parameters which
define CNN in the case of 1-neighborhood.
3. THE PROPOSED METHOD
Our presented method was based on the single layer CNN algorithm mentioned in [5]. We introduced the numerical
integration method, RK6(4) in the single layer CNN algorithm for edge detection. Our method has decreased the CPU time
or the computation time of this algorithm. This improvement was accomplished by choosing an adaptive step size when
RK6(4) was applied. So when the step size was increased to some extent, this means that the computation time would be
decreased. This point is one of the most essential parts in the proposed algorithm. So our contribution lies in increasing the
value of the chosen step size gradually to some extent using RK6(4) to obtain shorter CPU time. In addition, the algorithm
improved the edge detection results. Our results will be compared to those introduced in the literature [5].
Actually the idea of the algorithm in [5] is mentioned as follows: the centers of the templates A and B are passed to the input
image pixel by pixel through CNN processor till the algorithm converges to the steady state values [5]. This means that the
final state is the approximated output image with some error tolerance. Three different values for the templates A, B and the
bias value Z of CNN processor are applied according to the kind of the application. The application will be edge detection,
averaging template, or connected component.

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -19

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

Figure 3: Flow chart of single layer CNN algorithm


____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -20

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

Although our proposed algorithm essentially for edge detection only, but the other two templates, averaging template and
connected component are used for comparison purposes as we will mention below. The flow chart of the single layer CNN
algorithm [5] is shown in Fig. (3). The essential part in the flow chart will be the proposed numerical integration algorithm
RK6(4) that will be discussed in section (4.2). As we mentioned before that our purposed numerical integration algorithm has
two important points: First, to make a faster algorithm for edge detection by decreasing the CPU time; second, to improve the
edge detection results.
4. THE NUMERICAL INTEGRATION METHODS
CNN is represented by a system of differential equations which is solved using numerical integration algorithms. Three
numerical integration methods were used in the literature [5]. They were Euler, RK-Gill and RK-Butcher. Our proposed
method RK6(4) used the adaptive step size formula [11] to minimize the local truncation error. Since by increasing the step
size to some extent, the CPU time of the single layer simulator will be improved. These algorithms can be represented as
shown in the following equation[5]:

In section (4.1), we will discuss the numerical integration algorithms mentioned in the literature [5]. In section 4.2, the
proposed numerical integration algorithm RK6(4) will be mentioned in details.
4.1 THE NUMERICAL INTEGRATION ALGORITHMS USED IN THE PREVIOUS WORK
4.1.1 Euler method
Euler's method is very simple to be used to solve a system of nonlinear differential equations. It is a first order method that
uses local truncation error for each step and it uses a global truncation error at a given time. It is approximated according to
Taylor series as in the following equation [3, 8, 9]:

4.1.2 RK-Gill method


The RK-Gill algorithm which was proposed by [12] requires four calculations per step as shown in the following equation:

4.1.3 RK-Butcher
The RK-Butcher algorithm [3, 8, 9] requires six calculations for each step as shown in the following equation:

Where,

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -21

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

4.2 THE PROPOSED NUMERICAL INTEGRATION ALGORITHM RK6(4)


RK6(4) is a numerical integration method used in single layer CNN simulator. The equations of RK6(4) [11] are :

Therefore, we have the following equation which represent the solution for RK(6);

Our contribution is based on applying the adaptive step size selection method in the single layer CNN simulator using
RK6(4). According to [6], The step size h of r(s) - order RK methods was modified in terms of the error by step(EPS) [10] by
using the following equation:

Since f is a safety value and hn+1 = xn+1 - xn is approximated according to the estimation of the local truncation error error
which is approximated using the equation [6]:

Since x^n and y^n represents the approximated solutions of order rth and sth respectively.
And tol represents the required tolerance.
____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -22

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

If errorn+1 tol, this implies that yn+1 is acceptable otherwise, Equation (13) is recomputed by substituting
error n errorn+1.
By substituting r = 6 and s = 4, the value of the step size as follows:

So we use Rk6(4) to make an efficient single layer CNN simulator for edge detection and higher performance.
5. EXPERIMENTAL RESULTS
As we mentioned above that the simulation time used in the algorithm is the real CPU time. Our simulator was executed on a
machine with processor core i5. The input image is a boat image. The edge detection results are shown in Fig. (4). the input
image and output image are shown in Fig. (4a) and Fig. (4b) respectively. The performance measures are shown in Fig. (5).
Using our proposed algorithm, from Fig. (5a) , we notice that the simulation time due to simulating a small diamond image
used to detect the edges of the input image is better than those used in the literature.

(a) Input image

(b) Output image


Figure 4: Results of edge detection

Another very important point is choosing an adaptive value for the step size. Our proposed method used RK6(4) to optimize
the value of step size to some extent using the adaptive step size algorithm. In Fig. (5b) we notice that the value of step size
for our proposed algorithm is higher than those used in the literature. If the value of step size is very small, the algorithm will
take much time otherwise if the value of step size is very high, the algorithm might diverge. The results of figure (5b)
obtained by simulating a small diamond image more than one hundred times. Actually, choosing a proper value of the step
size helped in designing an efficient single layer CNN simulator which has some capabilities like improving the simulation
time and enhancing the edge detection results. i.e. this means that the local truncation error for each step is decreasing when
compared by the numerical integration algorithms which are used in the literature. So using RK6(4) in the single layer CNN
simulator increased the efficiency of the single layer CNN simulator because using the selection step size algorithm in
RK6(4) enhanced the quality of the edge detection results and minimized the local truncation error which implies a faster
performance for the proposed simulator.

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -23

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

(a) CPU time for 4 different methods

ISSN: 2393-9842
www.irjcs.com

(b) Maximum step size for 4 different methods:


1- Edge detection 2- Averaging template 3- Connected component
Figure 5: Measures of performance

Table (1) summarizes the results of CPU time and the corresponding maximum step size for the proposed method and the
methods used in the literature. We notice that our proposed method has the maximum value of step size and this means that
the corresponding CPU is absolutely has the minimum value. Also, table (2) shows the maximum step size for both
averaging and connected component templates. According to these results, our proposed numerical integration algorithm has
shown faster CPU time i.e. shorter time for the single layer CNN simulator.
METHOD
Euler
RK-Gill
RK-Butcher
RK 6(4)

CPU TIME
25
20
6
1

MAXIMUM STEP SIZE


5
1
2
3.5

Table 1: Results of CPU time and maximum step size for edge detection
METHOD
Euler
RK-Gill
RK- Butcher
RK 6(4)

AVERAGING TEMPLATE
7
1.5
2
2.8

CONNECTED COMPONENT
2
1.8
3
1.2

Table 2: Results of maximum step size for averaging template and connect component
6. CONCLUSION
Using our proposed numerical integration algorithm RK6(4), we achieved better results than those presented in the literature.
So our method improved the simulation time or CPU time for the single layer CNN simulator. This contribution utilized the
adaptive step size algorithm using RK6(4) which implied a faster single CNN simulator . There are further studies needed to
improve the obtained results by choosing an efficient numerical integration algorithm which improves the CPU time and
edge detection for the single layer CNN simulator.
REFERENCES
[1]. JC. Ban and CH. Chang. When are two multi-layer cellular neural networks the same? Neural Networks, March 2016.
[2]. L. O. Chua and L. Yang. Cellular neural networks: Theory and applications. IEEE Trans. Circuits and Systems, 1988.
[3]. N. Huang and CF. Ma. Modified conjugate gradient method for obtaining the minimum-norm solution of the
generalized coupled sylvester-conjugate matrix equations. Applied Mathematical Modelling, 40(2):1260_1275, January
2016.
____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -24

International Research Journal of Computer Science (IRJCS)


Issue 04, Volume 3 (April 2016)

ISSN: 2393-9842
www.irjcs.com

[4]. C.C. Lee and JP. de. Gyvez. Single-layer cnn simulator. In IEEE International Symposium on Circuits and Systems,
1994.
[5]. V. Murugesh and K. Kyung. An e_cient edge detection using raster cnn simulator. In Proceedings of the 5th
international conference on Convergence and hybrid information technology, pages 634_642, 2011.
[6]. TD. Papanikolaou and D. Tsoulis. Assessment of numerical integration methods in the context of low earth orbits and
inter-satellite observation analysis. Acta Geodaetica et Geophysica, January 2016.
[7]. G. C. Paul and S. Senthilkumar. Exploration on initial structures of extrasolar protoplanets via new explicit rkahem(4,4)
method. The Egyptian Journal of Remote Sensing and Space Science, 18(1):1_8, June 2015.
[8]. G. C. Paul and S. Senthilkumar. Execution of novel explicit rkarms(4,4) technique in determining initial configurations
of extra-solar protoplanets formed by disk instability. NRIAG Journal of Astronomy and Geophysics, January 2016.
[9]. S. Senthilkumar, M. Lee, and G. Jeong. A modified improved runge-kutta-fifth-order five stage technique to study
industrial robot arm. Int. J. Patt. Recogn. Artif. Intell, 27(6), September 2013.
[10]. L. F. Shampine. Some practical runge-kutta formulas. Math. Comp., 46:135_150, 1986.
[11]. CH. Tsitouras and S. N. Papakostas. Cheap error estimation for runge_kutta methods. SIAM J. Sci. Comput.,
20(6):2067_2088, 1999.
[12]. W. Xu, D. Meng, Y. Chen, H. Qian, and Y. Xu. Dynamics modeling and analysis of a flexible-base space robot for
capturing large flexible spacecraft. Multibody System Dynamics, Springer, 32(3):357_401, 2014.

____________________________________________________________________________________________________
IRJCS : Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -25

You might also like