Invariant Spectroscopic Pattern Recognition Using Mellin Transforms

presence of relatively severe translations, scale changes, and nonlinear distortion in their spectra. Thirdly, the invariance properties of Mellin tra...
0 downloads 0 Views 1MB Size
Anal. Chem. 1994, 66,3925-3936

Invariant Spectroscopic Pattern Recognition Using Mellin Transforms Mark Selby' and Roy J. Hughes Analytical Spectroscopy Group, Centre for Instrumental and Developmental Chemistry, Queensland University of Technology, G.P.0. Box 2434, Brisbane, Queensland 400 I , Australia

The Mellin transform and its related transforms-the FourierMellin, Mellin-Mellin, and Mellin-Fourier transforms-possess position, scale, and distortion invariance properties that suggest that they might find application in extremely robust spectroscopic instrumentation. In this report, the invariance properties of Mellin transforms have been considered in conjunction with infrared spectra. Findings suggest that the insensitivity of the Mellin transforms toward a variety of optical and experimental defects provides a means of separating differences in recorded spectra that result from instrumental factors, such as drift, misalignment, aberration, and other experimental factors, from those arising from true chemical differences between samples. Furthermore, the invariance properties are useful for robust pattern recognition, where the key features of the spectrum of interest can be recognized despite (i) translation in wavenumber, (ii) both linear and nonlinear scale changes in the wavenumber axis, or (iii) distortion in the amplitude. Normally, pattern matching algorithms are intolerant toward such instrumental factors. It is found that the Mellin correlation algorithm gives better results with discretely sampled data than the full application of the Mellin transforms. Invariant pattern recognition in the presence of translation, scale change, and distortion in the wavenumber axis is illustrated by consideration of spectra of dyes extracted from fabrics. It is demonstrated that a particular dye can be distinguished from very similar dyes despite relatively severe distortion in its infrared spectrum. In situ monitoring in industrial processes or at remote field locations is advantageous for continuous sampling and realtime data acquisition.' However, analytical instrumentation for in situ monitoring is required to be extremely robust, low cost, and easy to maintain and install. The desire for low-cost yet robust spectroscopic instrumentation leads us to examine Mellin transforms as a new approach to analysis of spectroscopic data. Mellin transforms have the mathematical property of "invariance", which means that the output of the Mellin transforms is insensitive to various distortions in the input data.24 The Mellin transforms considered in this work, in addition to the Mellin transform itself, are the FourierMellin transform, the Mellin-Mellin transform, and the Mellin-Fourier t r a n ~ f o r m . ~ In spectroscopic analysis, the data presented in this report will demonstrate that Mellin transforms are robust even in ( 1 ) Hirschfeld, T.Fresenius' 2.Anal. Chem. 1986, 324, 618-624. (2) Bracewell, R. N. The Fourier Transform and its Applications, 2nd ed.; McGraw-Hill: Tokyo, 1978; pp 254-257. (3) Sneddon, I. N. The Use ofIntegra1 Equations; McGraw-Hill: New York, 1972; Chapter 4. (4) Oberhettinger, F. Tables ofMellin Transforms;Springer-Verlag: Berlin, 1974. (5) Altes, R. A. J . Acoust. SOC.Am. 1978, 63, 174-183.

0003-2700/94/0360-3925$04.50/0 0 1994 American Chemical Society

the presence of severe wavenumber translations, wavenumber scale changes, and distortions in both amplitude and wavenumber position. Further to this, we also find that a correlation method based on Mellin transforms can form the basis of a robust new method of spectroscopic pattern recognition. The availability of such robust transforms and pattern recognition techniques might be used to advantage in the development of simple, compact, inexpensive, and robust optical instruments for measurements in harsh environments. For many such applications, Mellin transforms permit a degree of tolerance to misalignment, aberration, and temperaturedependent drift as well as other kinds of mechanical instability and shortcomings in the recording of spectra. On the basis of the digital simulations reported in this present study, it should be possible to substantially reduce the engineering tolerances on optical components yet, by using Mellin transform techniques, obtain satisfactory pattern matches between a distorted sample spectrum and its corresponding undistorted target spectrum. Mellin transforms have been previously used for correcting coma6 and other aberrations7 in optical and electron imaging systems but not to our knowledge in spectroscopic applications. Mellin transforms represent a new method for computer visualization of spectra that is capable of recognizing spectral characteristics for a given sample despite translations, scale changes, and distortions. In this regard, the Mellin transform methods mimic the intelligence of certain biological sensory systems. In mammalian hearing, it appears that a logarithmic remapping, similar to that used here in the implementation of the Mellin transform, occurs in the ~ o c h l e a .In ~ the simian visual system and in the visual system of the cat, it is found that a transformation from retinal space to the visual cortex approximates that of the Mellin transform.* Limitations of the Mellin transform method are threefold: firstly, Mellin transforms are applicable only to translations or distortions that can be described by a simple mathematical rule that applies globally across the spectral region of interest. However, multiply distorted spectra can be corrected by Mellin transform techniques. For instance, spectra that are distorted by both frequency translation and frequency scale change can be dealt with by the same transformation procedure. A second limitation arises because the Mellin transform, similarly to the Fourier transform, applies strictly to cyclic (6) Robbins, G. M.; Huang, T.S.Proc. IEEE 1972, 60, 862-872. (7) Hawkes, P. W . Pattern Recognit. 1975, 7, 59-60. (8) Altmann, J.; Reitbock, H. J. P. IEEE Trans. Pattern Anal. Mach. Intell.

1984, PAMI-6, 46-57.

AnalyticalChemistry, Vol. 66, No. 22, November 15, 1994 3925

transformationsgJOin which features that are lost from one end of the spectrum are required to circularly wrap around and appear at the other end of the spectrum. Translations or distortions which lead to loss of features from either end of the spectrum (or, conversely, translations or distortions which introduce new features into the spectrum at either end) will not show strict invariance. As spectra recorded in practice do not show such cyclic translations or distortions, a Mellin correlation method has been developed which measures the degree of similarity between a target spectrum and a distorted or translated version of itself but does not require exact invariance.8-11This Mellin correlation method has been found more suitable for spectroscopic application than direct implementation of the Mellin transforms themselves. Invariant pattern recognition using Mellin correlation is illustrated by consideration of spectra of dyes extracted from fabrics. It is demonstrated in the following discussion that one particular dye can be distinguished from very similar dyes despite the presence of relatively severe translations, scale changes, and nonlinear distortion in their spectra. Thirdly, the invariance properties of Mellin transforms are exact for continuous functions, but for discretely sampled spectra, this is not always the case. These advantages and limitations of Mellin transform techniques will be described in detail in the following sections.

