Keywords

1 Introduction

Hyperspectral imaging is a powerful technique for many applications such as anomaly detection, target detection, and classification. Due to hyperspectral images have rich spatial and spectral information, they consume large storage space and constitute challenge in transmission [1]. For these reasons, compression of hyperspectral images has become an important research topic. There are both lossless and lossy compression approaches for hyperspectral images [2,3,4]. Lossy compression methods generally consist of hybrid transforms that involve combination of spectral and spatial decorrelation steps. Methods in the literature mostly use JPEG2000 for spatial decorrelation because of giving better performance than other wavelet based compression techniques such as SPECK and SPIHT [5]. Additionally, JPEG2000 is a widely used standard and this increases its importance. For spectral decorrelation, several spectral transforms are evaluated in [6]. It is found that Principal Component Analysis transform with JPEG2000 (PCA+JPEG2000) yields better compression performances than other spectral transforms [6]. Moreover, the method achieves higher compression ratios at low bit-rates when limited number of significant principal components (PC) are used [4]. This method is denoted as SubPCA+JPEG2000. Despite its advantages, PCA transform includes covariance calculation step. Computational cost of the transform is extremely high in hyperspectral images. However, computational cost can be reduced by using spatial and spectral sub-sampling of hyperspectral image [7].

Whereas lossy compression methods provide higher compression ratios, target detection performance can be affected depending on the compression method and compression ratio [8,9,10]. There have been limited researches about anomaly and target preserving hyperspectral image compression [8,9,10]. For example, in [11], anomaly pixels are found Reed-Xiaoli (RX) algorithm, then their locations and signatures are compressed as side information to preserve anomaly pixels [8, 9]. In another research, a new target metric which guides the selection of optimum compression ratio for the selected target is developed [10].

As mentioned above, PCA transform exhibits superior performance for spectral decorrelation. In PCA transform, calculation of mean vector and covariance matrix are performed using equal weights in entire dataset. However, statistics of target region can be significantly different from background. In this study, we propose a novel target preserving compression method which is suitable for high compression ratios. In the proposed method, a novel weight matrix is generated for weighted PCA (WPCA) to retain the target regions and JPEG2000 based compression is executed. The rest of the paper is organized as follows. Section 2 presents the theory of the proposed method. Section 3 shows the experimental results and subsequently, Sect. 4 concludes the paper.

2 Proposed Method

Let \(\mathbf {X}\) denotes a \(N\times B\) dimensional hyperspectral data matrix with N pixels and B spectral bands. PCA transform determines an orthogonal linear transform matrix \(\mathbf {T}\) and maps the hyperspectral data into a new coordinate system by using \(\mathbf {Y=TX}\). Unlike other linear transforms, PCA depends on data. Therefore transform matrix \(\mathbf {T}\) must be calculated before JPEG2000 compression [4]. Calculation of the transform matrix \(\mathbf {T}\) can be performed in two steps. In the first step, mean pixel spectrum of the data \(\varvec{\mu = } \left[ \mu _{1},\mu _{2}, \ldots ,\mu _{B}\right] \) is found and covariance matrix \(\varvec{\varSigma }\) is calculated by using mean-removed data. Afterwards, covariance matrix \(\varvec{\varSigma }\) is decomposed into its eigenvectors and transform matrix \(\mathbf {T} \) is determined. In the standard PCA, equal weights are assigned to each pixel while the calculating the covariance matrix. Because target region is quite small and has a different spectral characteristic in the whole image, compression deteriorates target regions at low-bitrates especially. In this study, we propose to use a weighted PCA transform with better target preserving capability than standard PCA.

The main idea of WPCA is to minimize weighted squared reconstruction error under the definition of weight matrix \(\mathbf {W}=\mathop {\mathrm {diag}}(w_{1},w_{2}, \dots , w_{N})\) [12]. WPCA transform can be calculated similar to PCA. Weighted mean pixel spectrum \(\tilde{\varvec{\mu }}\) and weighted covariance matrix \(\tilde{\varvec{\varSigma }}\) are calculated using Eqs. 1 and 2. Mean vector and covariance matrix of standard PCA can be found when all weights are equal.

