## Parametric Weighted Finite Automata and ... - CiteSeerX

terms of finite-state devices called parametric weighted finite automata (PWFA). ... In common text-books on âFormal Languagesâ and âAutomata Theoryâ finite.

Parametric Weighted Finite Automata and Multidimensional Dyadic Wavelets German Tischler1 , J¨ urgen Albert1 and Jarkko Kari2 1 2

Lehrstuhl f¨ ur Informatik II, Universit¨ at W¨ urzburg, Am Hubland, D-97074 W¨ urzburg, Germany {tischler,albert}@informatik.uni-wuerzburg.de Department of Mathematics, University of Turku, FIN-20014 Turku, Finland [email protected]

Summary. Wavelets have found many applications in signal-analysis and as transform-functions in image compression, e.g. in JPEG 2000. This paper studies representations of well-known types of wavelets and their multidimensional variations in terms of ﬁnite-state devices called parametric weighted ﬁnite automata (PWFA). Since these PWFA can also simulate easily generalizations of iterated function systems, they provide a framework for fractal-type functions. PWFA are strictly more powerful than IFS and WFA. But also smooth functions like polynomials, sine, cosine etc. can be generated by small PWFA. Thus, we underline the fractal nature of the considered types of wavelets and open new perspectives on their representations and computation-algorithms. We provide convenient methods to display linear combinations of dilations and translations of one wavelet in a single compact automaton. These methods do not depend upon orthogonality or separability of the wavelet basis.

1 Introduction In common text-books on “Formal Languages” and “Automata Theory” ﬁnite automata (FA) mainly appear as acceptors, i.e. for arbitrary input-sequences they are deciding whether or not those are members of some regular set. Reading inputs sequentially, symbol by symbol, yields corresponding transitions from states to states within the ﬁnite automaton. After reading the last symbol, acceptance of the total input is decided by checking whether the current state can be a ﬁnal state (see e.g. ). Thus, ﬁnite acceptors can be viewed as representations of Boolean functions over all possible input-sequences. Finite automata are nondeterministic in general, so the Boolean result for an inputsequence is true, iﬀ there exists at least one accepting transition-sequence for it. With an appropriate interpretation of input-symbols (e.g. {0, 1, 2, 3}) as labels of quadrants in the unit-square, it is easy to associate bi-level images to ﬁnite automata. The acceptance pattern of all input-sequences of length

2

German Tischler, J¨ urgen Albert and Jarkko Kari

k thus yields an image of resolution 2k × 2k of black or white pixels. Even extremely simple ﬁnite automata can generate fractal (self-similar) patterns under this interpretation. The best known example is probably the Sierpinskitriangle, which only needs one state, which is also ﬁnal, and transitions of this state into itself for the input-symbols 0, 1, and 2, the automaton as well as the corresponding image is shown in ﬁgure 1. Weighted ﬁnite automata (WFA) were introduced as a generalization of non0

1

1

0

1

0,1,2

1

Fig. 1. Generated bi-level images of resolutions 4 × 4 and 256 × 256 and a corresponding NFA

deterministic ﬁnite automata by Culik II and Karhum¨aki in  as generators of real-valued functions. These functions can be viewed then as greyscale images. Given a nondeterministic FA N = (S, Σ, T, I, F ) with set of states S, input-alphabet Σ, transitions T ⊆ S ×Σ ×S, initial states I ⊆ S and ﬁnal states F ⊆ S. Then we consider the above subset-relations as functions, i.e. t(s0 , a, s1 ) = 1 iﬀ (s0 , a, s1 ) ∈ T , i(s) = 1 iﬀ s ∈ S and f (s) = 1 iﬀ s ∈ F , where t, i and s are the obvious total Boolean functions. For WFA these functions now become real functions and the automaton computes a real value for each input word instead of just accepting or rejecting. For a WFA the value computed for each word w is the sum of all path-values for w, where each path-value is given by starting with the initial value of the chosen initial state, multiplying it by the edge weights of all the edges along the path and at last by the ﬁnal value of the ﬁnal state that has been reached. The formal deﬁnition of the functions t, i and f is conveniently given in matrix and vector form. Definition 1. A WFA is a quintuple W = (S, Σ, W, I, F ) where 1. S = {0, 1, . . . , n − 1} is a finite set of states, 2. Σ = {0, 1, . . . , l − 1} is a finite alphabet, 3. W = {W0 , W1 , . . . , Wl−1 } is a set of transition matrices where Wi ∈ IRn×n for each i ∈ Σ, 4. I T ∈ IRn is the initial distribution and 5. F ∈ IRn is the final distribution.

