+ All Categories
Home > Documents > Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms...

Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms...

Date post: 16-Mar-2020
Category:
Upload: others
View: 19 times
Download: 0 times
Share this document with a friend
9
Spatial Aggregation : Language and Applications* Christopher Bailey-Kellogg and Feng Zhao Computer and Information Science The Ohio State University 2015 Neil Ave . Columbus, OH 43210 U .S .A . {kellogg,fz} Qcis .ohio-state .edu Abstract This paper describes the spatial aggregation language and its applications . Spatial aggregation comprises a framework and a mechanism for organizing computa- tions around image-like, analogue representations of physical processes in data interpretation and control tasks ; it transforms a numerical input field to succes- sively higher-level descriptions by applying a small, identical set of operators to each layer given a metric, neighborhood relation and equivalence relation . The spatial aggregation language provides two ab- stract data types (ADTs) - neighborhood graph and field - and a set of interface operators for construct- ing the transformations of the field . The language consists of a library of component implementations from which a user can mix-and-match and specialize for a particular application . The modular design of the ADTs supports language extensions and user con- trol over tradeoffs such as efficiency vs . generality. We illustrate the use of the language with examples ranging from region growing in image analysis to tra- jectory grouping in dynamics interpretation . Pro- grams for these different task domains can be written in a modular, concise fashion in the spatial aggrega- tion language . The language allows users to isolate and express important computational ideas while hid- ing low-level details . Content Areas : Qualitative Reasoning, geomet- ric/spatial reasoning, programming language, ontolo- gies, applications . Introduction Effective reasoning about a physical system requires an appropriate mapping from the system character- istics to abstractions that match the requirements of FZ is supported by an NSF National Young Investi- gator Award CCR-9457802, an Alfred P . Sloan Foundation Research Fellowship, a grant from Xerox Palo Alto Re search Center, and an NSF grant CCR-9308639 . CBK is supported bv FZ's NSF NYI grant CCR-9457802 . KY is supported by an NSF National Young Investigator Award ECS-935777 . Kenneth Yip MIT Artificial Intelligence Laboratory 545 Technology Square Cambridge, MA 02139 U .S .A . yipQmartigny .ai .mit .ed u the task at hand . Spatial aggregation organizes com- putations around image-like, analogue representations of physical processes in data interpretation and control tasks (Yip & Zhao 1996) . In Qualitative Physics, three ontological abstractions are widely used : device, pro- cess, and constraint . Spatial aggregation introduces a new ontological abstraction, the field ontology, to unify many reasoning tasks involving the image-like analogue representations such as the velocity field for fluid motion, phase space for dynamical systems, and configuration space for mechanism analysis . The input to spatial aggregation is a data massive, numerical field . 1 The desired output is a high-level, parsimonious description of the structure and behav- ior of the physical process that the field represents . To bridge the semantic gap between the analogue in- put field and the final symbolic description, spatial ag- gregation introduces layers of intermediate structures called spatial aggregates to capture spatial adjacencies among objects of the field at multiple spatial and tem- poral scales . A spatial aggregate is constructed from a metric, a neighborhood relation and an equivalence re- lation supplied by a user according to the objective of computation . Spatial aggregation transforms the input field to successively higher-level descriptions by apply- ing a small, identical set of operators to each layer of the spatial aggregates . The spatial aggregation framework grows of a class of problem solvers, KAM (Yip 1991), MAPS (Zhao 1994) and HIPAIR (Joskowicz & Sacks 1991), that derive their power primarily from percep- tual operators on analogue representations, and only secondarily from search and analytical methods . These programs have exhibited expert performance on dif- ficult problems in hydrodynamics, nonlinear control, and engineering mechanism analysis . Spatial aggre- gation abstracts the common computational structure out l A field maps one continuum to another . Examples in- clude velocity field (R3 -> R3 ), temperature field (R 3 -a Rl ), image field (R Z -> Rl ), and vector field (R" -+ R") . Bailey-Kellogg 3
Transcript
Page 1: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

Spatial Aggregation : Language and Applications*Christopher Bailey-Kellogg and Feng Zhao

Computer and Information ScienceThe Ohio State University

2015 Neil Ave .Columbus, OH 43210 U.S.A .

{kellogg,fz} Qcis .ohio-state .edu

Abstract

