InTechOpen uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.

Technology » "Advanced Technologies", book edited by Kankesu Jayanthakumaran, ISBN 978-953-307-009-4, Published: October 1, 2009 under CC BY-NC-SA 3.0 license. © The Author(s).

New Model and Applications of Cellular Neural Networks in Image Processing

DOI: 10.5772/8223

Article top

Overview

Figure 1. (a) Block diagram of proposed CNN model; (b) Circuit structure of a cell.

Figure 2. (a) Graphical construction for determining the driving point plot; (b) Driving point plot, dynamic routes and equilibrium points for different values of g i .

Figure 3. (a) Possible pixel combinations in convex corner detection; (b) Image loaded as initial state; (c) Output images containing detected corners.

Figure 4. (a) Binary image; (b) Transient state; (c) Steady state output image.

Figure 5. Closed curve detection: (a) binary image; (b) transient state; (c) output image.

Figure 6. (a) Labyrinth image as initial state; (b) input image; (c) transient state; (d) output image containing detected routes between selected points.

Figure 7. (a) Binary image; (b) Transient state; (c) Steady state output image.

Figure 8. (a) Test image; (b) initial state (marking points); (c) transient state; (d) output image.

Figure 9. (a) Image I1 as initial state; (b) Input image I2; (c) Resulted output image.

Figure 10. (a), (c) maximally-flat circular filter frequency responses; (b), (d) contour plots.

Figure 11. Frequency response and contour plots of two elliptically-shaped filters: (a), (b) φ = π / 3 , E = 2.8 , F = 1 ; (c), (d) φ = π / 3 , E = 2.4 , F = 0.6

Figure 12. (a) Elliptic 1D LP prototype filter; (b) 2D directional filter response ( φ = π / 6 ); (c) contour plot; (d) 2D directional frequency response for φ = 0.22 π ; (e) contour plot

Figure 13. Directional elliptically-shaped filters: (a),(b): p = 5 , E = 3 , F = 0.1 , φ = 0.22 π ; (c), (d) p = 5 , E = 7 , F = 0.5 , φ = 0.22 π

Figure 14. (a) Test image; (b),(c),(d) directionally filtered images with parameters: (a) φ = 0.8 π , p = 30 , E = 7 , F = 0.5 ; (b) φ = π / 7 , p = 70 , E = 7 , F = 0.3 ; (c) φ = − 0.2 π , p = 50 , E = 7 , F = 0.3

Figure 15. (a) Binary test image; (b) Directionally filtered image; (c) Texture image;

Figure 16. (a) Contour plot of a four-lobe filter; (b) Variation of the periodic function ρ ( φ ) ; (c) Maximally-flat low-pass prototype; (d) Very selective radial function

Figure 17. (a), (b) Frequency response and contour plot for the 4-lobe filter; (c) Test image; (d) Filtered image.

New Model and Applications of Cellular Neural Networks in Image Processing

1. Introduction

The cellular neural network (CNN) in its standard form as defined by Chua and Yang has become a paradigm of analog, high-speed computation, with various applications in parallel signal processing, especially in image processing tasks. Within two decades this domain has extensively developed both theoretically and from the applications point of view. Although the mainstream research basically followed the standard CNN model, many other CNN models and architectures were proposed, envisaging new and more complex classes of applications.

We propose here an alternative CNN model, inspired from Hopfield-type recurrent networks. This new model has the same general architecture as the standard model, while the cell structure, preserving the basic elements, is modified from a dynamical point of view. The cell non-linearity, having a major role in CNN dynamics, no longer applies only to the current state variable as it does in the standard model, but to the whole information fed to the current cell, thereby leading to a different dynamic behavior. The new cell structure and state equations are presented and the dynamics and equilibrium points are analyzed.

The advantages of this model, which we call “CNN with overall non-linearity”, are a simpler design of the templates, and the fact that all voltages in the cells are limited to a fixed dynamic range regardless of template parameters; thus the boundedness problem regards the current range instead of voltage, which makes it less critical from an implementation point of view. The image processing capabilities of the proposed CNN model will be approached. Some new image processing tasks are proposed. We first analyze the behavior of the proposed CNN in processing binary images, then using so-called local rules we design the templates for several specific tasks, which are: convex corner detection, erasing thin lines, detection of closed curves, finding all paths between two selected points through a labyrinth, rotation detector, marked object reconstruction and finding the intersection points of one-pixel thin lines from two superposed binary images. Many other processing tasks both on binary or grayscale images are possible. Further research may focus on extending the range of applications of the proposed model.

Next some applications of CNNs in image linear filtering will be approached. In this range of applications, the cells of the CNN operate in the linear domain, and the system stability must be ensured. The design of CNN linear filters with high selectivity may lead in general to large-size templates. Due to the fact that local connectivity in CNNs is an essential restriction, the decomposition of a large-size template into small-size templates is often necessary. Fast linear filtering using parallel computing systems like CNNs may be useful in early vision aplications and pre-processing tasks. We will present some original and efficient design methods for several types of two-dimensional filters: circular, maximally-flat, elliptically-shaped, orientation-selective filters etc. We also propose a class of 2D linear filters which are designed starting from a desired shape in the frequency plane, described in polar coordinates. Using this method, some interesting filters can be designed, such as concave-shaped filters presenting narrow lobes in the frequency plane. A particular class are the zero-phase 2D filters, which are extensively used in image processing due to the absence of phase distortions. For all the proposed filters, the design starts from an imposed 1D prototype and uses rational approximations and various frequency transformations to obtain the 2D frequency response. The resulted filters are efficient, at the same time of low complexity and relatively high selectivity. The design methods are entirely analytical, but they could be combined with numerical optimization techniques. The filters can be implemented either digitally or on analog processing systems like CNNs. Further research also envisages an efficient and reliable implementation of this class of filters.

2. Cellular Neural Networks with Overall Nonlinearity

2.1. Equations and Circuit Model

The state equation of the current cell i for a standard CNN has the form (Chua & Yang, 1988):

 dxidt=−xi+∑j∈NiAj⋅f(xj)+∑k∈NiBk⋅uk+Ii (1)

and the output is given by the piece-wise linear function:

 yi=f(xi)=0.5(|xi+1|−|xi−1|) (2)

Here a new version of CNN is proposed (Matei, 2001), with a modified structure as compared to the standard one. The difference lies in the form of the state equation, which has the form:

 dxidt=−xi+f(∑j∈NiAj⋅xj+∑k∈NiBk⋅uk+Ii) (3)

For simplicity we used a single index for the cells, as in the case of 1D CNNs. Unlike the standard CNN, in this case the nonlinear function applies to the entire information gathered from the neighboring cells, i.e. state variables ( xj ), inputs ( uk ) and the bias term ( Ii ). For this reason, we have called this a CNN with "overall non-linearity". This CNN version was inspired by the well-known dynamical model of a neuron which is the elementary unit of so-called recurrent neural networks or Hopfield networks. Within this framework, the standard CNN can be regarded as a particular Hopfield network with local connectivity. The neuron's output is related to the current state ("activation potential") through a nonlinear activation function with various shapes (logistic, piece-wise linear,etc.). There are two basic dynamical neuron models, related by a linear and generally invertible transformation (Haykin, 1994). The proposed CNN corresponds to the second recurrent model. Therefore, the proposed CNN model and the Chua-Yang model are equivalent, being described by similar equations if a linear transformation is applied.

Let us denote by zi the argument of the piece-wise linear function f in (3):

 zi=∑j∈NiAj⋅xj+∑k∈NiBk⋅uk+Ii=∑j∈NiAj⋅xj+ki (4)

where the inputs and bias are constant and were put together into the term ki .

Multiplying both members of (3) by Aj , summing over iNi ( Ni denotes the current cell neighborhood) and shifting again the indices i and j, we finally obtain (Matei, 2001):

 dzidt=−zi+∑j∈NiAj⋅f(zj)+∑k∈NiBk⋅uk+Ii (5)

having a form similar to (1), but in the new variable zi . Equation (4) defines the linear transformation which relates the two CNN models.

2.2. System and Circuit Description

The modified CNN will be analytically described from dynamical point of view, as well as at circuit level. Figure 1 shows a block diagram representation of the dynamic behavior of the modified CNN, which can be compared to the standard CNN block diagram (Matei, 2001).

