The Wavelet Transform as a Classiﬁcation Criterion Applied to Improve Compression of Hyperspectral Images

The use of the wavelet transform to analyze the behaviour of the complex systems from various fields started to be widely recognized and applied successfully during the last few decades. In this book some advances in wavelet theory and their applications in engineering, physics and technology are presented. The applications were carefully selected and grouped in five main sections - Signal Processing, Electrical Systems, Fault Diagnosis and Monitoring, Image Processing and Applications in Engineering. One of the key features of this book is that the wavelet concepts have been described from a point of view that is familiar to researchers from various branches of science and engineering. The content of the book is accessible to a large number of readers. hyperspectral-©


Introduction
Satellites continually feeding images to their base, pose a challenge as to the design of compression techniques to store these huge data volumes. We aim at lossless compression of hyperspectral images having around 200 bands, such as AVIRIS images. These images consist of several images (or bands) obtained by filtering radiation from the earth at different wavelengths. Compression is generally achieved through reduction of spatial as well as spectral correlations.
Most of the hyperspectral compressors are prediction-based. Since spectral correlation is usually high (much more higher than spatial correlation) pixels are predicted with other pixels in an adjacent band (rather than other pixels surrounding the one to be predicted). SLSQ (Rizzo et al., 2005), a low-complexity method designed for hyperspectral image compression, performs a simple prediction for each pixel, by taking a constant times the same pixel in the previous band. The constant is calculated by least squares over 4 previously encoded neighboring pixels. SLSQ-OPT version of SLSQ performs one band look-ahead to determine if the whole band is better compressed this way or with intraband prediction, while in the SLSQ-HEU version this decision is taken by an offline heuristic. CCAP (Wang et al., 2005) predicts a pixel with the conditional expected value of a pixel given the context. The expected value is calculated over coded pixels having matching (highly correlated) contexts. Slyz and Zhang (Slyz & Zhang, 2005) propose 2 compressors (BH and LM) for hyperspectral images. BH predicts a block as a scalar times the same block in the previous band. Coding contexts are defined by the quantized average error. LM predicts a pixel by choosing among different intraband predictions the one that works best for several pixels at the same position in previous bands. Mielikainen and Toivanen proposed C-DPCM (Mielikainen & Toivanen, 2003), a method that classifies the pixels at the same location and through all the bands, with vector quantization. Interband prediction is performed using the pixels at the same position in 20 previous bands. Weights, calculated for each class/ band, are sent into the code, as well as the 2D template with the classes. Aiazzi et al. (Aiazzi et al., 1999) classify the prediction context of every 23 www.intechopen.com pixel using fuzzy clustering, and then calculate the weights for each class. For compression of hyperspectral images (Aiazzi et al., 2007) they divide each band into small blocks (16 × 16), they calculate weights for interband prediction over each pixel in a block, and then make a fuzzy clustering of the weights obtained for all the blocks. For each pixel a membership degree is computed according to the efficiency of the weights (from different clusters) on a causal context of the pixel. The final prediction for a pixel is obtained by a combination of linear predictions involving weights from different clusters, pondered by the degrees of membership of the pixel to each cluster. It is worth mentioning that wavelet-based compressors such as JPEG2000 (Taubman & Marcellin, 2002) have been successfully used for lossy compression of multiband images, either hyperspectral (Blanes & Serra-Sagrista, 2010;Fowler & Rucker, 2007) or general earth data (Kulkarni et al., 2006).
In this work we will improve the well-known algorithm which was developed for hyperspectral images: LAIS-LUT. This algorithm makes predictions of each pixel using other pixels in the same band. Which pixel is used for prediction is determined by inspecting in the previously encoded band. This algorithm uses two possible candidates for prediction. We will introduce the wavelet transform as a tool for classification in order to make better decisions about which of these two possible candidates acts as a more appropriate prediction. First, LAIS-LUT will be introduced, as well as the LUT algorithm on which it is based. Then we show how the wavelet transform is used to improve it. Finally, we give some results and conclusions of our method, called Enhanced LAIS-LUT.