This paper describes the spatial aggregation languageand its applications . Spatial aggregation comprises aframework and a mechanism for organizing computa-tions around image-like, analogue representations ofphysical processes in data interpretation and controltasks ; it transforms a numerical input field to succes-sively higher-level descriptions by applying a small,identical set of operators to each layer given a metric,neighborhood relation and equivalence relation .The spatial aggregation language provides two ab-stract data types (ADTs) - neighborhood graph andfield - and a set of interface operators for construct-ing the transformations of the field . The languageconsists of a library of component implementationsfrom which a user can mix-and-match and specializefor a particular application . The modular design ofthe ADTs supports language extensions and user con-trol over tradeoffs such as efficiency vs . generality.We illustrate the use of the language with examplesranging from region growing in image analysis to tra-jectory grouping in dynamics interpretation . Pro-grams for these different task domains can be writtenin a modular, concise fashion in the spatial aggrega-tion language . The language allows users to isolateand express important computational ideas while hid-ing low-level details .

Content Areas : Qualitative Reasoning, geomet-ric/spatial reasoning, programming language, ontolo-gies, applications .

IntroductionEffective reasoning about a physical system requiresan appropriate mapping from the system character-istics to abstractions that match the requirements of

FZ is supported by an NSF National Young Investi-gator Award CCR-9457802, an Alfred P . Sloan FoundationResearch Fellowship, a grant from Xerox Palo Alto Research Center, and an NSF grant CCR-9308639 . CBK issupported bv FZ's NSF NYI grant CCR-9457802 . KY issupported by an NSF National Young Investigator AwardECS-935777 .

Kenneth YipMIT Artificial Intelligence Laboratory

545 Technology SquareCambridge, MA 02139 U.S .A .yipQmartigny .ai .mit .edu

the task at hand . Spatial aggregation organizes com-putations around image-like, analogue representationsof physical processes in data interpretation and controltasks (Yip & Zhao 1996) . In Qualitative Physics, threeontological abstractions are widely used : device, pro-cess, and constraint . Spatial aggregation introducesa new ontological abstraction, the field ontology, tounify many reasoning tasks involving the image-likeanalogue representations such as the velocity field forfluid motion, phase space for dynamical systems, andconfiguration space for mechanism analysis .The input to spatial aggregation is a data massive,

numerical field . 1 The desired output is a high-level,parsimonious description of the structure and behav-ior of the physical process that the field represents .To bridge the semantic gap between the analogue in-put field and the final symbolic description, spatial ag-gregation introduces layers of intermediate structurescalled spatial aggregates to capture spatial adjacenciesamong objects of the field at multiple spatial and tem-poral scales . A spatial aggregate is constructed from ametric, a neighborhood relation and an equivalence re-lation supplied by a user according to the objective ofcomputation . Spatial aggregation transforms the inputfield to successively higher-level descriptions by apply-ing a small, identical set of operators to each layer ofthe spatial aggregates .The spatial aggregation framework grows

of a class of problem solvers, KAM (Yip 1991),MAPS (Zhao 1994) and HIPAIR (Joskowicz & Sacks1991), that derive their power primarily from percep-tual operators on analogue representations, and onlysecondarily from search and analytical methods . Theseprograms have exhibited expert performance on dif-ficult problems in hydrodynamics, nonlinear control,and engineering mechanism analysis . Spatial aggre-gation abstracts the common computational structure

out

lA field maps one continuum to another . Examples in-clude velocity field (R3 -> R3 ), temperature field (R3 -aRl ), image field (RZ -> Rl ), and vector field (R" -+ R") .

Bailey-Kellogg 3

Page 2: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

and a set of generic operators from these problemsolvers . It can also apply to a wide variety of othertask domains such as image analysis and geographicinformation databases applications . The generic op-erators of spatial aggregation can be viewed as aparticular instantiation of Ullman's "visual routines"for visual information processing tasks (Ullman 1984 ;Mahoney 1995) .Other researchers have developed related frame-

works and systems for reasoning about spatial, ana-logue representations of physical world . For example,Forbus et al . developed the Metric Diagram/Place Vo-cabulary (MD/PV) framework for qualitative spatialreasoning (Forbus, Nielsen, & Faltings 1991) . Chan-drasekaran and Narayanan proposed a direct ana-logue simulation of elementary mechanics problem us-ing a diagrammatic representation (Chandrasekaran &Narayanan 1990) . In comparison, the spatial aggre-gation framework comprises multi-layer spatial aggre-gates with identical computational structure at eachlayer and focuses on the problem of recovering struc-tures from numerical fields .This paper describes the spatial aggregation lan-