In this block diagram all the variables are vectors or matrices. The correlation sums in the state equation can be written as convolutions. The variable z at the input of the nonlinear block is:

 z=A∗x+B∗u+I (6)

and the matrix state equation of the modified CNN will be:

 dx/dt=−x+f(A∗x+B∗u+I) (7)

Unlike the standard CNN case (where the nonlinear block is placed in the feedback loop), in

Figure 1.

(a) Block diagram of proposed CNN model; (b) Circuit structure of a cell.

the modified CNN it operates in the forward path. Here we must emphasize an important feature of the proposed CNN: the output is identical to the state variable y(t)=x(t) throughout the operating domain – a significant advantage in the CNN implementation.

In Figure 1(b) we present the cell circuit of the modified CNN, which preserves the same elements as the standard CNN, but has a different structure. The major difference between the two structures lies in the location of the nonlinear element. In the standard CNN case, the nonlinear function applies to the state variable xi , which is a voltage, and gives the output voltage yi=f(xi) . In the modified CNN equation (3), the non-linearity applies to the amount denoted zij , summing up the entire information from the states and the inputs of the neighboring cells. The variable zij is a current (given by several linear controlled current sources), and f(zi) is a current as well. For the piecewise-linear current-controlled current source we can write Iyx=f(zi) . The resistor denoted Ry has the single role of summing the currents given by the linear sources, while in the standard CNN cell it converts voltage into current. Unlike the Chua-Yang model, in this case the nonlinear current source feeds the current directly into the capacitor C and the resistor Rx . On the cell circuit, considering normalized values for C and Rx we can also derive the state equation (3).

2.3. Dynamics and Equilibrium Points

Using the Lyapunov method and the linear mapping (4) it can be proven that the modified CNN also has the property of convergence to a constant steady state following any transient. The stability properties are also established in Hopfield network theory (Haykin, 1994).

For standard CNNs, the state equation (1) is linear as long as all the state variables are less than one in absolute value, xi[1,1] . This domain defines the linear region of the state space. For the modified CNN, the linear region of the state space in variable xi depends on the feedback state information, the input information and the bias term, as shows (3). In the linear region of the state space, as long as no cell reached saturation, equations (1) and (3) have a similar form, since in this domain we have f(x)=x , which implies that the linear dynamics of the standard CNN and modified CNN are identical. The difference lies in the way in which the two types of CNNs enter the nonlinear region and reach equilibrium.

In the following paragraph we proceed to an analysis of the dynamic behavior and a study of the equilibrium points of the modified CNN. We will use the so-called driving-point plot, which gives the state derivative dxi/dt vs. state variable xi (Chua & Yang, 1988). We will emphasize the dynamic routes and the possible equilibrium points the system can reach.

Using equation (5) which corresponds to a standard CNN in the state variable zi , we can first represent the driving-point plot ( dzi/dt,zi ) in the new variable zi as in Figure 2 (a). The drawing of this plot is shown in detail in (Matei, 2001). In order to derive the driving point plot in the original variable xi , we use the linear mapping (4) in the form:

 zi(t)=p⋅xi(t)+gi(t) (8)
 gi(t)=∑j∈Ni,j≠iAj⋅xj+∑k∈NiBk⋅uk+Ii=∑j∈Ni,j≠iAj⋅xj+ki (9)

In (8), p=A0 is the central element of the feedback template. Supposing for the moment a fixed, constant value for gi(t) , denoted gi , we obtain for p0 :

 xi(t)=(1/p)⋅(zi(t)−gi) (10)
 dzi/dt=p⋅dxi/dt (11)

The case p=0 should be analyzed separately. Through a simple graphical construction shown in Figure 2 (a) we can draw the corresponding driving point plot in the original variable xi . This can be done using two auxiliary plots: (a) the plot (xi,zi) , given by (10), represented by a straight line with slope of value 1/p and offset value gi ; (b) the plot (dzi/dt,dxi/dt) , given by (11), consisting in a straight line with slope p crossing the origin.

The plots depicted in Figure 2 (b) were drawn for the particular values p=2 , gi=0.5 .

The segment A1B1 with slope ( p1 ), given by:

 dzi/dt=(p−1)⋅zi+gi (12)

has an identical form in xi :

 dxi/dt=(p−1)⋅xi+gi (13)

The points A1 , B1 , given by the coordinates: A1(1,p1+gi) , B1(1,p+1+gi) become:

 A(1−gip,p−1+gip),B(−1−gip,−p+1+gip) (14)

The lines A1D1 and B1C1 , described by the equations:

 dzi/dt=−zi+p+gi        dzi/dt=−zi−p+gi (15)

become AD and BC respectively, given by:

 dxi/dt=−xi+1               dxi/dt=−xi−1 (16)

Figure 2.

(a) Graphical construction for determining the driving point plot; (b) Driving point plot, dynamic routes and equilibrium points for different values of gi .

In the diagram (dxi/dt,xi) the points C and D result from the intersection of the straight lines BC and AD with axis xi , imposing the condition: dxi/dt=0 .

We finally obtain: xi(C)=1 and xi(D)=1 . Points C(1,0) and D(1,0) will therefore be fixed equilibrium points of the modified CNN, independent of the values of p and gi . For different values of the amount gi , the diagram (dzi/dt,zi) shifts up or down. Correspondingly, the (dxi/dt,xi) plot slides along the two parallel dashed lines crossing the two fixed points C and D. In Figure 2 (b) one typical driving point plot is shown with continuous line and the dynamic routes are indicated by arrows. The number of equilibrium points and their nature for different values of p and gi are analyzed in (Matei, 2001).

2.4. Dynamic Range of Modified CNNs

For standard CNNs the following result has been proven in (Chua & Yang, 1988):

Theorem: All states xi in a CNN are bounded for t0 and the bound vmax is given by:

 vmax=1+|I|+maxi∑i(|Ai|+|Bi|) (17)

if we consider the normalized resistance value Rx=1 .

The possibility of estimating the maximum dynamic range is very important from the implementation point of view, because it allows one to optimally design the circuit parameters in order to keep the voltage values within reasonable bounds.

In (Rodriguez-Vasquez et al., 1993) a new CNN model, called "full-range" model was introduced, adding a nonlinear term to the state equation, which confines the state value to the range [-1,1]. This simplifies the design, allowing for reduced area and power consumption in VLSI implementation.

Our approach gives in fact another solution to this problem, forcing the state and output values to be equal. Therefore, the proposed CNN with "overall non-linearity" is in fact a "full-range" model as well. In the modified CNN, this problem is solved by the form of the state equation itself. Indeed, at any equilibrium point, the current cell state variable is xi=f(zi) and consequently its variation is bounded to the range [1,1] . Moreover, the output variable is identical to the state variable at any time: yi(t)=xi(t) .

Referring again to the circuit structure, the argument zi(t) of the nonlinear function f(zi) given by (4) is physically a current. However, since equation (5) is similar to the state equation of a standard CNN cell, but written in variable zi , equation (17) may be formally applied to evaluate a maximum bound Imax for the cell currents.

Therefore in the case of proposed CNN with overall nonlinearity, the boundedness problem regards the current range instead of voltage, which makes it less critical from an implementation point of view. All voltage variations in the modified CNN are limited to a fixed range corresponding to the extreme pixel values, regardless of template parameters.

3. Applications of CNNs with Overall Nonlinearity

In this section we approach the image processing capabilities of the proposed CNN model. Some processing tasks will be proposed on binary (black and white) images. We first analyze the behavior of the proposed CNN model in processing binary images, then we design the templates for a few specific tasks, namely: convex corner detection, erasing thin lines, detection of closed curves, finding all paths between two selected points through a labyrinth, rotation detector, marked object reconstruction and finding the intersection points of one-pixel thin lines from two superposed binary images. Many other processing tasks on binary or grayscale images are possible.

A vast reference for different classes of standard CNN tasks is the CNN Software Library, a template catalog for a large range of analog processing operations on binary and grayscale images. These also include more complex analog algorithms which consist of sequences of elementary tasks which are fulfilled under digital control.

