*2.5. HyperLCA Preprocessing*

This compression stage of the HyperLCA algorithm is executed after the HyperLCA transform for adapting the output data for being entropy coded in a more efficient way. This compression stage is divided into two different parts.

#### 2.5.1. Scaling the V Vectors

The HyperLCA transform provides two different sets of vectors as a result. These two different sets of vectors, which have different characteristics, are needed for reconstructing the image using the inverse HyperLCA transform, and, hence, both should be entropy coded and transferred. The entropy coder proposed in this manuscript works with integer values. Accordingly, these two sets of vectors must be represented as integers.

**Algorithm 2:** Inverse HyperLCA transform.

**Inputs:** *P* = [*p*1, *p*2, ..., *pp*max ], *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ], *pmax*,**1** *M* = [*d*1, *d*2, ..., *dNp* ]; {Decompressed image.} **2 for** *k* = 1 **to** *Np* **do 3** *dk* = *c*; **4 end 5 for** *i* = 1 **to** *p*max **do 6** *pi* = *pi* − *c*; **7 end 8 for** *i* = 1 **to** *p*max **do 9** *q* = *pi*; **10** *u* = *pi*/(*pi<sup>t</sup>* · *pi*); **11** *M* = *M* + *q* · *vi*; **12 for** *j* = *i* + 1 **to** *p*max **do 13** *pj* = *pj* − (*u<sup>t</sup>* · *pi*) · *q*; **14 end 15 end Outputs:** *M* = [*d*1, *d*2, ..., *dNp*]

The first set of vectors obtained contains the centroid pixel, *c*, used for initializing the process, as well as the pixels selected by the HyperLCA transform, *P* = [*p*1, *p*2, ..., *pp*max ]. The pixels selected by the transform are already integers, since they are directly pixels of the image. The centroid pixel to be transferred has also been rounded to integers' values before starting the HyperLCA transform, as described in Section 2.2. Accordingly, adapting this set of vectors for the entropy coder is a straightforward step.

 *c*

On the other hand, the second set of vectors obtained by the HyperLCA transform, *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ], contains the projection of the image pixels into the space spanned by the different orthogonal projection vector, *u*, calculated in each iteration. The value obtained when projecting one pixel vector over one specific vector *u* will be determined by the angle between both vectors and their magnitude, according to Equation (3), which describes the scalar product between two vectors:

$$\mu^t \cdot \mathbf{x}\_i = \frac{||\boldsymbol{u}|| \cdot ||\mathbf{x}\_i||}{\cos(\theta)}\tag{3}$$

According to this equation, larger modules and smaller angles (more parallel vectors) will produce higher scalar product values. In the HyperLCA transform, we have selected the vector *u* as *u* = *xj*max/((*xj*max )*t* · *xj*max ), *xj*max being the brightest pixel in the image (the pixel with the largest magnitude). Hence, if we perform the scalar product of all the image pixels and the *u* vector as shown in Line 12 of Algorithm 1, *vi* = *ut* · *Mc*, the image pixel *xj*max will be the one producing the largest result, which will be exactly 1, as shown in Equations (4)–(8):

$$w\_{\dot{\jmath}\_{\text{max}}} = u^{t} \cdot x\_{\dot{\jmath}\_{\text{max}}} = \left(\frac{x\_{\dot{\jmath}\_{\text{max}}}}{\left(\left(x\_{\dot{\jmath}\_{\text{max}}}\right)^{t} \cdot x\_{\dot{\jmath}\_{\text{max}}}\right)}\right) \cdot x\_{\dot{\jmath}\_{\text{max}}} \tag{4}$$

$$
\sigma\_{j\_{\text{max}}} = \boldsymbol{\mu}^t \cdot \mathbf{x}\_{j\_{\text{max}}} = (\frac{\boldsymbol{x}\_{j\_{\text{max}}}}{||\boldsymbol{x}\_{j\_{\text{max}}}||^2}) \cdot \mathbf{x}\_{j\_{\text{max}}} \tag{5}
$$

$$w\_{\dot{j}\_{\text{max}}} = u^t \cdot x\_{\dot{j}\_{\text{max}}} = (\frac{x\_{\dot{j}\_{\text{max}}}}{||x\_{\dot{j}\_{\text{max}}}||}) \cdot (\frac{x\_{\dot{j}\_{\text{max}}}}{||x\_{\dot{j}\_{\text{max}}}||}) \,\tag{6}$$

$$w\_{j\_{\max}} = u^t \cdot x\_{j\_{\max}} = \frac{|\left(\left(\frac{x\_{j\_{\max}}}{\|\|x\_{j\_{\max}}\|}\right)\|\right. \cdot |\left(\left.\frac{x\_{j\_{\max}}}{\|\|x\_{j\_{\max}}\|}\right)\|\right. }{\cos(\theta)}\tag{7}$$

$$
v\_{j\_{\text{max}}} = \boldsymbol{\mu}^t \cdot \mathbf{x}\_i = \frac{1 \cdot 1}{\cos(0)} = 1.\tag{8}$$

Since the rest of the image pixels *xj*=*j*max have smaller magnitudes than *xj*max and wider *θ* angles with respect to the vector *u*, the values *vj*=*j*max will be between −1 and 1. Accordingly, it can be said that all the values of the vectors *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ] will be between −1 and 1, as shown in Equation (9).

$$
\forall v\_j \in V: -1 < v\_j \le 1\tag{9}
$$

According to this particular property of the vectors *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ] we can easily scale the *vj* values for representing them in integer values using all the dynamic range in order to avoid loosing too much precision in the conversion. The *vj* values are scaled in the HyperLCA algorithm according to the input number of bits , *N*bits, defined by the user for this purpose, as shown in Equation (10):

$$
v\_{j\_{\text{scaled}}} = (v\_j + 1) \cdot (2^{N\_{\text{bits}} - 1} - 1). \tag{10}$$

By doing this, it is guarantied that the maximum value obtained for each scaled *vj* vector is always 2*N*bits − 1, and its minimum value is always positive and very close to zero. After rescaling the *vj* values, they are rounded to the closer integer values so they can be entropy coded.

#### 2.5.2. Represent the Data with Positive Values Closer to Zero

The entropy coding stage takes advantage of the redundancies within the data to be coded, assigning shorter word length to the most common values. In order to achieve higher compression ratios in this stage, the centroid pixel, *c*, the selected pixels *P* = [*p*1, *p*2, ..., *pp*max ], and the already scaled and converted to integer vectors *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ], are lossless preprocessed in the HyperLCA algorithm, making use of the prediction error mapper described in the CCSDS recommended standard for lossless multispectral and hyperspectral image compression [19]. This compression stage independently processes each individual vector in order to represent its values using only positive integer values that are closer to zero than the original values of the vector, using the same dynamic range of the values.

Let us assume that we have a vector *Y* = [*y*1, *y*2, ...] whose components *yj* are represented using *n-bits* integers values. In the HyperLCA compressor, this vector *Y* may be either the centroid pixel, *c*, a pixel vector *pi* or a *vi* vector. Due to the spectral redundancies between contiguous bands, when the vector *Y* corresponds with a pixel vector *pi* or the centroid pixel *c*, we can assume that the difference between the *yj* and *yj*−<sup>1</sup> components of the vectors is closer to zero than the *yj* value itself. Similarly, we can make the same assumption when the vector *Y* corresponds with a *vi* vector, due to the spatial redundancies of the image. However, in order to prevent bit overflowing in this operation, the number of bits used for representing the prediction error, *j* = *yj* − *yj*−1, needs to be increased to *(n+1)-bits*, and the values will be in the range (−2*<sup>n</sup>* + 1, 2*n* − 1). In order to solve this issue, the prediction error, *j*= *yj*− *yj*−1, is mapped using the aforementioned prediction error mapper [19].