guage and its implementation, and the development ofapplications in the style of spatial aggregation . Thespatial aggregation language allows users to isolatethe important computational ideas in different prob-lem domains and provides primitives and means of ab-straction to express these ideas concisely while hid-ing low-level details . More specifically, the languageprovides two abstract data types (ADTs) - neighbor-hood graph and field -- and a set of interface opera-tors for constructing the transformations of the field .The language includes a library of component imple-mentations from which a user can mix-and-match andspecialize for a particular application . The modulardesign of the ADTs supports language extensions anduser control over tradeoffs such as efficiency vs . gen-erality. The language can be extended by providingadditional operators or new implementations for theADTs. We illustrate the use of the language with ex-amples ranging from region growing in image analysisto trajectory grouping in dynamics interpretation . Weshow that programs for these different task domainscan be written in a modular, concise fashion in thespatial aggregation language .

Given an input field, spatial aggregation constructsa neighborhood graph (N-graph) from primitive ob-jects of the field, explicates their spatial adjacencies,and forms equivalence classes of these objects usingan equivalence relation determined by the objective

4 QR-96

Overview

High-Level Description

geomehic ops

,I

Search

Redexhbe~

I L-liae

Lower-Level Objects

ws

Input Field

Higher-Level Objects

Figure 1 : Spatial aggregation : the lower-level objectsfrom the numerical input field are transformed intohigher-level objects through a sequence of operationsavailable in the language . The higher-level objects thenbecome the input to another level of spatial aggrega-tion where the identical set of operators apply .

of the task . An equivalence class can be redescribedas a primitive object at a higher level if necessary,and the identical steps of aggregation to form a newN-graph and classification to form equivalence classesapply with a new metric, neighborhood relation, andequivalence relation . This iteration terminates whenthe desired behavioral and structural description canbe readily derived from the N-graph . The N-graphand field serve as computational glue for the opera-tions that search, transform, and filter the spatial ob-jects . Figure 1 illustrates the data flow in the mainoperations of the language at each level of spatial ag-gregation .

Map, Filler, _

Spatial aggregation represents primitive objects ofa physical process or system with spatial objects . Forinstance, a spatial object might describe a state of adynamcal system -- a point and its direction of move-ment in an n-dimensional phase space spanned by thestate variables . A spatial object comprises a geomet-ric description and a feature description . The geo-metric description is specified in a metric space defin-ing distances between geometric primitives . The fea-ture description belongs to one or more feature spaces .For example, in image analysis, a pixel spatial ob-ject uses the pixel location as the geometric descrip-tion and the associated brightness value as the fea-ture description . Likewise, a region spatial object de-fines a geometric region in an image and an average

Page 3: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

Figure 2: Trajectory bundling operation in phase spacedynamics interpretation : the input field consists ofstates as points in phase space.

or minimum/maximum brightness value of the con-stituent pixels . In a meteorology application, eachspatial object specifies a location in space and a tem-perature, barometric pressure, and air flow velocity infeature space. The distance between values in a fea-ture space represents how different the correspondingspatial objects are. Spatial aggregation forms neigh-borhood graphs for spatial objects using the geometricdescription and groups the spatial objects using simi-larity or proximity measures in feature space. For ex-ample, spatial aggregation could group text with thesame font, using a feature space defined by font char-acteristics . In a mechanism analysis system, it couldgroup configurations in a configuration space .As an example of how spatial aggregation provides

organizational principles and building blocks to facili-tate the development of programs for engineering prob-lems, consider an interpretation task in dynamcal sys-tem analysis . The input is a field of sampled states aspoints in phase space shown in Figure 2 . The objec-tive is to group the states into trajectories and thentrajectories into trajectory bundles that share similarlimit behaviors, as shown in Figure 6 and Figure 9 re-spectively .The first step, aggregation, forms a neighborhood

graph using a neighborhood relation to explicitly in-dicate pairs of adjacent spatial objects . Different ap-plications require different neighborhood relations . Inthe trajectory interpretation application, a minimalspanning tree (MST) is appropriate; other applicationsuse Delaunay triangulations, nearness criteria, and soforth. The spatial aggregation code shown in Figure 3uses the operator aggregate to compute the neigh-borhood graph (the argument points-ngraph-fac -

(define points-ngraph(aggregate input-field points-ngraph-fac))

Figure 3: Aggregation of trajectory points

Figure 4: A neighborhood graph (MST) for the points .

constructed from language library components -- spec-ifies how to build an MST) . Figure 4 shows the result .The operator aggregate allows the user to focus onchoosing a good neighborhood relation while hidingimplementation details.The next main step, classification,, forms equiva-