We use here the convention that the pixel value -1 corresponds to white, and the pixel value +1 corresponds to black. Generally, one binary image is loaded into the CNN as initial state, while another binary image may be applied to the array input. In this range of applications the system must behave as a bipolar CNN. A standard CNN is said to be bipolar if u,yBMN , x(0)BMN , where B={-1,1} , and M, N are the number of rows and columns of the CNN array (Hänggi & Moschytz, 2000).

Based on the information contained in the two images, the CNN must accomplish a given task upon the state image, according to a set of local rules for which the feedback and control templates are designed. If a given binary image is loaded as initial state, this implies that all cells are initially saturated. Depending on the chosen template parameters, the initial state of a given cell may be stable or unstable. If the state is stable, the corresponding pixel will remain unchanged (black or white); if on the contrary the state is unstable, the pixel may switch to the opposite state, following a transient evolution. Taking into account that we want to obtain a binary output image in response to the processed image, we impose that the cells which are initially unstable switch into the opposite state, therefore for a generic cell C(i,j) we will have: x˙ij(0)0 . These cells will switch into the opposite saturated state which is supposed to be stable according to local rules. The switching of a cell between two saturated states implies a dynamic evolution through the middle linear region. As stated from the beginning in (3), the dynamics of the current cell is described by:

 dxi(t)/dt=−xi(t)+f(zi(t)) (18)

Suppose that a given pixel is initially black, i.e. xi(0)=1 . If it is to remain black, this implies x˙i(0)=0 and from (18) we must have: f(zi(0))=1 , therefore zi(0)1 . If the black pixel must switch to white, we impose: zi(0)1 , so f(zi(0))=1 ; the initial state derivative is:

 x˙i(0)=−xi(0)−1=−20 (19)

The cell state value decreases exponentially from 1 to -1:

 xi(∞)=−1          x˙i(∞)=−xi(∞)−1=0 (20)

therefore the cell finally reaches a stable equilibrium point.

In the following paragraphs we present several tasks on binary images in order to show the image processing capabilities of the proposed CNN model with overall nonlinearity. For each of these tasks, the templates are designed and simulation results are provided.

3.1. Convex Corner Detection

Although the convex corner detection on binary images is implemented as well on standard CNNs, we show here the template design method for the proposed model. We assume a feedback template A of the general symmetric form:

 A=[sssspssss] (21)

The first step is to find the local rules according to the desired result. We have to take into account all the possible combinations of black and white pixels within a 3×3 frame. Although the total number of combinations is quite large, due to template A symmetry the number of distinct combinations is largely reduced. All inner black pixels must turn white, while any edge pixel must remain black if it locates a convex corner or turn white otherwise. In Figure 3 (a), the combinations (a)–(d) represent convex corners, while cases (e)-(h) do not. Assuming for s a negative value, we obtain a system of inequalities which reduces to the set:

 p+2s+I−1p+I1p+8s−I1 (22)

Finding a solution to the above system is a linear programming problem which can be solved graphically or numerically. We finally reach the set of parameters: p=7.5 ; s=1.5 ; I=6 . A simulation of this task is shown in Figure 3 (b), (c). The result of convex corner detection is shown, resulted from the test image (b) loaded as initial state. We remark that all convex corners are correctly detected, while the concave corners do not appear in the output image (c). A thin line emerging from a convex corner is also detected.

Figure 3.

(a) Possible pixel combinations in convex corner detection; (b) Image loaded as initial state; (c) Output images containing detected corners.

3.2. Erasing Thin Lines

We intend to design a template which erases every thin line (one-pixel thick) from a binary image, leaving all other objects unchanged. For example, the test image in Figure 4(a) is loaded into the CNN as initial condition. We look for the feedback template A in the form (21), this time assuming s0 ; writing the local rules, we reach the following system:

 p−4s+I−1p−2s+I1p−I1 (23)

and we choose a convenient set of parameter values: p=8 ; s=2 ; I=2 . The CNN input is not used. The final result of the processing is shown in Figure 4(c). We notice that the two thin curves from the left, as well as the spiral and the lines emerging from the black square have been erased. The lines perpendicular to the square edges may leave a single residual pixel. In Figure 4(b) a snapshot of an intermediate state is shown, in which the progressive deletion of thin lines is noticeable. The compact objects present in the image remain unchanged.

3.3. Detection of Closed Curves

In some applications it might be useful to discern between closed and open curves. These curves in turn may result from a previous processing, such as edge detection etc.

We design a CNN task which detects the one-pixel thin closed curves and deletes the open curves from a binary image. The absence of at least one pixel from a closed curve turns it into an open curve. Both the input and the initial state are used. The same binary image P is loaded as initial state and applied to input: U(t)=P ; X(0)=P . The templates are chosen as:

 A=[sssspssss];  B=[rrrrprrrr];  r=−0.5s (24)

Applying the corresponding local rules, the set of inequalities is derived:

 2p−2s+I12p−3s−I12p−2.5s+I−1 (25)

A convenient choice of parameters is: p=9 ; s=6 ; I=4.5 . In this task we observed the 8-pixel connectivity, i.e. the current black pixel is considered connected to any other black pixel lying in its 3×3 neighborhood. A simulation is shown in Figure 5. The test image (a) contains six thin curves, which feature all types of possible edges and corners. There is also a compact concave object in the image. The image (b) shows the CNN state at an intermediate moment, and the final image (c) contains just the closed curves and the compact object, which was preserved. The process of erasing open curves relies on a dynamic propagation starting from the free ends. The black pixels from the ends turn white according to the imposed local rules until the entire curve is erased.

Figure 4.

(a) Binary image; (b) Transient state; (c) Steady state output image.

Figure 5.

Closed curve detection: (a) binary image; (b) transient state; (c) output image.

3.4. Finding All Paths Between Two Selected Points Through a Labyrinth

A processing task related to the previous one is presented below. We consider a labyrinth made up of white one-pixel thin curves against a black background. In this case we suppose valid the convention that one pixel is possibly connected only to four neighbors (up, down, left, right). The target of the proposed task is to find all the existing paths between two given points situated in the labyrinth, which are marked by white pixels in the input image. A point is represented by one pixel, either on the input or state image.

The binary image P representing the labyrinth is loaded into the CNN as initial state ( X(0)=P ). The input image may be zero everywhere (average grey level) except for two white pixels (of value -1) which mark the points selected in the labyrinth.

The dynamic process which finds the routes between the chosen points is similar to the one used in application 3.3. The template parameters are designed such that all labyrinth routes with unmarked ends are gradually erased starting from end pixels which turn from black to white (cell outputs switch from -1 to +1). The templates are searched in the form:

 A=[rsrspsrsr];   B=[0000a0000] (26)

and the following system results:

 −p+4r+I−1−p+2s−4r+I1−p+2s+2r+I1−p+2s+4r+I−a−1 (27)

with convenient parameter values: p=12 ; s=4 ; r=0.5 ; a=8 ; I=8 .

In Figure 6 a simulation example is shown. The input image (b) contains two white pixels on a uniform gray background (zero pixel value). The two pixels locate on the labyrinth image (a) (loaded as initial state) the points between which the routes are selected. At the end of dynamic propagation shown in (c), the output image (d) results.

More generally, routes can be found among several points in the labyrinth, or a single point is chosen and we find all the closed routes containing that point. The classical problem of finding the shortest path through a labyrinth is more complex and it can be solved through a CNN algorithm using several nonlinear templates, which are run sequentially under digital control.

Figure 6.

(a) Labyrinth image as initial state; (b) input image; (c) transient state; (d) output image containing detected routes between selected points.

3.5. Erasing Objects with Tilted Edges (Rotation Detector)

We will design a CNN task which detects in a binary image the compact convex or concave objects having only horizontal and vertical edges and removes all tilted objects or objects having at least one tilted edge. In particular the CNN can detect the rotation of such objects.

This is based on the discrete representation on an array of a straight line, in particular the edge of a compact object, with a certain slope. Due to the limited spatial resolution of the CNN array, any tilted edge will be mapped as a stair-like edge. An edge with the minimum angle will map into a staircase with only two stairs, while an edge with a slope of π/4 is mapped into a staircase with a maximum number of one-pixel stairs. The binary image P is loaded into the CNN as initial state ( X(0)=P ) and applied at the CNN input as well, U(t)=P . We look for the templates in the general forms:

 A=[rsrspsrsr];   B=[0.5r−0.5s0.5r−0.5sp−0.5s0.5r−0.5s0.5r] (28)