factor applied to the wavenumber scale; (iii) the combined effects of i and ii, namely, f ( x ) * f(axfp); (iv) nonlinear deformation of the wavenumber scale, f(x) f(xd), where d is a wavenumber distortion factor; and (v) a nonlinear distortion in amplitude across the spectrum,f(x) ==, xtwf(x), where w is an exponential weighting factor applied to the amplitude of the spectrum. After discussion of the theory of the Mellin transform, the application of of the Mellin transforms to correction for the above effects (items i-v above) will be illustrated. Finally, several new methods of invariant pattern recognition will be described that are insensitive to the types of distortions mentioned in items i-v above. THEORY OF THE MELLIN TRANSFORM The theory of the Mellin transform has been well documented24 but its application has been restricted by the availability of efficient computational facilities and algor i t h m ~ .The ~ ~ Mellin transform, M(s),in one-dimension, is defined by the equation: M ( s ) = Jomf(x)xs-' dx

(1)

where s is along the imaginary axis s = - i o M , WM is a Mellinspatial frequency (analogous to the Fourier-spatial frequency, W F ) , and x is a real variable. With a substitution of a variable, x = et (or t = In x), eq 1 can be written as

INVARIANT TRANSFORMS Mathematically, the property of "invariance" applies to a class of transforms whose output is insensitiveto certain specific types of change in the input data. Two common invariant transforms are (i) the Fourier transform, which is invariant This equation has the same form as the Fourier transform of to translation in position, and (ii) the Mellin transform, which F(WF)* is invariant to change in ~ c a l e . ~The - ~ invariance properties of transforms can be combined, for instance, the Fourier(3) Mellin transform combines the Fourier and Mellin transforms and is invariant to changes in both position and ~ c a l e . ~ In J~J~ two dimensions, the Fourier-Mellin transform can be written Equations 2 and 3 differ only by their terms, first, namely, in a polar form, the radial component of which possesses f(er) andf(t). In other words, the Mellin transform is simply rotational invariance.11J3-15The Mellin-Mellin transform, the Fourier transform off(x) after the coordinate axis off(x) which combines two sequentially applied Mellin transforms, has been remapped according tof(ef) -f(t). This is equivalent is invariant to a nonlinear distortion in s ~ a l e . ~ .On ' ~ Jthe ~ to a logarithmic remapping of the x-axis scale: other hand, the Mellin-Fourier transform, combining the f(x) -fun x) (4) Mellin and Fourier transforms, is reported to be invariant to a nonlinear distortion in amplitudes5 With these combinations of Fourier and Mellin transforms, (the double arrow indicates the remapping operation). Equathe imperfections in recording of spectra that can be specifically tions 2-4 suggest that a convenient means of computation of treated are (i) translations or shifts in wavenumber position, the Mellin transform is by use of the Fourier transform after f(x) ==, f(x f p ) , where p is the translation factor and the a logarithmic transformation of the x-axis. Further considdouble arrow denotes a distortion in the spectrum; (ii) linear eration of Mellin transforms will be made easier if illustrated changes in wavenumber scale,f(x) f(ax), where a is a scale with spectroscopic examples. Discussion of the Mellin transform will be continued after the necessary experimental (9) Brigham, E. 0. The Fast Fourier Transform and Its Applications, Prenticedetails are described. For a nontechnical discussion of the Hall: Englewood Cliffs, NJ, 1988; Chapter 4. (10) Press, W. H.; Flannery, B. P.; Teukolsky, S . A,; Vetterling, W. T. Numerical Fourier transform, the reader is referred to Brighamg and Recipes in C: The Art ofScientific Computing,2nd ed.; Cambridge University Press et al.1° Press: Cambridge, U.K., 1992; Chapter 12. =-$

(1 1) Casasent, D.; Psaltis, D. Appl. Opt. 1976,15, 1795-1799.

(12) Psaltis, D.; Casasent, D. Proc. IEEE 1977,65, 77-84. (1 3) Psaltis, D.; Casasent, D. Deformation Invariant, Space-variant Optical Pattern Recognition, in Progress in Optics XVI; Wolf, E., Ed.: North-Holland: Amsterdam, 1978; pp 290-355. (14) Sheng, Y . Opt. Eng. 1989,28,494-500. (15) Konforti, N.; Mendlovic, D.; Marcom, E. J . Opt. SOC.Am., Part A 1990,7, 225-230. (16) Psaltis, D.; Casasent, D. Opt. Commun. 1977,21, 307-310

3926

Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

EXPER I MENTAL SECTION Spectral Measurements. A gas-phase absorbance spectrum of acetone obtained from a Perkin-Elmer 1600DX IR (1 7) Zwicke, P. E.; Kiss, I. IEEE Trans. Pattern Anal. Mach. Intell. 1983,PAMI5 , 191-199.

Absorbance

Table 1. Dye Samples Extracted from Samaron Pattern Cards

sample name

manufacturer name

POLY-037 POLY-038 POLY-039 POLY-040 POLY-043 POLY-044 POLY-045 POLY -046 POLY-047

navy blue HGR navy blue HTR liquid navy blue GR navy blue HR black HGL liquid black HBBL liquid black BBL liquid black HGS liquid black HBS

0.0

1.5

0.5

2.0

2.5

3.0

a No manufacturer data are available for samples POLY-041 and POLY -042.

spectrometer (Norwalk, CT) has been used a test spectrum for illustration of the Mellin transforms. The pattern recognition studies used the diffusereflectanceinfrared Fourier transform (DRIFT) spectra of navy blue and black dyes extracted from the fabric provided on Samaron polyester pattern cards (Hoechst, Germany). The chemical nature of the dyes is not specified by the manufacturer; however, thinlayer chromatography suggested that the dyes were mixtures containing up to 6 components.18 The dyes used are listed in Table 1 and were extracted from 2-mm strands of yarn in capillary tubes using A.R. grade chlorobenzene according to the procedure described by Kokot et al.19 Spectra were measured with a BIORAD FTS-7 (Bio-rad, Digilab Division, Cambridge, MA) spectrometer using 256 scans and a resolution of 4.0 cm-I. The DRIFT spectra used here are averages from duplicate extractions. Full details of the procedures used obtaining the dye spectra are available in the thesis by Carswell.18 Computational Facilities. Calculations were performed using a Matlab version 3.5j (The Mathworks, Inc., Natick, MA) with a 80386 computer using a 80387 coprocessor and a clock speed of 30 MHz and containing 4 MB of RAM (Custom Computer Services Pty. Ltd., Brisbane, Australia). With this system, computation of the Mellin transform requires about 20 min. However, with the recently released Matlab version 4.0, the SPLINE function uses sparse matrix techniques and is significantly faster, requiring about 2 min for each Mellin transform. Other Matlab functions from the signal processing and spline toolboxes were also used in this study. Software used for calculating the Mellin transforms under the Matlab system is available by writing to theauthors.

COMPUTATION OF THE MELLIN TRANSFORM Algorithms. As was indicated in the above theory section, the Mellin transform of a spectrum,f(x), can be represented by the discrete Fourier transform of the functionfon x). The process of obtainingfon x) is shown diagrammatically in Figure 1 for a test spectrum of acetone. Figure 1 illustrates that the original spectrum (Figure 1, top left axis) is logarithmically compressed (Figure 1, bottom axis) such that equally spaced data points in the original spectrum become unequally spaced at intervals of In x from the origin. Fourier transformation of the logarithmically compressed data then completes the (1 8) Carswell, S. Microanalysis ofDyesfrom Textiles, Master of Applied Science

