1. Introduction
Hyperspectral images from space-borne spectrometers play a crucial role in multifarious aspects, including geological exploration, environmental monitoring, and material identification [
1]. Researchers continue to enhance the spectral and spatial resolutions of the instruments, and the size of a hyperspectral image is currently more than hundreds of megabytes (MBs) [
2,
3,
4]. Nevertheless, such a wealth of information places excessive demands on the transmission and storage processes. Data compression has proven to be an effective way to alleviate this issue [
5,
6].
The compression techniques for hyperspectral images are divided into three categories: lossless, lossy, and near-lossless compression [
7]. Lossless compression allows for reconstruction of the original image, ideally at the price of a limited compression ratio. Lossy compression approximates the original image while generally minimizing distortion in the
-norm. It tolerates a small amount of information distortion between the original image
I and the reconstruction image
, which allows for a high compression ratio. Near-lossless compression aims to achieve a higher compression ratio than lossless techniques by allowing pixel-level distortion. It strictly bounds the
-norm by setting the peak absolute error (PAE) [
8]. The user-specified parameter guarantees the max. absolute distortion so that
defines a limited error range for reconstruction of individual pixels. As a result, employing a proper parameter
makes the compression process almost lossless. It is a well-known fact that the quality of images is affected by the inherent noise of the device [
9,
10]. When the maximum error introduced by the compression process is smaller than the background noise, the quality of the reconstructed image is almost similar to that obtained with lossless compression.
Details on near-lossless compression techniques are discussed in a later section. Most near-lossless compression techniques can be roughly classified into three categories: prediction-based subsequent quantization coding, lossless coding based on pre-quantization, and two-stage near-lossless encoding [
11].
Predictive-based coding, one of the most popular schemes, enables low-complexity, high-throughput solutions [
12,
13,
14]. These schemes first compute the prediction value of the target pixel from the previous encoding. The difference between the predicted and the original pixel value is known as the prediction error. Subsequently, a near-lossless compression scheme is obtained by encoding the quantized prediction error. The two most typical prediction schemes are JPEG-LS [
15] and CALIC [
16], which are widely used to process two-dimensional images. Meanwhile, the CALIC algorithm, with its better compression performance, is extended to 3D-CALIC [
17] and M-CALIC [
18] based on the correlation of hyperspectral images. However, the CALIC-based extension scheme cannot effectively remove the redundancy of hyperspectral images and is not friendly to hardware implementation. The Consultative Committee for Space Data Systems (CCSDS) proposes the standard CCSDS-123, which is based on the signed least mean square (SLMS) filter [
19,
20]. This compression scheme has low complexity and excellent compression results. NL-CCSDS-123 [
10] and CCSDS-123-AC [
21] are two near-lossless extended versions that both rely on the predictor of CCSDS-123. The NL-CCSDS-123 scheme encodes the quantized residual pixels after using a range coder, whereas CCSDS-123-AC employs a lightweight context-based arithmetic encoder. However, since their predictor uses a simple function to update the weight coefficients, the prediction accuracy can be further improved.
The second type of near-lossless compression category is based on pre-quantizing the original pixels with a quantizer and then applying a lossless compression technique. It is widely known that such a model is suboptimal, and the compression results are not outstanding [
22]. However, it is suitable for a scene with high-speed compression demands since it does not need to include a feedback loop. S.-C Tai et al. proposed the Pre-CCSDS-IDC [
23] compression scheme in order to improve the compression rate without modifying the existing CCSDS-IDC hardware system [
24]. It can import the pre-quantized images into CCSDS-IDC directly. In [
25] a pre-quantization compression scheme is implemented based on ground-based CNN reconstruction. The spaceborne part can be considered a combination of the pre-quantizer and CCSDS-123 predictor. Eventually, the CNN is employed as a feature extractor on the ground to do a secondary reconstruction of the decoded image, which leads to a higher signal-to-noise ratio.
The third near-lossless compression category builds on a combination of lossy and lossless compression. First, the reconstructed images are obtained by lossy compression. Then, the differences between these and the original image are quantized and encoded. X. Wu proposes an approximate lossless image compression scheme that combines wavelets and CALIC [
26]. It uses CALIC to compress the residual image between the wavelet approximation and the original image. C.-W Chen employed CCSDS-IDC for the lossy phase, followed by bit-plane encoding (BPE) coding. However, the scheme does not obtain the optimal lossy bit rate. J.Beerten combines JPEG2000, as a lossy layer, with a near-lossless layer consisting of BPE and arithmetic coding [
27]. This scheme uses computationally expensive iterative methods to determine the optimal lossy bitrate and obtain a competitive coding performance.
Due to the characteristics of the prediction-based compression scheme, it gradually replaces the transform-based algorithm in the on-board compression platform [
28]. In this paper, we focus on the prediction-based quantization technique, which aims to enhance the performance of the near-lossless compression scheme by fully exploiting the spatial–spectral redundancy of hyperspectral images. The proposed method combines recursive least squares (RLS) with an in-loop quantizer and, subsequently, encodes the quantization residuals using an entropy encoder. Ultimately, a competitive compression ratio is produced while guaranteeing the quality of the reconstructed image.
The rest of the paper is organized as follows:
Section 2 provides a detailed description of the near-lossless feedback loop’s compression framework with the RLS prediction.
Section 3 presents the experimental dataset and comparative results of this method with an analysis and discussion. Finally,
Section 4 concludes this paper.
2. Compression Scheme
In this work, a loop predictor is used for near-accurate prediction of target pixels by removing the correlation of hyperspectral images. The input image data is passed through the loop predictor point by point. The differences between the predicted and original values are quantized. Subsequently, the entropy encoder encodes the quantized residual image and outputs the compressed codestream. The same algorithm with the same parameters must be used at the decoding stage during the reconstruction process after inverse entropy coding.
Figure 1 presents a pictorial representation of the compression scheme, which explains the essential steps. The five significant steps of the proposed scheme, including spatial predictor, spectral predictor, controlled quantization, sample representative, and entropy coding, are discussed in the following subsections.
2.1. Loop Predictor
Hyperspectral images can be regarded as a three-dimensional data. Let denote the value of the original pixel in the zth band at the xth row with the yth column. We also use to represent the nth pixel in band z, where the notation n means the pixel is derived from in the spatial domain. , , and provide the image’s width, height, and number of bands.
The spatial prediction estimate is computed using a causal, linear predictor for each pixel. To remove spatial correlation from the hyperspectral image, the preliminary estimate
of the target pixel
is generated by averaging the pixels in the context window of the same band. The context window of the target pixel can be explained using
Figure 2. The parameter
r denotes the local context window’s radius, and the target pixel points are represented in orange. The blue and green parts show the neighborhood windows with radii of one and three, respectively.
Then, the spatial prediction error
for the
nth pixel point in the
zth band is defined as Equation (
1).
Note that in order to ensure the feasibility of the decompressor, the preliminary prediction error of the first spectrum is directly encoded with the entropy encoder that follows. The others are encoded after removing the inter-spectral redundancy.
In the spectrum prediction process, the RLS filter input vector is formed by
, where
k is the number of history bands used to predict the current pixel, i.e., the prediction length. The corresponding weight vector is
. Then, the RLS predictor is initialized as Equation (
2).
The spectrum prediction residual
is calculated as Equation (
3).
The parameter’s peak absolute error
determines the maximum allowable absolute difference between the original and reconstructed pixel values. Each predicted residual corresponds to a quantized residual
defined by Equation (
4).
where the
is a function that extracts the sign value of
x. For spectral images that need to be stored with absolute accuracy, a lossless compression mode can be used by setting
. That is,
, thus ensuring that the decoding process can accurately reconstruct the original sample. However, when using a non-zero peak absolute error,
represents an approximation of the above prediction error, rather than the actual value.
Since the image introduces distortion affected by the quantizer, the compressed code stream cannot be directly employed to reconstruct the sample. In order to guarantee synchronization with the decompression stage, the reconstruction value
should be calculated for each pixel, as shown in Equation (
5). Then,
is used in the prediction process for the next pixel point to be measured.
where the center of the predicted residual reconstruction value
is calculated by Equation (
6).
The gain of RLS is
where
is an auxiliary vector required to reduce the computational burden.
Then, the weight vector
is updated by the recursive Equation
9.
Finally, the predictor is executed for each pixel in raster scan order until the last pixel is reached.
2.2. Entropy Encoding
Entropy coding techniques are used to encode the residual error after quantization in predictive compression. The adaptive arithmetic encoder is adopted in the encoding stage, whose compression ratio is near the theoretical entropy. The quantization residual is represented by 16 bits, meaning that the arithmetic code’s codebook needs 65,536 symbols. Based on the probability distribution of the prediction residual, most symbols are not used. Therefore, an adaptive codebook is adopted. The initial codebook contains two symbols: 0 and ESC. When a new symbol needs to be encoded, the encoder will use the probability of ESC to encode it, and the 16-bit symbol will be appended to the code stream. The code book absorbs the new symbol after the symbol has been output to the stream.
3. Experimental Results
The proposed scheme, named near-lossless recursive least squares (NLRLS), has two parameters, namely, the radius of the context window r and the prediction length k. Since these two parameters critically impact the compression results, the selection of optimal values is explained in the first subsection. Furthermore, the compression performance of the proposal is compared with several state-of-the-art schemes, including compression results in the distortion metrics of the reconstructed image. This section highlights the corresponding results and analysis.
The platform for testing is a personal computer powered by a single Intel Core i7-7700K central processing unit (CPU) at 4.2GHz with 16GB random access memory (RAM). We adopted the standard hyperspectral image test data recommended by the International Consultative Committee for Space Data Systems, which includes Atmospheric Infrared Sounder (AIRS) and Airborne Visible/Infrared Imaging Spectrometer Calibrated and Uncalibrated (AC and AU) [
29]. Each of them has a bit depth of 16 bit-per-pixel (BPP).
Table 1 details the dataset used in the tests, including sensor abbreviations, scene names, and dimensions.
3.1. Parameter Settings
The accuracy of the RLS predictor has a strong correlation with the prediction length k of the input vector
. Additionally, to preserve the causality of the pixels in the context window, the local mean predictor is used to estimate
. Therefore, the radius
r of the context window is another important parameter that directly affects the compression results. In order to evaluate the effects of the
k and
r parameters on near-lossless compression performances, average bit rates of the proposed scheme at different peak absolute errors are shared in
Figure 3 for the AC datasets.
It can be seen from
Figure 3a–d that the proposed compression schemes exhibit similar radio-compressed bit-rate characteristics for different peak absolute errors. The lowest bit rates are observed in the case of low
r–high
k parameter pairs. If the radius is treated as a constant, we can see that the deceleration of the compressed bit rate gradually slows down as the prediction length increases. Moreover, the RLS predictor update requires the computation of
as well as
. The algorithm has an
computational complexity, meaning that the computing resource consumption increases quadratically with
k. Considering the dual effects of the actual compression results and the computational complexity, the initial radio
r and prediction length
k parameters are selected as 2 and 12, respectively.
3.2. Compression Performance Analysis
3.2.1. Compression Results
A total of 16 scene data from three types of hyperspectral image datasets (AC, AU, AIRS) were used as test data sources. The results of CCSDS-123-AC, NLCCSDS-123, and M-CALIC are listed here to compare with the proposed near-lossless compression scheme.
Table 2 shows the average compression results for multiple compression schemes at five different peak absolute errors.
Table 2 reports compression results in terms of the bit rate. The second column reports the first-order entropy on average (in bit-per-pixel) for each scene type. It represents the entropy of individual pixels, regardless of any correlation among the pixels. In addition, each subsequent column shows the average compression results for a compression scheme at different peak absolute errors
. The best compression results for each test are indicated in bold. The bracketed text indicates the coding gain of our method relative to other techniques, and a positive difference means our scheme is better.
It can be seen that the compression bit rate of each technique decreases rapidly as a function of . The reported results indicate that our scheme outperforms the other known schemes for all sensors. For lossless coding (), our scheme beats the other schemes by a slight margin. For near-lossless encoding (), our scheme provides outstanding compression results; i.e., it clearly yields the lowest ratio of all the compared methods. Compared to CCSDS-123-AC, which has the best-known compression results, on average, the proposal provides benefits ranging from 0.11 to 0.6 bpp, depending on the allowed absolute error of the peak.
The previous subsection stated that the computational complexity of NLRLS is . The computational complexity of the SLMS filter used by CCSDS-123-AC is , where k is the number of bands. Although NLRLS has higher complexity than CCSDS-123-AC, it produces better convergence and more accurate predictions. Therefore, the compression results of the NLRLS scheme are better.
Graphically, the relative gain of our scheme over CCSDS-123-AC is represented in
Figure 4 for different datasets. Each color represents the comparison results using different datasets, and each cluster indicates a different peak absolute error. Therefore, the higher percentage means that our scheme is superior. The results indicate that the proposed scheme provides an average optimization from 5.29% to 31.19% in bit-per-pixel change for different peak absolute errors. The AIRS images, especially, outperform by almost
with
.
We note that complex image preprocessing can achieve better compression results, such as band reorder, clustering, and super-pixel methods [
30,
31]. However, this is beyond the scope of this paper and will not be discussed here.
3.2.2. Reconstruction Quality Analysis
In the near-lossless compression scheme, the peak absolute error
introduced by the compression process directly affects the quality of the reconstructed image.
Figure 5 shows the original image of the AIRS Grand16 image and the reconstructed image at
. It can be noted that the visual performance of each image is extremely similar.
To objectively evaluate the quality of the reconstructed images, we compare the proposed scheme with the best-known near-lossless compression scheme CCSDS-123-AC, including two metrics, namely the peak signal-to-noise ratio and spectral angle mapper.
If D is the dynamic range (in bits) of the original image, the maximum pixel value is
. The reconstructed image quality is evaluated in terms of the peak signal-to-noise ratio (PSNR), which is measured in dB and defined as:
where
is the mean square error between the original image S and the reconstructed image
.
Spectral Angle Mapper (SAM) treats the spectrum of each image element as a high-dimensional vector and measures the similarity between two spectra by calculating the angle of the vector. The SAM of each pixel spectrum in the original and reconstructed image is denoted as
The average spectral angle is used to calculate the spectral variability of the reconstructed image, and, the smaller the angle, the less distortion.
We experimentally obtained a series of reconstructed image data by varying the maximum allowable peak absolute error.
Figure 6 and
Figure 7 show the PSNR and the average SAM variation with the bit rate, respectively.
The experimentally obtained data points have been highlighted by marked dots, and linear interpolation is used between the markers. It can be seen that under the same compressed bit rate, the proposed scheme has a higher peak signal-to-noise ratio and a smaller average spectral angle. Further, for image quality, as measured by the PSNR and SAM, our approach is competitive compared to the best-known CCSDS-123-AC scheme.