3

The real value A(x) which the WFA A computes for an input word x ∈ Σ ∗ is |x|−1



A(x) = I

Wxi F

(1)

i=0

where as usual Σ ∗ denotes the set of ﬁnite words over Σ, |x| the length of the word x and xi ∈ Σ the i-th symbol in x. Each input word x is interpreted as a real number by assigning the value |x|−1

x=



xi |Σ|−i−1

(2)

i=0

to it. To compute real functions on the unit interval [0; 1] we need words of inﬁnite length. This is done by using a limit construction A(x) = lim A(x0,n−1 ) n→∞

(3)

where x0,n−1 denotes the ﬁrst n symbols of the word x that is chosen to be an element of Σ ω , the set of words of inﬁnite length over Σ. If this limit does not exist for a certain word, the function of the automaton is undeﬁned at that point.  shows that all polynomials can be represented on the unit interval by simple WFA, so-called line-automata.  had found that polynomials are the only completely smooth functions (having all derivatives everywhere in the unit interval) that are computable by WFA. For this fact there is a new and independent proof by J. Kari, M. Droste and P. Steinby. WFA were shown to be successful tools for compressing still images and video, see for example , , ,  or . The compression quality is usually slightly below state of the art wavelet codecs like JPEG 2000, but the runtime performance of the decoder is better. Culik II and Dube showed in  that WFA can be used to compute the scaling functions, wavelets and wavelet transforms implied by Daubechies orthonormal compactly supported wavelets . PWFA were ﬁrst described in . They generalize WFA by introducing a parameter d that is called the dimension of the automaton. A PWFA can have d initial distributions instead of one. Formally, we use an initial matrix instead of an initial vector. The vectors for each dimension form the rows of this initial matrix. The formal deﬁnition otherwise stays the same, but the deﬁnition of the computed set S(A) for a PWFA A is S(A) =

∞ 

S≥n

(4)

Si (A)

(5)

n=0

where S≥n (A) =

∞  i=n

4

German Tischler, J¨ urgen Albert and Jarkko Kari

and Si (A) = {A(x)|x ∈ Σ i }

(6)

where the overline notation in equation 4 denotes the topological closure of the set under the line. A vector v ∈ IRd is in S(A) iﬀ there is an inﬁnite sequence of words of strictly growing length 0 x, 1 x, 2 x, . . . such that v = lim A(n x). n→∞

(7)

The PWFA computable sets include all iterated function system (IFS) computable sets, Recurrent IFS computable sets and Mutual Recursive Function Systems (MRFS)  computable sets.

2 Multidimensional Dyadic Wavelets and PWFA The L2 -norm of a function f : IR → IR is deﬁned as   12 2 f (x) dx ||f ||L2 =

(8)

IR

and L2 (IR) denotes the space of square integrable functions that means f ∈ L2 (IR) iﬀ ||f ||L2 < ∞. For WFA functions in L2 ([0; 1]) i.e. functions that have support on [0; 1] are considered, for PWFA this restriction is not necessary. A (m) wavelet basis for L2 (IR) is a family of functions ψn (t) that are all derived from a single function called the ,,mother wavelet” ψ(t) by translation and dilation, according to √ (9) ψn(m) (t) = 2−m ψ(2−m t − n) for n, m ∈ ZZ (m)

such that the ψn (t) are linearly independent and span L2 (IR). See for example  for an introduction to this topic. The scope of this paper is limited to dyadic wavelets, where the dilation is expressed only in powers of 2. In the case of  these functions are not only linearly independent but also orthonormal. To be relevant for most applications, the wavelet also needs to have compact support. In this paper, only wavelets with ﬁnite impulse response (FIR) are considered. Wavelets are related to multi-resolution analysis . One central term in this context is that of the scaling function ∞ √  g0 [n]φ(2t − n) φ(t) = 2