lence classes of neighboring spatial objects accordingto their similarity in the feature space. In the tra-jectory interpretation example, a point can be consid-ered similar to a neighbor if their separation is not sig-nificantly longer than the distances separating othernearby neighbors . In the code of Figure 5, classifyforms equivalence classes of points from the MST,points-ngraph, by deleting edges that are too long ac-cording to the threshold *point-distance-tol* ; theresult is shown in Figure 6. Other classification mech-anisms, discussed later in the paper, use consistencypredicates to test the classes. The operator classifyallows the user to select an appropriate equivalence re-lation and a classification mechanism .The third main step of spatial aggregation, re-

describing, maps equivalence classes of objects at onelevel to single higher-level objects at the next level .In the trajectory interpretation example, each equiv-alence class of points becomes a single trajectory ob-ject ; Figure 7 shows the spatial aggregation code . Theredescribe operator shifts the level of abstraction sothat the aggregation process can repeat at a higherlevel . The inverse of redescribing is localizing, whichmaps each higher-level object to the equivalence classof constituent objects at the lower level .

Bailey-Kellogg 5

Page 4: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

(define point-classes(classifypoints-ngraph points *point-distance-tol*))

Figure 5 : Classification of trajectory points

6 QR-96

Figure 6 : Points grouped into trajectories labeled by athrough l respectively.

To group trajectories into trajectory bundles, thesame process repeats, using the operators aggregate,classify, and redescribe . The only differences arein the metric, neighborhood relation, and equivalencerelation : trajectories are aggregated into a neighbor-hood graph where the neighborhood is defined by asphere of some fixed radius, and neighboring trajecto-ries are bundled using an equivalence relation compar-ing corresponding vectors along trajectories . Figure 8shows the spatial aggregation code, and Figure 9 showsthe result . The aggregation process can repeat at aeven higher level if necessary . 2As the example demonstrates, programs written in

the spatial aggregation language are modular, using acommon data structure (neighborhood graph) and anidentical set of generic operators (see Figure 10) . Theyare concise and make explicit the important compu-tational characteristics of the problem: neighborhoodand equivalence relations .

Additional operators are available for manipulating