The overall process works as follows. First of all, the possible minimum and maximum (*y*min, *y*max) values are calculated as (−2*<sup>n</sup>*−1, 2*<sup>n</sup>*−<sup>1</sup> − 1) when the vector *Y* contains negative integer values and (0, 2*n* − 1) when it does not. Then, *θj* is calculated as *θj* = *minimum*(*yj*−<sup>1</sup> − *y*min, *y*max − *yj*−<sup>1</sup>). Finally, the prediction error *j* = *yj* − *yj*−<sup>1</sup> is mapped according to the *j* and *θj* values as shown in Equation (11):

$$Y\_{\dot{\jmath}\_{\text{mpped}}} = \begin{cases} 2\triangle\_{\dot{\jmath}\_{\text{'}}} & 0 \le \triangle\_{\dot{\jmath}} \le \theta\_{\dot{\jmath}}, \\ 2||\triangle\_{\dot{\jmath}}|| - 1, & -\theta\_{\dot{\jmath}} \le \triangle\_{\dot{\jmath}} < 0, \\ \theta\_{\dot{\jmath}} + ||\triangle\_{\dot{\jmath}}||, & \text{otherwise}. \end{cases} \tag{11}$$

By doing this, the values of the centroid pixel, *c*, the selected pixels *P* = [*p*1, *p*2, ..., *pp*max ], and the already scaled and converted to integer vectors *V* = [*<sup>v</sup>*1, *v*2, ..., *vp*max ], are represented using positive values closer to zero, and using the same amount of bits.

#### *2.6. HyperLCA Entropy Coding*

After the preprocessing stage of the HyperLCA compressor, the extracted vectors (centroid, Pixels and V vectors) are independently coded using a Golomb–Rice coding strategy. Each single vector is coded as follows:

	- **–** The quotient code is obtained by coding the *q*-value using unary code (*q* + 1 bits are required).
	- **–** The reminder code is obtained from the *r*-value. If *M* is a power of 2, the reminder code is obtained by coding *r* as plain binary using *b* bits. If *M* is not a power of 2, and *r* < 2*b* − *M*, the reminder code is obtained by coding *r* in plain binary using *b* − 1 bits. In any other situation, the reminder code is obtained by coding *r* + 2*b* − *M* in plain binary using *b* bits.

The fact of independently coding each vector provides different advantages. On one side, it is possible to use the average value of each vector as the compression parameter, *M*, which provides almost the best coding performance for the Golomb–Rice method [20], without incrementing too much the complexity of the coder. Nevertheless, in those situations in which calculating the average value of the vector represents an important disadvantage due to its complexity, other solutions could be used, such as the median value, as it is done in other compression algorithms, without compromising its good performance.

On the other side, the fact of independently coding each vector allows coding them in the same order that they are obtained in the previous compression stages of the HyperLCA algorithm. This eases the parallelization of the process, making it possible to pipeline the inputs and outputs of the different compression stages for a single block of pixels, and also reducing the amount of memory required.

#### *2.7. HyperLCA Bitstream Generation*

Finally, the outputs of the previous compression stages are packed in the order that they are produced, generating the compressed bitstream. By doing so, the computational requirements for accomplishing this last step of the HyperLCA compressor are minimal. Additionally, this order also eases the decompression process, since the compressed data is used for reconstructing the image in the exact same order that it is produced by the compressor. Figure 3 graphically shows the produced bitstream structure.

**Figure 3.** General structure of the bitstream generated by the HyperLCA algorithm

According to Figure 3, the first part of the bitstream is a header that contains the global information about the hyperspectral image and the parameters used in the compression process within the HyperLCA algorithm, which are needed for decompressing the image. Then, the compressed information of each individual block of pixels is packed in the exact same way and sequentially added to the bitstream, as shown in Figure 3.

The information contained in the header of the generated bitstream is:


Figure 4 graphically describes the header structure. In this figure, *bS* represents the number of pixels per block, *blockSize*. According to the defined number of bits used for the different data contained in the header, 89 bits are required.

**Figure 4.** Structure of the bitstream header.

The information of each individual block of pixels may be packed in two ways that contain a minimal difference, as shown in Figure 5. The first one, graphically described in Figure 5a, is used when no additional stopping condition is used, and *p*max *Pixels* and *V vectors* are extracted for each individual block. In this situation, the amount of compressed elements in each block is perfectly determined by the *p*max, *Np* and *Nb* values that are already included in the bitstream header. On the contrary, when using an additional stopping condition for stopping the algorithm if the desired quality is achieved before extracting *p*max *Pixels* and *V vectors*, the number of *Pixels* and *V vectors* extracted for each block of pixels may be different and smaller than *p*max, producing higher compression ratios. In this situation, the number of *Pixels* and *V vectors* used for compressing each block of pixels, *p* ≤ *p*max, needs to be included when coding each block of pixels, as shown in Figure 5b. This *p* ≤ *p*max value is coded as plain binary using 8 bits.

**Figure 5.** Structure of the bitstream for each block of pixels compressed by the HyperLCA algorithm. (**a**) without using extra stopping conditions; (**b**) using extra stopping conditions based on quality metrics.

#### *2.8. Possible Stopping Conditions within the HyperLCA Algorithm*

As previously described, all the losses of the compression–decompression process within the HyperLCA algorithm are produced in the spectral transformation and compression stage, carried on by the HyperLCA transform. As aforementioned, the HyperLCA transform sequentially selects the most different pixels of the image, and uses them for representing the hyperspectral data. Each time that a pixel is selected, the information that can be represented using that specific pixel is subtracted from the image, *Mc*, as described in Line 13 of the Algorithm 1. Accordingly, matrix *Mc* contains the information that would be lost if no more pixels were selected. This information can be used for setting an stopping condition in the sequential pixels selection process, based on the amount of losses desired within the compression–decompression process. For such purpose, two different approaches can be followed:


Although many different metrics can be efficiently applied to the proposed HyperLCA transform, we will focus on the RMSE, the SNR and the MaxSE metrics since these are widely used state-of-the-art metrics for evaluating the compression–decompression performance. While the RMSE and SNR are global evaluation metrics that are useful for verifying an average good compression–decompression performance, the MaxSE, despite its simplicity, is more suitable for ensuring that the anomalous pixels are preserved through the compression–decompression process. Any of the possible stopping conditions based on these metrics would be placed in line 14 of the Algorithm 1, and would prevent the extraction of more pixels if the losses achieved are small enough according to the quality metric used.

#### 2.8.1. RMSE Based Stopping Condition

The *Root Mean Square Error* (RMSE) is a frequently used metric for measuring the average differences between the real hyperspectral image and the decompressed one. A low RMSE represents low average compression–decompression errors. This metric is defined as:

$$\text{RMSE} = \frac{1}{N\_p \cdot N\_b} \cdot \sqrt{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{i,j} - M\_{i,j}')^2} \tag{12}$$

where *M* and *M* refer to the real hyperspectral image and to the decompressed one, and *Np* and *Nb* refer to the number of pixels and the number of bands in the hyperspectral image, respectively. Since *Mc* contains the information that cannot be represented with the already selected pixels, it could be directly calculated within the HyperLCA algorithm as:

$$\text{RMSE} = \frac{1}{N\_p \cdot N\_b} \cdot \sqrt{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{c\_{i,j}})^2}. \tag{13}$$

#### 2.8.2. SNR Based Stopping Condition

The *Signal-to-Noise Ratio* (SNR) generally compares the level of the desired signal to the level of background noise. It is defined as the ratio of signal power to the noise power, often expressed in decibels. In the compression scenario, the SNR metric measures the ratio between the real hyperspectral image power and the compression–decompression loses power, as shown in Equation (14), where *M* and *M* refer to the real hyperspectral image and to the decompressed one, and *Np* and *Nb* refer to the number of pixels and the number of bands in the hyperspectral image, respectively:

$$\text{SNR} = 10 \cdot \log\_{10}(\frac{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{i,j})^2}{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{i,j} - M\_{i,j}')^2}). \tag{14}$$

As aforementioned, (*Mi*,*<sup>j</sup>* − *M i*,*j* ) directly corresponds with *Mci*,*<sup>j</sup>* . Hence, the SNR can be calculated within the proposed HyperLCA transform every time that a new pixel is extracted as:

$$\text{SNR} = 10 \cdot \log\_{10} (\frac{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{i,j})^2}{\sum\_{i=1}^{N\_b} \sum\_{j=1}^{N\_p} (M\_{c,j})^2}). \tag{15}$$

As a further optimization, ∑ *Nb i*=1 ∑ *Np <sup>j</sup>*=<sup>1</sup>(*Mi*,*j*)<sup>2</sup> can be calculated just once at the beginning of the compression process, since it evaluates just the power of the real hyperspectral image, *M*.

Finally, it is important to remark that the HyperLCA transform is thought to be independently applied to blocks of pixels of the image, not to the entire image at once. Accordingly, these stopping conditions must be also independently applied to each block of pixels, and, hence, the number of pixels shown in this equations, *Np*, should be substituted by the number of pixels per block, defined as *blockSize*.

#### 2.8.3. MaxSE Based Stopping Condition

The *Maximum Single Error* (MaxSE) evaluates the maximum absolute difference between the real hyperspectral image and the compressed-decompressed one. The MaxSE that would be obtained in the compression–decompression process within the HyperLCA algorithm if no more pixels were extracted can be directly calculated, in each iteration, as the maximum absolute value of *Mc*.

#### *2.9. Computational Complexity of the HyperLCA Compressor*

The HyperLCA algorithm has been specifically designed for being able to independently compress blocks of pixels of the hyperspectral image without requiring any specific spatial alignment. This fact eases the image compression, especially when using pushbroom or whiskbroom sensors for collecting them, allowing for independently compressing the blocks of pixels as they are captured. This strategy avoids the necessity of storing big portions of the image until being able to compress them, reduces the amount of required resources for compressing the collected data, speeds up the process and provides parallelization and error-resilience. Besides the obvious gains that this fact brings in terms of lower computational complexity, the HyperLCA algorithm has the advantage that it uses simple mathematical operations that can be easily parallelized, avoiding complex matrix operations like, for instance, computing the eigenvalues and eigenvectors, operations that are present in many KLT based compression approaches.

The proposed HyperLCA compressor consists of different compression stages. The first and most computationally demanding one is the HyperLCA transform. This transform spectrally decorrelates each block of pixels of the image and reduces its number of spectral components, according to the specified compression ratio and/or quality measure stopping condition. The amount of data resulting from this transform is already much smaller than the original image. This, together with the simplicity of the subsequent compression stages, makes the computational complexity of these compression stages negligible in relation with the computational burden of the HyperLCA transform. Hence, this section focuses on analysing the computational complexity of the HyperLCA transform.

In order to simplify the analysis of the computational complexity of the HyperLCA transform, the description shown in Algorithm 1 has been followed, considering that no stopping condition based on quality metrics is used, and, hence, the maximum number of pixels to be extracted, *p*max, is always reached. In particular, the total number of operations done by the HyperLCA transform has been estimated. Despite the fact that the HyperLCA transform can be executed using integer or floating point values, the number of floating point operations (FLOPs) has been considered for simplicity. Additionally, since the HyperLCA transform is independently applied to each block of pixels, the estimation of the number of FLOPs has been done for a single block of *Np*block pixels. The amount of FLOPs required for processing the entire image directly scales with the number of blocks.

As shown in Algorithm 1, there are three sets of operations that are applied to all the pixels in each of the *p*max iterations of the HyperLCA transform, and represents the majority of its required FLOPs. These are:


• The subtraction of the information that can be spanned by the selected pixel (line 13 of Algorithm 1). This consists of first multiplying the <sup>1</sup>*xNp*block vector, *vi*, with the *Nbx*1 vector, *qi*, obtaining a *NbxNp*block , and then subtracting this matrix to the image matrix, *Mc*. Both steps require *Nb* · *Np*block FLOPs, resulting in a total of 2 · *Nb* · *Np*block .

The total number of FLOPs required by these three sets of operations is 6 · *Nb* · *Np*block . Since these operations are done once per each of the *p*max iterations of the HyperLCA transform, 6 · *p*max · *Nb* · *Np*block FLOPs are required for completely processing one block of *Np*block pixels of *Nb*. Additionally, the *p*max value depends on the different HyperLCA input parameters, as it is described in Section 2.2. Its exact value can be calculated as shown in Equation (1). Accordingly, the amount of FLOPs to be done by the HyperLCA transform for a single block can be directly estimated from the input parameters as shown in Equation (16):

$$\begin{aligned} \text{FLOPs}\_{\text{block}} &= \boldsymbol{\theta} \cdot \text{N}\_{\text{b}} \cdot \text{N}\_{\text{P}\_{\text{block}}} \cdot p\_{\text{max}}, \\ \text{FLOPs}\_{\text{block}} &= \boldsymbol{\theta} \cdot \text{N}\_{\text{b}} \cdot \text{N}\_{\text{P}\_{\text{block}}} \cdot \text{Integer}(\frac{\boldsymbol{DR} \cdot (\text{N}\_{\text{b}} \cdot (\text{N}\_{\text{P}\_{\text{block}}} - 1))}{\boldsymbol{CR} \cdot (\boldsymbol{DR} \cdot \text{N}\_{\text{b}} + \text{N}\_{\text{bits}} \cdot \text{N}\_{\text{P}\_{\text{block}}})}). \end{aligned} \tag{16}$$

Finally, since the HyperLCA transform is independently applied to each block of pixels, the amount of FLOPs required for processing the entire image can be estimated by multiplying the number of FLOPs required for processing one block by the number of blocks to be compressed. The resulting amount of FLOPs required for processing the entire image withing the HyperLCA transform is shown in Equation (17)

$$\begin{aligned} FlOPs\_{\text{Image}} &= 6 \cdot N\_b \cdot N\_p \cdot p\_{\text{max}} \\ FlOPs\_{\text{Image}} &= 6 \cdot N\_b \cdot N\_p \cdot Inputerger(\frac{DR \cdot (N\_b \cdot (N\_{P\_{\text{block}}} - 1))}{CR \cdot (DR \cdot N\_b + N\_{\text{bits}} \cdot N\_{P\_{\text{block}}})} . \end{aligned} \tag{17}$$

Different conclusions can be dragged from these expressions. Firstly, it can be observed that higher CR leads to lower *p*max values, which results in less number of FLOPs required for compressing the image. Additionally, less data is produced by the HyperLCA transform as the CR increases, and, so, less data is to be compressed in the subsequent compression stages. These two facts make the HyperLCA compressor more efficient as the compression ratio increases. Secondly, for the same CR and *Nb* values, smaller block sizes *Np*block produce smaller *p*max values, decreasing the number of FLOPs required for compressing the entire image. This makes the HyperLCA compressor more efficient when smaller blocks are used. Additionally, the number of FLOPs required for processing each single block directly depends on the *Np*block and the *p*max value, and, hence, the computational complexity (in terms of FLOPs) for independently processing one single block exponentially decreases by decreasing the number of pixels per block, *Np*block. According to these facts, the HyperLCA compressor

would be especially efficient (in terms of FLOPs) for processing hyperspectral images when it is desired to achieve high compression ratios and when using small blocks of pixels. All these facts present important advantages especially when using pushbroom or whiskbroom sensors for collecting the images. The strategy followed by the HyperLCA compressor, based on these facts, avoids the necessity of storing big portions of the image until being able to compress them, reduces the amount of required resources for compressing the collected data, speeds up the process and provides parallelization and error-resilience.

Finally, the operations done by the HyperLCA inverse transform, shown in Algorithm 2, are almost the same as the operations done by the HyperLCA transform, but are used for adding information to the image instead of subtracting it. In general, the operations required for decompressing the image using the HyperLCA algorithm are almost the same as the operations used for compressing it, but applied in reverse order. Due to this reason, the number of FLOPs required for decompressing each block of pixels of the image, as well as the entire image, can be also estimated as shown in Equations (16) and (17), respectively.

#### *2.10. Advantages of the HyperLCA Compression Algorithm*

The HyperLCA algorithm has several advantages with respect to other state-of-the-art solutions for lossy compressing hyperspectral images, which will be demonstrated in Section 4 of the current paper. The main advantages of the HyperLCA compressor are detailed next:


All these advantages make the HyperLCA algorithm a very suitable option for applications under tight latency constraints or with limited available resources, such as the compression of hyperspectral images on board satellites, where it is critical to consider the amount of power, time and computational resources used.

#### **3. Material and Methods**

In order to evaluate the goodness of the proposed HyperLCA algorithm for compressing hyperspectral images in relation with other state-of-the-art approaches for this task, different experiments have been done. The hyperspectral images and quality metrics used in these experiments are detailed next.

#### *3.1. Hyperspectral Images Used*

A heterogeneous test bench has been selected in order to evaluate the behavior of the proposed compressor under different circumstances. On one side, we have selected three different images from the well known Airbone Visible/Infrarred Imaging Spectrometer (AVIRIS) [21]. This sensor captures 224 spectral bands in the wavelength range of 400–2500 nm. The first one is the Yellow Stone (Sc 0) radiance image. The other two images used, collected with the AVIRIS sensor, correspond to reflectance images. These are the Lunar Lake image and the Moffet Field one. These images have been cropped to portions of 512 × 512 pixels. Figure 6 graphically shows a false color representation of the portions of the AVIRIS hyperspectral images used.

**Figure 6.** RGB representation of the used hyperspectral images collected by the AVIRIS sensor. (**a**) Yellowstone; (**b**) Lunar Lake; (**c**) Moffet Field.

On the other side, in order to evaluate the behavior of the HyperLCA algorithm in a more challenging scenario, three different uncalibrated images from the Hyperion sensor have been used. The Hyperion sensor produces 242 spectral bands between 355.59 and 2577.08 nm [22]. The Hyperion images that have been used in the experiments are the Erta Ale image, the Lake Monona image and the Mt. St. Helens one. These images have been cropped to portions of 512 × 256 pixels. Figure 7 shows a grey scale representation of these images. As it can be observed in this figure, these images contain a high amount of striping noise, which makes the compression of these images more challenging.

Finally, the impact of the HyperLCA compression process in the ulterior hyperspectral imaging applications has also been evaluated. Specifically, classification, anomaly detection and spectral unmixing applications have been considered. For measuring the effect of the compression process in these applications, some well known images, typically used in these fields due to the existence of their corresponding ground truths, have been selected. These images are preprocessed as it is usually done in the corresponding targeted hyperspectral imaging applications.

**Figure 7.** Grey scale representation of the used hyperspectral images collected by the Hyperion sensor. (**a**) Erta Ale; (**b**) Lake Monona; (**c**) Mt. St. Helens.

First, two different hyperspectral data sets have been used for evaluating the effect of the HyperLCA compression process in classification applications. The first one was collected in 1996 by the AVIRIS sensor over Indian Pines in northwestern Indiana. The selected scene is a total of 145 × 145 pixels with a spatial resolution of 20 m. Bands [1–4], [108–112], [154–167], and 224 have been removed due to water absorption, resulting in a total of 200 hyperspectral bands. The Indian Pines scene contains two-thirds agriculture, and one-third forest or other natural perennial vegetation. There are two major dual-lane highways, a rail line, as well as some low-density housing, other build structures, and smaller roads. The ground truth available is designated into sixteen classes that are briefly summarized in Table 1. The second data set used for evaluating the impact of the HyperLCA compression process in classifications' applications was captured over the city of Pavia, Italy, by the Reflective Optics Spectrographic Imaging System (ROSIS-03) airborne instrument. The ROSIS-03 sensor has 115 data channels with a spectral coverage ranging from 430 to 860 nm. Twelve channels have been removed due to noise. The data have been corrected atmospherically but not geometrically. The scene consists of 640 × 340 pixels with a spatial resolution of 1.3 m per pixel that covers the Engineering School at the University of Pavia and consists of nine different classes, briefly summarized in Table 1. Figures **??** and 8 show a false color representation of the two described hyperspectral images as well as their corresponding ground truths.

The impact of the HyperLCA compression in anomaly detection applications has been evaluated using two different hyperspectral data sets. The first one was captured over the Rochester Institute of Technology (RIT) by the Wildfire Airborne Sensor Program (WASP) Imaging System [23]. This system covers the visible, short, mid and long-wave infrared regions of the spectrum. The sensor was comprised by a high-resolution colour camera that covers the visible spectrum, a short wave infrared imager that covers from 900 nm to 1800 nm, a mid wave infrared imager that covers from 3000 nm to 5000 nm and a long wave infrared imager that covers from 8000 nm to 9000 nm. In particular, a portion of the overall image, taken over a parking lot, with a size of 180 × 180 pixels and 120 spectral bands, is used in this study. In this scene, the anomalies are fabric targets, which consist of 72 pixels and account for 0.22% of the image. The second data set used was captured by the AVIRIS sensor over the World Trade Center (WTC) area in New York City on 16 September 2001 [24]. A portion of the entire data set, with a size of 200 × 200 pixels and 224 spectral bands, has been used for the tests, where the anomalies are thermal hot spots that consist of 83 pixels and account for 0.21% of the image scene. Figure 9 shows a false color representation of the two described hyperspectral images as well as their corresponding ground truths.


**Table 1.** Ground truth classes for the Indian Pines and Pavia University scenes and their respective number of samples.

**Figure 8.** RGB representation of the Pavia University (PU) hyperspectral image and its corresponding ground truth for classification applications. (**a**) PU Image; (**b**) PU Ground truth.

**Figure 9.** RGB representation of the Rochester Institute of Technology (RIT) and World Trade Center (WTC) hyperspectral images and their corresponding ground truths for anomaly detection applications. (**a**) WTC Image; (**b**) WTC Ground truth; (**c**) RIT Image; (**d**) RIT Ground truth.

Finally, the Cuprite data set has been used for evaluating the impact of the HyperLCA compression process in unmixing applications. This image was taken by the AVIRIS sensor over the region of Cuprite, Nevada, USA in the summer of 1997. The selected scene consists of a total of 350 × 350 pixels with a spatial resolution of 4 m. Several bands have been removed due to water absorption and low SNR, resulting in a total of 188 spectral bands. The site is well understood mineralogically, and has several exposed minerals of interest including alunite, buddingtonite, calcite, kaolinite and muscovite. The ground truth of this data set consists of the spectral signature of these five minerals, each of them represented in the same 188 spectral bands that the hyperspectral image. Figure 10 graphically shows these five spectral signatures as well as a false color representation of the Cuprite hyperspectral image.

## *3.2. Evaluation Metrics*

Lossy compression approaches for hyperspectral images are typically evaluated in terms of the rate-distortion relation achieved. However, it has been proven that low average distortions in the compression–decompression process do not necessarily ensure good results when the decompressed images are used in specific hyperspectral applications [5]. In general, lossy compression behaves as a low-pass filter, reducing the noise present in the image. This may improve the results obtained in some applications when using the decompressed images. Nevertheless, the low pass filter can also remove the most atypical elements of the image, which are crucial for several applications, such as anomaly detection, classification, unmixing, or target detection [13–17]. Due to this reason, three different evaluation metrics have been used for measuring the goodness of the compression–decompression process within the HyperLCA algorithm. On one side, the *Signal-to-Noise Ratio* (SNR) has been calculated as already described in Section 2.8.2 for measuring the average looses introduced by the compressor. High SNR values indicate good average compression performance.

**Figure 10.** RGB representation of the Cuprite hyperspectral image as well as the spectral signatures corresponding to the five minerals that are known to be present in this scene. These signatures conform the ground truth typically used for evaluating the endmembers extraction algorithms. (**a**) cuprite image; (**b**) reference spectral signatures.

On the other side, the *Maximum Single Error* (MaxSE), already described in Section 2.8.3, has also been used. The maximum single reconstructions errors are typically produced in the most different elements, and, hence, it can be assumed that lower MaxSE values indicate that the most different pixels in the data set are being better preserved through the compression–decompression process [25].

Finally, most of the hyperspectral imaging applications make use of the spectral information of the image for identifying or distinguishing between the different materials present in the scene. Due to this reason, in order to not affect the results of the subsequent hyperspectral applications, it is crucial to preserve the spectral signatures of the pixels through the compression–decompression process, introducing the minimal possible amount of spectral distortions. In order to evaluate the spectral distortions produced by the compression–decompression process within the HyperLCA algorithm, the *Spectral Angle* (SA) [26], has been used. Lower SA values indicate lower spectral distortions. In particular, the average and maximum spectral distortions have been measured in the experiments by calculating the average and maximum spectral angles between the pixels of the real images and the compressed-decompressed images.

It is important to remark that, although the HyperLCA compressor independently compresses each block of pixels of the image, all these metrics have been calculated for the entire compressed-decompressed images once each single block is decompressed. This allows for making fair comparisons with the other compression approaches used.

#### **4. Results and Discussion**

This section discloses the results obtained in all the uncovered experiments with the purpose of evaluating the goodness of the proposed HyperLCA algorithm for compressing hyperspectral images.

#### *4.1. Effect of the Input Parameters of the HyperLCA Compressor*

The HyperLCA algorithm has two main input parameters that may affect its compression performance: the number of pixels per block in which the image is divided, *blockSize*, and the number of bits used for scaling the extracted *V vectors*, *N*bits. Different experiments have been done in order to evaluate the behavior of the HyperLCA compressor when using different values for these parameters. In particular, the number of pixels per block, *blockSize*, has been set to 256, 512 and 1024 pixels, and considering the dynamic range of the AVIRIS and Hyperion sensors, the *N*bits parameter has been set to 16, 12 and 8 bits for the AVIRIS images and 12 and 8 for the Hyperion sensor images. Figure 11a graphically shows the average rate-distortion obtained, in terms of SNR, when compressing the Lunar Lake hyperspectral image collected by the AVIRIS sensor, according to these parameters for

different compression ratios. Figure 11b graphically shows the MaxSE obtained for the same image and compression ratios, according to the different values of *blockSize* and *N*bits. Similarly, Figure 12a,b display the same information but for the Erta Ale hyperspectral image collected by the Hyperion sensor.

**Figure 11.** HyperLCA compression results for the Lunar Lake AVIRIS image using different *blockSize* and *N*bits values.

**Figure 12.** HyperLCA compression results for the Erta Ale Hyperion image using different *blockSize* and *N*bitsvalues.

The achieved compression has been represented in Figures 11 and 12 in terms of *Bits per Pixel per Band* (bpppb). The *bpppb* indicates the number of bits of the compressed data in relation with the number of bits of the original image. Accordingly, lower *bpppb* indicates higher compression ratios, *RC*.

According to the results shown in Figures 11 and 12 it can be observed that the HyperLCA compressor is able to achieve very high compression ratios with a good rate-distortion relation and low MaxSE values with all the tested combinations of the *blockSize* and *N*bits parameters, for both the Lunar Lake AVIRIS image and the Erta Ale Hyperion image. Nevertheless, the best results have been produced when using blocks of 1024 pixels (*blockSize* = 1024). Additionally, the *N*bits value that has produced the best results is, in average, 12 bits for the Lunar Lake AVIRIS image and 8 bits for the Erta Ale Hyperion image. Hence, in order to verify that these parameters values also produce good compression results for the complete set of images of the AVIRIS and Hyperion sensors, the rest of the images of the data set have been also compressed using the HyperLCA algorithm, using *blockSize* = 1024 and *N*bits = 12 for the AVIRIS images and *blockSize* = 1024 and *N*bits = 8 for the Hyperion sensor ones. Figure 13 graphically shows the obtained results. According to these results, the HyperLCA compressor is able to produce relatively high rate-distortion ratios for all the images in the data set, and for very high compression ratios. It is also worth mentioning that the compression performance of the HyperLCA algorithm is very solid for the three different uncalibrated images, collected by the Hyperion sensor, that contain a high amount of striping noise and typically represent a bigger challenge for the compression algorithms. Figure 13 also shows that the MaxSE values tend to very low values for both sensors in relation with their dynamic ranges, also demonstrating the good compression performance of the HyperLCA algorithm.

**Figure 13.** HyperLCA compression results for the images collected by the AVIRIS and Hyperion sensors. (**a**) AVIRIS images; (**b**) Hyperion images.

#### *4.2. Evaluation of the HyperLCA Algorithm against Other Transform-Based Approaches*

Most of the advantages of the HyperLCA compression algorithm, described in Section 2.10, are inherited from the HyperLCA transform, explained in Section 2.3. This transform allows to efficiently perform the spectral decorrelation and compression of the hyperspectral image. As aforementioned, the HyperLCA transform has been specially developed for being able to preserve the most different pixels through the compression–decompression process, since these pixels are very important for different hyperspectral imaging applications such as anomalies detection, target detection or classification. In order to verify the goodness of the HyperLCA transform against other state-of-the-art transforms used for the same purpose, the *Principal Component Analysis* (PCA) has been considered. Despite its computational complexity, the PCA produces some of the best transform-based compression results, in terms of rate-distortion as well as in preserving the relevant information for the ulterior hyperspectral analysis [4–7].

For making a fair comparison of both hyperspectral transforms, the different hyperspectral images of the data set have been spectrally decorrelated and reduced using the HyperLCA and the PCA transforms, for different compression ratios, without applying any further compression stage. Figures 14–17 graphically show the obtained results. It is also worth to mention that while the HyperLCA transform has been computed in order to produce integer values that can be directly

processed by the upcoming compression stages, the PCA transform has been computing in Matlab using double precision floating point.

**Figure 14.** Comparison of the results produced by the HyperLCA and PCA transforms using the data set images collected by the AVIRIS sensor, in terms of SNR and MaxSE. (**a**) Lunar Lake; (**b**) Moffet Field; (**c**) Yellowstone.

Figures 14 and 15 graphically show the results produced by the HyperLCA and PCA transforms for the different data set images collected by the AVIRIS sensor. Similarly, Figures 16 and 17 show the results obtained with these transforms when processing the images collected by the Hyperion sensor. According to the results shown in Figure 14, both transforms produce similar results in terms of average rate-distortion ratio, the SNR produced by the PCA for these images being slightly better than the SNR produced by the HyperLCA transform. On the contrary, the MaxSE values obtained by the HyperLCA transform for these images are much lower than the MaxSE values obtained by the PCA transform, which indicates that the most different elements are much better preserved when using the HyperLCA transform. Figure 15 corroborates these conclusions. The average rate-distortion relation obtained, evaluated in terms of MeanSA, is similar for both transforms, being slightly better for the PCA transform. However, the MaxSA values obtained in the experiments indicate that there are spectral signatures with higher distortions when using the PCA transform than when using the HyperLCA transform. On the other hand, according to the results obtained when processing the images collected by the Hyperion sensor, shown in Figures 16 and 17, the HyperLCA transform clearly outperforms the PCA transform in terms of SNR, MaxSE and MaxSA, but not in MeanSA.

**Figure 15.** Comparison of the results produced by the HyperLCA and PCA transforms using the data set images collected by the AVIRIS sensor, in terms of SA. (**a**) Lunar Lake; (**b**) Moffet Field; (**c**) Yellowstone.

All these results demonstrate the goodness of the HyperLCA transform for spectrally decorrelating and reducing hyperspectral data sets, and sugges<sup>t</sup> that its results are also good enough when processing images with high levels of noise. The obtained results also verify that the HyperLCA transform is capable of keeping the most different elements of the data set through the compression–decompression process introducing minimal spectral distortions, which makes it very useful when the compressed-decompressed images are to be used for hyperspectral applications such as anomalies detection, target detection, or classification.

Additionally, it can also be observed that the results of the HyperLCA transform, shown in Figures 14 and 16, display similar curves to the results provided by the entire HyperLCA compressor (HyperLCA transform, preprocessor and coder), but at lower compression ratios (higher *bpppb* values). This is due to the fact that the HyperLCA preprocessing and coding stages slightly increase the compression ratios achieved by the HyperLCA transform without introducing further compression losses.

**Figure 16.** Comparison of the results produced by the HyperLCA and PCA transforms using the data set images collected by the Hyperion sensor, in terms of SNR and MaxSE. (**a**) Erta Ale; (**b**) Lake Monona; (**c**) Mt. St. Helens.

#### *4.3. Evaluation of the Impact Produced by the HyperLCA Compression Process in the Ulterior Hyperspectral Imaging Applications*

As already mentioned, the HyperLCA algorithm is a lossy compressor for hyperspectral images, especially designed for achieving high compression ratios at a reasonable computational burden. However, it is important to have in mind that the compressed-decompressed data sets have to be useful for the ulterior hyperspectral imaging applications, and, hence, some more requirements need to be fulfilled rather than just achieving a high compression rate–distortion relation. Due to this reason, the HyperLCA algorithm has been specifically designed for preserving the most different pixels of the data set through the compression–decompression process, since these pixels are very important for applications such as anomaly detection, spectral unmixing or classification, as well as for introducing few spectral distortions, since the spectral information is extremely important in most of the hyperspectral imaging applications. Different experiments have been uncovered in this section for evaluating the impact of the HyperLCA compression process in hyperspectral imaging classification, anomaly detection and spectral unmixing applications.

**Figure 17.** Comparison of the results produced by the HyperLCA and PCA transforms using the data set images collected by the Hyperion sensor, in terms of SA. (**a**) Erta Ale; (**b**) Lake Monona; (**c**) Mt. St. Helens.

From the entire HyperLCA compression process, all the losses of information are produced by the HyperLCA transform. Due to this reason, the impact of the compression–decompression process using just the HyperLCA transformation stage in the mentioned hyperspectral applications is evaluated and compared with the impact produced by the PCA transform for the same images and applications. It is worth to mention here that the PCA transform is used in many hyperspectral applications, such as unmixing or classification, for spectrally decorrelating the information and reducing the number of spectral components of the data set, with the goal of reducing the redundant information, increasing the separability of the different elements of interest and improving the application results [9,10,27]. Accordingly, the PCA transform can be considered as a good reference to compare with, regarding the impact of the HyperLCA transform in the ulterior hyperspectral applications.

4.3.1. Evaluation of the Impact Produced by the HyperLCA Compression Process in Hyperspectral Imaging Classification

For fairly evaluating the effect of the HyperLCA compressor in hyperspectral imaging classification applications, the Indian Pines and Pavia University data sets, described in Section 3.1, have been spectrally decorrelated and reduced using the HyperLCA and the PCA transforms, for different compression ratios, without applying any further compression stage. Figure 18 graphically shows the obtained performance using both transforms, according to the different evaluation metrics described in Section 3.2. These results have been obtained using blocks of 725 pixels (*blockSize* = 725) for the Indian Pines image, which corresponds to five lines of the image, and blocks of 680 pixels (*blockSize* = 680) for the Pavia University data set, which corresponds to two lines of the image. Additionally, the *N*bits value has been set to 8 bits for both data sets. After doing so, all the reconstructed images as well as the original images (without applying any transformation) have been classified using the well known *Suport Vector Machine* (SVM) classifier, which is one of the most widely used classifiers for hyperspectral imaging applications [28]. The SVM classifier has been trained for performing linear prediction following the one versus one classification model, using the LIBSVM tool [29].

**Figure 18.** Comparison of the results produced by the HyperLCA and PCA transforms using the Indian Pines and Pavia University data sets, according to the different evaluation metrics. (**a**) Indian Pines; (**b**) Pavia University; (**c**) Indian Pines; (**d**) Pavia University.

The followed methodology is described next:


The results obtained by following this process are graphically shown in Figure 19 for both the Indian Pines and Pavia University data sets. Each graph displays the OA obtained for each spectral transform and compression ratio (left vertical axis), as well as the PC (right vertical axis). Lower PC values indicate a higher impact of the spectral transform in the classification process (a lossless compression would produce *PC* = 100%). However, the produced impact does not necessarily need to be negative, since the lost information may be removing part of the noise present in the image, which could improve the classification results, or relevant information, which would decrease the classification performance [12]. When the OA values obtained with the reconstructed images are higher than the OA values obtained with the original image, it indicates a positive impact of the transform. On the contrary, when the OA values obtained with the reconstructed images are lower than the OA values obtained with the original image, it indicates a negative impact. The horizontal dashed line displayed in both graphs shows the OA obtained with the original Indian Pines and Pavia University images.

**Figure 19.** Comparison of the effect of the HyperLCA and PCA transforms in the SVM classification results using the Indian Pines and Pavia University data sets. (**a**) Indian Pines; (**b**) Pavia University.

Different conclusions can be dragged from the results shown in Figure 19. First of all, according to the obtained PC, it can be observed that the HyperLCA transform produces a lower impact in the classifier than the PCA transform, for both data sets, with independence of the compression ratio achieved. It can also be seen that the PC obtained using both transforms decreases as the compression ratio increases (smaller *bpppb*), which makes sense considering that the amount of losses introduced by the transforms increase with the compression ratio.

Regarding the OA obtained in the experiments, it can be observed that better classification results are obtained when using the HyperLCA transform than when using the PCA transform, when using the SVM classifier with the specified configuration and the two described data sets. It can also be observed that the OA obtained for the images processed using the PCA transform are always lower than the OA obtained for the original images, and decreases when the compression ratio increases. This suggests that part of the important information present in the original image is lost when using the PCA transform, and these losses are higher when the compression ratio increases. On the contrary, the OA obtained for the images processed using the HyperLCA transform tends to be higher than the OA obtained for the original images. This suggests that the information lost when using the HyperLCA transform is not relevant for the SVM classification process, and that these losses help to maximize the differences between the samples of the different classes.

According to these results, it could be considered that the HyperLCA transform has a smaller and more positive impact than the PCA transform in the ulterior hyperspectral imaging classification.

#### 4.3.2. Evaluation of the Impact Produced by the HyperLCA Compression Process in Hyperspectral Anomaly Detection

For fairly evaluating the effect of the HyperLCA compressor in hyperspectral anomaly detection applications, the Rochester Institute of Technology (RIT) and the World Trade Center (WTC) data sets, described in Section 3.1, have been spectrally decorrelated and reduced using the HyperLCA and the PCA transforms, for different compression ratios, without applying any further compression stage. Figure 20 graphically shows the obtained performance using both transforms, according to the different evaluation metrics described in Section 3.2. These results have been obtained using blocks of 1080 pixels (*blockSize* = 1080) for the RIT image, which corresponds to six lines of the image, and blocks of 1000 pixels (*blockSize* = 1000) for the WTC data set, which corresponds to five lines of the image. Additionally, the *N*bits value has been set to 8 bits for both data sets. After doing so, all the reconstructed images as well as the original images (without applying any transformation) have been processed using the well known *Orthogonal Subspace Projection Reed-Xiaoli* (OSPRX) detector for identifying the anomalous pixels. The OSPRX algorithm is one of the commonly used detectors for anomaly detection applications and provides good detection results [30–32].

The followed methodology is described next:


The results obtained by following this process are graphically shown in Figure 21 for both the RIT and WTC data sets. Each graph displays the AUC values obtained for each spectral transform and compression ratio (left vertical axis), as well as the MSE obtained for the different anomaly maps, corresponding to the reconstructed images (right vertical axis). Higher MSE values indicate a bigger difference between the anomaly maps generated with the reconstructed images and the one generated with the original image, which means a higher impact of the HyperLCA and PCA transforms in the anomaly detection process. This impact could be positive if just part of the noise present in the image is removed by the transforms, which could improve the anomaly detection results, or negative if relevant information, such as the anomalous pixels, is lost [12]. When the AUC values obtained with the reconstructed images are closer to 1 than the AUC value obtained for the original image, it indicates a positive impact of the transform. On the contrary, when the AUC values obtained with the reconstructed images are closer to 0 than the AUC values obtained with the original image, it indicates a negative impact. The horizontal dashed line displayed in both graphs shows the AUC value obtained with the original RIT and WTC images.

**Figure 20.** Comparison of the results produced by the HyperLCA and PCA transforms using the Rochester Institute of Technology (RIT) and the World Trade Center (WTC) data sets, according to the different evaluation metrics. (**a**) Rochester Institute of Technology; (**b**) World Trade Center; (**c**) Rochester Institute of Technology; (**d**) World Trade Center.

Different conclusions can be dragged from the results shown in Figure 21. First of all, according to the obtained MSE, it can be observed that the HyperLCA transform produces a lower impact in the anomaly detection process within the OSPRX detector than the PCA transform, for both data sets, with independence of the compression ratio achieved. It can also be seen that the MSE obtained using both transforms increases with the compression ratio (smaller *bpppb*), which makes sense considering that the amount of losses introduced by the transforms also increases with the compression ratio. It is also appreciable that the MSE values obtained are very close to 0. This is due to the fact that the anomaly maps should provide values close to 0 for the background pixels and values close to 1 for the anomalous pixels. Accordingly, most of the values obtained in the anomaly maps are very close to 0. Since the amount of anomalous pixels represents less than the 0.25% in both images, anomaly maps with big errors in the anomalous pixels would still produce very small MSE values. Hence, it is important to have in mind that low MSE values when comparing the obtained anomaly maps do not necessarily mean a low impact of the transforms in the anomaly detection process, and that this metric can be used just as a comparative between both transforms.

**Figure 21.** Comparison of the effect of the HyperLCA and PCA transforms in the OSPRX detector results using the Rochester Institute of Technology (RIT) and World Trade Center (WTC) data sets. (**a**) Rochester Institute of Technology; (**b**) World Trade Center.

Regarding the AUC values obtained in the experiments, it can be observed that better anomaly detection results are obtained when using the HyperLCA transform than when using the PCA transform, when using the OSPRX detector with the specified configuration and the two described data sets. It can also be observed that the AUC values obtained when using the compressed-decompressed RIT image, using both transforms, are better than the results obtained when using the original image. This suggests that the important information for the anomaly detection is preserved by both transforms and that just part of the noise or not useful information (for anomaly detection and the OSPRX detector) has been removed. It is also interesting that, for the RIT data set, the OSPRX performance increases with the compression ratio (higher AUC values are obtained for lower *bpppb*), for both spectral transforms. However, for the WTC data set, the OSPRX performance obtained with the compressed-decompressed image using the PCA transform significantly decreases for the highest compression ratios. This suggests that at such high compression ratios, the anomalous pixels have been lost through the PCA compression process.

According to these results, it could be considered that both spectral transforms are able to preserve the anomalous pixels through the compression–decompression process, having a positive impact in the anomaly detection process when using the OSPRX detector, at least for a wide range of compression ratios and the two selected data sets. It could also be concluded that the results obtained by the OSPRX detector are better when the HyperLCA transform has been applied rather than when the PCA transform has been applied.

4.3.3. Evaluation of the Impact Produced by the HyperLCA Compression Process in the Endmembers Finding Process for Spectral Unmixing Applications

The effect of the HyperLCA compressor in endmembers finding applications has been evaluated using the Cuprite data set, described in Section 3.1. This hyperspectral image has been spectrally decorrelated and reduced using the HyperLCA and the PCA transforms, for different compression ratios, without applying any further compression stage. Figure 22 graphically shows the obtained performance using both transforms, according to the different evaluation metrics described in Section 3.2. The HyperLCA results have been obtained using blocks of 700 pixels (*blockSize* = 700), which corresponds to two lines of the image, and setting the *N*bits value to 8 bits.

**Figure 22.** Comparison of the results produced by the HyperLCA and PCA transforms using the Cuprite data set, according to the different evaluation metrics.

After spectrally decorrelating and reducing the Cuprite image for the different compression ratios, using both transforms, all the reconstructed images as well as the original one (without applying any transformation) have been analysed in order to identify the pixels of the data set with the smallest differences in relation to the five pure spectral signatures of the ground truth: alunite, buddingtonite, calcite, kaolinite and muscovite. This allows identifying the pixels that would be the best candidates of each image to be selected as endmembers by spectral linear unmixing algorithms based on pure pixels [11], such as the *Vertex Component Analysis* (VCA) [34], the *Orthogonal Subspace Projection* (OSP) [35] or N-Finder [36] algorithms, among others. The best performance that the mentioned unmixing algorithms could achieve when processing the different compressed-decompressed images, as well as the original one, can be evaluated attending to the spectral angle obtained for the pixels identified as the best candidates to be endmembers. Lower spectral angle values indicate better achievable performance. The MeanSA and MaxSA values obtained for these pixels in the Cuprite image, when using both transforms and different compression ratios are graphically shown in Figure 23. The MeanSA and MaxSA values obtained for the original Cuprite image are also displayed in this graph as dashed lines.

**Figure 23.** Comparison of the effect of the HyperLCA and PCA transforms in the unmixing results, using the Cuprite data set.

The results displayed in Figure 23 show that the effect of the HyperLCA transform in the SA values obtained does not vary too much with the compression ratio achieved. This suggests that the

HyperLCA transform could have a low impact in the results of the unmixing applications. On the other hand, the SA values obtained when using the PCA transform present larger variations for the different compression ratios, which suggests that the PCA transform has a higher impact on the achievable results of the ulterior unmixing applications. Nevertheless, the results obtained when using any of the tested transforms are very similar to the results obtained when using the Original Cuprite image, indicating that the impact produced by these transforms in the ulterior spectral unmixing applications could be negligible.

#### *4.4. Evaluation of the HyperLCA Algorithm against the State-of-the-Art Solutions for on-Board Applications*

Finally, as described in Section 1, the HyperLCA algorithm has been designed with the purpose of offering a hardware-friendly transformed based approach for lossy compressing hyperspectral images. The main goal is to provide a new solution for applications with limited available resources, such as compression on-board satellites. In particular, this new solution focuses on obtaining high compression ratios at a reasonable rate-distortion relation, without compromising too much the ulterior hyperspectral imaging applications.

This section is devoted to evaluating the characteristics of the HyperLCA compressor against the state-of-the-art solutions for on-board hyperspectral imaging compression, and, more specifically, against the actual standards proposed by the Consultative Committee for Space Data Systems [19] for space applications. The goal is to verify that the HyperLCA algorithm provides some new advantages for some specific situations and/or applications that are not totally covered by the existing standards.

The CCSDS has published two standards specially focused on hyperspectral imaging compression (also applicable to multispectral image compression). These are the CCSDS122.1-B-1 *Spectral Preprocessing Transform for Multispectral and Hyperspectral Image Compression* [37] and the CCSDS123.0-B-1 *Lossless Multispectral and Hyperspectral Image Compression* [38].

The CCSDS122.1-B-1 proposes a compressor that consists of two main functional parts: a spectral transform and a set of 2D encoders. The proposed 2D coders extend the (two-dimensional) CCSDS Image Data Compression standard, CCSDS 122.0-B-2 [39]. The process consists of first spectrally decorrelating the data set using one of the three proposed spectral transforms: the *Integer Wavelet Transform* (IWT) [40], the *Pairwise Orthogonal Transform* (POT) [41,42] or the *Arbitrary Affine Transform* (AAT), and, then, independently compressing each of the decorrelated image bands using the mentioned two-dimensional coder. The CCSDS122.1-B-1 also allows using the Identity Transform instead of any of the mentioned transforms. This transform is defined for the sake of providing a compressed data structure to encode a 3D image without requiring the implementation of a more complex transform stage. The compressor proposed in the CCSDS122.1-B-1 standard may produce both lossless or lossy hyperspectral image compression. However, the losses are mostly introduced by the 2D CCSDS 122.0-B-2 image coder, the spectral transform being mainly executed as lossless transforms. The AAT is the only one of the mentioned transforms that is not guaranteed to produced lossless results. In this sense, the HyperLCA compressor proposes a different strategy, the HyperLCA transform being the one taking control of the introduced losses while the subsequent HyperLCA compression stages produce lossless compression. This represents an additional computational advantage for the HyperLCA compressor, since the amount of data to be coded by the compression stages that goes after the HyperLCA transform is much smaller than the original image. On the contrary, when following the strategy proposed in the CCSDS122.1-B-1, the amount of information to be coded after applying the spectral transforms is exactly the same size as the original image. The equivalent approach using the transforms proposed in the CCSDS122.1-B-1 standard would be to preserve just a certain number of the decorrelated bands for reconstructing the hyperspectral image, and lossless compressing these bands using the CCSDS 122.0-B-2 coder. The information contained in the bands that are not considered would correspond with the losses produced in the compression process. However, even doing it this way, it would not exactly correspond with the strategy followed by the HyperLCA algorithm, since, in this approach, the spectral transform would being applied to the entire image at once, while the

HyperLCA transform is independently applied to a subset of pixels of the image (typically one or some lines of the image).

Nevertheless, the transform-based compression approach proposed by the CCSDS122.1-B-1 is the most similar to the HyperLCA compression strategy from all the CCSDS standards. As it is described in this standard, the Karhunen Loève Transform (KLT) is "the transform that provides perfect decorrelation", and the POT is an approximation of the (KLT) at a fraction of its computational cost. The standard also describes that, in general, the POT provides better coding performance than the IWT, but requires more computational resources and has a more complex implementation. Additionally, these assertions are empirically demonstrated in [5,7,41–43]. These results show that the compression performance of the KLT transform (PCA) clearly surpasses the compression performance provided by the rest of the transforms contained in the aforementioned standard. Accordingly, the results shown in the previous sections of this manuscript, where the results provided by the HyperLCA transform are widely compared with the results provided by the PCA transform, for different images and compression ratios, should be enough for verifying the good behavior of the HyperLCA transform for lossy compressing hyperspectral images, particularly when high compression ratios are desired. It is also important to remark here that the HyperLCA compressor has been specifically developed for lossy compressing hyperspectral images and, hence, its efficiency is not guaranteed for compressing multispectral images (with few bands), or for lossless compressing hyperspectral images.

On the other hand, the CCSDS123.0-B-1 proposes a 3D lossless prediction-based compression algorithm for hyperspectral images, which is hardly optimized for producing an efficient lossless compression at a relatively low computational cost. However, as any other lossless compressor, its achievable compression ratio is limited [44–46]. The authors consider that the use of a lossy transform-based approach, such as the HyperLCA compressor, which may be more complex that the compressor described in this standard, is only justified when it is important to achieve high compression ratios that are not achievable by the CCSDS123.0-B-1 compressor. Hence, the maximum compression ratios achieved by this compressor for the data sets described in Section 3.1 are shown in Table 2. Table 2 also shows different rate-distortion relations achieved by the HyperLCA compressor for the same images. The HyperLCA results shown in this table have been obtained using 1024 pixels per block (*blockSize* = 1024) and setting the *N*bits parameter to 12 and 8 for the images collected by the AVIRIS and Hyperion sensors, respectively. The CCSDS123.0-B-1 results have been obtained using the WhiteDwarf software [47], developed by the European Space Agency (ESA). Additionally, an RGB representation of the compressed-decompressed AVIRIS images corresponding to Table 2 are displayed in Figure 24. Similarly, a grey scale representation of the compressed-decompressed Hyperion images corresponding to Table 2 are displayed in Figure 25. Figure 24 demonstrates that no appreciable spatial errors are introduced in the images collected by the AVIRIS sensor when compressing them using the HyperLCA algorithm, since the RGB images obtained for the different compression ratios seem very similar. However, there are some spatial differences in the compressed-decompressed images obtained for the Hyperion sensor, as can be observed in the Figure 25, especially for the highest compression ratios shown in Table 2. It seems that the striping noise is slightly removed, but also that some lines of the images are blurred (just for the highest compression ratios). Nevertheless, these results seem pretty good considering the quality of the Hyperion images and the achieved compression ratios.

The obtained results verify that the HyperLCA compressor is able to achieve much higher compression ratios (lower bpppb) than the CCSDS123.0-B-1 compressor at a reasonable good rate-distortion relation. This, together with the other features of the HyperLCA algorithm, makes this proposal a suitable option for those applications, where it is desired to perform lossy compression with the purpose of achieving high compression ratios (less than 2 *bpppb*).


**Table 2.** CCSDS123.0-B-1 compression results.

(**d**)

Yellow Stone (**g**) (**h**) (**i**)

(**e**) (**f**)

**Figure 24.** RGB representation of the different compressed-decompressed images collected by the AVIRIS sensor, according to the information displayed in Table 2. These images have been generated by displaying the bands number 50, 20 and 10 as the red, green and blue bands, respectively. (**a**) lossless; (**b**) 0.55 bpppb; (**c**) 1.62 bpppb; (**d**) lossless; (**e**) 0.53 bpppb; (**f**) 1.75 bpppb; (**g**) lossless; (**h**) 0.58 bpppb; (**i**) 1.70 bpppb.

**Figure 25.** Grey scale representation of the different compressed-decompressed images collected by the Hyperion sensor, according to the information displayed in Table 2. These images have been generated by displaying the bands number 150 from the 242 bands of this sensor as an intensity image. (**a**) lossless; (**b**) 0.32 bpppb; (**c**) 1.30 bpppb; (**d**) lossless; (**e**) 0.30 bpppb; (**f**) 1.27 bpppb; (**g**) lossless; (**h**) 0.32 bpppb; (**f**) 1.30 bpppb.