and finally the following convenient values are found: p=5 ; s=5 ; r=0.8 ; I=11.2 .

Figure 7.

(a) Binary image; (b) Transient state; (c) Steady state output image.

A simulation is presented in Figure 7. Image (a) contains several compact objects: a rectangle and a square placed horizontally and their rotated versions etc. The objects with at least one tilted edge are gradually eroded through a dynamic propagation, as shows the transient snapshot (b); the final image (c) preserves only objects with horizontal and vertical edges. Therefore, this task can be used to detect the rotation of simple objects (rectangles etc.).

A simulation is presented in Figure 7. Image (a) contains several compact objects: a rectangle and a square placed horizontally and their rotated versions etc. The objects with at least one tilted edge are gradually eroded through a dynamic propagation, as shows the transient snapshot (b); the final image (c) preserves only objects with horizontal and vertical edges. Therefore, this task can be used to detect the rotation of simple objects (rectangles etc.).

3.6. Marked Object Reconstruction

A binary image P containing compact shapes or curves is applied to the CNN input. From this image we intend to select certain objects which we want to preserve, and delete the others. The selection of objects is done by marking them with a black pixel, in the image loaded as initial state. Therefore at the input we have U=P and the initial state X(0) consists in black marking pixels against a white background. These can be placed anywhere within the area of selected object (in the interior or on the edge). The marked objects are reconstructed in the state image through a gradual process. Starting from the marking pixel, the white pixels within the marked object turn black. This propagation process stops on the edge of the object in the input image. The unmarked objects will not appear in the final image. We assume the feedback template of the form (21) and the control template zero, except the central element equal to a. With s0 , p0 , we finally obtain the system:

 p−8s+I+a1p+8s−I−a1p+6s−I−a−1 (29)

A convenient set of parameters results as: p=3 ; s=1.5 ; a=12 ; I=1.5 . An example of selecting marked objects is shown in Figure 8. The image (a) contains six compact objects and curves. Using the marking points from (b) the objects from (d) were selected, while using points in (e), we selected the objects as in image (f). The image (c) is an intermediate snapshot showing the reconstruction of the selected objects around the marking points.

Figure 8.

(a) Test image; (b) initial state (marking points); (c) transient state; (d) output image.

3.7. Finding the Intersection Points of One-Pixel Thin Lines from Two Binary Images

We consider two binary images I1 and I2 containing one-pixel thin lines or curves, among other compact objects. Superposing the two images, the objects will have overlapping areas. We propose to design the feedback and control templates such that the CNN detects only the intersection points (marked by single black pixels) of the thin lines present in the two images. All other overlapping areas will be ignored and will not appear in the output image. This task may be regarded as logic selective AND operation, since it only applies to some objects of particular shape from the images to be processed. One of the images is loaded as initial state while the other is applied to the input: X(0)=I1 ; U=I2 . Interchanging the two images ( X(0)=I2 ; U=I1 ) yields the same result. The feedback and control templates are identical, A=B , of the form (21). For this task we get the system:

 2p−8s+I12p−2s+I−114s−I1 (30)

and a set of suitable parameter values is: p=3 ; s=0.5 ; I=8.5 . The described task is shown in Figure 9. The binary images (a) and (b) contain thin lines and various other objects. The first image is loaded as initial state, the second is applied to the input. The output result

is the image (c) which contains only the intersection points of thin lines.

Figure 9.

(a) Image I1 as initial state; (b) Input image I2; (c) Resulted output image.

4. Applications of CNNs in Image Linear Filtering

Although cellular neural networks are basically designed for nonlinear operation, an important class of applications of CNNs in image processing is also linear filtering (Crounse & Chua, 1995). Generally, the two-dimensional spatial filters are most commonly designed in the frequency domain, by imposing a set of specifications, or starting from various 1D prototype filters with given characteristics and applying frequency transformations which finally lead to the desired 2D filter. For each specific method the filter stability must also be ensured. We will approach here only the IIR spatial filters. Generally the existing design methods of 2D IIR filters rely to a large extent on 1D analog filter prototypes, using spectral transformations from s to z plane via bilinear or Euler transformations followed by z to (z1,z2) transformations. The most investigated were circular, elliptic-shaped, fan filters etc.

When CNNs are used as stable linear filters, the image I to be filtered is usually applied at the input (U=I) and the initial state is usually zero (X=0). The CNN cells must not reach saturation during operation, which implies the restriction for the cell state: |xij(t)|1 , i,j=1...N .

The linear CNN filter is described by the spatial transfer function (Crounse & Chua, 1995):

 H(ω1,ω2)=−B(ω1,ω2)/A(ω1,ω2) (31)

where A(ω1,ω2) , B(ω1,ω2) are the 2D Discrete Space Fourier Transforms of templates A, B.

An essential constraint for CNNs is local connectivity, specific to these parallel systems. Design specifications may lead to high-order 2D filters, requiring large-size templates, that cannot be directly implemented. The templates currently implemented are no larger than 3×3 or 5×5 . Larger templates can only be implemented by decomposing them into a set of elementary templates. The most convenient are the separable templates, which can be written as a convolution of small-size templates. As we will show, the templates of the 2D filters resulted from 1D prototypes can always be written as convolution products of small-size templates, therefore the filtering can be realized in several steps. The filtering function will be a product of elementary rational functions.

For an 1D recursive CNN filter of order N, its transfer function has the following expression, where equal degrees are taken for numerator and denominator:

 H(ω)=∑n=1Nbncosnω/∑m=1Namcosmω=B(ω)/A(ω) (32)

The numerator and denominator of (32) can be factorized into first and second order polynomials in cosω . For instance, the numerator can be decomposed as follows:

 B(ω)=k⋅∏i=1n(cosω+bi)⋅∏j=1m(cos2ω+b1jcosω+b2j) (33)

with n+2m=N (filter order). Correspondingly, the template B ( 1×N ), can be decomposed into 1×3 or 1×5 templates.

A similar expression is valid for the denominator A(ω) . Coupling conveniently the factors of A(ω) and B(ω) , the filter transfer function (32) can be always written as a product of elementary functions of order 1 or 2, realized with pairs of 1×3 or 1×5 templates:

 H(ω)=H1(ω)⋅H2(ω)⋅...⋅Hk(ω) (34)

Here we will discuss zero-phase IIR CNN filters, i.e. with real-valued transfer functions, which correspond to symmetric control and feedback templates. In IIR spatial filtering with a 2D filter H(ω1,ω2) , the final state can be written:

 X(ω1,ω2)=U(ω1,ω2)×H(ω1,ω2)=U(ω1,ω2)×H1(ω1,ω2)×H2(ω1,ω2)…Hn(ω1,ω2) (35)

The image X1(ω1,ω2)=U(ω1,ω2)H1(ω1,ω2) resulted in the first filtering step is re-applied to CNN input, giving the second output image: X2(ω1,ω2)=X1(ω1,ω2)H2(ω1,ω2) and so on, until the whole filtering is achieved. The frequency response H(ω1,ω2) can be written:

 H(ω1,ω2)=∏kHk(ω1,ω2)=∏kBk(ω1,ω2)/∏kAk(ω1,ω2) (36)

which implies a cascade interconnection of IIR filters. The separable templates A and B can be written as convolution products, where Bi , Aj are elementary ( 3×3 or 5×5 ) templates:

 B=B1∗B2∗…∗Bn          A=A1∗A2∗…∗Am (37)

4.1. Design Methods for Circularly-Symmetric Filters

In this section we propose an efficient design technique for 2D circularly-symmetric filters, based on 1D prototype filters. Circular filters are currently used in many image processing applications. Given a 1D filter function Hp(ω) , the corresponding 2D filter H(ω1,ω2) results through the frequency transformation ωω12+ω22 :

 H(ω1,ω2)=Hp(ω12+ω22) (38)

A currently-used approximation of the function cosω12+ω22 is given by:

 cosω12+ω22≅C(ω1,ω2)=−0.5+0.5(cosω1+cosω2)+0.5cosω1cosω2 (39)

and corresponds to the 3×3 template:

 C=[0.1250.250.1250.25−0.50.250.1250.250.125] (40)