`ln control applications, the trajectory bundles are fur-ther aggregated to form reachability graphs ; see (Zhao1994) .

(define trajs(redescribe point-classes traj/create))

Figure 7 : Redescription of point classes as trajectories

Aggregate the trajectories .(define traj-ngraph

(aggregate trajs traj-ngraph-fac))

Form equivalence(define traj-bundles

(classifytraj-ngraph trajs *vector-similarity-tol*))

classes .

Figure 8 : Aggregation and classification of trajectories

Figure 9 : Trajectories grouped into bundles labeled athrough d respectively.

States

Aggregate

Points N-graph

Classify

Point sets

Redeseribe

Trajectories

Aggregate

Trajectory N-graph

Classify

Similarity threshold

Trajectory bundles

MSTneighborhood

Separation threshold

Spherical neighborhood

Figure 10 : The flow chart of the phase space interpre-tation example .

Page 5: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

Spatial Aggregation Language Features

Data types :

Ngraph and its constructors, accessors, modifiers.Examples of ngraph : 4-adjacency, MST, andVoronoi diagram.

Field and its constructors, accessors, modifiers.Examples of field: array, grid, and k-d tree .

Interface operators:

aggregate, classify, redescribe, localize,search

A user must specify the. neighborhood relation, fieldmetric, and equivalence relation for these operatorsexplicitly, or provide procedures that compute thengraph and equivalence classes .

Table 1: Features of the spatial aggregation language .

the objects in the neighborhood graph. For exam-ple, search starts at any of a list of objects in thegraph and moves from neighbor to neighbor, followingsome desired control strategy (e .g . depth-first search orbreadth-first search) and finding paths satisfying somecriteria . Interfaces to standard geometric and numeri-cal libraries could further extend the capabilities of thelanguage . Table 1 summarizes the main features of thespatial aggregation language .

Spatial Aggregation Language

We describe the spatial aggregation language and itsprototype implementation in Scheme . The languageconsists of operators and abstract data types that auser can choose and instantiate for each spatial aggre-gate layer. A library available in the language containsbasic implementations for each abstract data type andoperator . Other component implementations can bebuilt according to the defined specifications and addedto the library if necessary.We use a region-growing example from image analy-

sis to illustrate the basic features of the language andhow a simple program can be written for the task . Aregion is an area in an image whose pixels share a com-mon property (Zucker 1976) . The program takes asinput a field - an image mapping pixel coordinatesto brightness values - and produces a list of disjointregions of pixels with similar brightness values . Forexample, given the input shown in Figure 11, the pro-gram could produce the regions shown in Figure 12 .The pixel spatial objects encapsulate points and corre-sponding gray-scale values . The points belong to a sub-

1 1 z z 4 4 e e 4 4 z z 1 11 1 z z a a e e a a z z i iz z z z a a a e a a z z z zz z z z a a e e a a z z z za a a

a a e e a

a a aa n a a a e a a a

a e e e e e e e a e e e e ea e e a e e e a e e e e e ea a a n a a e e a a a n a a

a a a a a a a a az z z z a a e e a a z z z zz z z z a a e e a a z z z zi i z z a n e e a a z z 1 1

1 1 z z 4 a 8 s 4 4 z z - 1

Figure 11 : Input Image: A 14 x14 array ofpixels . Eachpixel has a coordinate and a brightness value.

Figure 12 : Output Image: five regions -a through e- consisting of pixels of similar brightness .

space of an Euclidean plane R2 , and the feature spacecomprises gray-scale values from the set {0,1, . . ., 255}-a subspace ofRl . Pixels are neighbors by the stan-dard 4-adjacency relation .

The field and N-graph abstract data types

Two abstract data types, the field and the ngraph,form the core of the spatial aggregation language . Theoperations of an abstract data type are separated intoprimary operations defining the basic capabilities of thedata type in terms of its representation, and secondaryoperations (also called capabilities) providing extendedfunctionality layered over the primary operations. Thechoice of primary and secondary operations is deter-mined by the requirement of basic functionality andfuture language extension (Weide, Ogden, & Zweben1991) .The abstract data types are highly parameterized .

Each different implementation of an abstract data typeprovides an instantiate procedure that takes the pa-rameters and returns a facility defining the primaryoperations . Parameters include functions specifyinghow to manipulate generic objects, and facilities forother data types used in the implementation . A facilityis a function that, given a primary operation's name,returns the appropriate function . Each different imple-mentation of asecondary operation also provides an in-

Bailey-Kellogg

Page 6: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

(define image-field-fac(field-array/instantiate '(256 256)

pixel/point))

Figure 13 : Field instantiation for region growing

stantiate procedure that returns the secondary opera-tion . While the basic abstract data types are highly pa-rameterized, the library also provides data types whoseparameters are partially instantiated with commonly-used values . The library allows users to choose amongimplementations trading efficiency with generality.Field

The first major component making up the spa-tial aggregation language is the field abstract datatype . A f ield defines a metric space for the geometricdescriptions of spatial objects, and can answer spatialqueries . The interface provided by a f ield facility pro-vides a function create to collect objects into a field,a function domain to return the objects defined in thefield, and a function near to return objects within agiven distance of a specified object . The syntax ofthese operators is omitted here due to the space limita-tion ; interested readers are referred to (Bailey-Kellogg,Zhao, & Yip 1996) for details .Many different spatial indices can serve as implemen-

tations for f ield . The current component library con-tains array and grid implementations, a k-d tree imple-mentation, and a simple list implementation that com-pares objects pairwise . These components are generic,with instantiation parameters indicating how to ex-tract geometric descriptions, how to measure distances,and so forth . Fields can also be defined intensionally orinterpolated from sample data points ; library compo-nents allow user-specified intensional and interpolationfunctions .A 256 by 256 array field suffices for storing pixel

values in the region-growing application, as shown inFigure 13 .N-graph

Thesecond main component of the spatialaggregation language is the ngraph abstract data type .An ngraph defines a neighborhood relation for a setof spatial objects, and can return the neighbors of anygiven object defined in the ngraph . The interface of anngraph facility provides a function create to aggregatethe objects of a field, and a function neighbors toreturn the neighbors of a specified object .A wide variety of ngraph implementations support

different neighborhood relations; each implementationuses a field facility indexing the objects to be ag-gregated . One implementation considers an object'sneighbors to be all other objects within some distance

8 QR-96

(define image-ngraph-fac(ngraph-near/instantiate image-field-fac 1))

Figure 14 : Ngraph instantiation for region growing

(define image-ngraph(aggregate pixels image-ngraph-fac))

Figure 15 : Aggregation of region-growing input

in the field . Another implementation builds a min-imal spanning tree of all objects and returns neigh-bors according to the minimal spanning tree . A thirdimplementation builds a Delaunay triangulation withobjects as vertices . Finally, a very generic imple-mentation allows the user to specify a neighborhood-generating function . For example, a simple way to pro-gram an 4-adjacency neighborhood relation would beto provide a function that generates the four surround-ing points and returns those defined in the field .The code for the region-growing example, shown in

Figure 14, defines a 4-adjacency neighborhood relationin terms of the nearness ngraph : return as a pixel'sneighbors all pixels within a distance of one pixel.

Interface OperationsThe spatial aggregation language provides the opera-tions of Table 1 to manipulate primitive objects andneighborhood graphs .Aggregate

Aggregation groups objects of a field intoa neighborhood graph . The function takes a field,along with an ngraph facility, and returns an ngraph :

aggregate : objects * ngraph-fac -+ ngraph

This is simply syntactic sugar for the ngraph ADT'screate primary operation .

Figure 15 shows the code to form a neighborhoodgraph for the region-growing application, with the ob-jects from the image in Figure 11 . The pixels listincludes all pixels in the image.Classify Classification is performed by an ngraphsecondary operation . Given an ngraph, a list of ob-jects to classify, and a threshold for feature similarity,this operation returns a list of equivalence classes (listsof objects) :

classify : ngraph * objects * threshold -+ classes

The objects argument specifies the portion of anngraph to classify, since the ngraph can be very large

Page 7: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

in space . There are several possible ways to deter-mine what threshold to use for object similarity, eachof which is supported by an implementation in the lan-guage library :

1 . Standard : The easiest approach is to rely on a user-specified threshold . Objects are considered similarif they are neighbors in an ngraph and their differ-ence according to the specified difference functiondoes not exceed the threshold . An instantiation pa-rameter specifies how object differences should bemeasured . Equivalence classes are found by takingthe transitive closure of this similarity relation acrossneighboring nodes . 3

2 . Splitting : A more advanced method of determininga threshold is called splitting classification . To find athreshold by splitting, the system first classifies witha loose threshold . It then applies a user-suppliedconsistency check to each ofthe resulting equivalenceclasses . Classes that pass the consistency check areadded to the results . Classes that fail the consis-tency check are reclassified with a tighter threshold .If the threshold bottoms out, failure is reported .

3 . Merging: The third method for determining athreshold is called merging classification . To finda threshold by merging, the system starts classifica-tion using a tight threshold . It then examines theresulting classes and merges those that are similar .To determine which classes are similar, it views theclasses as higher-level objects and aggregates themas another invocation of spatial aggregation .

4 . Stabilizing : The final classifying method currentlyin the library is called stabilizing classification . Sta-bilizing classification compares the classificationsyielded by a particular difference measure over arange of thresholds . It returns the classification thatpersists over the largest subrange of thresholds .

The code in Figure 16 takes the ngraph yielded bythe code in Figure 15 and produces the classificationof Figure 12 . The instantiation uses a difference mea-sure that compares pixel values and considers themequivalent if their difference doesn't exceed the spec-ified threshold . Different instantiations could replacethis classification method with one of the more power-ful approaches .

3More precisely, two objects Oo and O, are consideredequivalent if there exists a sequence of objects Oo, Oi, . . .,On such that Oi and Oi+i, for i from 0 to n-1, are adjacentin ngraph and similar according to the similarity measure .The equivalence relation thus defined is a subset of thetransitive closure of the neighborhood relation .

(define classify(classify-standard/instantiateimage-ngraph-fac(lambda (nl n2)(abs (- (pixel/value ni)

(pixel/value n2))))))

(define classes(classify image-ngraph pixels *thresh*))

Figure 16 : Simple classification of region-growing in-put

(define regions(redescribe classes region/create))

Figure 17 : Redescribing equivalence classes as regions

Redescribe Redescribing maps equivalence classesto higher-level objects . The function takes a listof equivalence classes and a function to construct ahigher-level object from a list of lower-level objects,and it returns a list of higher-level objects :

redescribe : classes * redescribe-function -4 ob-jects

Given a function region/create to create a regionobject from a list of pixels, the code in Figure 17 per-forms the redescribing for the region-growing example.

Localize

Localize inverts the work of redescribe . Ittakes a list of higher-level objects and a function toconvert a higher-level object to its constituent lower-level objects, and returns a list of lists of lower-levelobjects :

localize : objects * localize-function -> objects

Given a function region/pixels to return a list ofpoints in a region, the code in Figure 18 generates thepoints forming the regions computed by the redescribeabove .

Other operations N-graph secondary operationsprovide extended functionality. For example, a searchoperation returns paths through a neighborhood graphstarting from any of a list of objects and satisfyingspecified goal predicate :

search: ngraph * objects * goal-predicatepaths

Different implementations of this operation would pro-vide depth-first control, breadth-first control, and soforth .

Bailey-Kellogg 9

Page 8: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

(define classes(localize regions region/pixels))

Figure 18 : Localizing a region into its equivalence class

Finally, a variety of other operations, such as thestandard Lisp operations map and filter, along withvarious geometric operations, manipulate primitive ob-jects.

Application Domains of the Language

This section describes several application domains forthe spatial aggregation language . In addition to imageanalysis and dynamical system analysis tasks, the spa-tial aggregation language is applicable to a wide rangeof other problem domains. Preliminary prototypicalimplementations have been developed for a number ofthese applications ; others are under development .

Dynamical system analysis

Spatial aggregation generalizes KAM (Yip 1991),MAPS (Zhao 1994), and a number of other pro-grams (Bradley 1992 ; Nishida & others 1991 ; Sacks1991) for analyzing nonlinear dynamical systems . Ac-cording to modern dynamical systems theory, the qual-itative behaviors of a nonlinear dynamical system canbe described by the geometric features in phase space.Once the appropriate metrics and equivalence relationsare defined, the spatial aggregation language can nat-urally express the operations in analyzing dynamics inphase space, as the trajectory interpretation examplehas already illustrated.

Fluid flow motion analysis is another domain wherespatial aggregation can be used to aggregate flow linesinto coherent bundles (Yip 1995) .

Mechanical mechanism analysis

A mechanical mechanism analysis determines the fea-sibility of a mechanism . HIPAIR is a program for thistask (Joskowicz & Sacks 1991) . A mechanism is oftendescribed in a configuration space where each dimen-sion represents an independent degree of freedom. Theconfiguration space consists of blocked space (impossi-ble configurations) and free space (possible configura-tions) . Spatial aggregation can be used determine thefeasibility of a mechanism by clustering configurationsinto sign-invariant regions (free space or blocked spaceregions) with a Hausdorff distance measure betweensets of points and then analyzing the connectedness ofthe free-space regions.

10 QR-96

Image analysisWe have shown how the region growing operation canbe coded in the spatial aggregation language . Otherimage analysis operations such as boundary tracingand segmentation can be likewise programmed . Ma-honey (Mahoney 1995) developed a library of elemen-tary image analysis operations in the style of Ullman'svisual routines . An interesting open problem is to re-implement the Ullman's set of visual routines in thespatial aggregation language .

Other applicationsAuditory scene analysis attempts to differentiate con-current acoustic signals generated by distinct sources.An auditory scene is an image in which signals areseparated by features such as tones, onset times andoffset times. Spatial aggregation can partition an audi-tory scene into groups based on feature similarity andhence separate acoustic signals from distinct sources .Data mining is another potential application do-

main . Data mining extracts regularities from a massiveamount of data using correlation and generalization .The space of possible relationships among data itemsis very large and prohibits a brute-force search . Bydefining appropriate metric and equivalence relationsfor the data items, spatial aggregation might be able toexploit the spatial adjacencies among data and hencereduce the need to search .

Geographic information databases are another areain which the neighborhood of data items is alreadydefined in a geographic space.

Language Experience`Ve have developed several small-scale application pro-grams written in this language . Based on our experi-ence, programming in the spatial aggregation languagehas several advantages :

