2. Fundamentals of Cellular Neural Network and Genetic Algorithm
2.2 CNN Templates for Digital Image Processing
2.2.1 Edge Detection CNN Template
Descriptions: Extract edges of the objects of the input image.
Rules: Each black pixel which has at least one white pixel in the defined neighborhood is defined to be an edge cell.
Boundary Condition: Fixed boundary condition Initial State: 0xij(0)= (0 means white in an image)
(a)
(b)
Fig. 2.2.1_1 Edge detection example by some specified template for (a) the binary image (b) the gray-level image (Left: the original image, Right: the processed
image) 2.2.2 Color Inverse CNN Template
Descriptions: Inverse colors of the objects in a digital image.
Rules: The color of the input image would be equivalently inversed via the middle of the color range in CNN format.
Boundary Condition: Fixed boundary condition Initial State: 0xij(0)= (0 means white in an image)
(a)
(b)
Fig. 2.2.2_1 Inverse operation example by some specified template for (a) the binary image (b) the gray-level image (Left: the original image, Right: the processed
image)
2.2.3 Image Thresholding CNN Template
Descriptions: Transform a gray-level image into a binary image by some predefined threshold.
Rules: Each pixel of a gray-level image can be labeled as ‘pure white’ if and only if its transformed intensity in CNN format (between -1 and 1) is higher than some predefined threshold z*.
Boundary Condition: Fixed boundary condition Initial State: )xij(0)=uij(0
Cloning Template:
*
Fig. 2.2.3_1 Thresholding example by some specified template (Left: the original image, Right: the processed image)
2.2.4 Low-pass Filtering CNN Template
Descriptions: Do the low-pass filtering for the gray-level image..
Rules: The pixels with some specific color range (usually in the low band) can be labeled as ‘black’ pixels while the others are labeled as ‘white’ pixels.
Boundary Condition: Fixed boundary condition Initial State: 0xij(0)= (0 means white in an image)
Fig. 2.2.4_1 Low-pass filtering example by some specified template (Left: the original image, Right: the processed image)
2.2.5 Laplacian CNN Template
Descriptions: Laplacian operation for the digital image.
Rules: Each pixel of the input image would be filtered via the defined Laplace filter.
Boundary Condition: Fixed boundary condition Initial State: 0xij(0)= (0 means white in an image)
(b)
Fig. 2.2.5_1 Laplacian operation example by some specified template for (a) the binary image (b) the gray-level image (Left: the original image, Right: the processed
image) 2.2.6 Half-toning CNN Template
Descriptions: Transform a gray-level image into a half-toned binary image which preserves the major characteristics of the original image.
Rules: The gray-level intensity of an input image would be re-sampled to obtain a binary image via half-toning which could resume the original image intensity by inverse half-toning.
Boundary Condition: Fixed boundary condition defined by the constant values of the initial state and the input image.
Initial State: )xij(0)=uij(0
(a)
(b)
Fig. 2.2.6_1 Image half-toning by some specified template for (a) the natural gray-level image (b) the human gray-level image (Left: the original image, Right:
the processed image)
2.3 CNN Justifications
In this section, we shall discuss the related justifications about CNN. Also, we would like to elucidate some querying points for those who might be concerned about using CNN in the related applications of image processing in three aspects.
A. Discussions of CNN equations
As what we have mentioned in the earlier part of this chapter, the most crucial part of applying CNN to image processing is to determine the corresponding arguments of CNN templates. In addition, the structure of CNN depends on the state and output equations as (3) and (4). Those who are good at image processing but not familiar with CNN might doubt the relationship between these two equations and might be curious about the resultant images after using CNN. In fact, many original studies
about CNN have proved that the processed images after CNN should be in the binary form on account of the following theorem [68].
Theorem 2.3.1.
The output y of every cell at any stable equilibrium point of a completely ij stable standard CNN defined by (3) and (4) is equal to either plus 1, or minus 1, if the center element a of the A template satisfies ij aij >1.
Also, without loss of generality, the processed images could be binarized if aij ≠1 as to meet the bistable criterion of CNN.
B. Justifications of CNN circuit
Some might be concerned about the pros of cons by using CNN. Therefore, in this section we shall briefly introduce some significant reasons for applying CNN’s to applications of images. As we know, CNN is very attractive in its successful implementation of an analog input/output CNN universal machine which can also be referred to as a CNN universal chip. The analog circuit is very different from the digital one in the sense that the analog could truly transmit and process most signals in the undistorted way. Furthermore, a single silicon chip is regarded as a completely dynamic array stored-program computer where the CNN chromosome can be executed and programmed on the chip at a tremendously high speed (given 1012 analog instructions per second based on a 100x100 CNN chip). Also, the chip design by the CNN universal machine would differ from that by a digital circuit because it could be carried out in the completely nonlinear dynamics. Hence, we would like to take advantage of some dominant and distinguishing characteristics of CNN’s in more complicated applications of images.
C. Sensitivity of CNN’s
In addition to some justifications of CNN’s stated above, some might be
concerned about its sensitivity when applying CNN to various applications. In this thesis, we used CNN’s in image documentation and texture analysis. For CNN applications that we discussed in this thesis, we have to find the appropriate templates of CNN with respect to some specific purpose. We in here make use of GA to optimize the related arguments of CNN templates. Naturally, the desired patterns in some sense should be specified beforehand. Unlike the concept of classic cellular automata, CNN cannot be defined by local rules directly but can be simply defined by iterating the CNN genes. That is why GA could be broadly applied to every sort of image applications. Speaking to the proposed applications in the chapter 3, we do not need to accurately pre-specify the desired patterns of CNN templates because only the ratio of black and white pixels in the CNN output would be quite sufficient to provide a proper decision in the later processes. The related explanations about sensitivity in optimizing CNN arguments when using GA have been given in some important works of the literature [13], [43]. As they concluded, the form of desired patterns in black/white or white/black arrangement has no influence on the final results even for some applications in need of high accuracy. Therefore, in the point of view in using CNN for pattern selection, the arrangement of black/white or white/black in setting the desired patterns shows no difference in the final performance if GA is applied to optimize the CNN templates.
2.4 Concluding Remarks of CNN
It is observed that the CNN templates in all introduced examples are defined by the sphere of influence in radius r = 1. That is to say, only 19 parameters in the triplet template {A, B, z} have to be determined. The main reason is that this kind of CNN template would be much more efficient for various image applications by experienced rules and practical uses. Besides, the examples demonstrated above try to associate
the design of CNN templates with some image characteristics in the specific application. These kinds of arrangement in CNN templates not only reveal the intuitive decision of CNN templates but also motivate our approach in analyzing the nature of images and inspiring the design of CNN templates. After that, we especially state the justifications of CNN in three aspects in order to make those who like to use CNN in image applications more comprehensive on these concerning topics. We hence make use of a more effective training and learning approach for optimizing CNN templates in our proposed high-order image applications based on CNN’s. This optimization method, genetic algorithm (GA), would be given in more details in the next section.
2.5 Genetic Algorithm (GA)
There exist two kinds of optimization approaches where one is the specific optimization rule and the other is the generalized one. The specific design rule is defined by some specific characteristics of object functions. The object functions have to satisfy some properties such as linear, invariant, differential properties, so the differential and gradient approaches are of this type. As for the generalized one, the design rules are independent of object functions, and random searching as well as genetic algorithm should be of this type. For the design of CNN templates, GA would be a better choice since no direct relation between CNN templates and image applications can be found by intuition. The most significant advantage of GA lies in the wide range of searching, and this makes optimization of CNN templates more effective and accurately. Later in this section, we will introduce some necessary components and important properties of GA, which have a great influence on the design of CNN templates.
Genetic algorithms are based upon a kind of optimization searching mechanism
during the process of natural selection which spiritually imitates the natural rule, the survival of the fittest. As the evolution rule of genes, GA can choose a better parent generation in the species which has the superior properties and randomly exchanges the genetic information with each other. In this way, the children generation could be expected to be superior to the last parent generation and the best species would be generated by this repetitive way. In fact, there are three major operators for GA including reproduction, crossover, and mutation. The fundamental concept of GA applied to optimization lies in the following essentials, i.e. encoding all the searching arguments to so called chromosomes, design of fitness function by the given acquirements, selection of the species with higher fitness values for mating pool, and crossover and mutation for the worse reproduction result. Fig. 2.4_1 illustrates the whole process of GA.
Fig. 2.4_1 Flow chart of the systematical GA structure
2.6 Essentials in GA
After introducing the whole structure of GA, in this section we will give more detailed information about the essentials in GA which are organized as below.
A. Reproduction
Reproduction is an operation process which can decide the quantum of Generating the initial
population randomly
Encoding searching arguments
Calculating fitness function values
Judging Condition
Reproduction
Optimized solution
Crossover
Mutation
yes
no
species of the next generation that need to be eliminated or reproduced according to how fitting the species of the parent generation can be. The species in higher fitting capability would be reproduced much more while those in lower fitting capability would be excluded in the next generation. The fitting capability that we mentioned above can be estimated by the responses of fitness function. In general, there exist two types of reproduction where one is the roulette wheel selection and the other is the tournament selection.
a. Roulette wheel selection
During the process of evolution, the area of each component of the roulette wheel can be determined by its corresponding fitness function value. The bigger the fitness function value, the larger the corresponding area of roulette wheel.
The proportion of occupied area of roulette wheel also indicates the probability of being selected for the mating pool. Assume that there are N species and fi
represents the fitness function value of the ith species. Theoretically, the total
number of this kind of species, ⋅
∑
= =∑
means the average fitness function value of all species, would be reproduced and selected to the mating pool.
b. Tournament selection
The major difference between tournament and roulette wheel selection is that tournament selection randomly selects two or more species at the first run and the species with the biggest fitness function value would be sent to the mating pool during the process of evolution.
Basically speaking, these two selection methods both can achieve the goal of survival of the fittest. Obviously, tournament selection is good at its processing speed on account of less complexity and roulette wheel selection is fascinating in its
generality and wide applications if calculation complexity is not the most significant matter in the discussing issues.
B. Crossover
Crossover would randomly select two strings of species in the parent generation from mating pool and exchange their information to generate two new species. In pursuit of generating the superior children generation, crossover could take advantage of outstanding information from the last generation. The probability of crossover depends on how often the process of crossover could occur which includes the following three types, one-point crossover, two-point crossover, and masking crossover. For an easier comprehension, it is sufficient for us describe these three types of crossover by illustrating one example encoded by strings as below.
a. One-point crossover
Fig. 2.5_1 Illustrating figure for one-point crossover b. Two-point crossover
A=111000 A=111111
B=000000 B=000111
crossover
Crossover point Crossover point
Crossover point Crossover point
Fig. 2.5_2 Illustrating figure for two-point crossover c. Masking crossover
Fig. 2.5_3 Illustrating figure for masking crossover C. Mutation
During the process of mutation, one string/ species and the location of mutation point would be chosen and then the information of corresponding species at mutation point would also be changed. The probability of mutation depends on the process of occurring mutation, and the location of mutation point could be defined as a bit, a whole string, or by a specific mask. The types of mutation hence could be defined by the location of mutation point as what we have introduced for the crossover process.
GA could be equipped with these three introduced essentials and its type is
A=111000 A=100000
B=011111 B=000111
crossover
Crossover point Crossover point
Crossover point Crossover point
Mask=011000
A=111000 A=111110
B=000001 B=000111
crossover
Crossover point Crossover point
Crossover point Crossover point
chosen by the characteristics of some specific image application. In our practical use by GA, we would give more information about how we could determine the types of each essential and its pros and cons in the later topics of this thesis.
2.7 Discussions of GA
GA is basically different from the traditional approaches and can be characterized by the following issues.
A. GA cannot be operated on the parameter itself but the set of parameters, so it can jump away from the constraint of analysis in search space.
B. GA cannot search a single point but many points in search space, so it can obtain the global optimum sooner and avoid finding the local optimum.
C. All GA needs is the information of fitness function, that is to say, it is not necessary for GA to use other aided information like gradient. In this way, GA can use many kinds of fitness functions so as to save complexities resulted from over mathematical computations.
D. GA can be applied to various sorts of optimization problems since it does not solve problems by well-defined rules but use the probabilistic rules to make the searching direction more clear.
In the remained part of this section, we will focus on some important discussions about the adjustment of GA structure.
2.7.1 Parameter settings
The most complicated and difficult matters in GA would be the settings of related parameters. It is impossible for us to develop a standard method for all cases to set all the parameters of GA here. Instead, we will give broad descriptions about where we could put more emphasis and how the parameters can be related to each other. The major parts that one needs to design GA parameters for a specific case are
the range of encoding, length of string, size of population, mutation and crossover rate, and the design of fitness function. These aspects would have a great impact on the final searching result and between them the close relationship and dependence exist in process of optimization. For the setting of rates in some essentials of GA, we will show in the practical applications of this thesis. As for the kernel part of GA, we will discuss the problems appeared frequently when using GA and we will also introduce some existed types of fitness functions in this section.
2.7.2 Global optimization
The convergence speed of GA could be governed by the population size, crossover rate, and mutation rate. A higher value may speed up convergence of GA and then result in finding the local minimum. On the contrary, a lower value may cause the difficulty of convergence. Therefore, we have to take into consideration the dimensionality of search space, the range of parameters, and the string length while encoding. To avoid giving a higher crossover or mutation rate, we can predefine its corresponding maximum and minimum. In one way, the setting of theses two parameters can be initiated at the maximum and then decayed to the minimum along with the growing generations. Another flexible approach is using the floating mutation or crossover rate, since the local optimization might be achieved if the species have stopped evolving. This approach invokes to add some artificial interference in order to simulate the generation of new species, and this can be implemented by switching the mutation and crossover rate. For simplicity, we can increase the generated speed of new species (mutation and crossover rates) if the best fitness function value has kept unchanged through generations, and also we will get mutation and crossover rates back if the best fitness function value has increased. It is apparent that we can avoid finding the local optimization value as long as these adjustable parameters in GA could be effectively determined. Besides, the other
crucial essential of GA, fitness function, will be introduced in the next section in much more details.
2.7.3 Fitness Function
The selected fitness function should be capable of reflecting the differences between different species. Besides, fitness function ought to exclude the inferior species and offer more chances for new species to get in the populations. Sometimes, diversity of species in the mating pool can help to generate a better optimized solution since choosing the same superior species from the mating pool might bring about a worse optimized result. To achieve the above requirements, how to adjust the fitness function becomes more important. Thus, there exist three kinds of methods to adjust fitness functions in the history of GA. In the followings, we shall introduce the basis and the pros and cons of these three methods.
A. Linear scaling
Linear scaling can transform the values calculated from fitness function by the following (7).
f′=af +b (7) where f and f ′ are the original and transformed values of fitness function, respectively, and the coefficients a and b can be chosen such that
favg = favg′ and fmax′ =κ⋅favg (8)
where favg , favg′ and fmax′ are the original and transformed average values of fitness function, and the transformed max fitness value, respectively. The coefficient κ is the multiplier between favg and fmax′ . The linear scaling function is shown in Fig.
3.3.3_1. In the point of view by statistics, (8) can ensure one of the chromosomes with
3.3.3_1. In the point of view by statistics, (8) can ensure one of the chromosomes with