Let us consider a 1D filter HP(ω) described by the symmetric templates BP , AP of radius R:

 BP=[…b2b1b0b1b2…]AP=[…a2a1a0a1a2…] (41)

Applying DSFT and using trigonometric identities we finally get the transfer function as a ratio of polynomials in cosω . Its denominator has the factorized form (with, the filter order):

 Ap(ω)=c0+∑k=1Rck(cosω)k=k⋅∏i=1n(cosω+ai)⋅∏j=1m(cos2ω+a1jcosω+a2j) (42)

Substituting cosω by C(ω1,ω2) given by (39) in the prototype function AP(ω) , we obtain:

 A(ω1,ω2)=Ap(ω12+ω22)=c0+∑k=1Rck⋅Ck(ω1,ω2) (43)

Therefore, the design of the 2D circular filter consists in substituting cosω with C(ω1,ω2) in each factor of HP(ω) ; A(ω1,ω2) will have the form, corresponding to (42):

 A(ω1,ω2)=k⋅∏i=1n(C(ω1,ω2)+ai)⋅∏j=1m(C2(ω1,ω2)+a1j⋅C(ω1,ω2)+a2j) (44)

Since the 1D prototype filter function can be factorized, the 2D circularly-symmetric filter is separable, a major advantage in implementation. The large-size template A corresponding to A(ω1,ω2) results directly decomposed into elementary ( 3×3 or 5×5 ) templates:

 A=k⋅(C1∗...∗Ci∗...Cn)∗(D1∗...∗Dj∗...Dm) (45)

If we use the 3×3 template C given in (40) to approximate the 2D cosine function, each template Ci from (45) is obtained from C by adding ai to the central element. Each 5×5 template Dj results as Dj=CC+b1jC1+b2jC0 , where C0 is a 5×5 zero template, with central element one; C1 is a 5×5 template obtained by bordering B with zeros.

4.2. Maximally-Flat Zero-Phase Filters

We propose a method of designing 2D spatial filters of different types starting from approximations commonly used in temporal filters. However, we will design spatial filters which will preserve only the magnitude characteristics of their temporal prototypes, while the designed filters will be zero-phase; their frequency response will be real-valued. The design of the desired 2D filters will be achieved in several steps, detailed as follows.

The starting point is a discrete prototype filter of a given type and desired specifications, with a transfer function H(z) . Using this discrete filter we first derive an 1D spatial filter. This 1D filter will inherit only the magnitude characteristics of its temporal counterpart, while its phase will be zero throughout the frequency domain, namely the range [π,π] . We consider the magnitude |H(ω)| of H(z)=H(ejω) . In order to find a zero-phase 1D filter transfer function which approximates |H(ω)| , we can make the change of frequency variable:

 ω=arccosx⇔x=cosω (46)

Substituting ω in |H(ω)| by arccosx , we first get a real function G(x) in variable x; next we find a convenient rational approximation for G(x) . One of the most efficient (best tradeoff between accuracy and approximation order) is the Chebyshev-Padé approximation. The main drawback of this method is that the coefficients of the rational approximation can be only determined numerically using for instance a symbolic computation software. After finding the approximation of G(x) as a ratio of polynomials in variable x, we return to the original variable ω by substituting back x=cosω , and finally we get the rational approximation of |H(ω)| in the variable cosω on the range ω[π,π] , similar to (32):

 |H(ω)|≅∑n=1Nbncosnω/∑m=1Namcosmω=B(ω)/A(ω) (47)

From the numerator B(ω) and denominator A(ω) we directly identify the corresponding control and feedback templates, preferably of equal size. The polynomials B(ω) and A(ω) can be factorized according to relation (33).

 A(ω)=k⋅∏i=1n(cosω+ai)⋅∏j=1m(cos2ω+a1jcosω+a2j) (48)

with n+2m=N (filter order). A similar expression is valid for B(ω) . In the following sections we will use this technique to design several types of 2D filters: circularly-symmetric filters, elliptically-shaped filters, directional filters etc.

Let us consider as prototype a type 2 Chebyshev low-pass digital filter with the following specifications: order N=6 , stop-band ripple R=40dB , stop-band edge frequency ωS=0.3 (where generally ωS[0.0,1.0] , with 1.0 corresponding to half the sample rate).

Following the procedure described above, we finally get an approximation of the form (47). The numerator and denominator coefficients are given by the vectors:

 [bn]=[0.0176 0.0068 -0.0164 0.0038][am]=[-0.4240 1.2552 -1.1918 0.3724] (49)

and the factorization of the numerator and denominator of the 1D prototype function is :

 B(ω)=0.0176⋅(cosω+1.261)⋅(cosω-0.2957)⋅(cosω-0.5789) (50)
 A(ω)=-0.424⋅(cosω-1.4035)⋅(cos2ω-1.5568⋅cosω+0.6257) (51)

To obtain a circularly-symmetric filter from the 1D factorized prototype function, we simply replace in (50) and (51) cosω with the circular cosine function (39). For instance, the feedback template A results as the discrete convolution:

 A=k⋅A11∗A12∗...∗A1n∗A21∗A22∗...∗A2m (52)

where A1i (i=1...n) are 3×3 templates and A2j (j=1...m) are 5×5 templates, given by:

 A1i=C+ai⋅A01 (53)
 A2j=C∗C+a1j⋅C0+a2j⋅A02 (54)

where A01 is a 3×3 zero template and A02 is a 5×5 zero template with central element one; C0 is a 5×5 template obtained by bordering C(3×3) with zeros. The above expressions correspond to the factors in (44). In Figure 10 the frequency response and the contour plot are shown for two 2D circularly-symmetric maximally-flat filters. The first one has a narrower characteristic, corresponding to ωS=0.3 , while the second has a larger cutoff frequency, being derived from a Chebyshev prototype with N=6 , R=40dB , ωS=0.7 .

Figure 10.

(a), (c) maximally-flat circular filter frequency responses; (b), (d) contour plots.

4.3. Elliptically-Shaped Oriented Filters

Next we study a class of 2D low-pass filters having an elliptically-shaped horizontal section. These filters will be specified by imposing the values of the semi-axes of the ellipse, and the orientation is given by the angle of the large axis with respect to ω2 axis in the frequency plane. Starting from the frequency response for a 1D zero-phase filter given by (47), we can derive a 2D elliptically-shaped filter using the frequency transformation ωEφ(ω1,ω2) :

 Eφ(ω1,ω2)=ω12(cos2φE2+sin2φF2)+ω22(sin2φE2+cos2φF2)+ω1ω2sin(2φ)(1F2−1E2)=a⋅ω12+b⋅ω22+c⋅ω1ω2 (55)

An elliptically-shaped filter results from a circular one through the linear transformation:

 [ω1ω2]=[E00F]⋅[cosφ−sinφsinφcosφ]⋅[ω1'ω2'] (56)

where E and F are the stretching coefficients ( EF ), (ω1,ω2) are the current coordinates and (ω1',ω2') are the former coordinates. Thus, the unit circle is stretched along the axes ω1 and ω2 with factors E and F, then counter-clockwise rotated with an angle φ , becoming an oriented ellipse, which is the shape of the proposed filter in horizontal section. Consequently, given a 1D prototype filter of the general form (47), we can obtain a 2D elliptically-shaped filter, specified by the parameters E, F and φ which give the shape and orientation, by using the frequency transformation:

 ω2→Eφ(ω1,ω2)=a⋅ω12+b⋅ω22+c⋅ω1ω2 (57)

where the coefficients a, b and c are identified from relation (55).

Replacing the real frequency variables ω1 and ω2 by the complex variables s1=jω1 and s2=jω2 , the function Eφ(ω1,ω2) can be written in the 2D Laplace domain as:

 Eφ(s1,s2)=−(a⋅s12+b⋅s22+c⋅s1s2) (58)

The next step is to find the discrete approximation Eφ(z1,z2) for Eφ(s1,s2) in (58), using the forward or backward Euler approximations, or the bilinear transform. We will use here the forward Euler method, therefore along the two axes of the plane we have: s1=z11 , s2=z21 . The discrete approximations for s12 , s22 and s1s2 will result as (Matei, 2004):

 s12=z1+z1−1−2s22=z2+z2−1−2          2s1s2=z1+z1−1+z2+z2−1−2−z1z2−1−z1−1z2 (59)

