Density codes and shape spaces Pierre Courrieu * Laboratoire de Psychologie Cognitive, CNRS - UMR 6146, Universite ´ de Provence, Centre St Charles, Bat. 9, Case D, 3 Place Victor Hugo, 13331 Marseille Cedex 1, France Received 30 September 2004; accepted 31 October 2005 Abstract This paper presents an algorithm that allows for encoding probability density functions associated to samples of points of R n . The resulting code is a sequence of points of R n whose density function approximates that of the set of data points. However, contrarily to sampled data points, code points associated to two different density functions can be matched, which allows to efficiently compare such functions. Moreover, the comparison of two codes can be made invariant to a wide variety of geometrical transformations of the support coordinates, provided that the Jacobian matrix of the transformation be everywhere triangular, with a strictly positive diagonal. Such invariances are commonly encountered in visual shape recognition, for example. Thus, using this tool, one can build spaces of shapes that are suitable input spaces for pattern recognition and pattern analysis neural networks. Moreover, a parallel neural implementation of the encoding algorithm is available for 2D image data. q 2005 Elsevier Ltd. All rights reserved. Keywords: Sets of points; Density functions; Pattern encoding; Geometrical invariants; Shape similarity 1. Introduction There are applications in which the input provided to a neural network is not a point (real vector) but a set of unordered points of R n . Specific methods for suitably encoding unordered, deterministic, fixed size sets of points have been proposed (Courrieu, 2001). However, one can frequently consider that a set of points results from random sampling governed by a particular density of probability on R n . In this case, it is usually the density function (not the random sample) that is relevant for the application. For example, the set of black pixels in an image representing a written word, or an object whose detail can be subject to some random variation, can be considered as a random sample of points of R 2 generated by a density function that characterizes a recognizable shape (that of the word or of the object). However, many pattern recognition problems show that recognizable shapes can vary not only in a (limited) random way, but also in a large regular way. For example, depending on the used character font, or on the particular writer, a written word can substantially vary in width, in height, and in skewing, and its position in the image can also vary. Thus, a recognizable shape must, in fact, be characterized by a family of density functions depending on a set of regular transformations of the support. The set of transformations that does not affect the recognizable identity of a shape can conveniently be called ‘invariance set’. Note that the invariance set depends on the considered shape: for example, the character ’x’ is invariant to a 1808 rotation, while the character ’b’ is not (since it becomes ’q’). More globally, the set of letters (alphabet) is invariant to transformations such as translations, scaling, stretching, and skewing, but not to reflections (symmetries) or large orthogonal rotations (consider the subsets {b, d, p, q}, {u, n}, {f, t}, {N, Z}). The same seems to be true, in human vision, for more complex shapes such as written words: words are easily recognized with geometrical transformations that do not change their orientation, however, reading words in a mirror is quite uneasy for human readers, and psychologists hypothesized that reading inverted words requires a prior corrective mental rotation of the word image (Tzelgov & Henik, 1983). Various methods have been developed, in pattern recognition area, in order to encode shapes (usually 2D-shapes) invariant to certain affine trans- formations. Well-known methods are based on moment invariants (Heikkila ¨, 2004; Hu, 1962; Jin & Tianxu, 2004; Suk & Flusser, 2003), on Fourier descriptors (Arbter, Snyder, Burkhardt, & Hirzinger, 1990; Zhang & Lu, 2002), or on an analysis of characteristic contour points (landmarks) such as extreme points, or curvature maxima (Mokhtarian & Abbasi, 2002; Zhang, Zhang, Krim, & Walter, 2003). Density functions do not seem to be very popular in this context, despite the fact Neural Networks 19 (2006) 429–445 www.elsevier.com/locate/neunet 0893-6080/$ - see front matter q 2005 Elsevier Ltd. All rights reserved. doi:10.1016/j.neunet.2005.10.006 * Tel.: C33 4 88 57 69 02; fax: C33 4 88 57 68 95. E-mail address: courrieu@up.univ-mrs.fr