1 . The language allows a user to isolate what is impor-tant and express the important computational ideasin terms of the formation of equivalence classes andthe transformation of neighborhood graphs, whilehiding low-level implementation details. For exam-ple, the classify operator provides means for a userto specify and search for appropriate classificationthresholds . The resulting programs are modular andconcise .

2 . The language provides field and N-graph data typesfor naturally representing physical objects in contin-uous domains. Field is a commonly used abstrac-tion in science and engineering and hence facilitatesthe scientific and engineering applications of the lan-guage. N-graph serves as a common interface for

Page 9: Spatial Aggregation: Language andApplications*spatial objects are. Spatial aggregation forms neigh-borhoodgraphsforspatialobjects using thegeometric description and groups the spatial

developing programs . The interface operators areidentical for different layers of spatial aggregation.

For a given task, a user can craft a program by mix-ing and matching and specializing components fromthe library provided by the language . A user hasfine control over efficiency and generality in the lan-guage implementation and can extend the languagecapability by adding additional component imple-mentations . Specializing data types through par-tial instantiation can improve performance; so can amore efficient implementation of a component . Forexample, a k-d tree field facility that replaces a gridcan improve the object indexing performance in ma-nipulating non-uniformly distributed points .

The current implementation of the language is lim-ited in a number of ways . We plan to incorporate ad-ditional types of components, provide additional com-ponent implementations, and improve computationalefficiency of the implementation . Other goals includethe implementation of lazy evaluation and incrementalanalysis and update for N-graphs . To apply the lan-guage to large-scale problems, we need to build inter-faces to existing numerical and computational geome-try libraries so that the language can tap the power ofthe existing software base .