Replacing the above operators in (58), Eφ(s1,s2) takes the form:

 Eφ(z1,z2)=−(a+c/2)⋅(z1−1+z1)−(b+c/2)⋅(z2−1+z2)+(c/2)⋅(z1z2−1+z1−1z2)+(2a+2b+c) (60)

After re-arranging terms and identifying coefficients of the 2D Z transform, we obtain the matrix operator Eφ :

 Eφ=[0a+c/2−c/2b+c/2−(2a+2b+c)b+c/2−c/2a+c/20] (61)

The matrix Eφ depends on the orientation angle φ and the stretching coefficients E and F. We found the frequency transformation Eφ:2 , ω2Eφ(z1,z2) in the matrix form:

 ω2→[z1−11z1]×[Eφ]×[z2−11z2]T (62)

As anumerical example, taking the parameter values φ=π/3 , E=2.4 , F=0.6 we get:

 Eφ=[03.2544−1.12771.9523−8.15811.9523−1.12773.25440] (63)

Let us consider the simple 1D zero-phase prototype filter:

 HP(ω)=(b0+b1ω2+b2ω4)/(1+a1ω2+a2ω4) (64)

Applying the frequency transform (62), we obtain the 2D elliptically-shaped filter:

 HEφ(z1,z2)=b0+b1⋅Eφ(z1,z2)+b2⋅Eφ2(z1,z2)1+a1⋅Eφ(z1,z2)+a2⋅Eφ2(z1,z2)=BEφ(z1,z2)AEφ(z1,z2) (65)

Since Eφ(z1,z2) corresponds to the matrix Eφ in (61), we determine the filter templates as:

 BEφ=b0⋅E0+b1⋅Eφ1+b2⋅Eφ∗Eφ           AEφ=E0+a1⋅Eφ1+a2⋅Eφ∗Eφ (66)
By we denoted matrix convolution. E0 is a 5×5 zero matrix with the central element of value 1. The 5×5 matrix Eφ1 is obtained by bordering with zeros the 3×3 matrix Eφ in order to be summed with E0 and EφEφ .

In general, for a zero-phase prototype HP(ω) of order 2N , we obtain following the method presented above a 2D filter transfer function HEφ(z1,z2) whose numerator and denominator correspond to templates BEφ and AEφ of size (2N+1)×(2N+1) .

For a design example, we take as 1D prototype a type-2 Chebyshev digital filter with N=4 , Rs=40 dB and passband-edge frequency ωp=0.5 . Its transfer function in z is:

 Hp(z)=0.012277⋅z2−0.012525⋅z+0.012277z2−1.850147⋅z+0.862316 (67)

The real-valued transfer function approximating the magnitude of the filter Hp(z) is:

 |Hp(ejω)|≅Ha1(ω)=0.940306−0.57565⋅ω2+0.0947⋅ω41−2.067753⋅ω2+4.663147⋅ω4 (68)

Figure 11 shows two elliptically-shaped filters based on (68), having a flat characteristic in the pass-band and a very low stop-band ripple. An advantage of this design method is that the filter characteristics in the vertical and horizontal plane are specified independently.

Figure 11.

Frequency response and contour plots of two elliptically-shaped filters: (a), (b) φ=π/3 , E=2.8 , F=1 ; (c), (d) φ=π/3 , E=2.4 , F=0.6

4.4. Directional Filters

There are several classes of 2D filters with orientation-selective frequency response, which find applications in many image processing tasks, such as edge detection, motion analysis, texture analysis etc. For instance, steerable filters which are synthesized as a linear combination of a set of basis filters (Freeman & Adelson, 1991). Another important class are the Gabor filters, efficiently implemented also on CNNs (Shi, 1998), with useful applications in image processing and computer vision. A particular class of filters, which can be also implemented on CNNs, are directional (orientation-selective) filters, which select narrow domains along specified directions in the frequency plane. Several design examples of 2D recursive directional filters with an arbitrary orientation were given in (Matei, 2004). They can be used in selecting lines with a given orientation in the input image.

The spatial orientation is specified by an angle φ with respect to ω1 -axis and is defined by the 1D to 2D spatial frequency transformation: ωω1cosφ+ω2sinφ . Considering a 1D zero-phase prototype filter H(ω) and using this substitution we obtain the transfer function of the oriented filter, Hφ(ω1,ω2) :

 Hφ(ω1,ω2)=H(ω1cosφ+ω2sinφ) (69)

The 2D oriented filter Hφ(ω1,ω2) has the magnitude along the line ω1cosφ+ω2sinφ=0 , identical with the prototype H(ω) , and is constant along the line ω1sinφω2cosφ=0 (longitudinal axis). The design of an oriented filter based on a 1D prototype relies on finding a realization of the 2D oriented cosine function, which depends on the orientation angle φ :

 Cφ(ω1,ω2)=cos(ω1cosφ+ω2sinφ) (70)

Next we will determine a convenient 1D to 2D complex transformation which allows an oriented 2D filter to be obtained from a 1D prototype filter. We will treat here the zero-phase filters, which sometimes are desirable in image processing tasks.

An accurate rational approximation (Chebyshev- Padé) of the cosine for ω[π2,π2] is:

 cosω≅1−0.447754ω2+0.018248ω41+0.041694ω2+0.002416ω4 (71)

The range of approximation [π2,π2] was required due to the fact that in the frequency plane πω1π , πω2π the largest value for the frequency ω of the prototype filter is π2 . Next we have to find a discrete approximation for the expression (70). Denoting fφ(ω1,ω2)=(ω1cosφ+ω2sinφ)2 , we obtain using (70) and (71):

 Cφ(ω1,ω2)≅1−0.447754fφ(ω1,ω2)+0.018248fφ2(ω1,ω2)1+0.041694fφ(ω1,ω2)+0.002416fφ2(ω1,ω2) (72)
fφ(ω1,ω2) can be written in 2D Laplace domain in the complex variables s1=jω1 , s2=jω2 :
 fφ(s1,s2)=−(s1cosφ+s2sinφ)2=−(s12cos2φ+s22sin2φ+2s1s2sinφcosφ) (73)

Using the forward Euler method as in section 4.3, we obtain the discrete approximations (59) for s12 , s22 and s1s2 ; substituting these expressions into (73), fφ(s1,s2) finally becomes:

 fφ(z1,z2)=−[cos2φ(z1+z1−1−2)+sin2φ(z2+z2−1−2)+sinφcosφ(z1+z1−1+z2+z2−1−2−z1z2−1−z1−1z2)] (74)

corresponding to an "orientation matrix" operator Oφ , resulted after re-arranging terms and identifying the coefficients of 2D Z transform:

 Oφ=−12(sin2φ⋅[01−11−21−110]+cos2φ⋅[​01​0−10−1​01​0]+[0101−41010]) (75)

The matrix Oφ depends only on the orientation angle φ . The 2D rational function Cφ(ω1,ω2) , derived from relations (72) and (74), can be regarded itself as a recursive filter:

 Cφ(ω1,ω2)=Bφ(ω1,ω2)/Aφ(ω1,ω2) (76)

and can be realized using the pair of templates:

 Bφ=O0−0.447754⋅Oφ'+0.018248⋅Oφ∗Oφ (77)
 Aφ=O0+0.041694⋅Oφ'+0.002416⋅Oφ∗Oφ (78)

also depending only on the orientation angle φ . By " " we denoted the operation of matrix convolution; O0 is a 5×5 zero matrix with the central element of value 1; in (77) and (78) the 5×5 matrix Oφ' is derived by bordering with zeros the 3×3 matrix Oφ in order to be summed with O0 and OφOφ .

For a design example we use the 1D prototype filter from section 4.2, where A(ω) and B(ω) in the transfer function are factorized as in (50) and (51); we simply have to substitute cosω by the oriented cosine function (76). Corresponding to A(ω) factorized as in (51), the resulting function A(ω1,ω2) is realized by a template A, decomposed into elementary templates as in (52), where A1i are 3×3 templates and A2j are 5×5 templates, given by:

 A1i=Bφ+ai⋅AφA2j=Bφ∗Bφ+a1j⋅Aφ∗Bφ+a2j⋅Aφ∗Aφ (79)

