Cellular Neural Networks & Visual Computing
Cellular Neural Networks & Visual Computing
Cellular Neural Networks & Visual Computing
foundation
Column
1 2 3 j N
1
3
C(i, j)
Row i
Fig. 2.1.
Remark:
There are applications where M = N . For example, a 5 × 512 CNN would be more
appropriate for a scanner, fax machine, or copy machine.
7
8 Notation, definitions, and mathematical foundation
C(i, j ) C(i, j )
(a) (b)
Remarks:
1 In IC implementations, every cell is connected to all its neighbors in Sr (i, j) via
“synaptic” circuits.
2 When r > N /2, and M = N , we have a fully connected CNN where every cell
is connected to every other cell and Sr (i, j) is the entire array. This extreme case
corresponds to the classic Hopfield Net. It is impractical to build any reasonable size
(several thousand cells) Hopfield Net in a VLSI chip. There exists a “commercial”
Hopfield-like chip by INTEL called “ETANN,” type 80170 ($500 in 1995). This
chip has 64 cells which makes it more of an expensive “toy.”
Remark:
The outermost boundary cells are called edge cells. Not all boundary cells are edge
cells if r > 1.
1 State equation
ẋi j = −xi j + A(i, j; k, l)ykl + B(i, j; k, l)u kl + z i j (2.2)
C(k,l)∈Sr (i, j) C(k,l)∈Sr (i, j)
9 2.1 Basic notation and definitions
Corner cell
Fig. 2.3.
2 Output equation
1 1
yi j = f (xi j ) = |xi j + 1| − |xi j − 1| (2.3)
2 2
This is called standard nonlinearity (Fig. 2.4).
yij
–1 0 1 xij
–1
Fig. 2.4.
3 Boundary conditions
The boundary conditions are those specifying ykl and u kl for cells belonging to Sr (i, j)
of edge cells but lying outside of the M × N array.
10 Notation, definitions, and mathematical foundation
4 Initial state
xi j (0), i = 1, . . . , M, j = 1, . . . , N (2.4)
Remarks:
1 The input u kl is usually the pixel intensity of an M × N gray-scale image or picture
P, normalized without loss of generality, to have the range −1 ≤ u kl ≤ +1 where
“white” is coded by −1 and “black” is coded by +1. For a still image, u kl is a
constant for all time, for a moving image (video) u kl will be a function of time.
Other variables (x(0), y, z) can also be specified as images.
2 In the most general case, A(i, j; k, l), B(i, j; k, l), and z i j may vary with position
(i, j) and time t. Unless otherwise stated, however, we will assume they are space
and time invariant.
3 In the most general case both A(i, j; k, l) and B(i, j; k, l) are nonlinear operators1
which operate on xkl (t), ykl (t), u kl (t), xi j (t), yi j (t), and u i j (t), 0 ≤ t ≤ t0 , to
produce a scalar (A(i, j; k, l) ◦ ykl )(t0 ) and (B(i, j; k, l) ◦ u kl )(t0 ), 0 ≤ t ≤ t0 .
4 We may also introduce synaptic laws depending on the states (C template) and on
mixed variables (D template), respectively.
That is (C(i, j; k, l) ◦ xkl )(t0 ) and (D(i, j; k, l) ◦ (u kl , xkl , ykl )(t0 ).
Unless otherwise stated, however, A(i, j; k, l)ykl and B(i, j; k, l)u kl will denote
ordinary multiplication with real coefficients where they may be nonlinear functions of
states, inputs, and outputs of cells C(i, j), C(k, l) and may involve some time delays
(i.e., they may contain a finite time history, as in the case of having a time delay).
The following are some space and time invariant nonlinear examples chosen from
the CNN catalog of applications (CNN Software Library). See some of them in
TEMLIB (Appendix A).
EXAMPLE 2.1:
a( yij )
1
–1
Fig. 2.5.
11 2.1 Basic notation and definitions
EXAMPLE 2.2:
c(xij)
1
0 0.2 xij
–3
Fig. 2.6.
EXAMPLE 2.3:
Fig. 2.7.
EXAMPLE 2.4:
0.125
–2 –1 yij – ykl
Fig. 2.8.
EXAMPLE 2.5:
C(i, j; k, l) = c(xi j , xkl ): depends on two states (from TEMPLATE EXTREME)
(Fig. 2.9).
c(xij , xkl )
– 0.2 0.2
xij – xkl
–1
–2
Fig. 2.9.
EXAMPLE 2.6:
d (ukl , yij )
0 ukl – yij
–1
Fig. 2.10.
EXAMPLE 2.7:
(A(i, j; k, l)ykl )(t) = 0.68ykl (t − 10): depends on the past of the output (from
TEMPLATE SpeedDetection).
EXAMPLE 2.8:
(B(i, j; k, l)u kl )(t) = −0.25u kl (t − 10), (k, l) = (i, j): depends on the past of the
input (from TEMPLATE ImageDifferenceComputation).
Remarks:
1 A gray-scale image can be represented pixelwise using a one-to-one map between a
picture element (pixel) and a cell. The luminance value of the pixel would be coded
as: black → +1, white → −1, gray → (−1, +1).
2 It is useful and correct to think of the triple {A(i, j; k, l), B(i, j; k, l), z i j } as an
elementary CNN instruction (macro), because they specify how an M × N input
image U at t = 0 will be transformed to produce an M × N output image Y(t) for
all t ≥ 0.
A standard CNN (with linear synaptic operators) has the following state equation
(using the same notation as in (2.2)):
ẋi j =−xi j + A(i, j; k, l)ykl + B(i, j; k, l)u kl + z i j
C(k,l)∈Sr (i, j) C(k,l)∈Sr (i, j)
+ C(i, j; k, l)xkl + D(i, j; k, l)(u kl , xkl , ykl ) (2.2∗ )
C(k,l)∈Sr (i, j) C(k,l)∈Sr (i, j)
14 Notation, definitions, and mathematical foundation
where
h i j (x̃i j , t) = −xi j (t) + A(i, j; k, l)ykl (t) + si j (t)
C(k,l)∈Sr (i, j)
where
ykl = f (xkl )
si j (t) = B(i, j; k, l)u kl (t) + z i j (t)
C(k,l)∈Sr (i, j)
x̃i j is a vector of length (2r + 1)2 whose components include all variables xkl ∈
Sr (i, j), i.e.
{xkl : |k − i| ≤ r, |l − j| ≤ r }
We can cast Eq. (2.6) into the following M × N matrix differential equation which
exhibits a one-to-one correspondence with the CNN architecture
ẋ11 ẋ12 ... ẋ1N
ẋ ... ẋ2N
21 ẋ22
.. .. ..
. . .
ẋ M−1,1 ẋ M−1,2 . . . ẋ M−1,N
ẋ M1 ẋ M2 ... ẋ M N
h 11 (x̃11 ) h 12 (x̃12 ) ... h 1N (x̃1N )
h 21 (x̃21 ) h 22 (x̃22 ) ... h 2N (x̃2N )
. . .
= .. .. .. (2.7)
h M−1,1 (x̃ M−1,1 ) h M−1,2 (x̃ M−1,2 ) . . . h M−1,N (x̃ M−1,N )
h M1 (x̃ M1 ) h M2 (x̃ M2 ) ... h M N (x̃ M N )
Boundary conditions
Any virtual variable in xi j of Eq. (2.6) must be specified via various boundary
conditions which are the most commonly used for a 3 × 3 neighborhood.
M×N
CNN
Fig. 2.11. The circuit interpretation of the fixed (Dirichlet) boundary condition.
Remark:
This boundary condition usually applies to the case where there is no input, i.e., u i j =
0 for all (i, j). Because any input would cause energy and/or material flow from the
outside making the system an “open system” in the sense of thermodynamics, CNN
16 Notation, definitions, and mathematical foundation
x11 x1N
x11 x1N
M×N
CNN
xM1 xMN
xM1 xMN
with zero input is called autonomous CNN, and constitutes an important class with
widespread applications in pattern formation and “autowave” generation.
A B
A B
M N
D
C
CNN
D C
Fig. 2.13. The circuit interpretation of the Periodic (Toroidal) boundary condition.
Identify each cell from the top row with the corresponding cell in the bottom row,
identify each cell from the left column with the corresponding cell in the right column.
17 2.2 Mathematical foundations
These packing schemes are shown in Figs 2.14(a), (b), and (c), respectively.
11 12 13 14 1N 11 12 13 1N
11 1N
22 23
21 2N 21 2N
31 3N
31 3N
41
51
M1 MN M1 MN
M1 M2 M3 MN
(a) (b) (c)
or in vector form
where x = [x̂1 , x̂2 , . . . , x̂n ]T is the state vector with the same order of state variables.
The two matrices  and B̂ are n × n matrices whose nonzero entries are the synaptic
weights A(i, j; k, l) and B(i, j; k, l), respectively, corresponding to the above three
18 Notation, definitions, and mathematical foundation
0
q q
0
Fig. 2.15. The band structure of  and B̂.
packing schemes. Each matrix is quite sparse (most entries are zero) with the band
structure shown in Fig. 2.15.
For M = N , the band has a bandwidth
w = 2q + 1
where
q = N + 1 for row-wise packing schemes,
q = 2N − 2 for diagonal packing schemes,
q = 2N − 1 for column-wise packing schemes.
The band corresponding to the above three packing schemes can be divided into two
or more diagonal sub-bands, each of which is a sparse matrix.
Remarks:
 and B̂ are very large matrices, e.g., for M = N = 1000 (for HDTV applications),
n = 1,000,000, q = 1001, w = 2003 for row-wise packing scheme, which is only
0.2% of L = 106 (L is the bandwidth of the full matrix). This shows  and B̂ are very
sparse matrices.
Example 1
Consider the circuit shown in Fig. 2.16(a) whose state equation is given by
1
ẋ = − , t ≥0 (2.9)
2x
19 2.2 Mathematical foundations
The characteristics of the right-hand side are shown in Fig. 2.16(b). The solution of
Eq. (2.9) with initial condition x(0) = x0 > 0 is given by
1 1 x
i= x= –
+ + 2v 2x
x0
x x0
v
x
1F 0
t
– – 0 T = x02
Fig. 2.16. Example of a circuit which has no solution after a finite time T .
Example 2
Consider the circuit shown in Fig. 2.17(a) whose state equation is given by
3 1/3
ẋ = x (2.11)
2
The characteristics of the right-hand side are shown in Fig. 2.17(b). The solution of
Eq. (2.11) with initial condition x(0) = 0 is given by
0, 0≤t ≤T
x(t) = (2.12)
(t − T )3/2 , t>T
for any T ∈ R. This solution is shown in Fig. 2.17(c) for different choices of
T = T1 , T2 , . . . , TN . Since T is arbitrary, this circuit has an infinite number of distinct
solutions.
Example 3
Consider the circuit shown in Fig. 2.18(a) whose state equation is given by
ẋ = x 2 (2.13)
The characteristics of the right-hand side are shown in Fig. 2.18(b). The solution of
Eq. (2.13) with initial state x(0) = 1 is given by
1
x= (2.14)
1−t
20 Notation, definitions, and mathematical foundation
3 3 3 1/3 x
i=– v x= x
+ + 2 2
x v
1F x
0
t
– – 0 T1 T2 TN
As shown in Fig. 2.18(c), this circuit has a solution which cannot be continuous
beyond t ≥ 1 because it blows up at t = 1. This phenomenon is called a finite escape
time.
x
i = –v2 x= x2
+ +
x0
x v
1F 1
x
0 1 t
– – 0 1
(a) (b) (c)
The examples in Fig 2.18 show that even a simple two-element nonlinear circuit
may not have a solution, and even if a solution exists it may not be unique, or may not
be continued for all times t ≥ 0. How do we determine whether a nonlinear circuit has
a unique solution for all times t ≥ 0. This is of fundamental importance for us since
we will be concerned with asymptotic behavior as t → ∞. There is no general method
to answer this fundamental question since any method or theorem must exclude such
simple equations as (2.9), (2.11), and (2.13)! Fortunately, for CNN, we can prove the
following:
H1: The synaptic operators are linear and memoryless, i.e., A(i, j; k, l)ykl and
B(i, j; k, l)u kl are scalar multiplications, where A(i, j; k, l) and B(i, j; k, l) are
real numbers.
H2: The input u i j (t) and threshold z i j (t) are continuous functions of time.
H3: The nonlinearity f (x) is Lipschitz continuous in the sense that there exists a
constant L such that for all x , x ∈ R
f (x ) − f (x ) ≤ Lx − x (2.15)
(Note: for the scalar case, the norm is equivalent to the absolute value.)
Then for any initial state xi j (0) ∈ R, the CNN has a unique solution for any t ≥ 0 (see
Fig. 2.19).
f (x)
–L
L
x
0 x
Fig. 2.19.
Remark:
The standard CNN satisfies all three hypotheses H1, H2, and H3.
Proof:
Hypotheses H1 implies we can recast Eq. (2.1) into the vector form
We show first that h(x, t) is Lipschitz continuous with respect to x. Choose any x ,
x ∈ Rn , and let y = [ f (x1 ), . . . , f (xn )]T , so that, y = f(x ) and y = f(x ).
Now
f (x 1 ) f (x 1 )
f (x 2 )
f (x 2 )
y − y = .. − ..
. .
f (x n ) f (x n )
= | f (x 1 ) − f (x 1 )|2 + · · · + | f (x n ) − f (x n )|2
the solution xi j (t) of the standard CNN with linear memoryless synaptic operators
A(i, j; k, l) and B(i, j; k, l) is uniformly bounded in the sense that there exists a
constant xmax such that
where
xmax = 1 + z max + max (|A(i, j; k, l)| + |B(i, j; k, l)|) (2.20)
1≤i≤M
1≤ j≤N C(k,l)∈Sr (i, j)
Lemma 1 (Appendix 1)
The complete solution of
ẋ = −x + f (t)
x(0) = x0
is given by
t
x(t) = x0 e−t + e−(t−τ ) f (τ ) dτ, t ≥0
0
+
x(t) 1Ω f (t)
Fig. 2.20.
24 Notation, definitions, and mathematical foundation
Proof of Theorem 2:
ẋi j = −xi j + A(i, j; k, l)ykl + B(i, j; k, l)u kl +z i j (2.21)
C(k,l)∈Sr (i, j) C(k,l)∈Sr (i, j)
αi j (t) βi j (u(t))
f (t)
where αi j (t) and βi j (t) are defined for all t ≥ 0 in view of Theorem 1. Applying
Lemma 1,
t
x(t) = xi j (0) e−t + e−(t−τ ) [αi j (τ ) + βi j (u(τ )) + z i j (τ )] dτ (2.22)
0
where
αmax = max |αi j (t)| ≤ |A(i, j; k, l)| max ykl (t) (2.24)
t≥0 t≥0
C(k,l)∈Sr (i, j)
βmax = max |βi j (u)| ≤ |B(i, j; k, l)| max u kl (t) (2.25)
u u
C(k,l)∈Sr (i, j)
But
t
e−(t−τ ) dτ = 1 − e−t < 1, t ≥0 (2.26)
0
|u kl (t)| ≤ 1 (2.27)
|xi j (0)| ≤ 1 (2.28)
Remarks:
1 For space-invariant CNN, |xi j (t)| is bounded by
x̂max = 1 + z max + |Akl | + |B kl | (2.29)
1≤k≤M 1≤l≤N
2 Theorem 2 imposes a minimum power supply voltage for any CNN circuit imple-
mentation, and is fundamental for designing a CNN circuit.
Let us examine the contributions from the two synaptic operators and the threshold
items in (2.21).
where the 3 × 3 matrix A is called the feedback cloning template, and the symbol “”
denotes the summation of dot products, henceforth called a template dot product. In
26 Notation, definitions, and mathematical foundation
where
is called the rate function, g(xi j ) is called the driving-point (DP) component because
it is closely related to a central concept from nonlinear circuit theory, and
wi j (xi j , t) = Ā Yi j + B Ui j + z
(a) (A, B, z)
B A
(b) z
U x ij x ij y ij
B + ∫ dt f( )
uij –
A
Y
Fig. 2.21. A space-invariant CNN C(A, B, z) with a 3 × 3 neighborhood S1 (i, j). (a) Signal flow
structure of a CNN with a 3 × 3 neighborhood. The two shaded cones symbolize the weighted
contributions of input and output voltages of cell C(k, l) ∈ S1 (i, j) to the state voltage of the center
cell C(i, j). (b) System structure of a cell C(i, j). Arrows printed in bold mark parallel data paths
from the input and the output of the surround cells u kl and ykl , respectively. Arrows with thinner
lines denote the threshold, input, state, and output, z, u i j , xi j , and yi j , respectively.
Fig. 2.22. Zero-feedback (feedforward) CNN ∈ C(0, B, z). (a) Signal flow structure of a
zero-feedback CNN with a 3 × 3 neighborhood. The cone symbolizes the weighted contributions of
input voltages of cells C(k, l) ∈ S1 (i, j) to the center cell C(i, j). (b) System structure of a cell
C(i, j). Arrows printed in bold denotes the input signal from the surround cells. In this case, there is
no self-feedback, and no couplings from the outputs of the surround cells.
Fig. 2.23. Zero-input (Autonomous) CNN ∈ C(0, B, z). (a) Signal flow structure of a zero-input
CNN with a 3 × 3 neighborhood. The cone symbolizes the weighted contributions of the output
voltage of cells C(k, l) ∈ S1 (i, j) to the center cell C(i, j). (b) System structure of a center cell
C(i, j). Arrow printed in bold denotes the signal fed-back from the outputs of the surround cells.
In this case, there are no input signals.
30 Notation, definitions, and mathematical foundation
Fig. 2.24. Uncoupled CNN ∈ C(0, B, z). (a) Signal flow structure of an uncoupled CNN with a
3 × 3 neighborhood. The cone symbolizes the weighted contributions of the input voltages of cells
C(k, l) ∈ S1 (i, j) to the center cell C(i, j). (b) System structure of a center cell C(i, j). Arrow
printed in bold denotes the input signals from the surround cells. In this case, the data streams
simplified into simple streams marked by thinner arrows, indicating only a “scalar” self-feedback,
but no couplings from the outputs of the surround cells.
So far, we have not mentioned the details of the physical or biological meaning of
the various terms in the CNN equations. To highlight some of these issues, next we
show a possible electronic circuit model of a cell. In Fig. 2.25, voltage-controlled cur-
rent sources are used to implement various coupling terms. These trans-conductances
can be easily constructed on CMOS integrated circuits. The details will be discussed in
Chapter 15. A very rough sketch of a typical living neuron with interacting neighbors
is shown in Fig. 2.26. A more detailed discussion can be found in Chapter 16.
1
a
, j+
ent 1, 0
–1
A Y –1 y a –1,
yi
1
j–
1,1
total i+
1,
1,
a–
fe ij
i+
u
curr edforwa
j–
b 1,1
1
b1,0ui+1, j
–1
ent rd
1,
u i+1,
b
a1
1
j–
1,
,1 yi
i–
y
,–
1
+1
,j
–1
a1,0 yi+1, j
+1
a
uij
bij uij xij
– zij xij +
1 xij
input voltage +
aij y ij
of cell C(ij) f (xij )
– 1 y ij
threshold current
of cell C(ij) –
internal core
of cell C(ij) state voltage
of cell C(ij)
output voltage
of cell C(ij)
Fig. 2.25. Cell realization of a standard CNN cell C(i, j). All diamond-shape symbols denote a
voltage-controlled current source which injects a current proportional to the indicated controlling
voltage u kl or ykl , weighted by bkl or akl , respectively, except for the rightmost diamond f (xi j ) in
the internal core which is a nonlinear voltage controlled current source, resulting in an output
voltage yi j = f (xi j ).
32 Notation, definitions, and mathematical foundation
sensory
neuron
C(mn)
axon ymn
C(ij)
nd b m
in
rit
ic nu mn
axon yij
neuron
C(kl)
a synapse from the axon
(output) of neuron C(kl)
axon to a dendrite of neuron
ykl C(ij)
Fig. 2.26. A caricature of a typical neuron C(i, j) receiving an input from a sensory neuron on the
left and a neighbor neuron below through respective “synapses.”
for the synaptic signal flow graph B, these two signal flow graphs are identical and
hence easy to remember. Observe that the bold heavy edges indicate signal flowing
into cell C(i, j), whereas the light edges indicate signal flowing out from cell C(i, j).
Observe that each synaptic weight occurs exactly twice in each flow graph, and that
they are always associated with a pair of edges, one bold edge and one light edge, with
arrows pointing in the same directions. For example, the coefficient a−10 is associated
with the two edges originating from the North (N) cell and terminating in the South (S)
33 2.2 Mathematical foundations
NW N NE
a1,–1
a–1,–1
a0,1 a 0,1
W a00 E
yi, j–1 yi, j+1
a0,–1 a0,–1
a–1,1 a1,1
a–1,–1
a–1,0
a1,0
a1,–1
SW S SE
(b)
Fig. 2.27. Feedback synaptic signal flow graph A associated with the A template.3 (a) The A
template with self-feedback synaptic weight a00 , (b) Signal flow graph A.
cell. This is because the “top” cell C(i − 1, j) is North of the center cell C(i, j), which
is itself North of the “bottom” cell C(i + 1, j). The same observation applies to the
horizontal pairs, and all diagonal pairs of similarly-directed bold-light edges. Observe
also that for each zero coefficient akl = 0, or bkl = 0, two corresponding edges will
disappear from the corresponding signal flow graph. Hence, for templates with only
a few non-zero entries, their associated synaptic signal flow graphs are particularly
simple. It is in such situations where useful insights can be obtained, specially when
two or more such synaptic signal flow graphs are interconnected to form a composite
synaptic system graph.
34 Notation, definitions, and mathematical foundation
NW N NE
b1,–1
b–1,–1
b0,1 b 0,1
W b00 E
ui, j–1 ui, j+1
b0,–1 b0,–1
b–1,1 b1,1
b–1,–1
b–1,0
b1,0
b1,–1
SW S SE
(b)
Fig. 2.28. Input synaptic signal flow graph B associated with the B template. (a) B template with
self-input synaptic weight b00 . (b) Signal flow graph B.