ConclusionWe have described an implemented language that sup-ports programming in the style of spatial aggregationfor a number of small-scale applications ranging fromdynamics interpretation to image analysis . The spa-tial aggregation language provides primitives - field,N-graph, and a small set of operators - and meansof abstraction for building problem solvers that deriveconcise symbolic descriptions from analogue represen-tations of physical phenomena. Our experience pro-vides evidence that the language supports the devel-opment of modular programs at an appropriate levelof abstraction.A central problem in artificial intelligence is to un-

derstand and construct the mappings from analoguesignals to symbols and back . Spatial aggregationachieves a descriptive economy for an analogue in-put field by successively forming equivalence classes oflower-level objects and transforming a multi-layer ofspatial aggregates, and is a possible realization of thesignal-to-symbol mapping. Many important researchquestions remain open : What class of scientific prob-lems can be formulated and solved in the style of spa-tial aggregation? Is there biological evidence that thebrain might be performing spatial aggregation? What

are other styles of reasoning that might bridge the ana-logue signals with the symbols?

ReferencesBailey-Kellogg, C . ; Zhao, F. ; and Yip, K. 1996 . Spa-tial aggregation : language and applications . Techni-cal Report OSU-CISRC-1/96-TR04, Department ofComputer and Information Science, The Ohio StateUniversity.Bradley, E. 1992 . Taming chaotic circuits . TechnicalReport AI-TR-1388, MIT Artificial Intelligence Lab.Chandrasekaran, B., and Narayanan, N. 1990 . To-wards a theory of commonsense visual reasoning . InNori, K ., and Madhavan, C., eds ., Foundations ofSoftware Technology and Theoretical Computer Sci-ence . Springer .Forbus, K. ; Nielsen, P. ; and Faltings, B . 1991 . Qual-itative spatial reasoning : the CLOCK project . Arti-ficial Intelligence 51 .Joskowicz, L., and Sacks, E. 1991 . Computationalkinematics . Artificial Intelligence 51 :381-416 .Mahoney, J . 1995 . Signal-based figure/ground sepa-ration . Preprint .Nishida, T., et al . 1991 . Automated phase portraitanalysis by integrating qualitative and quantitativeanalysis . In Proceedings of AAALSacks, E. 1991 . Automatic analysis of one-parameterplanar ordinary differential equations by intelligentnumerical simulation . Artificial Intelligence 51:27-56 .Ullman, S. 1984 . Visual routines . Cognition 18 .Weide, B . ; Ogden, W.; and Zweben, S . 1991 .Reusable software components . Advances in, Com-puters 33:1-65 .Yip, K. M ., and Zhao, F. 1996 . Spatial aggregation:Theory and applications . J. Artificial Intelligence Re-search. To appear .Yip, K . M. 1991 . KAM. A system for intelligentlyguiding numerical experimentation by computer . MITPress.Yip, K. M. 1995 . Reasoning about fluid motion : Find-ing structures . In Proceedings of IJCAI.Zhao, F. 1994 . Extracting and representing quali-tative behaviors of complex systems in phase spaces .Artificial Intelligence 69(1-2) :51--92.Zucker, S. 1976 . Region growing: childhood and ado-lescence . Comput. Graphics Image Process. 5 .

Bailey-Kellogg


Recommended