(10)

n=−∞

where g0 [n] ∈ IR is a coeﬃcient sequence. Given that this sequence satisﬁes certain properties, a mother wavelet can be built from the scaling function as ψ(t) =

∞ √  2 g1 [n]φ(2t − n) n=−∞

(11)

5

where g1 [n] = (−1)n+1 g0 [−(n − 1)].

(12)

The extension of the scaling function to a higher dimension is straightforward: √ ∞ ∞ φ(t1 , . . . , td ) = ( 2)d n1 =−∞ . . . nd =−∞ (13) g0 [n1 , . . . , nd ]φ(2t1 − n1 , . . . , 2td − nd ) We can apply the scheme used in  to construct a WFA that computes a dilation of the generated function on a subset of the unit hypercube of dimension d. In the example of a 2 dimensional scaling function based on 3 coeﬃcients for each dimension one obtains ⎧ g(0, 0)Φ01,01 (2t1 , 2t2 ) for 0 ≤ t1 < 1/2, ⎪ ⎪ ⎪ ⎪ 0 ≤ t2 < 1/2 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ g(1, 0)Φ01,01 (2t1 − 1, 2t2 )+ for 1/2 ≤ t1 < 1, ⎪ ⎪ ⎪ ⎪ g(0, 0)Φ12,01 (2t1 − 1, 2t2 ) 0 ≤ t2 < 1/2 ⎪ ⎪ ⎪ ⎪ ⎨ for 0 ≤ t1 < 1/2, Φ01,01 (t1 , t2 ) = g(0, 1)Φ01,01 (2t1 , 2t2 − 1)+ ⎪ ⎪ g(0, 0)Φ (2t , 2t − 1) 1/2 ≤ t2 < 1 ⎪ 01,12 1 2 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ g(1, 1)Φ01,01 (2t1 − 1, 2t2 − 1)+ for 1/2 ≤ t1 < 1, ⎪ ⎪ ⎪ ⎪ g(1, 0)Φ01,12 (2t1 − 1, 2t2 − 1)+ 1/2 ≤ t2 < 1 ⎪ ⎪ ⎪ ⎪ g(0, 1)Φ (2t − 1, 2t − 1)+ ⎪ 12,01 1 2 ⎪ ⎩ g(0, 0)Φ12,12 (2t1 − 1, 2t2 − 1) etc. for the functions Φ01,12 , Φ12,01 and Φ12,12 according to lemma 1 in . An example of a constructed WFA is given in ﬁgure 3. As there is control over the coordinate axes for PWFA, this cube can be scaled to the original area of support of the scaling function. One minor problem present in  for WFA is that points outside the support of the function have to be computed too. This can be overcome in the same way as in  for B-splines, by mapping the unused words to other sub-intervals of the support. In certain cases the structural similarities between the automata computing scaling functions and B-splines are not only syntactical but also semantically motivated. The 3 tap scaling function of the well-known 5/3 ﬁlter, to give an example, is the uniform linear B-spline. A WFA computing this function is shown in ﬁgure 2. In the case of a separable transform equation (13) can be rewritten as √ ∞ ∞ φ(t1 , . . . , td ) = ( 2)d n1 =−∞ . . . nd =−∞ (14) g0 [n1 ] . . . g0 [nd ]φ(2t1 − n1 , . . . , 2td − nd ). Although the examples given in this paper are all separable, separability is not a necessary condition to build a WFA or PWFA from a scaling function of a multiresolution analysis. The original deﬁnition of the term multiresolution analysis is based on an orthonormal set of basis scaling functions. This can be relaxed to the so called bi-orthogonality equation

6

German Tischler, J¨ urgen Albert and Jarkko Kari

Φ02 0:1

1:1 1:0.25

0:0.25 1:0.5

Φ01

Φ12

0:0.25

0:0.5 1:0.25

Fig. 2. WFA computing uniform linear B-spline (left) and its curve (right)

Φ02,02