Thesis, QueenslandUniversity of Technology, Brisbane,Queensland, Australia, 1991. (19) Kokot,S.; Carswell, S.; Massart, D. L. Appl. Spectrosc. 1992,46,1393-1399.

3 1.00

1026

1035

1125

2025

Remapped Wavenumber, cm-l Figure 1. Illustrationshowingthe logarithmicremapping of the original acetone spectrum (top left axis) onto a logarithmic axis (bottom axis) using an exponentialinterpolationfunctlon (a).The logarithmicremapplng Is the first step In the calculation of the Mellin transform. An acetone spectrum which has been subjected to a scale change of 0.75 Is shown by dotted lines. After logarithmic remapping, with the aid of the interpolation function (a), the scale change is transformedto a simple linear translation. Arrows indicate the remapping of representative data points In the original llnear axls to the logarithmic axis.

Mellin transformation. However, because most discrete Fourier transform algorithms assume equal spacing between the data in the input sequence and because of the digital sampling constraints mentioned in the next section, it is more convenient to use an interpolation formula to interpolate equally spaced data along the logarithmic scale. A cubic spline interpolation routine using an exponential remapping function (trace a in Figure 1) has been used to interpolate equally spaced logarithmic data in f(ln x) from the original equally spaced data values,f(x). The remapping function (trace a in Figure 1) has the form e2*klM,where k = 1, 2, ..., M , and M is the number of data to be interpolated from the N data points in the original spectrum. The interpolation procedure is shown diagrammatically in Figure 1 for the original acetone test spectrum and for the same spectrum which has undergone an x-axis scale change (dotted lines in Figure 1); the arrows indicate how representative data values are remapped onto the bottom logarithmic scale. In this work, the remapping operation has been conveniently carried out using the standard SPLINE function from the Matlab system or the function CSAPI from the spline toolbox. The procedure described above for calculation of the Mellin transform has become known as the fast Mellin transform.’’ The name “fast Mellin transform” arises because the fast Fourier transform (FFT) is used to effect the Mellin transform but does not imply computational efficiency; the logarithmic resampling step is normally much slower than the Fourier transform step. After the FFT step, the fast Mellin transform requires the addition of a dc correction term.” The dc correction term is often neglected because dc offset (mean level of the spectrum) is usually of little value in distinguishing between spectra. With typical spectroscopic data used in this Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

3927

present study, the dc correction factor was found to be consequential only for the Fourier-Mellin and Mellin-Mellin transforms: it could be ignored in calculation of the Mellin and Mellin-Fourier transforms, provided that background subtracted spectra were used. An alternative to the fast Mellin transform is the direct Mellin tran~f0rm.l~ The direct Mellin transform uses a direct expansion of eq 1 rather than the FFT algorithm. The direct Mellin transform can be written as a matrix product.13J7The direct implementation does not require logarithmic resampling or a separate dc correction term. Digital Sampling Considerations. For digitally sampled data there is a discretization problem associated with the Mellin tran~f0rm.I~ The fast Mellin transform requires a logarithmic resampling of the data prior to performing a FFT: in the initial part of the data range, the resampled points are closely spaced, but as the intersample distance grows exponentially, there are very few sampled data points at one extreme of the data range. This raises the question of how many nonuniform resampled data points are required to adequately represent the Mellin transform? In answering this question, it is assumed that the original data have been sampled at the Nyquist frequency (or that they have been low-pass filtered to meet the Nyquist criterion) such that uniform sampling at x = 0, Ax, 2Ax, ..., NAx adequately represents the original f ( x ) . The intersample spacing is 1I N , where N is the number of data. In the Mellin domain, M equally spaced samples are required for w at w = 0, Aw, 2A0, ..., MAW in order to adequately represent the Mellin transform, M ( s ) . From eqs 2-4, it is clear that a uniform spacing in u results in a nonuniform spacing in x, beginning at an intersample spacing of x = Ax and increasing with increasing x according to x = Axew,where w = 0,27r/M, 47r/M, ..., 27r. If the largest intersample spacing in x is Ax, to meet the sampling theorem, then, M must be6-’’ M=NlnN

L A

Original Wavenumber, cm.] FOURIER TRANSFORM

5

-0

15

10

20

25

30

Fourier Coordinate, a+

+

(5)

By resampling at this rate it is possible to apply the FFT to adequately represent the Mellin transform without aliasing. In this work, the test spectrum of acetone consists of 5 12 data samples covering the frequency range 1026-2048 cm-I. For 5 12 data samples, N In N = 3 194, which is the minimum number of logarithmically remapped data points to adequately represent the Mellin transform, as described above. Because the number 3 194 is somewhat inconvenient for the subsequent FFT, the next highest power of 2 (i.e., 4096 points) has been used. Similarly, for the polyester dye spectra, 512 original data points over the range 800-1786 cm-1 were remapped to give 4096 data points on a logarithmic scale. RESULTS AND DISCUSSION Position Invariance: The Fourier Transform. As discussed in the introductory remarks, the Fourier transform is invariant to a shift which translates the spectrum in one direction or the other with respect to the true wavenumber scale. This property is potentially useful in compensating for mechanical backlash and positioning irreproducibility in scanning drive systems. If the Fourier transform of the original spectrum is F ( w ) , then the magnitude of the Fourier transform of the repositioned 3928

2.0

Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

4

0

8

12

16

20

Fourier Coordinate, a+

Flgure 2. Demonstrationof the translation invariance property of the Fourier transform. (A) Unshifted acetone spectrum (a) and the same spectrum translated by +200 cm-I (b), (B) Invarianceof the magnitude of the Fourier transforms for the unshifted spectrum (-), translation of +200 cm-I (- -), +400 cm-I translation (- - -), and - M O O cm-I translation (- -) (C) The phase of the Fourier transform for the same translations as in B, demonstrating that the translation has been transformed into a phase-onty factor.

-

-

spectrum,f(x +p), is invariant to the wavenumber translation, f p , as can be seen from2

(where the double arrow denotes the Fourier transform). The Fourier transform of the spectrum translation, k p , has been transformed into an exponential factor, efsp, which is a purely phase term that does not alter the magnitude of the Fourier transform. The insensitivity of the Fourier transform to translation is illustrated in Figure 2. The effect of a translation

2.5