$$\begin{aligned} \tilde{\mu _{j}}=\frac{1}{\textstyle \sum \nolimits \limits _{i=1}^{N}w_{i}}\textstyle \sum \nolimits \limits _{i=1}^{N}w_{i}x_{i,j} \end{aligned}$$
(1)
$$\begin{aligned} \tilde{\varvec{\varSigma }} =\frac{1}{^{\textstyle \sum \nolimits \limits _{i=1}^{N}w_{i}}}\left( \mathbf {X-1}_{N} \varvec{\mu }^{T}\right) ^{T}\mathbf {W}\left( \mathbf {X-1}_{N}\varvec{\mu } ^{T}\right) \end{aligned}$$
(2)

Determination of the weight matrix \(\mathbf {W}\) is crucial part for the method. Our method consists of four steps including target detection, weight matrix generation, spectral decorrelation and spatial decorrelation. In the first step, Adaptive Cosine Estimator (ACE) target detection algorithm is performed on hyperspectral image and similarity map is obtained [13]. Similarity between a pixel spectrum \(\mathbf {x}_{i}\) and target spectrum \(\mathbf {x}_{TG}\) can be calculated using Eq. 3.

$$\begin{aligned} d_{ACE}(\mathbf {x}_{i},\mathbf {x}_{TG})=\frac{\left( {\mathbf {x}_{i}-\varvec{\mu }}\right) ^{T}\varvec{\varSigma } ^{-1}\left( {\mathbf {x}_{TG}-\varvec{\mu }}\right) }{\sqrt{\left( {\mathbf {x}_{TG}-\varvec{\mu }}\right) ^{T}\varvec{\varSigma }^{-1} \left( {\mathbf {x}_{TG}-\varvec{\mu }}\right) }\sqrt{\left( {\mathbf {x}_{i}-\varvec{\mu }}\right) ^{T}\varvec{\varSigma }^{-1}\left( {\mathbf {x}_{i}-\varvec{\mu }}\right) }} \end{aligned}$$
(3)

In second step, we define two different weighting approaches WPCA1 and WPCA2. Weight matrices for WPCA1 and WPCA2 are calculated as in Eqs. 4 and 5. In these equations, \(N_{TG}\), \(\tau \) and \(\sigma \) denote number of targets pixels, decision threshold and scaling parameter, respectively. WPCA1 method first thresholds the similarity value and then determines two constant weights, proportional to the number of target pixels. Alternatively, WPCA2 method uses a scaling parameter and maps similarity values exponentially. Different from WPCA1, weights determined from WPCA2 can take values between 0 and 1.