LUT algorithm
The Look Up Table algorithm (Mielikainen, 2006) is a fast compression technique based on predicting a pixel with another pixel from the same band. The previous band is inspected in order to determine which pixel in the same band is used for prediction. As an example, suppose pixel I (z) x,y in band z wants to be predicted. Then we seek on band z − 1t h ep i x e l with the same intensity as I (z−1) x,y which is nearest to it in a causal neighborhood. Let I (z−1) x ′ ,y ′ be that pixel. Then, the prediction for pixel I (z) x,y will be I (z) x ′ ,y ′ . If no match is found, pixel I (z−1) x,y is the one selected for prediction. In order to speed things up, a look up table data structure is used for searching the pixel on the previous band. With this data structure the algorithm is efficiently implemented as shown in Fig 1 for consecutive bands z and z − 1. Then, the difference I (z) − P (z) between the band and its prediction is entropy coded and this process is repeated for z = 2, . . . , 224.
In Fig. 2 entropy values are ploted for each band of the Jasper Ridge image. In dashed line, entropies of the pixels of the image are ploted. 6 steps of the 2D S+P wavelet transform were computed and the entropy of the coefficients is plotted in dotted line for each band. Finally it is shown in gray line the entropy of the prediction differences for the LUT algorithm. It is remarkable how high is the compression achieved with this simple algorithm, which is only based on indexing and updating a table. It is entirely based on the premise of high correlation between bands and designed in order to take advantage of this fact.

528
Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology

www.intechopen.com
The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images 3 Data:B a n d sI (z) , I (z−1) and table initialized as LUTable(i)=i Result:P r e d i c t i o nf o rb a n dz: P (z) for every pixel I   Table 1.

LAIS-LUT
An improvement over the LUT algorithm has been presented in (Huang & Sriraja, 2006). It was named LAIS-LUT after Locally Averaged Interband Scaling LUT and it behaves more accurately in presence of outliers. This modification adds an extra LUT table and the predictor 529 The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images www.intechopen.com is selected from one of the two LUTs. Using a scaling factor α which is precomputed on a causal neighbourhood, an estimateP (z) x,y is calculated for a current pixel I Since two values are now possible candidates for prediction (one for each LUT), the one that is closer toP x,y is selected as the final prediction ( Fig. 3 shows LAIS-LUT algorithm). When prediction P (z) for band z is estimated, the prediction error I (z) − P (z) is entropy coded. This is repeated for z = 2, . . . , 224. Notice that when the tables are not initialized, P (z) x,y is selected for prediction, and, the value of the first LUT is used for prediction only when this table is initialized.
Data:B a n d sI (z) , I (z−1) , tables LUTable 1 and LUTable 2 are not initialized Result:P r e d i c t i o nf o rb a n dz: P (z) for every pixel I (z) x,y do if both tables are not initialized on entry (x,y) then

LAIS-QLUT
Mielikainen and Toivanen proposed a modification to the LAIS-LUT method in order to shrink Lookup tables (Mielikainen & Toivanen, 2008). For that, the value used for indexing into the LUTs is quantized and smaller LUTs can be used (i.e., the value x used as an index in the LUT is replaced by ⌊x/q⌋ for some quantization step q,being⌊·⌋ : R → Z afunctionthatmapsa real number to a close integer). In the previous section, LAIS-LUT found exact matches in the previous band in order to obtain the predictor in the current band. For LAIS-QLUT, this search is no more exact and the predictor's selection in the current band is based on 'similarities' in the previous band. The best quantization step is obtained by an exhaustive search on each band (LAIS-QLUT-OPT version) or determined offline for each band by training on a set of images (LAIS-QLUT-HEU version). We decided not to add classes to the context over LAIS-QLUT, since a combination of the two would result in a prohibitive increase in complexity.