by 200 cm-I can be seen from Figure 2A. As demonstrated in Figure 2B, the magnitude of the FFT of the test spectrum of acetone and versions of itself translated successively by 200, 400, and 600 cm-I exactly coincide with each other. However, the phase of the FFT is not invariant to translation, as can be seen from Figure 2C, because translation by * p leads to a change in phase. If the translation Ap was not known in advance, it could be deduced from the phase data. It is important to note that the Fourier transform is strictly invariant to a circular translation where the data that are translated past the end of thedata range are circularly wrapped from one end to the other. The translations introduced in Figure 2 follow this type of circular wrap-around. However, in practice, translations are likely to lead to loss of spectral features from one end of the data range or, conversely, the appearance of new features into the data range. Under such circumstances, exact invariance will not be attained. Nevertheless, in spectroscopic applications, positional shifts are likely to be small in comparison to the wavenumber range scanned so that this limitation on the invariance of the Fourier transform is unlikely to be severe. Scale Invariance: The Mellin Transform. The scale invariance property of the Mellin transform is potentially useful for compensating temperature-dependent expansion or contraction in mechanical components of a spectrometer or optical misalignment. In this case, the Mellin transform of a scaled version of a spectrumftx), namely,f(ax), where a is the scale factor, is of interest. If the Mellin transform of spectrumf(x) is M ( s ) , then, similarly to eq 2, the Mellin transform of the spectrum of altered scale is M'(s):

2.0

-

.

.

A

-

/

"

'

I'

Original Wavenumber,cm-' MELLIN TRANSFORM

Mellin Coordinate, OM

+

3

2

(7)

a$ e

1

$ 0

-

where it should be noted that the logarithmic remapping has converted the change in scale to a linear shift by In a , f l a x ) f(ln x In a ) (the double-arrow indicates the Mellin transform). Evaluation of eq 6 and comparison with eq 2 gives2J7

+

9

-1

6

-2

0

0

4

6

12

16

20

Mellin Coordinate, o+,, Figure 3. Demonstration of the scale invarianceproperty of the Mellin transform. (A) The test spectrum at full scale (a) and II2-scale (b). (B) Invariance of the mgnltude of the Mellin transforms at full-scale (-), 1/2-scale(- -), I/,-scale (- - -), and 1/8-scale(- -). (C) The phase of the Mellintransform for the same scale factors as in (B), demonstrating that the scale change has been transformed into a phase-only factor.

-

From eq 8, the magnitude of the Mellin transform is independent of the scale factor a, the scale change having been transformed to a phase-only term, a+. A diagrammatic illustration of the effects of logarithmic remapping indicated in eq 6 can be seen in Figure 1. The dotted spectrum in Figure 1 has been subjected to a scale factor of a = 0.75. From this diagram it is apparent that the logarithmic remapping has the effect of transforming thescale change in the spectrum, f(ax), into a translation in the logarithmic axis, f(ln x + In a). From the discussion in the preceding section, we have seen that the magnitude of the Fourier transform is invariant to translation. Hence thechange in scale can be removed by a logarithmic remapping followed by Fourier transform (Le., a Mellin transform). However, only the magnitude of the Mellin transform is invariant to the scale change, the phase of the Mellin transform is not invariant.

-

The invariance properties of the Mellin transform are further illustrated in Figure 3, which demonstrates the acetone test spectrum subjected to scale factors of ' / 2 (as shown in Figure 3A), '/4, and I/g. The scale factors were introduced using a decimation procedure (the Matlab DECIMATE function) that ensured that the Nyquist criterion was maintained at the lower sampling rate. In Figure 3A, the original spectrum is represented by 512 data points and by 256 data points at I/z-scale. At l/d- and '/*-scale, the spectrum is represented by 128 and 64 data points, respectively. In each case, the data are then filled to 512 data points by repeating the last value in the sequence. Figure 3B demonstrates the scale invariance of the magnitude of the Mellin transform; all the Mellin transforms Analyrcal Chemistry. Vol. 66, No. 22, November 15, 1994

3929

from all the scaled spectra overlap closely regardless of the scale factor. Some lack of agreement is observed from the '/*-scale data at higher Mellin components owing to loss of spectral detail from the decimation of the data from 5 12 to 64 data points (Figure 3B). With the discrete Mellin transform, as opposed to the continuous Mellin transform, limits are imposed upon the invariance properties owing to finite sampling. However, the phase of the Mellin transforms (Figure 3C) displays a shift. If the scale factor was not known in advance, it could be found from the phase change, which depends upon a. Combined Scale and Position Invariance: The FourierMellin Transform. The Mellin transform is not position invariant because the Mellin transform of the translated spectrum is not equal to the Mellin transform of the original data.3,4 However, as we have seen, the magnitude of the Fourier transform is position invariant. Combination of both the Fourier and Mellin transforms into the Fourier-Mellin transform should provide invariance to both changes in scale and p o s i t i ~ n . ~ ~ ~ ~ ' ~ The Fourier-Mellin transform is illustrated using the acetone test spectrum by translating the l / 2 - and '/d-scaled data from the origin by 20 and 410 cm-', respectively. Figure 4A shows the translated '/4-scale data in comparison to the full unshifted spectrum. On taking the Fourier transforms of the spectra in Figure 4A, normalizing by dividing by F(O), and taking the magnitude, the data presented in Figure 4B are obtained. The effect of the translation is removed by the Fourier transformation, but the scale change still remains, because, from Table 12.6 in Bracewell:*

-

Chiginal Wavenumber, cm-'

1

Fourier Transform

Fourier Coordinate, a+

1

Logarithmic Remapping

Remapped Fourier coordinate,In q-

1

Fourier Transform

FT

f(ax)

a-'F(w/a)

(9)

The scale factor of 1/ a can be removed by taking the Mellin transform of the magnitude of the Fourier transform. The first step in taking the Mellin transform is the logarithmic remapping shown in Figure 4C. The remapping operation transforms the scale change into a shift in position. The Fourier-Mellin transform is completed, as shown in Figure 4D, by taking the Fourier transform of the data in Figure 4C. Unfortunately, Figure 4D demonstrates that the invariance of the Fourier-Mellin transform is not strictly attained under these circumstances. The relatively poor invariance properties of the FourierMellin transform result, it would appear, from the finite extent of the sampled data.8 In the Fourier domain, the finite extent of the data leads to bandwidth limitations and a consequent "windowing" of the observed frequencies. When the data are affected by scale changes, the remapping operation can result in features being moved in or out of this window in the Fourier domain. In the case of the shifted acetone data at '/4-scale (Figure 4C), an extraneous feature at low frequency has been translated into the remapped Fourier spectrum. This feature, which is not present to the same extent in the undistorted data, has a strong influence on the subsequent Fourier transform (Figure 4D). As described above, translation of new features into the input data sequence limits the translation invariance of the subsequent Fourier transform. Such effects lead to poor invariance properties for the Fourier-Mellin transform with discretely sampled data. 3930 AnalyiicalChemistry, Vol. 66, No. 22, November 15, 1994

3

E

800

20

30

40

50

Fourier-Mellin Coordinate, %

Flgure 4. Demonstration of the combined scale and translation invariance properties of the Fourler-Mellin transform. (A) The test spectrum unshifted, at full-scale (a) and translated by 205 cm-l, scale (b). (B) Fourier transformsof the data similar to A but for translated data at both 1/2-scale(a) and 1/4-scale(b). (C) Logarithmicallyremapped Fourier transformsfrom B for untranslated,full-scale (a) and translated, '/,-scale (b). (D) Fourier-Mellin transforms, untranslated, at full-scale (-); translated, at l/pscaIe (- -); and translated, at '/,-scale (- - -), showing relatively poor invariance.

