CAEPIA 2003- prog. genetica

download CAEPIA 2003- prog. genetica

of 10

Transcript of CAEPIA 2003- prog. genetica

  • 8/9/2019 CAEPIA 2003- prog. genetica

    1/10

    Genetic Programming for Automatic Generation

    of Image Processing Algorithms

    on the CNN Neuroprocessing Architecture

    Vctor M. Preciado1, Miguel A. Preciado2, and Miguel A. Jaramillo1

    1 Departamento de Electronica e Ingeniera ElectromecanicaUniversidad de Extremadura, E-06071 Badajoz, Spain

    {[email protected], [email protected]}2 Dept. de Ingeniera de Sistemas y Automatica, Universidad de Sevilla

    Paseo de los Descubrimientos, s/n, 41092 Sevilla, Spain

    Abstract. The Cellular Neural Network Universal Machine (CNN-UM)is a novel neuroprocessor algorithmically programmable having real timeand supercomputer power implemented in a single VLSI chip. The localCNN connectivity provides an useful computation paradigm when theproblem can be reformulated as a well-defined task where the signalvalues are placed on a regular 2-D grid (i.e., image processing), andthe direct interaction between signal values are limited within a localneighborhood. This paper introduces a Genetic Programming technique

    to evolve both the structure and parameters of visual algorithms on thisarchitecture. This is accomplished by defining a set of node functions andterminals to implement the basic operations commonly used. Lastly, theprocedures involved in the use of the algorithm are illustrated by severalapplications.

    1 Introduction

    The Cellular Neural Network Universal Machine (CNN-UM) is a programmableneuroprocessor having real-time power implemented in a single VLSI chip [1].This neurocomputer is a massive aggregate of regularly spaced nonlinear analogcells which communicate with each other only through their nearest neighbors.This fact makes the CNN an useful computation paradigm when the problemcan be reformulated as a task where the signal values are placed on a regular2-D grid, and the direct interaction between signal values are limited within afinite local neighborhood [2]. This cellular structure and the local interconnectiontopology not only resemble the anatomy of the retina, indeed, they are very close

    to the operation of the eye [3], especially when photosensors are placed over eachtiny analog processor.Local interaction facilitates the implemetation of this kind of networks as effi-

    cient and robust full-custom mixed-signal chip which embeds distributed opticalsignal acquisition in a 0.5 m standard CMOS technology [4]. The chip is ca-pable to complete complex spatio-temporal image processing tasks within short

    R. Conejo et al. (Eds.): CAEPIA-TTIA 2003, LNAI 3040, pp. 374383, 2004.c Springer-Verlag Berlin Heidelberg 2004

  • 8/9/2019 CAEPIA 2003- prog. genetica

    2/10

    Genetic Programming for Automatic Generation 375

    computation time (< 300ns for linear convolutions) but, in contrast, program-ming in the framework of this novel architecture is not a trivial matter. Manifoldnonlinear phenomena from nonlinear waves to chaotic oscillations may ap-pear while designing the topology and weights of this dynamic network. In thisdirection, several works has been presented to yield a programming methodologywhen the operator is restricted to binary output and the stability of the networkis assumed.

    In this paper we propose a stochastic optimization technique based on Ge-netic Programming to automatically generate image processing programs in thisneurocomputing architecture. In contrast with previous algebraic design tech-niques, this input-output approach offers a flexible description of CNNs andmakes possible to learn propagating and grey-scale-output templates. On theother hand, the resulting cost function is difficult to minimize. Due to com-

    plex dynamic phenomena in the network, the energy function to be minimizedis noisy when chaos or sustained oscillations appear in the network, and non-differentiable when catastrophes, bifurcations or multistability ocurrs.

    The paper is organized as follows. In Section 2, the cellular neural networkmathematical model and the architecture of the CNN-Universal Machine pro-totyping system is introduced. The optimization technique based on a GP al-gorithm, as well as implemented software tools, are described in Section 3. Ex-perimental applications to automatic algorithm design, and the summary of theexperiences are our main results presented here.

    2 CNN-Based Neuromorphic Architecture

    The CNN Universal Machine (CNN-UM) architecture [1] is an analogic spatio-temporal array computer wherein analog spatio-temporal dynamics and logicoperations are combined in a programmable framework. Elementary instructionsand algorithmic techniques are absolutely different from any digital computersbecause elementary operators (denominated templates) perform complex spatio-temporal nonlinear dynamics phenomena by varying the local interconnection

    pattern in the array.

    2.1 CNN Dynamical Model

    The simplest CNN cell consists in a single capacitor which is coupled to neigh-bouring cells through nonlinear controlled sources. The dynamic of the array canbe described by the following set of differential equations

    d

    dtxi,j(t) = xi,j(t) +

    k,lNr

    Ak,lyi+k,j+k(t) +

    k,lNr

    Bk,lui+k,j+k(t) + I (1)

    with output nonlinearity

    y(x) =1

    2[|x 1| |x + 1|] (2)

    The input,state and output, represented by ui,j, xi,j and yi,j.

  • 8/9/2019 CAEPIA 2003- prog. genetica

    3/10

    376 Vctor M. Preciado, Miguel A. Preciado, and Miguel A. Jaramillo

    Fig.1. Schematic architecture of the Cellular Neural Network-Universal Machine.

    2.2 CNN-Univeral Machine Architecture

    The elementary image processing tasks performed on the input data by a singletemplate can be combined to obtain more sophisticated operation mode on theCNN Universal Machine (CNN-UM) [1]. The machine uses the simple CNNdynamics (1) in a time multiplexed way by controlling the template weightsand the source of the data inputs for each operation. The machine suppliesmemory and register transfers at each cell that allow the outputs of simple CNNoperations to be combined and/or supplied to the inputs of the next operation.

    The architecture of the CNN-UM is shown in Fig. 1. As it can be seen, theCNN-UM is an array computer with a dynamic CNN core, called CNN nucleus.The CNN-UM extends this core in two main parts: (i) the array of extendedCNN cells and (ii) the Global Analogic Programming Unit (GAPU).

    An extended CNN cell has the following extra elements added to the CNNnucleus (core cell):

    Local Analog Memory (LAM); a few continuous (analog) values are storedin the LAM in each cell,

    Local Logic Memory (LLM); several binary (logic) values are stored in the

    LLM in each cell, Local Logic Unit (LLU); a simple programmable multi input/single output

    logic operation is executed, the input and output is stored in the LAM, Local Analog Operation Unit (LAOU); analog operations between input im-

    ages are executed. The input and output is stored in the LAM, Local Comunication and Control Unit (LCCU) which receives the messages

    from the central (global) commander, the GAPU, and programs the ex-tended cells accordingly.

    Due to implementability concerns, the template neighborhood radius is gen-erally restricted to be as small as possible, and templates are applied in a space-invariant manner (A and B are the same for every cell). The actual ACE4kvisual microprocessor [4] is an array of 64 64 CNN cells that occupies an areaof 9145 9548 m2 packaged in a 120 Pin Grid Array using a low power budget(< 1.2W for the complete chip).

  • 8/9/2019 CAEPIA 2003- prog. genetica

    4/10

  • 8/9/2019 CAEPIA 2003- prog. genetica

    5/10

    378 Vctor M. Preciado, Miguel A. Preciado, and Miguel A. Jaramillo

    In the Grow technique, the codified trees (in prefix notation) are gen-erated connecting terminals and functions to a root node according toa predetermined probability. In our approach, every branch is limitedin depth, thus if this limit is achieved terminal nodes are automaticallyadded until the end of the branch.

    The Ramped Half & Half technique is an hybrid method between theFull Generation and Grow Technique. In this case, a half of the initialpopulation is generated by the full method, and the other half by amodified grow technique in which the branch depth is modified from 2to a maximum value along the individuals of the initial population.

    3.1 Fitness Function

    A well-defined fitness or cost function, which compares the desired output to theresult of the transient in the neural network, is an essential matter for obtainingsuccesfull GP results. While the proposed methodology has to tackle with manydifferent problems, several fitness functions has been proved. It is responsabilityof the user to properly choose the most adequate cost function based on the apriori information about the problem. In this work we have implemented thefollowing functions:

    Correlation-Based Fitness: A correlation operator between desired andoutput image is applied as usually defined in signal processing theory. This

    kind of cost function is specially interesting when the desired output is agrey-scale image.

    fcorr(p)

    iI

    ydi yi()

    k2

    iI

    ydi2

    iI (yi())2

    (3)

    where p denotes the parameter vector, I is the whole set of pixels in theimage, k is the size of the network, ydi is the value of the ith pixel of thedesired output and yi() stands for the corresponding pixel of the settled

    output. Absolute Difference: It is exclusively defined to measure the distancebetween binary images. It used a simple first-order norm between pixelsin both desired and output images in the following format. The result isnormalized taking into account the size of the images.

    fabs(p)

    ki=1

    ydi |yi()|

    k

    (4)

    Special Difference: The special difference fitness function allows a fuzzy

    definition of the desired image. It is defined in the space of binary images asfollows

    fspc(p) 1

    s (Z)

    iZ

    ydi |yi()|

    +

    1

    s

    Z

    iZ

    ydi (1 |yi()|) , (5)

    Z i I :ydi = 0

    and Z

    i I :ydi = 0

    . (6)

  • 8/9/2019 CAEPIA 2003- prog. genetica

    6/10

    Genetic Programming for Automatic Generation 379

    where the function s denotes the size in pixels of the set used as argument.Therefore, this method gives a different treatment to zero and non-zero val-ues in the image, relying a greater emphasis on black pixels in the output.

    Several secondary components are included in the fitness function to avoidseveral non-feasible individuals. These are a penalty all-black/all-white used toavoid individuals consisting in a uniform black or white image which can yield ahigh fitness evaluation in several problems, and a number-of-operations penaltywhich gives a handicap to huge trees.

    3.2 Genetic Operators

    Genetic operators used in this work are similar to those used in standard GP

    algorithms [8]. Thus, we briefly enumerate the kinds of operators implementedand experimentally proved in our software tool.

    Selection. Four different selection methods have been developed: , (fromnu individual, lamda sons are generated, from which best nu individuals arechosen), + (from nu individual, lamda sons are generated, and from allnu+lambda individuals, nu individuals are chosen), ranking and tournamentas usually defined in Evolutionary Optimization theory.

    Mutation. As in the selection operator, four different kinds of operatorshave been developed: the Subtree mutation in which a subtree is stochasti-

    cally selected and substituted for another stochastically generated tree , theNode operator which stochastically modifies a tree node, the Hoist methodwhich substitutes an individual tree with a stochastically extracted subtree,and Collapse mutation which stochastically extracts a subtree and substi-tutes it for a stochastically generated terminal node.

    Once the theoretical details have been exposed, we presents a software toolimplemented to prove, in a friendly GUI, the manifold posibilities presented bythe GP algorithm under study.

    4 Numerical Results

    A complete software package has been programmed to numerically implementthe GP algorithm herein studied. Two programs outlight in this package: theCNN Visual Algorithm Simulator and the GP-based Generator of CNN VisualAlgorithm. Both have been programmed in Borland C++ Builder, and are specif-ically designed to handle individuals represented by means of a tree structure.

    The GP-based Generator of CNN Visual Algorithm implements the GP

    searching algorithm discussed in this paper, and allows the user to define allsearch parameters previously commented. The CNN Visual Algorithm Simula-tor permits the simulation of user-defined algorithms and single templates. Itcan be used to verify or refine any solution algorithm obtained by GP optimiza-tion. Both programs use a template library which can be arbitrarily modified bythe user to include interesting templates.

  • 8/9/2019 CAEPIA 2003- prog. genetica

    7/10

    380 Vctor M. Preciado, Miguel A. Preciado, and Miguel A. Jaramillo

    Fig. 2. Automatic generation of a visual algorithm for roughness measurement. Theparemeters used in the GP algorithm are: population=200, crossover probability=0.8.The mutation probabilities are: subtree=0.02, node: 0.03, collapse=0.005, hoist=0.01.Parameters used in the generation of the first population: generation type=Rampedhalf and half, terminal probability=0.07, generation depth=6. Selection parameters: se-lection type=Ranking, probabilities range (0.5, 1). Fitness evaluation: image evaluationtype=special difference, number of functions penalty=ON.

    In the following, some examples of GP searching application are shown inorder to illustrate the performance of the implemented software package for theautomatic generation of image processing algorithms on the CNN-UM.

    Example 1 (Roughness Measurement).In this example, the desired algorithm takes a binary input image that contains

    a black figure over a white background, and make a measure of its roughnessby the detection of concavities in the boundary of the black object. Both thedesired and output images are shown in Fig. 2, and GP parameters are specifiedin the label of the figure.

    Successive automatically obtained solutions are represented in Fig. 2 (c)-(e).It can be seen how the first solutions dont accomplish with a minimum qualityrequirement. This is due to the stochastic nature of our optimization algorithm.After 396 generations, the solution which fulfill our minimum requirement is theone showed in Fig. 2 (e). The automatically generated algorithm is represented as

    a tree in Fig. 4 (a), where discontinuous line box marks an intron a redundantpiece of code that usually appears in GP individuals.

    Example 2 (Depth Estimator).In this example, we are looking for a simple program which estimate the depth ofa concrete object in a scene. The depth estimator algorithm searched needs four

  • 8/9/2019 CAEPIA 2003- prog. genetica

    8/10

    Genetic Programming for Automatic Generation 381

    Fig. 3. Automatic generation of a visual algorithm for 3D depth estimation. Theparemeters used in the GP algorithm are: population=200, crossover probabil-ity=0.8. Mutation probabilities: subtree=0.02, node=0.03, collapse=0.005, hoist=0.01.Generation parameters: generation type=Ramped half and half, terminal probabil-ity=0.07, generation depth=8. Selection parameters: selection type=Ranking, proba-bilities range=(0.5, 1). Fitness evaluation: image evaluation type=correlation, number

    of functions evaluation=ON.

    input images represented in Fig. 3: two of them representing the right and leftimages of a stereoscopically captured scene including the object (the black box),Fig. 3 (a)-(b), and the other two representing the scene without the object, Fig.3 (c)-(d). From a GP point of view, these four images constitute the terminalset. The desired algorithm makes a estimation of the depth map of the scene.The result is based in disparity, in such a way that, in the output image, eachobject disparity is shown by horizontal segments.

    After 204 generations, the obtained solution can be seen in Fig. 3 (e), fulfillsour minimum requirement. The automatically generated algorithm is representedas a tree in Figure 4 (b).

    5 Conclusions

    In this paper, a new learning machine for automatic design of CNN visual al-gorithms was described. The novel neurocomputng architecture based on the

    Cellular Neural Network-Universal Machine has been briefly presented. Com-plex dynamics in this nonlinear networks provides us with a powerful tool forreal-time image processing. On the other hand, there is only specific method-ologies to design a very reduced set of image processing operators, almost all ofthem based on an extension of classical LTI filters [9]. In this paper, we propose ageneral design approach consisting in using the stochastic optimization technique

  • 8/9/2019 CAEPIA 2003- prog. genetica

    9/10

    382 Vctor M. Preciado, Miguel A. Preciado, and Miguel A. Jaramillo

    Fig. 4. Automatically generated visual algorithms for roughness measuremente (a),and depth estimation (b). The appearance of introns in the first algorithms can beobserved in the framed subtree.

    called Genetic Programming for automatic generation of visual algorithms. Wehave briefly presented nonlinear dynamics of the CNN and the associated com-putational infrastructure which yields the CNN-UM. Next, we have presented aGP-based methodology to accomplish an automatic design of image algorithms.

    It is important to note that the objective of this methodology isnt the elimi-nation of the hands of the expert from the design process, but provide an usefultool to the expert designer in order to facilitate his work in the framework ofprogramming this neuroprocessor. From this point of view, it is worth notingthat a basic knowledge about how the GP works is essential for the user to

    properly configure the manifold parameters needed for a correct performance ofthe algorithms.As correct GP configuration is essential for an effective searching, several

    rules have been observed to provide acceptable results:(i) The set of terminals and the desired image must be representative enough

    to appropriately orient the search process, and shouldnt be too complex to slowit down.

    (ii) The set of functions should include every neccesary operator for thesolution to be fulfilled, but not too numerous to retard the searching.

    (iii) When the problem involves binary output images, the special differencefitness is recommended because it permits a fuzzy definition of the desired image,which results very interesting in finding unknown algorithms. It is also recom-mended to include a penalty for big trees, because it is usual the appearanceof introns to protects individuals from the destructive effects of mutation andcrossover, making higher its probability of standing for generations.

  • 8/9/2019 CAEPIA 2003- prog. genetica

    10/10

    Genetic Programming for Automatic Generation 383

    (iv) The ramped half-and-half is an efficient method to yield a more diverseand heterogeneous initial population.

    (v) The ranking method of selection produce an interesting equilibrium be-tween searching orientation and diversity standing, which benefits the searchingprocess.

    (vi) Each mutation operator produces a different effect over the searching:the hoist operator tends to impoverish population diversity, the subtree oper-ator provoke increasing individual trees size thus parsimony pressure mustbe increased , node operator enrich population diversity, and secondary effectshavent been detected, and collapse operator tends to decrease individuals size,therefore it must be used moderately.

    References

    1. T. Roska, A. Zarandy, S. Zold, P. Foldesy, and P. Szolgay, The computationalinfrastructure of the analogic CNN computing - Part I: The CNN-UM Chip proto-typing system, IEEE Trans. Circuits Syst., vol. 46, no. 1, pp. 261-268, 1999.

    2. L. O. Chua, and L. Yang. Cellular neural networks: Theory. IEEE Trans. CircuitsSyst.,vol. 35, no. 10. pp. 1257-1272, 1988.

    3. F. Werblin, T. Roska, and L. O. Chua, The analogic cellular neural network as abionic eye, Int. J. circuit Theory Appl., vol. 23, no. 6, pp. 541-549, 1995.

    4. G. Linan, S. Espejo, R. Domnguez-Castro, and A. Rodrguez-Vazquez, The CN-

    NUC3: an Analog I/O 64 x 64 CNN Universal Machine with 7-bit Analog Accuracy,in Proc. IEEE Int. Workshop on Cellular Neural Networks and their Applications(CNNA2000), pp. 201-206, 2000.

    5. M. Ebner, On the evolution of interest operators using genetic programming, inFirst European Workshop on Genetic Programming, pp. 6-10, 1998.

    6. R. Poli, Genetic Programming for Feature Detection and Image Segmentation, in:Evolutionary Computing. Lecture Notes in Computer Science, vol. 1143. Springer,Berlin, pp. 110-125, 1996.

    7. V.M. Preciado, D. Guinea, J. Vicente, M.C. Garcia-Alegre, and A. Ribeiro, Au-tomatic CNN Multitemplate Tree Generation, in Proc. IEEE Int. Workshop on

    Cellular Neural Networks and their Applications (CNNA2000), pp. 327-332, 2000.8. J. Koza, Genetic Programming, MIT Press, Cambridge MA, 1992.9. K.R. Crounse and L.O. Chua, Methods for image processing and pattern formation

    in cellular neural networks: A tutorial, IEEE Trans. Circuits Syst., Vol. 42, no. 10,pp. 583-601, 1995.