530
Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology www.intechopen.com The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images 5

The wavelet transform as a tool for classification
In order to improve compression bitrates, the scaling factor in LAIS-LUT will be estimated more accurately. For that, a classification stage will be added to the algorithm. The scaling factor is computed as an average of quotients of collocated pixels in consecutive bands according to Equation 1. These pixels belong to a close neighbor of the pixel to be predicted (either on the current band, or on the previous band). Once classes are established for each pixel, not all the pixels in the close causal neighbor will be used for estimating the scaling factor α. Instead, we may use only those pixels that belong to the same class of the pixel to be predicted so as to obtain a more accurate estimation. This will enhance the LAIS-LUT algorithm, by allowing a better decision on which of the two look up tables yields a better prediction.
In order to establish classes we will make use of the wavelet transform. Since hyperspectral images have a considerable number of bands, the wavelet transform can be applied in the spectral direction. AVIRIS images have 224 bands. Considering each pixel as a vector in Z 224 , each of them may be 1D-wavelet transformed. And with the information of the wavelet transform of each 'pixel' classes can be determined. First, the wavelet transforms used in this work are introduced.

The wavelet transform
The wavelet transform allows the representation of a signal in multiresolution spaces. In the wavelet representation, the transformed signal can be viewed as an approximation of the original signal plus a sum of details at different levels of resolution. Each of these details and approximations are associated to function basis which have good time-frequency localization (Mallat, 1999). In images -a simple extension of the 1-dimensional case-, decorrelation is achieved obtaining a sparse representation. Two different types have been considered in this work: orthogonal wavelets and lifting-based wavelets.
For the classical orthogonal wavelet, consider a 1D signal x =[ x n ] n=0,...,N−1 of length N (even). For a step of the wavelet, x is transformed into approximation coefficients s = [s n ] n=0,..., N 2 −1 and detail coefficients d =[ s n ] n=0,..., N 2 −1 ,w h e r es is the result of convolving x with a lowpass filter followed by a decimation. The same process happens to d,butahigh pass filter is used instead. For more steps, the wavelet transform is applied recursively over the approximation coefficients s. The original signal can be recovered if the inverse process is carried out in order (upsampling followed by the convolution with the corresponding reversed filter -see Fig. 4). Depending on the filter, wavelets with different properties can be obtained. In this work we use the Daubechies 4 wavelet (Daubechies, 1992) The Symmlet wavelet, with 8 vanishing moments (and filter of length 16), was also used in this work.
Another way of constructing different wavelets is by the lifting scheme . They are built in the spatial domain. The basic idea is to split the signal into two components, for instance, odd samples (x odd = x 2k+1 ) and even samples (x even = x 2k ). Then, detail coefficients are obtained by using one component to predict the other: d = x odd − P(x even ). Better predictions will yield more zeros, and therefore more decorrelation is

531
The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images www.intechopen.com 6 Will-be-set-by-IN-TECH Fig. 4. Orthogonal wavelet analysis via convolutions and decimations followed by the synthesis via upsampling and convolution. Highpass filter g is obtained from lowpass filter h as g k =(−1) k h 1−k ,andg ′ indicates the g filter reversed.
achieved. In order to obtain the approximation part of the transformed signal, the unpredicted component is softened with an 'update' of the detail previously obtained: s = x even + U(d). See Fig. 5 for an illustration of this scheme. With the lifting scheme it is possible to construct wavelets that map integers into integers (Calderbank et al., 1998) by the use of a rounding operator at the prediction or update stage. For this work the (2, 2) and S+P wavelets have been considered (see Table 2).