2:1 0:1 0:0.0625 1,2:0.125 3:0.25

3:1 1:1

1:0.0625 3:0.125

Φ01,01

Φ12,01 0:0.0625

0:0.0625 2:0.125

0,3:0.125 1:0.0625 2:0.25

1:0.0625 2:0.0625 3:0.125

0:0.0625 1:0.125

0:0.125 1:0.0625

2:0.125 3:0.0625

2:0.0625

0,3:0.125 1:0.25 2:0.0625

1:0.125 3:0.0625 Φ01,12

3:0.0625 Φ12,12

0:0.125 2:0.0625

0:0.25 1,2:0.125 3:0.0625

Fig. 3. WFA computing separable scaling function of dimension two for 3 tap

 prototype 14 , 12 , 14 (left) and its image (right)



 (m) ˜ ψn(m) , ψ˜n˜ = δ[n − n ˜ ]δ[m − m]∀n, ˜ m, n ˜, m ˜ ∈ ZZ

(15)

where ψ˜ denotes the dual wavelet of ψ while keeping the perfect reconstruction property. Biorthogonal transforms are popular in image compression because they, unlike orthonormal transforms (with the exception of the Haar wavelet), allow perfect reconstruction linear phase FIR transforms for two channels ﬁlterbanks resulting in dyadic decompositions of images. Linear phase ﬁlters satisfying either

or

−iωd ˆ ˆ h[d + n] = h[d − n] ; h(ω) = ±|h(ω)|e

(16)

ˆ ˆ h[d + n] = −h[d − n] ; h(ω) = ±|h(ω)|i × sgn(ω)e−iωd

(17)