Using this method, some design examples are presented as follows.

1) With a zero-phase elliptic filter (Figure 12 (a)), we design a directional filter oriented at an angle φ=π/6 ; its frequency response and contour plot are shown in Figure 12 (b) and (c).

2) A simple and efficient low-pass zero-phase filter prototype has the frequency response:

 Hp(ω)=1/(p+1−pcosω) (80)

where the value of p sets the filter selectivity. If in (80) cosω is substituted by Cφ(ω1,ω2) given by (76), for p=25 , φ=0.22π a very selective directional filter results (Figure 12 (d), (e)). Another two very selective directional filters are shown in Figure 13; these are in fact elliptically-shaped filters with a large ratio E/F , and are designed as shown in section 4.3; for instance, the first filter given in Figure 13 (a), (b) has the parameters E=3 , F=0.1 and φ=0.22π .

Directional filters may be used in detecting straight lines with a given orientation in an image (Matei, 2004). In order to demonstrate the directional selectivity of the proposed filters, we present an example of detecting lines with a given inclination from an image, by means of filtering with a 2D IIR oriented low-pass filter. The spectrum of a straight line is oriented in the plane ( ω1 , ω2 ) at an angle of π/2 with respect to the line direction. The binary image in Figure 15 (a) contains straight lines with different orientations and some ellipses and is filtered with an oriented elliptically-shaped filter with φ=π/6 , designed using the method presented in section III. Depending on the filter selectivity, in the filtered image in Figure 15 (b), only the lines which have the spectrum oriented more or less along the filter characteristic, remain practically unchanged, while all the other lines appear more or less blurred, due to low-pass filtering. For a good orientation resolution, to separate lines with very close orientation

Figure 12.

(a) Elliptic 1D LP prototype filter; (b) 2D directional filter response ( φ=π/6 ); (c) contour plot; (d) 2D directional frequency response for φ=0.22π ; (e) contour plot

Figure 13.

Directional elliptically-shaped filters: (a),(b): p=5 , E=3 , F=0.1 , φ=0.22π ; (c), (d) p=5 , E=7 , F=0.5 , φ=0.22π

Figure 14.

(a) Test image; (b),(c),(d) directionally filtered images with parameters: (a) φ=0.8π , p=30 , E=7 , F=0.5 ; (b) φ=π/7 , p=70 , E=7 , F=0.3 ; (c) φ=0.2π , p=50 , E=7 , F=0.3

Figure 15.

(a) Binary test image; (b) Directionally filtered image; (c) Texture image;

(d) Directionally filtered image with φ=π/12 , p=70 , E=7 , F=0.3

angles, the filter selectivity has to be properly chosen. Another example is shown in Figure 15 (c), (d). The texture-type grayscale image (c) representing a portion of a straw-chair upper face is directionally filtered with the given parameter values and the result is image (d), which suggests a possible use in texture segmentation.

4.5. Filters Designed in Polar Coordinates

In this section we study a family of 2D zero-phase filters which can be designed starting from a specified shape in polar coordinates in the frequency plane. The contour plots of their frequency response can be defined as closed curves which can be described in terms of a variable radius ρ which is a periodic function of the current angle φ formed with one of the axes. This periodic radius can be expressed using a rational approximation. Then, using some desired 1D prototype filters with factorized transfer functions, spatial filters can be obtained by a 1D to 2D frequency transformation. Their frequency response is symmetric about the origin and has at the same time an angular periodicity. If we consider any contour resulted from the intersection of the frequency response with a horizontal plane, the contour has to be a closed curve which can be described in polar coordinates by: ρ=ρ(φ) where φ is the angle formed by the radius OP with the ω1 - axis, as shown in Figure 16 (a) for a four-lobe filter. Therefore ρ(φ) is a periodic function of the angle φ in the range φ[0,2π] .

The proposed design method is based on zero-phase filter prototypes whose transfer function is real-valued and can be expressed as a ratio of polynomials in even powers of the frequency ω . In general this filter will be described by:

 Hp(ω)=∑j=0Mbj⋅ω2j/∑k=0Nak⋅ω2k (81)

where MN and N is the filter order. This function may be obtained through a rational approximation of the magnitude of an usual prototype (Chebyshev, elliptic etc.). The proposed design method for this class of 2D filters is based on a frequency transformation of the form:

 F:ℝ→ℂ2,  ω2→F(z1,z2) (82)

Through this transformation we will be able to obtain low-pass type filters, symmetric about the origin, as in fact are most 2D filters currently used in image processing. The frequency transformation (82) is a mapping from the real frequency axis ω to the complex plane (z1,z2) . However, it will be defined initially through an intermediate frequency mapping of the form:

F1:2 ,
 ω2→F1(ω1,ω2)=(ω12+ω12)/ρ(ω1,ω2) (83)

Here the function ρ(ω1,ω2) plays the role of a radial compressing function and is initially determined in the angular variable φ as ρ(φ) . In the frequency plane (ω1,ω2) we have:

 cosφ=ω1/ω12+ω22 (84)

If the radial function ρ(φ) can be expressed in the variable cosφ , using (84) we obtain by substitution the function ρ(ω1,ω2) . Generally the function ρ(φ) will have to be determined as a polynomial or a ratio of polynomials in variable cosφ . For instance, the four-lobe filter whose contour plot is shown in Figure 16 (a) corresponds to a function:

 ρ(φ)=a+bcos4φ=a+b−8bcos2φ+8bcos4φ (85)

which is plotted in Figure 16 (b) in the range φ[0,2π] .

As a first 1D prototype we consider a type-2 Chebyshev digital filter with the parameters: order N=4 , stopband attenuation RS=40 dB and passband-edge frequency ωp=0.7 , where 1.0 is half the sampling frequency. The transfer function in z for this filter is:

 Hp(z)=0.012277⋅z2−0.012525⋅z+0.012277z2−1.850147⋅z+0.862316 (86)

The magnitude of its transfer function in the range [π,π] is shown in Figure 16 (c). Using a Chebyshev-Padé approximation, we determine the real-valued zero-phase frequency response which approximates quite accurately the magnitude of the original filter function:

 |Hp(ejω)|≅Ha1(ω)=0.940306−0.57565⋅ω2+0.0947⋅ω41−2.067753⋅ω2+4.663147⋅ω4 (87)

Let us now consider the radial function with the form:

 Hr(φ)=1/(p⋅B˜(φ)−p+1) (88)

where B˜(φ) is a periodic function; let B˜(ω)=cos(4φ) . We will use this function to design a 2D filter with four narrow lobes in the frequency plane (ω1,ω2) . Using trigonometric identities, it is straightforward to obtain:

 Hr(φ)=1/(1+8p⋅(cosφ)2−8p⋅(cosφ)4) (89)

plotted for φ[π,π] in Figure 16 (d). This is a periodic function with period Φ=π/4 and has the shape of a “comb” filter. In order to control the shape of this function, we introduce a parameter k, such that the radial function will be ρ(φ)=kHr(φ) . We obtain using (83):

 ω2→F(ω1,ω2)=ω14+(2+8p)ω12ω22+ω24k(ω12+ω22) (90)

Since ω12=s12 and ω22=s22 we derive the function F1(s1,s2) in the plane (s1,s2) as:

 F2(s1,s2)=−(s14+(2+8p)s12s22+s24)/(k(s12+s22)) (91)

Finally we determine a transfer function of the 2D filter H(z1,z2) in the complex plane (z1,z2) . This can be achieved if we find a discrete counterpart of the function ρ(ω1,ω2) .

A possible method is to express the function ρ(ω1,ω2) in the complex plane (s1,s2) and then to find the appropriate mapping to the plane (z1,z2) . This can be achieved either using the forward or backward Euler approximations, or otherwise the bilinear transform, which gives better accuracy. The bilinear transform is a first-order approximation of the natural logarithm

Figure 16.

(a) Contour plot of a four-lobe filter; (b) Variation of the periodic function ρ(φ) ; (c) Maximally-flat low-pass prototype; (d) Very selective radial function

function, which is an exact mapping of the z-plane to the s-plane. For our purposes the sample interval takes the value T=1 so the bilinear transform for the two variables s1 and s2 in the complex plane (s1,s2) has the form:

 s1=2(z1−1)/(z1+1)        s2=2(z2−1)/(z2+1) (92)