Classification of hyperspectral images
Using images captured by the scanner system called AVIRIS (Airborne Visible/Infrared Imaging Spectrometer) developed by JPL (Jet Propulsion Laboratory; see 532 Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology

www.intechopen.com
The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images 7 http://aviris.jpl.nasa.gov), we aim at determining classes for pixels. These images have 224 bands, each corresponding to a response in a certain range of the electromagnetic spectrum. Each pixel represents 20 meters and is allocated in a 2 byte signed integer. AVIRIS images usually have 614 columns and every 512 rows, the image is partitioned into 'scenes', and each scene is stored in a different file.
Considering each pixel I x,y as a vector in Z 224 where each component belongs to a different band, different behaviours depending on what type of soil is being considered can be observed. Figure 6 shows the first scene of the Jasper Ridge image with four pixels belonging to different classes, marked with symbols '⊕', '•', '♥'and'♦'. The spectral vectors associated to the same 4 positions are plotted in Figure 7; where the characteristic signal -called the spectral signature-of the type of soil can be observed. In order to classify the image, for every pixel, a 1-D wavelet transform is applied along the spectral direction. The entropy of each transformed spectral vector is computed, giving an image C where C x,y := H(W(I x,y )),b e i n gW(·) a 1-D wavelet transform function and H(·) the entropy function weighted by wavelet subband. Since AVIRIS images have 224 bands, 5 steps of the wavelet transform are applied to each pixel. So we have 5 detail subbands and 1 approximation subband. Since decimation is performed after each step, these subbands are different in size. Therefore, the total entropy of the 1-D wavelet transform is computed as the 533 The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images www.intechopen.com    Table 3. Compression ratios for Enhanced LAIS-LUT (with classes for estimating the scaling factor) and classical LAIS-LUT and LUT algorithms.
sum of the entropies of each subband, weighted by the size of the subband relative to the size of the whole transform.
In Figure 8 a grayscale image of the entropies is displayed. This image may be further split into classes with an unsupervised classifier. In this work, mean-shift (Comaniciu & Meer, 2002) was used.

Results
Results of compressing AVIRIS images with LAIS-LUT and the enhanced version (in which the scaling factor is calculated with pixels belonging to the same class, considering a causal neighbor of 4 × 4 pixels around the one to be predicted) is shown in Table 3.
The name of the wavelet in the table indicates the wavelet used to transform each pixel (and all the bands) followed by the entropy estimation and mean shift classification. Compression ratio results for LAIS-LUT and LUT algorithms were obtained from (Mielikainen & Toivanen, 2008). It can be observed that the enhanced version of LAIS-LUT using Daubechies 4 for classification outperforms the other methods.
We may conclude that the scaling factor α plays an important role in the compression performance of LAIS-LUT algorithm. When introduced, it was intended to decrease the deterioration produced by outliers in the original LUT algorithm. We have also been able to make use of the information in the wavelet domain and apply it to develop an efficient classifier. Since hyperspectral images have many bands because of their high spectral resolution, the information of the signal that each pixel represents (in all bands) was well captured by the wavelet transform and was fed into a powerful classifier such as mean-shift, giving good compression results.  The use of the wavelet transform to analyze the behaviour of the complex systems from various fields started to be widely recognized and applied successfully during the last few decades. In this book some advances in wavelet theory and their applications in engineering, physics and technology are presented. The applications were carefully selected and grouped in five main sections -Signal Processing, Electrical Systems, Fault Diagnosis and Monitoring, Image Processing and Applications in Engineering. One of the key features of this book is that the wavelet concepts have been described from a point of view that is familiar to researchers from various branches of science and engineering. The content of the book is accessible to a large number of readers.

How to reference
In order to correctly reference this scholarly work, feel free to copy and paste the following: Daniel Acevedo and Ana Ruedin (2012). The Wavelet Transform as a Classification Criterion Applied to Improve Compression of Hyperspectral Images, Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology, Dr. Dumitru Baleanu (Ed.), ISBN: 978-953-51-0494-0, InTech, Available from: http://www.intechopen.com/books/advances-in-wavelet-theory-and-their-applications-in-engineeringphysics-and-technology/the-wavelet-transform-as-a-classification-criterion-applied-to-improve-compression-ofhyperspectral-