-

Another difficulty with the Fourier-Mellin transform observed from Figure 4D is its general lack of distinguishing features. The logarithmic remapping of the first Fourier transform has the effect of strongly weighting the extremely low frequency content of the original data. This leads to a undesirable low-frequency filtering effect in the final FourierMellin t r a n ~ f o r m . ' ~The utility of the Fourier-Mellin transform is severely limited by both the spectral window effect and the low-frequency filtering effect. In finding an alternative solution to the combined scale and position invariance problem, consider the logarithmic remapping of the first Fourier transform as in Figure 4C. In

this figure, close similarities between data of differing scale are apparent; the major difference between the traces in Figure 4C are the broad boundary features near the origin. This suggests that a better approach than the full application of the Fourier-Mellin transform is a correlation algorithm8 that “keys to” these similarities in Figure 4C rather than performing a second Fourier transform (as in Figure 4D), which accentuates differences which are of little consequence in distinguishing translation and scale changes. This approach will be discussed in detail in a subsequent section. Before leaving the topic of the Fourier-Mellin transform, it should be pointed out that the Matlab SPLINE and CSAPI cubic spline interpolation routines should not be used for the coordinate remapping of the Fourier transform because the “not-a-knot” end condition used by these routines is not able to match the derivative at the left-hand boundary of the Fourier transform. Spline interpolants using “natural” end conditions such as CSAPN in the Matlab spline toolbox or biharmonic interpolation in the standard Matlab INTERP2 routine yield better results. Invariance to Nonlinear Distortion: The Mellin-Mellin Transform. A further significant property of Mellin transforms is their invariance to a nonlinear distortion that deforms f(x) intof(x*d), where d is an exponential distortion factor. This typeof distortion is of great interest in optical spectroscopy because of its bearing on correction for the effects of coma6 and other forms of aberration.’ The Mellin transform off(x*d) is. from Table 12.6 in Bracewell:2

0.5

c,,

1026

1200

1600

1400

1000

2DOO

Original Wavenumber, cm-’

1

Mellin Transform

MellinCoordinate,

1

Logarithmic Remapping I

1.0

Remapped hkllin coordinate,In

1

Fourier Transform

(where the double arrow signifies the Mellin transform). From eq 10, the Mellin transform of the distorted function differs from that of the undistorted function, i.e., M(s), by a normalization factor of l1/4 and a scale factor of & l / d 5 J 3 J 6 A distortion invariant transform is obtained by (i) renormalizing the magnitude of the first Mellin transform (eq 10) and (ii) performing a second Mellin transform to remove the scale change remaining after the first Mellin transform, similarly to eq 8. The magnitude of the Mellin-Mellin transform obtained in this manner is unaffected by the distortion produced by an exponential factor d. As an example of the possible application of the MellinMellin transform in spectroscopy, consider the acetone test spectrum distorted by a nonlinear distortion of the formf(x) -f(xd), where d take on values of 0.5, 1S , and 2.0. Figure 5A shows the effect of distortion factors of 0.5 and 2.0. Taking the Mellin transform of the distorted data has the effect of transforming the nonlinear distortion into a linear change in scale as shown in Figure 5B for distortion factors of 1 and 2. The effect of the change in scale can be removed, as has been seen already, by taking a second Mellin transform. The first step in the second Mellin transform, shown in Figure 5C,is the logarithmic remapping of the data in Figure 5B, which transforms the scale change to a shift in position. As with the Fourier-Mellin transform, a spline interpolant using “natural” end conditions is required at this point. The Mellin-Mellin transform is completed by taking a Fourier transform toremove the position change, shown in Figure 5D,which demonstrates

Mdlin-MellinCoordinate, % Flgure 5. Demonstration of the scale invariance of the Mellln-Mellin transform to nonlinear distortion in the wavenumber axis of the form 4x1 =+ 4xd). (A) The test spectrum with d = 2 (a) and 0.5 (b). (B) Mellin transforms of the data slmllar to A but for no distortlon (a) and for d = 2 (b). (C) Logarlthmically remapped Mellln transforms for data in B; Mellln-Mellin transforms for undistorted data (-), and for d = 1.5 (- -), 2.0 (- - -), and 0.5 (- -), showing lnvarlance to nonlinear distortion.

-

-

satisfactory invariance to the effects of nonlinear distortion for the Mellin-Mellin transform.

Invariance to Amplitude Distortion: The Mellin-Fourier Transform. Altess suggested that the Mellin-Fourier transform should be invariant to an amplitude distortion of the formf(x) xiWf(x). This invariance property holds interest in spectroscopy because of the possibility of compensation for various forms of nonlinear instrumental drift. For instance, amplitude drift of this form, with a small negative value of w, is often observed after the spectroscopic source is switched on, before its operating temperature is reached. The Mellin transform of x f W f ( x )is, from Table 12.6 in Bracewell?

-

Analytical Chemistty, Vol. 66, No. 22, November 15, 1994

3931

MT

x'"f(x)

0.01or

M ( s f w)

.

,

,

.

.

,

.

.

,

,

(11) 0.006

where the amplitude distortion by the exponential weighting factor x * has ~ been transformed into a translation in the Mellin domain. The translation can be removed, as seen above, by performing a Fourier transform on the magnitudeof the Mellin transform from eq 1 1. Therefore, the magnitude of the MellinFourier transform is invariant to an amplitude distortion of the formf(x) x'"f(x). If required, the factor w can be deduced from the shift after the Mellin transform (eq 11). In order to test the phase invariance properties of MellinFourier transform, the peak in the vicinity of 1750 cm-I in the acetone spectrum has been used for illustrative purposes (Figure 6A). This peak has been distorted in Figure 6A by application of distortion factors of xo (i.e., no distortion), x3, and x5. Factors of this magnitude introduce a particularly severe distortion in peak amplitude, shape, and position. In order to compare the distorted spectra on the same graph, each trace has been renormalized to unit area in Figure 6A. Figure 6B illustrates theeffect of logarithmic remapping upon the distorted spectra. The Mellin transform, shown in Figure 6C, demonstrates a main peak centered at zero Mellin coordinate whose width changes depending upon thedistortion factor applied. However, the expected shift in the Mellin transform by distance w is not observed here. The final MellinFourier transform is shown in Figure 6D, but because the expected shift in the Mellin transform has not been observed, the results obtained for the Mellin-Fourier transform in this application do not demonstrate strict invariance. Further numerical calculation has been carried out in order to clarify why the expected shift in the Mellin transform was not observed. Applying the distortion factors, as above, to cosine and sine functions yielded Mellin transforms which revealed the expected shift in position by exactly the value w as given in eq 11. Calculations using Gaussian-shaped peaks demonstrated Mellin transforms similar to that observed in Figure 6C, namely, a single peak centered at a Mellin coordinate of zero. The width of this peak increased with increasing distortion factor but not by the expected value of w. On the basis of these findings, it appears that the MellinFourier transform is invariant to an amplitude distortion for periodic signals but not for aperiodic signals with the main attribute of their Mellin transform centered around zero coordinate (i.e., near to the dc level). While the Mellin-Fourier transform appears to be the least useful transform considered in this work at this stage, further research is warranted. Preliminary findings suggest that the phase of the Mellin transform is a more sensitive measure of the amplitude distortion indicated in eq 11 than is the magnitude and is suitable for ( w I < 1. In addition, using the phase of the Mellin transform, it might prove possible to correct for amplitude and scale-change distortion simultaneously. Mellin Correlation: Invariant Pattern Recognition. As described above, poor invariance properties have been found for the Fourier-Mellin transform. In this section a method for implementing the Mellin transforms is described that uses a Mellin correlation approach and does not require full application of the Mellin transform.*J2-16 The correlation between two spectrafl(x) andfi(x), whose Fourier transforms