$$\begin{aligned} w_{i}=\left\{ \begin{array}{cc} \frac{N-N_{TG}}{N_{TG}}, &{} d_{ACE}(\mathbf {x}_{i},\mathbf {x}_{TG})\le \tau \\ 1, &{} d_{ACE}(\mathbf {x}_{i},\mathbf {x}_{TG})>\tau \end{array} \right. \end{aligned}$$
(4)
$$\begin{aligned} w_{i}=1-\exp \left( -\frac{\left( {d_{ACE}(\mathbf {x}_{i},\mathbf {x}_{TG})}\right) ^{2}}{\sigma ^{2}}\right) \end{aligned}$$
(5)

After weight matrix is determined, hyperspectral image is decorrelated along spectral axes similar to PCA. Finally, resulted image is compressed by using JPEG2000 [4]. Moreover, similar to SubPCA, we propose to use only most significant principal components during compression. This method is denoted as WSubPCA+JPEG2000.

3 Experimental Results

In order to evaluate the compression performance, Cuprite and Moffett Field dataset [14] which are acquired by AVIRIS sensor are used in experiments. Both datasets include a \(512 \times 512 \times 224\) dimensional image and each pixel represents an area of 20 m \(\times \) 20 m on the ground. Color image of Cuprite and Moffett Field datasets are given in Fig. 1(a) and (b), respectively. Three target regions are evaluated in this paper. All targets are selected inside anomaly regions of the datasets. For the determination of target regions RX detector is applied to find anomaly pixels and the highest 50 anomalies are selected as target depicted in [15]. Selected two target regions of Cuprite dataset are shared in Fig. 1(c) with red and green colors. Also, target region of Moffett dataset is given in Fig. 1(d) with red color.

Fig. 1.
figure 1

Color image of each datasets and target regions used in the work (Color figure online)

To measure the detection performances, ACE detector is applied to the compressed data and Receiver Operating Characteristic (ROC) curves are obtained. Because of having two target regions, average ROC curves are shared in the study. Additionally, average SNR and average mean square error (MSE) are given. We use Kakadu encoder for JPEG2000 compression [16]. Generation of PCA and WPCA transform matrices are implemented in MATLAB platform. In our experiments, scale \(\sigma \) and decision threshold \(\tau \) parameters are both selected as 1000.

Average SNR results of PCA+JPEG2000, WPCA1+JPEG2000, WPCA2+JPEG2000 methods and their subPCA versions are given for various bit-rates in Table 1. Moreover, average MSEs in target regions are given in Table 2.

Table 1. Average SNR results for various bit-rates
Table 2. Average MSE of target regions for various bit-rates

It is seen that WPCA1+JPEG2000 and WPCA2+JPEG2000 give quite similar results and they dramatically decrease average error in target regions. Additionally, PCA+JPEG2000 shows nearly 1–2 dB higher SNR values than WPCAs+JPEG2000. Hence WPCA achieves better reconstruction performance in target regions despite a slight loss on SNR. For SubPCA, two different number of PCs are selected as 104 and 20 to interpret the effects of #PCs on SNR. At lower bit-rates, SubPCA+JPEG2000 provides significantly higher SNR values compared to PCA+JPEG2000. WSubPCA1 and WSubPCA2 achieve lower average error than SubPCA at target regions. For extremely lower bit-rates, e.g. 0.025, SubPCA and WPCA methods with lower number of PCs gives better SNR results.

Fig. 2.
figure 2

ROC curves of the methods for various bit-rates

Fig. 3.
figure 3

Groundtruth map for target-2 and ACE outputs at 0.025 bpp

Average ROC curves of the methods for various bit-per-pixel (bpp) values are shared in Fig. 2. Figure 2 shows that WPCA1+JPEG2000, WPCA2+JPEG2000 and their SubPCA versions yield higher detection performances than PCA+JPEG2000 and SubPCA+JPEG2000 for all bit-rates. In 0.05 bpp and 0.025 bpp, PCA+JPEG2000 and SubPCA+JPEG2000 (#PC = 104) almost lose target regions. It is seen that higher detection performances can be obtained at lower bit-rates when the number of PCs are selected as small enough. From Fig. 2(c), it is observed that WSubPCA2 achieves higher true positive rates when false positive rate is low. ACE maps of SubPCA+JPEG2000, WPCA1+JPEG2000 and WPCA2+JPEG2000 methods for target-2 are shared in Fig. 3. The maps are extracted for compression ratio = 640 and bpp = 0.025. Pixels with high intensity values in result maps correspond to higher target detection probability. It is seen that target regions can be reconstructed even if compression ratio is 640 for both WSubPCA1+JPEG2000 and WSubPCA2+JPEG2000. Note that compared methods give similar performance for 0.2 bpp and higher bit-rates.

4 Conclusions

In this paper, WPCA+JPEG2000 method is proposed for target preserving hyperspectral image compression. Two different weighting approaches are developed for calculation of WPCA transform. Additionally, compression with a selected subset of weighted principal components are investigated. Experimental results show that WPCA1+JPEG2000 and WPCA2+JPEG2000 give significantly better target detection performance than standard PCA+JPEG2000 method. Moreover, WSubPCA1+JPEG2000 and WSubPCA2+JPEG2000 methods yield superior target detection performances and preserve target regions at higher compression ratios.