ˆ denotes the Discrete Fourier Transform of h) have a symmetric or (where h anti-symmetric impulse response relative to some center of symmetry d. For images there is no cause to assume that the correlation of points is biased towards a certain direction, so choosing linear phase symmetric basis functions to decompose images seems natural. Popular transforms used in image

7

processing and compression are the 5/3 ﬁlter shown in ﬁgure 3 and the 9/7 ﬁlter shown in ﬁgure 4 presented in .

Fig. 4. 7 tap scaling function of 9/7 ﬁlter, left to right: 1D, 2D grey, 3D two color and 2D grey computed with 4096 grey levels where the modul of 256 is shown. Display of the corresponding WFA having 12 (1D) respectively 57 (2D) states is omitted.

The structure of a PWFA computing a scaling function can be seen in ﬁgure 5. There are three parts in the automaton:

Tree

Recurrent function system

... Coordinate axes

Fig. 5. Construction scheme for PWFA computing a scaling function

1. Recurrent function system (RFS): contains the sub-hypercube funcd−1 tions Φa0 ,...,ad−1 . It has i=0 ki states, where ki ∈ IN is the maximum distance of two non-zero coeﬃcients in component i. 2. Tree is a tree of order 2d , where d is the dimension of the scaling function. The tree has enough leaves so every Φa0 ,...,ad−1 can be attached to a diﬀerent outgoing edge of a leaf corresponding to its coordinates. The leaves all have the same distance from the root of the tree. 3. Coordinate axes: These states are used to compute the d coordinates the function depends on. The structure shown in ﬁgure 5 refers to the case where the tree is complete. If the tree is not complete, this part is also preﬁxed with a tree of order 2d to remap coordinates outside the support of the function to coordinates inside. The tree part is also adjusted to reﬂect this mapping. The number s of PWFA states needed to compute a separable scaling function of dimension d with k nonzero coeﬃcients is therefore in

8

German Tischler, J¨ urgen Albert and Jarkko Kari

⎡

⎤

⎜ ⎟ k  d ⎜ d ⎟ 2d k ⎜ ⎥ ⎢ k + d + ⎢ d ⎥ + ... + 1+ d + 1 ⎟ O ⎜    ⎟ 2 ⎢ 2 ⎥ ⎝ RFS ⎠ coord.−axes    d

(18)

tree

9

Assume that we have two WFA computing functions f (x) and g(y). Then f and g can be extended so f ignores every odd positioned symbol in its input and g every even. The Cartesian product automaton of f and g then computes (f g)(x, y) where the input is interleaved. The straightforward method to let f and g ignore input symbols is to double the number of their states by introducing a copy of every state. So there are two strategies to build automata computing multidimensional wavelets: 1. Keep two labels while multiplying the state number of the one dimensional case by 2d−1 or 2. use 2d labels while keeping the state number of the one dimensional case. This leaves the number of basic operations necessary to decode the automaton for a certain output roughly untouched, but it changes the length of the words used. A nice application of wavelet linear combinations is shown in ﬁgure 6. Assume that a topological map supplies height information as samples depending on longitude and latitude. Then we can build a greyscale image from this map at a certain resolution and transform this image in virtue of a given wavelet transform and build a PWFA from the given transform coeﬃcients. Result vectors produced by decoding this PWFA can be interpreted in various ways e.g. as an approximation of the original samples of a greyscale image or as a 3D model of the landscape.

Fig. 6. Wavelet cliﬀs

3 Conclusion We have shown that the construction scheme described in  can also be applied to the more recent non-orthonormal compactly supported scaling functions and wavelets resulting from a multiresolution analysis. Separability is not a necessary condition to build PWFA from scaling functions and wavelets. Linear combinations of dilated and translated instances of a mother wavelet

10

German Tischler, J¨ urgen Albert and Jarkko Kari

can be represented compactly with PWFA for any dimension. It is still an open problem whether the WFA inference algorithms can be generalized to PWFA.

References 1. Albert J, Kari J (1999) Parametric Weighted Finite Automata and Iterated Function Systems. Proceedings L’Ing´enieur et les Fractales - Fractals in Engineering, Delft, 248–255 2. Barnsley M, Elton J, Hardin D (1989) Recurrent Iterated Function Systems. Constructive Approximation 5:3–31 3. Cohen A, Daubechies I, Feauveau JC (1992) Biorthogonal bases of compactly supported wavelets. Comm. Pure Appl. Math. 45(5):485–560 4. Culik II K, Kari J (1993) Image Compression Using Weighted Finite Automata. Computers and Graphics 17:305–313 5. Culik II K, Kari J (1994) Eﬃcient Inference Algorithm for Weighted Finite Automata. In Fractal Image Encoding and Compression, ed. Y. Fisher, SpringerVerlag, 243–258 6. Culik II K, Dube S (1993) L-systems and mutually recursive function systems. Acta Informatica 30:279–302 7. Culik II K, Dube S (1997) Implementing Daubechies wavelet transform with weighted ﬁnite automata. Acta Informatica 34:347–366 8. Culik II K, Karhum¨ aki J (1994) Finite automata computing real functions. SIAM Journal on Computing (23) 4:789–814 9. Daubechies I (1988) Orthonormal basis of Compactly Supported Wavelets. Comm. Pure Appl. Math. 41:909–996 10. Derencourt D, Karhum¨ aki J, Latteux M, Terlutte A (1996) On Computational Power of Weighted Finite Automata. Fundamenta Informatica 25:285–293 11. Hafner U, Albert J, Frank S, Unger M (1998) Weighted Finite Automata for Video Compression. IEEE Journal on Selected Areas in Communications 16:108–119 12. Hafner U (1999) Low Bit-Rate Image and Video Coding with Weighted Finite Automata. PhD Thesis, Universit¨ at W¨ urzburg 13. Hopcroft JH, Ullman JD (1979) Introduction to automata theory, languages and computation. Addison Wesley 14. Katritzke F (2001) Reﬁnements of Data Compression Using Weighted Finite Automata. PhD Thesis, Universit¨ at Siegen 15. Mallat S (1989) Multiresolution Approximation and Wavelets. Transactions of American Mathematical Society 315:69–88 16. Taubman DS, Marcellin MW (2002) JPEG2000 Image Compression Fundamentals, Standards and Practice. Kluwer Academic Publishers 17. Tischler G (2004) Parametric Weighted Finite Automata for Figure Drawing. Proc. CIAA 2004, LNCS 3317:259–268 18. Tischler G (2004) Properties and applications of parametric weighted ﬁnite automata. submitted for publication