-

3932

Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

0.004 0.002 0.000

1650

1700

1750

1850

1800

Original Wavenumber, on"

0,010r

.

.

.

1

Logarithmic Remapping . . . . . . . ., . . . , ..,

. . . . .,

Remapped Wavenumkr, cm-' Fourier Transform 3 S L .

,

.

1

I

.

,

.

,

,

.

.

,

Mellin Coordinate,

1

Fourier Transform

Mellin-Fourier Coordinate,%

Figure 6. Demonstration of the invariance of the Mellln-Fourier transformto nonlinear distortionin amplitude of the form qx)* #"r(x). (A) A single peak from the acetone test spectrum in the vicinity of 1750 cm-1distorted with w = 0 (undistorted), (-, a); 3 (- -, b); and 5 (- -, c). (B) Test spectra following logarithmic remapping for the same weighting factors as in A. (C) Mellin transformsafter Fourier transform of the data in B. (D) The Mellin-Fourier transform of the data in C, showing relatively poor invariance to amplitude distortion.

-

-

are F ~ ( w Fand ) F ~ ( w Fand ) whose Mellin transforms are M I ( W Mand ) M ~ ( w M )respectively, , can be found from the following equations (adapted from Casasent and Psaltis11y'2 in order to account for the conventions described in the previously in the theory section):

where represents the correlation operation. The application of eqs 12 and 13 to the correlation of an unknown sample

spectrum (recorded in situ under unfavorable experimental conditions) to a library of reference spectra (recorded under ideal conditions) we have termed "invariant pattern recognition." Spectra which arise from the samechemical composition but differ because of instrumental effects which lead to translation and distortion are said to belong to the same "invariance group." There are several advantages in using the correlation functions defined above for spectroscopic pattern recognition. Firstly, in eq 12, the correlation function is independent of translation or scale change in the wavenumber axis, and the correlation function defined in eq 13 is independent of scale changes and nonlinear distortion in the wavenumber position. The Mellin correlation methods given by eqs 12 and 13, therefore, provide a means of correlating two spectra even though one or the other of those spectra might have been adversely affected by gross distortion. Secondly, the relative magnitude of the scale change or distortion in wavenumber position between the two spectra can be deduced from the relative displacement in the correlation peak from zero. This information would not normally be available, if as performed above with the acetone spectrum, an algorithm using the magnitude of the FourierMellin or Mellin-Mellin transforms were used. Thirdly,when using the correlations defined by eqs 12 and 13, full calculation of the Fourier-Mellin and Mellin-Mellin transforms are no longer required. In eq 12, the full calculation of the Fourier-Mellin transform is replaced by a Fourier transform, a logarithmic remapping, and a correlation operation; the final Fourier transform is no longer required. In eq 13, the full Mellin-Mellin transform is replaced by a single Mellin transform, a logarithmic remapping, and a correlation operation. Several numerical methods have been evaluated here for carrying out the correlation operation shown by the symbol 8 in eqs 12 and 13. It was found that the most effective correlation method for spectroscopic data was a onedimensional version of the normalized Euclidean distance measure suggested by Altmann and Reitbock? M

M

i= 1

i= 1

d o ) = [ x ( A ( i )- B(i-j))2]1/2/[xA(i)2+ B(i-j)2]1/2 (14)

where dG) is a distance or similarity function of 2M + 1 elements corresponding to j = -M, -M 1 , ..., 0, ..., M - 1, M . This equation provides a measure of the correlation between two data sequences A and B, each of M data points, by successively evaluating the Euclidean distance between A and B for all possible displacements,j. Because eq 14 is used to implement the Mellin correlation indicated in eqs 12 or 13 in this work, A and B correspond to either the logarithmically remapped Fourier transform or the logarithmically remapped Mellin transform, depending on whether eq 12 or eq 13 is being used. For transformed spectra A and B that exactly match each other, d u ) = 0 for a value of j equal to the signed offset between A and B . In general, A and B will not be identical, and the minimum element in d o ) will not be zero but will reach a distinct minimum for a particularj corresponding to

+

Displacement 0.71

,

8

.

1

.

.

t

I

.

1

t

a

E

o

600 .

o

-400 ~

~

-200 "

'

0~

' 200v

"400 *

~