Substituting s1 , s2 in (91), we find the frequency transformation in z1 , z2 , in matrix form:

 ω2→F(z1,z2)=B(z1,z2)A(z1,z2)=Z1×[B]×Z2TZ1×[A]×Z2T (93)

where Z1 and Z2 are the vectors:

 Z1=[z1−2z1−11z1z12]Z2=[z2−2z2−11z2z22] (94)

where × denotes matrix/vector product. The expression of the frequency transformation (93) can be considered in itself a 2D recursive filter. The templates B, A giving the coefficients of B(z1,z2) , A(z1,z2) are the matrices of size 5×5 :

 B=8⋅[−1−2p04p−20−1−2p080804p−20−8p−2004p−208080−1−2p04p−20−1−2p]       A=k⋅[1010−40101]∗[121242121] (95)

We next use the maximally flat filter prototype (87). We only have to make the substitution of (93) in Ha1(ω) given in (87) and we obtain the desired 2D transfer function:

 H(z1,z2)=b2B2(z1,z2)+b1A(z1,z2)B(z1,z2)+b0A2(z1,z2)B2(z1,z2)+a1A(z1,z2)B(z1,z2)+a0A2(z1,z2)=Bf(z1,z2)/Af(z1,z2) (96)

where b2=0.9403 , b1=0.5756 , b0=0.0947 , a1=2.0677 , a0=4.6631 are the coefficients of the prototype (87). In our case H(z1,z2) results of order 8. For a chosen prototype of higher order, we get a similar rational function in powers of A(z1,z2) and B(z1,z2) . Since the 2D transfer function (96) can be also described in terms of templates Bf and Af corresponding to Bf(z1,z2) , Af(z1,z2) we have equivalently:

 Bf=b2⋅B∗B+b1⋅A∗B+b0⋅A∗AAf=B∗B+a1⋅A∗B+a0⋅A∗A (97)

where denotes two-dimensional convolution. For our filter Bf and Af are of size 9×9 .

Figure 17.

(a), (b) Frequency response and contour plot for the 4-lobe filter; (c) Test image; (d) Filtered image.

The designed filter has the frequency response and contour plot as in Figure 17 (a), (b). We remark that the filter is very selective simultaneously along both axes of the plane (ω1,ω2) .

We now present an example of image filtering using a selective four-lobe filter. This type of filter can be used in detecting lines with a given inclination from an image, as the directional filters discussed in section 4.4. The spectrum of a straight line is oriented in the plane (ω1,ω2) at an angle π/2 with respect to the line direction. The test image in Figure 17 (c) contains straight lines with different orientations and lengths, and also a few curves. We consider the filter shown in Figure 17 (a), with parameter values p=50 and k=0.8 . Depending on filter selectivity, only the lines with the spectrum oriented more or less along the filter pass-bands will be preserved in the filtered image. We notice that in the output image shown in Fig.17 (d), the lines roughly oriented horizontally and vertically are preserved, while the others are filtered out or appear very blurred. The intersections of the detected lines appear as darker pixels; this allows also these intersections to be detected, if after filtering a proper threshold is applied.

5. Conclusion

An alternative CNN model was proposed, in which the state equations are modified such that the piece-wise linear function operates on the entire information fed to the current cell, including input, feedback and offset term. The circuit structure, dynamic behavior and equilibrium points were analyzed. Through a linear transformation, the proposed model is shown to be equivalent to the standard CNN model. We aimed at making a connection between these two models and compare them from the recurrent neural network point of view. Certain advantages regarding implementation result from the limited voltage range. Several processing tasks on binary images were proposed, templates were designed and simulation results on test images are provided. The template design is relatively easy and can be optimized in order to obtain high robustness to parameter variations. A deeper insight into the proposed CNN dynamic behavior may lead to further image processing capabilities.

As regards the applications of CNNs in linear filtering, some original and efficient design methods were approached, for several types of two-dimensional filters: circular and elliptically-shaped filters, maximally-flat, orientation-selective filters etc. The design starts from an imposed 1D prototype filter and uses rational approximations and various frequency transformations to obtain the 2D frequency response. These analytical methods could be combined with numerical optimization techniques in order to realize an efficient design.

Even if theoretically all the presented spatial linear filters can be implemented in analog processing systems like CNNs, we have to take into account the fact that these analog filters may be very sensitive to template elements variations due to technological dispersion which is inherently present in any VLSI process. A systematic theoretical study on the effect of these dispersions on filter characteristics and stability can be found in (David, 2004). It has been found both analytically and through simulations that the sensitivity of the frequency response to process variations increases with filter selectivity. Since we have designed also some very selective filters, a sensitivity analysis has to be carried out in each case, to find out if a given filter can be reliably implemented. The filter robustness and stability requirements may imply strong constraints on the realization of filters with high selectivity. Further research also envisages an efficient and reliable implementation of this class of filters.

Acknowledgements

This work was supported by the National University Research Council under Grant PN2 – ID_310 “Algorithms and Parallel Architectures for Signal Acquisition, Compression and Processing”.

References

1 - L. O. Chua, L. Yang, 1988 Cellular Neural Networks: Theory, IEEE Transactions on Circuits and Systems, 35 Oct.1988
2 - K. R. Crounse, L. O. Chua, 1995 Methods for Image Processing and Pattern Formation in Cellular Neural Networks- A Tutorial, IEEE Trans. on Circuits Systems, CAS-42 (10)
3 - E. David, M. Ansorge, L. Goras, V. Grigoras, 2004 On the Sensitivity of CNN Linear Spatial Filters: Non-homogeneous Template Variations, Proc. of 8-th IEEE Int. Workshop on Cellular Neural Networks and their Applications, CNNA’2004, 40 45 . Budapest, Hungary
4 - D. E. Dudgeon, R. M. Mersereau, 1984 Multidimensional Digital Signal Processing, Englewood Cliffs, NJ: PrenticeHall, 1984
5 - W. T. Freeman, E. H. Adelson, 1991 The Design and Use of Steerable Filters, IEEE Trans. on Pattern Analysis and Machine Intelligence, 13 9 Sept. 1991
6 - M. Hänggi, G. S. Moschytz, 2000 Cellular Neural Networks. Analysis, Design and Optimization, Kluwer Academic Publishers, Boston, 2000
7 - S. Haykin, 1994 Neural Networks: A Comprehensive Foundation, Macmillan, 1994
8 - R. Matei, 2001 Cellular Neural Networks with Modified Non-Linearity, Proc. of Int. Symp. Signal Processing and Information Technology, ISSPIT’2001, 296 300 , Cairo, Egypt
9 - R. Matei, 2003 Oriented Low-Pass CNN Filters Based on Gaussian 1-D Prototype, Proceedings of 16th European Conf. on Circuit Theory and Design, ECCTD’2003, Vol.II, 185 188 , Krakow, Poland
10 - R. Matei, 2004 Design Method for Orientation-Selective CNN Filters, Proceedings of International Symposium on Circuits and Systems ISCAS’2004, 3 105 108 , 078038251 Vancouver, Canada, May 23-26, 2004
11 - R. Matei, 2004 On the Design of a Class of Selective CNN Linear Filters, Proceedings of the 8-th IEEE International Workshop on Cellular Neural Networks and their Applications, CNNA’2004, 153 158 , Budapest, Hungary
12 - R. Matei, 2006 Design of a Class of Maximally-Flat Spatial Filters, Proceedings of the IEEE International Symposium on Circuits and Systems ISCAS’2006, 2165 2168 , 978-0-78039-389-9 May 21-24, 2006, Kos Island, Greece
13 - A. Rodriguez-Vasquez, et al. 1993 Current Mode Techniques for the Implementation of Continuous- and Discrete-Time Cellular Neural Networks, IEEE Transactions on Circuits and Systems-II, CAS-40 , 132 146 , March 1993
14 - B. E. Shi, 1998 Gabor Type Filtering in Space and Time with Cellular Neural Networks, IEEE Trans. on Circuits and Systems, CAS-I, 45 2 121 132 , Feb. 1998
15 - *** CNN Software Library (CSL) (Templates and Algorithms), version 3.1, Analogical and Neural Computing Laboratory, Computer and Automation Research Institute