Displacement Figure 7. Invariant pattern recognition using Mellin correlation: (A) EucUdean distance functions for the logarithmically remapped Fourler transform of the test spectrum showlng comparisons with a copy of itself (a), translated spectrum at 'lrscale (b), translated spectrum at I/*-scaie (c); and the comparison between the translated spectra at I/*-and '/*-scale (d), demonstrating invariance to translatlons and scale change. (B) Euclidean distance functlons for logarithmically remappedMeiiln transforms of the test spectrum showingcomparisons with a copy of itself (a) and distorted with d = 1.5 (b), 2.0 (c), and 0.5 (d), showing Invariance to nonlinear distortion. The displacement in j refers to eq 14.

the offset between A and B. If this minimum dG) is below a preselected threshold value, then A and B are judged to be similar (i.e., belong to the same invariance group). Interpretation of the similarity function is facilitated by a plot of the displacement between A and B, namely,j, vs the normalized Euclidean distance, d o ) , as in Figure 7. Mellin correlation using eqs 12 and 14 has been applied to the translated and rescaled acetone data used previously in Figure 4. The Mellin correlation algorithm is applied to the logarithmically remapped Fourier transforms of the acetone spectra as shown in Figure 4C. In Figure 7A, the similarity functions (eq 14) are shown for the normalized Euclidean distances between each of the data sets in Figure 4C,Le., the normalized distances between the unshifted, fullscaledata compared with (a) a copy of itself; (b) the l/~-scale, translated data; (c) the l/d-scale, translated data; and (d) the normalized distances between the '/2-scale, translated spectrum and the l/d-scale, shifted data. Because the minima in the similarity functions shown in Figure 7A approach zero, a close match is indicated between each of the spectra despite the sizeable differences in scale and position. The full distance Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

3933

l

function need not be calculated. Computational efficiency is improved by evaluation of the similarity function only for a region around zero displacement. The magnitude of the scale change in the spectra can be estimated from the displacement between the minima in the similarity functions shown Figure 7A. From the logarithmic relationship between the original Fourier data and the remapped data, the scale factor, c, can be estimated from c = (N/2)"IM

(15)

where m is the displacement found from the minimum in the similarity function, N is the number of data points in the original spectrum, and M is the number of interpolated data points for the remapped Fourier transform. Equation 15 has been modified from eq 33 in Altmann and Reitbock* in order to take into account some minor differences in calculation procedures between that work and this present study. From the displacements found from the minima in Figure 7A, the scale factors are calculated from eq 15 to be 0.53, 0.27, and 0.52 for traces b, c, and d, respectively. These values should be compared with the known values of 0.50, 0.25, and 0.50, respectively. The Mellin correlation method can also employ the logarithmically remapped Mellin transforms, as indicated in eq 13, which provide an alternative to the remapped Fourier transform method of eq 12 as described above. The use of eq 13 offers both scale- and distortion-invariant pattern recognition. This form of the Mellin correlation method has been applied to the data shown in Figure 5C The similarity functions calculated using eq 14 are shown in Figure 7B for the undistorted spectrum compared with (a) a copy of itself; (b) a spectrum distorted asf(x ) = + f ( ~ ~ /(c) ~ ) a; spectrum distorted asf(x) =+f(x2); and (d) a spectrum distorted asf(x) f ( ~ l / ~ )Even . in the presence of severe distortion, close matches between the spectra are found. In the case of the Mellin correlation method using eq 13, the magnitude of the distortion factor can be deduced from the displacement of the minimum in the Euclidean distance function. The method for finding the distortion factor corresponds to the method used for finding the scale factor described above, but in this case the remapped Mellin transform data are used instead of the remapped Fourier transform data. Using eq 15 for the displacements observed in Figure 7B, distortion factors of 1.44, 1.89, and 0.60 were observed for traces b, c and d, respectively. These factors should be compared with the known distortion factors of 1S O , 2.00, and 0.50, respectively. The inexactness in the estimation of the scale factors appears to result largely from discretization and interpolation errors accumulated at each step of the algorithm. Two methods of invariant pattern recognition using Mellin correlations have been described: the first involving logarithmically remapped Fourier transform data and the second using logarithmically remapped Mellin transforms. The similarity between two data sets is determined from an Euclidean distance function which has the advantage that scale factors or distortion factors can be deduced. The Mellin correlation method is computationally more efficient and more effective for pattern recognition than the application of an

-

3934

Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

0.00' 1800

"

1600

"

1400

"

1200

"

1000

'

1

800

Wavenumber, cm-' Flgure 8. DRIFT spectra for a representatlveselectiondyes extracted from the polyester pattern cards (see Table 1).

inverse Mellin transform restoration method previously reported by Robbins and Huang6 and Hawkes.' Invariant Pattern Recognition: Classification of Dyes Extracted from Fabrics. The invariant pattern recognition methods described above have been applied to the classification of dyes extracted from a Samaron pattern card (as described in the Experimental Section). The dyes used are mixtures of several pure components (up to six) that are known only by their manufacturer's names. Navy blue and black dyes were chosen in this study to provide an exacting and, at the same time, a practical test of the invariant pattern recognition methods developed in the previous sections. Figure 8 shows representative DRIFT spectra for some representative dye samples. Table 2 shows a similarity matrix for the original (undistorted) spectra of each of these dyes. This similarity matrix was calculated from the minima of the normalized Euclidean distance functions from eq 14. The data in Table 2 demonstrate the degree of similarity between each of the polyester dyes used in this study. A normalized distance of 0.3 is considered by one manufacturer20 to be a necessary condition for a close match in their software package, which uses a distance measure similar to eq 14 used here. A large majority of distances in Table 2 are around 0.3 or less, which is an indication of the similarity between these spectra, even without introducing any form of distortion. In general, a suitable threshold distance will need to be determined for each specific application after evaluation of a representative range of samples of known composition. In this study, the dye POLY-037 was used as a test sample, and its spectrum was subjected to various forms of distortion in the wavenumber axis. A library of Mellin transforms for each of the dye spectra in Table 2 is also required for classification purposes. An attempt was then made to classify (20) BIORAD FTS-7R Search32 Users Manual; Bio-Rad, Digilab Division:

Cambridge, MA, 1989.

Table 2. Nomallzed Euclidean Distances between Spectra ol Dyes Extracted from Samaron Pattern Card

P-037 P-037 P-038 P-039 P-040 P-041 P-042 P-043 P-044 P-045 P-046 P-047

P-038

P-039

P-040

P-041

P-042

0.0 0.348 0.260 0.231 0.207 0.236 0.113 0.0998

0.0 0.280 0.364 0.307 0.336 0.398 0.273

0.291 0.162 0.374 0.304 0.386

P-043

P-044

P-045

P-046

P-047

0.0

0.145 0.159 0.0996 0.203 0.185 0.290 0.140 0.322 0.0700 0.175

0.0

0.232 0.0963 0.194 0.211 0.317 0.154 0.402 0.0487 0.356

0.0

0.111 0.302 0.260 0.256 0.201 0.275 0.0452 0.262

this dye as POLY-037 from amongst the other dyes in the spectral library, even though its spectrum had been severely distorted and those in the library had not. The first case considered, the spectrum of POLY-037, was subjected to scale distortion factors of 0.95,0.90, and 0.80 in the wavenumber axis and translated by +36.6, +61.6, and -34.7 cm-l, respectively. The Mellin correlation, based upon eq 12, was then performed with the logarithmically remapped Fourier data. The similarity functions are shown in Figure 9A for the original and translated, rescaled versions of the POLY-037 spectra and, for comparison, a very similar dye spectrum, POLY-041. Using the Mellin correlation algorithm, the similarity functions are able to compensate for the translation and rescaling: the minima in Figure 9A are close to zero and are shifted by increasing amounts from the origin, reflecting the differing scale factors in the spectra for b, c, and d. In Figure 9B, the minima in the curves from Figure 9A, d(m),are plotted vs the displacement of this minimum from the origin, m. The d(m)and m values were determined from a least-squares parabolic fit to the data in the vicinity of the minimum. With the Mellin correlation algorithm, the distances, d(m),in Figure 9B are close to zero, but are not exactly zero and increase with increasing scale distortion. Although the logarithmically remapped Fourier transform is insensitive to scale and translation changes, it is not completely invariant, which makes d more difficult to classify than c and b on the basis of distance only. However, the displacements also need to be taken into account. Figure 9B shows that displacement increases with increasing scale factor for dyes from the same invariance group but not, in general, for dyes from different invariance groups (which tend to cluster around zero displacement). A two-dimensional classification plot of d(m)vs m, as in Figure 9B, takes both factors into account in the classification. From the classification plot in Figure 9B, the translated and rescaled spectra (traces b, c, and d) can be clearly recognized as belonging to the POLY-037 invariance group by virtue of the combined properties of d(m) 0 and the characteristic displacement (with m f 0). A decision boundary which makes use of both d(m)and m is shown by the dashed line I in Figure 9B. Using this decision boundary, the spectra for dye POLY-037 are clearly distinguished from the other dyes despite the fact that the wavenumber axes have been translated and the wavenumber scales compressed from their true positions. As before, the displacement, m, can be used to estimate the compression factor in the wavenumber scale. For the data presented in Figure 9A, the estimated wavenumber scale

=

0.0

P)

0.0

0.06

0

$

5 8

E

0.0

0.198 0.154

0.05 \

. -f,.

0.04-

BP43

....

..... . ..

Bd

aP41

.

. .. ... p4p3*



Bc

p47 UP42 Up39

.pg,,

\

1 0.01 -

0.02

0.0

0.154

B

u 0.03

.z

0.0

0.332 0.241 0.357

-

P)

w”

0.0

0.272 0.321 0.270 0.330

\

Db

Ua I

.

I

-140 -120

.

I

-100

.

I

-80

.

t

-60

.

,

-40

.

I

-20

.

I

0

.

20

Displacement at Minimum Figure 9. Pattern recognition of dye spectra In the presence of shifts and scale change in the wavenumber axis. (A) Euclidean distance functionsforthe dye POLY-037, originalspectrum (a); shifted by +36.6 cm-l and wavenumber scale factor 0.95 (b); shifted by +61.6 cm-l and a scale factor of 0.90 (c); and shifted by -34.7 cm-’ and a scale factor of 0.80 (d); the distance function for undistorted POLY-041 spectrum is shown for Comparison. (B) Classification plot of minimum Euclidean distance vs displacement; the dye POLY-037 can be easily distinguished from other similar dyes despite shifts and scale changes in its spectrum (a, b, c, and d refer to the same shifts and scale factors as In A): I is a decision boundary.

compression factors are 0.96, 0.91, and 0.83 for traces b, c, and d, respectively. These values should be compared with known values of 0.95, 0.90, and 0.80, respectively. In a second example of the application of invariant pattern recognition techniques, the spectrum of POLY-037 has been subjected to a nonlinear distortion by factors of 0.80, 0.90, Analytcal Chemistfy, Vol. 66, No. 22, November 15, 1994

3935

8 0.6 C Y

.2 0.5 U

C

0.4

.? W

0.3

3

0.2

0

3

a

zz

3 .e

0.1

0.0'

-400

"

'

'

-200

-300

"

-100

. " ' 0

'

100

"

200

"

300

Displacement

8

0.25

1

B

OP42 OP41

C

1

0P43

0P44

C

2

2

0.15

OP38 oP47

0.00

-300

I

I

-200

-100

/

//

Od

,

0

100

Displacement at Minimum Figure 10. Pattern recognition of dye spectra in the presence of nonlinear distortion in the wavenumber axis. (A) Euclidean distance functions for the dye POLY-037 with the following distortion factors: 0.80 (a): 0.90 (b); 0.95 (c); 1.0 (undistorted) (d); 1.05 (e); 1.10 (f); and 1.20 (9). The distance functions for undistorted POLY-041, POLY-038, and POLY-039 spectra are shown for comparison. (8)Classification plot of minimum Euclidean distance vs displacement; the dye POLY037 can be distinguishedfrom other similar dyes despite the nonlinear distortion in its spectrum (a, b, c, d, e, f, and g refer to the same distortion factors as in A. Two possible decision boundariesare shown by I and I1 (see text).

0.95, 1.05, 1.10, and 1.20 in the wavenumber axes. Mellin correlation is applied to the logarithmically remapped Mellin transforms (eq 13), and the similarity functions are calculated as shown for some representative data in Figure 10A. Comparison between the similarity functions for the distorted spectra of POLY-037 and other dye spectra shown in Figure 1OAdemonstrate that thedye POLY-037 can bedistinguished from other similar dyes despite severe nonlinear distortions to its spectrum. A plot of d(m) vs m is presented for the distorted data in Figure 10B. This plot is less useful in the case of distortion invariance because the displacements for the dissimilar dye spectra do not necessarily cluster around m = 0, as was the case in the previous example (Figure 9B). Nevertheless, a simple threshold decision boundary as shown by I in Figure 10B will correctly discriminate between the distorted dye spectra and all other dye spectra excepting that for POLY-040. If a priori information is available, then (21) Crochiere, R. E.; Rabiner, L. R. IEEE Trans. Acoust.. Speech, Signal Processing 1975, ASSP-23, 444456.

3938 Analytical Chemistry, Vol. 66, No. 22, November 15, 1994

improved discrimination might be possible. For instance, if it is known in advance that the distortion factor is less than 1 (Le., a nonlinear compression in the wavenumber axis), then a decision boundary such as I1 in Figure 10B will correctly distinguish between the distorted POLY-037 spectra and all other spectra. Improved discrimination might also be achieved by application of multivariate methods with the similarity data. Finally, the estimated distortion factors from Figures 10A and 10B are 0.876,0.934,0.964, 1.04, 1.07, and 1.13. These factors should be compared with known values given above. The errors in the estimated distortion factors are relatively larger than those in the previous study with the acetone data. This appears to result from the large decimation/interpolation factors used to effect the noninteger data resampling rates2' and from the interpolation errors arising from the nonlinear distortion of the wavelength axis. Conventional wisdom dictates that good spectroscopy demands the best equipment. The above results indicate that, at least in some applications, this might not be the case. Invariant pattern recognition in the presence of severe distortions in the wavenumber scale has been demonstrated. It is, however, necessary to know the form of the distortion so that the appropriate correlation algorithm can be applied.

CONCLUSIONS This work has raised the possibility of performing Mellin transform spectroscopy as an alternative to the commonly used Fourier transform methods. The advantages of Mellin transforms for spectroscopy arise from their invariance to many types of spectral distortion. Thus, the implementation of Mellin transforms in spectroscopy may lead to the development of robust yet simple and inexpensive instrumentation which is unaffected by adverse environments and, therefore, suitable for industrial process monitoring or field applications. This work has employed digital Mellin transforms. Mellin transforms can also be implemented in real-time optical systems.' 1-16 The optical Mellin transform does not suffer from the discretization and spectral boundary problems associated with the digital Mellin transform. ACKNOWLEDGMENT The authors are grateful to Stewart Carswell for carrying out the dye extractions and for provision of the digitized dye spectra. The spectrum of acetone was obtained from Perkin Elmer Corp., Norwalk, CT. The authors have also benefited from discussions with Dr. Graeme Winstanley, CSIRO, Division of Manufacturing Technology, Pinjarra Hills, Queensland, Australia and Dr. John Bombarderi, Telecom Research Laboratories, Clayton North, Victoria, Australia. This work has been partly supported by the Commonwealth Department of Employment, Education and Training, and Varian Australia Pty. Ltd. through an Australian Postgraduate Research Award (Industry). Received for review June 21, 1994. Accepted August 15, 1994.' e

Abstract published in Aduance ACS Abstracts, October 1 , 1994.