Proposing a Continuous Spectral-Spatial Sparse Representation Model for Denoising Hyperspectral Images

Due to its high capability in acquiring spectral and spatial information, hyperspectral imaging technology has gained significant attention in remote sensing. However, in practice, it is impossible to avoid noise in hyper spectral images due to camera artifacts and external environment during the acquisition and transmission process. The presence of noise in these images hinders the detection of subtle differences between different materials in the image. Therefore, it is crucial to minimize noise as much as possible before performing any analysis and interpretation. Removing noise from hyperspectral images is a crucial preprocessing step that enhances image quality for various applications, including object recognition and classification. The challenge arises when we need to remove additive white mean-spherohomogeneous Gaussian noise from the given image. Previous research has suggested that thinning the noise-free parts of the image can be effective in removing noise. This article aims to implement the method proposed in using a programming language. The method involves extracting intra-band structure and inter-band correlation while displaying the common tank and learning the common dictionary. In the continuous thin coding phase, the inter-band correlation is extracted to maintain the same structure and achieve spectrum continuity. In contrast, the intra-band structure is used to encode differences in the spatial structure of different bands. Furthermore, a joint dictionary training algorithm is used to obtain a dictionary that simultaneously describes the content of different bands. This ensures that the resulting dictionary preserves the inter-band correlations and enhances the noise removal process.


INTRODUCTION:
Spectral imagery is composed of an array of pixels that represent a specific object, and within those pixels, they encode the spectral signature of the material (Aharon et al., 2006).Each pixel of an image corresponds to a vector L, which represents the radiance of a specific wavelength.These images are generated by instruments called imaging spectrometers.Spectrometer detectors collect data in the form of a set of 2D images, and then these images are combined to form a 3D cube of spectral data for processing and analysis (Elad and Aharon, 2006), known as spectral imagery.The two dimensions of the image represent spatial information, while the third dimension represents spectral information (Fig. 1).The term spectral is used to describe this type of the data because it contains valuable spectral information over a large number of the spectral bands with very high spectral resolution (Parag and Setu, 2022; Uddin et al., 2023).
This paper provides a comprehensive survey of deep neural network (DNN) architectures and their applications.It covers various types of DNNs, including feedforward, convolutional, recurrent, and generative models, and discusses their strengths and weaknesses.The paper also reviews the use of DNNs in a range of applications, such as computer vision, natural language processing, speech recognition, and drug discovery (Liu et al., 2018).This paper proposes a novel deep neural network architecture called ResNet, which addresses the issue of vanishing gradients in very deep networks.ResNet introduces residual connections that allow the network to learn residual functions, rather than mapping inputs directly to outputs.This approach enables the training of very deep networks (up to 152 layers) with improved accuracy compared to previous state-of-the-art methods (Muti and Bourennane, 2002).This paper introduces a convolutional neural network (CNN) architecture called the LeNet-5, which was designed for handwritten digit recognition.The paper discusses the use of backpropagation to train the network, as well as techniques such as weight sharing and max-pooling that was used to reduce the number of parameters in the model.The paper also presents experimental results that demonstrate the effectiveness of the proposed approach (Soltani-Farani et al., 2014) This paper introduces a generative model called Generative Adversarial Networks (GANs), which consists of two neural networks: a generator and a discriminator.The generator learns to generate samples that are similar to those in the training data, while the discriminator learns to distinguish between the real and generated samples.The two networks are trained in a game-like manner, where the generator tries to fool the discriminator, and the discriminator tries to correctly classify the samples.The paper presents experimental results that demonstrate the ability of the GANs to generate realistic samples in a range of applications, such as image synthesis and text generation (Yuan et al., 2015;Uddin et al., 2021).In the recent decades, various methods have been proposed to remove noise from hyperspectral images.The simplest method for noise removal from hyperspectral images is applying the old two-dimensional noise removal algorithm, spatially and band-by-band.However, these methods have some drawbacks.One of the main issues is that they only remove noise in the spatial dimension and ignore strong dependencies in the spectral dimension.achieve better noise removal results while preserving the spatial and spectral properties of the hyperspectral image.These limiting constraints play an important role in controlling the answer's confusion and have a significant impact on the process of noise removal.
Based on the strong correlation and continuity along the spectral dimension of the hyperspectral images, regularization-based methods have achieved very good results in noise removal.The method implemented in this article is a continuous spectral-spatial distributed sparse representation method for restoring a noise-free hyperspectral image by extracting correlation between bands and detecting adaptive differences between bands.Firstly, bands with the strong correlation are classified into a group, the reason being to obtain more local sparsity and redundancy.Then, each group is represented by a sparse spectral-spatial distributed coding.These limiting constraints play an important role in controlling the answer's confusion and have a significant impact on the process of noise removal.
Based on the strong correlation and continuity along the spectral dimension of the hyperspectral images, regularization-based methods have achieved very good results in noise removal (Al Mamun et al., 2021).The method implemented in this article is a continuous spectral-spatial distributed the sparse representation method for restoring a noise-free hyperspectral image by extracting correlation between bands and detecting adaptive differences between bands.Firstly, bands with strong correlation are classified into a group, the reason being to the obtain more local sparsity and redundancy.Then, each group is represented by a sparse spectral-spatial distributed coding.Other parts of the article are as follows: in section 2, the proposed method and the formulated optimization process are explained briefly, along with a brief explanation of how this method is implemented.Section 3 presents the results obtained by applying this algorithm to the target data, and section 4 concludes the article.In addition, some of the most important notations and prerequisites are explained further.Bold symbols with lowercase letters indicate vectors, and bold symbols with uppercase letters are used to represent matrices.For a matrix with a three-dimensional data array XϵR^(I_1I_2I_3) with size I_1I_2I_3, three-dimensional pieces of X with a size of √n×√n are represented as column vectors x_ijb in the i-th row and j-th column of the b-th band.The vector x_(ij.) is formed by stacking all column vectors of the i-th row and j-th column of different bands into a column vector.X^T is the transpose of X (Khaleduzzaman et al., 2021).

MATERIALS AND METHODS:
In  (Landgrebe, 2002).The experiments demonstrate that the proposed algorithm outperforms the state-of-the-art methods in terms of PSNR and SSIM.Moreover, we also conducted experiments to evaluate the robustness of the proposed algorithm against different levels of noise, and the results show that our method is effective in a wide range of noise levels.In summary, the proposed regularized algorithm based on a grouping strategy and KSVD algorithm shows promising results for image denoising and can be considered as a potential method for practical applications.

Sparse Image Denoising Model Based on Spectral-Spatial Information with Adaptive Noise
Due to the strong correlation and similar reflectance values in neighboring pixels or in correlated bands, pieces with the same spatial location are considered as similar structural information.It is assumed that similar structural information produces the same sparse patterns.Therefore, bands with strong correlation between them can be represented simultaneously by the spectral-spatial sparse representation model, which will be explained in more detail below.

Band grouping
First, bands with strong correlation are grouped using the K-means algorithm (LeCun et al., 1998).This algorithm finds similar bands based on a similarity metric, which in this method is the correlation, and assigns them to clusters in group C1.As shown in Fig. 2, after the end of the K-means clustering, the clusters in group C1 are further grouped based on their spectral location and placed in groups C2.In the proposed algorithm, the band grouping process is performed using the K-means clustering algorithm.This algorithm is a popular unsupervised machine learning technique that partitions a dataset into K clusters based on their similarity or distance to each other.In our case, the similarity between two bands is measured by their correlation coefficient, which reflects the strength of their linear relationship.The first step of the band grouping process is to calculate the correlation matrix of the input image.Each entry of this matrix represents the correlation coefficient between a pair of bands.The matrix is then used as input to the K-means algorithm, which divides the bands into K clusters based on their correlation coefficients.The value of K is determined based on the number of distinct correlation patterns observed in the image.After the initial band grouping, the bands in each cluster are rearranged based on their spectral position.This is because the correlation coefficient only reflects the similarity of the shapes of the spectral curves, not their exact positions.By rearranging the bands based on their spectral position, we can ensure that each cluster contains bands that are not only similar in shape but also close to each other in the spectral domain.The band grouping process is an important step in the proposed algorithm because it allows us to exploit the sparsity of the image in the spectral-spatial domain.By grouping similar bands together, we can represent the image using a smaller number of nonzero coefficients in the dictionary learning phase, which reduces the computational complexity and improves the denoising performance.

Segmentation and vectorization
After grouping the image into smaller parts, each group is divided into T smaller sections, and for each section, T sections with the highest similarity within the bands are selected and represented in a sparse stack vector.Homogeneity is also used as the similarity metric.Vectorization is performed as follows: First, the 3D sections are extracted from the groups and sorted into a two-dimensional matrix, as shown in Fig. 3.Each 3D section is reshaped to a sub-matrix of the overall matrix.The sections are stacked in x_ij vectors of size n×T and then encoded continuously.
When applying the sparse representation on the vector, due to the fact that the sections in the vector belong to the same spatial position and have similar structural information, they use the same atoms in the dictionary, thus producing similar sparse patterns.Moreover, due to the spectral information in the vector, spectral noise is removed simultaneously during the process.With the grouping performed and using the sparse representation model, the objective function for hyperspectral images can be written as follows:

……………………………………..(1)
In the above equation, R_ij is a matrix that extracts the vector x_ij ∈ R^(nT×1) from the image X, and α_ij is a sparse vector based on vector x_ij.In this equation, ‖α_ij‖0 is the previous sparsity and ∑_ij▒‖Dα(ij.)-R_ijX‖2^2 is the overall error (Landgrebe, 2002).The representation error ϵ_ij^2 = ‖Dα(ij.)-R_(ij.)X‖_2^2 exists as noise in the image.The selection of μ_ij is implicitly controlled by the number of non-zero values in α_ij and thus depends on the representation error for each band.The smaller the representation error, the smaller the noise in the image.

Sparse Common Component Estimation
In this step, it is assumed that the common sparse component is the same for all bands, and the unique sparse component represents the unique structural information of each band, which is specific to each band.To simplify the definition of equations in the following, x with the sparse component α is used instead of the extracted vector x_(ij.)with the sparse component α_(ij.),x_b with the sparse component α_b is used instead of the band-specific vector x_ijb with the sparse component α_ijb, and µ is used instead of μ_ij for the vector x_(ij.).Therefore, the representation of the common sparse component for a portion of the b-th band will be as follows: Where, α_b (1≤b≤B) is the sparse representation component.Considering that the desired model is a common sparse representation model, α_b can be decomposed into two parts, z_c as the common sparse component, which is the same for all vectors with correlation x_b that belong to a group, and z_b as the unique sparse component in the representation of α_b, which preserves the within-band correlation of the b-th band.Assuming that the dictionary D_b is constant, the sparse representation process here includes solving the following optimization problem:

Training Joint Dictionary
In this step, it is assumed that the common sparse component is the same for all bands, and the unique sparse component represents the band-specific structural information that is specific to each band.To simplify the equation notation in the following, we use α to denote the sparse component for all bands instead of the vector extracted xij with the sparse component αij and use αb to denote the sparse component for the vector xijb in band b with the sparse component αijb, and we use µ instead of μij for the vector xij.Therefore, the joint sparse representation for a piece of the bth band is as follows: In summary, training the dictionary is solved by the alternating between the following two steps: First, the common and the unique components are obtained from the sparse components with a fixed dictionary using continuous sparse encoding, and then.The spectral-spatial dictionary is trained using the learned continuous dictionary through the proposed continuous dictionary training method.

Merging process
By alternating between the two steps of joint sparse approximation and joint dictionary learning, the removed pixels can be recovered.This is achieved by combining the sparse coefficients α_(ij) and dictionary D of each group side by side, resulting in the final coefficients and dictionary.Then, by returning to the equation (1), it is time to update X.This update is equivalent to the problem of denoising spectral images and can be solved as follows: ̂= ( + ∑     .

Implementation
In this section, the implementation of the proposed algorithm in MATLAB software and the application of the algorithm using the Indian Pines database are examined.The size of this database is 220×145×145.However, bands 150 to 160 are removed from the image due to atmospheric and water damage, and since the image is noisy, it should be segmented, and the size of each block should be equal to n.The last row and column of the image are copied, i.e., one row and column are added to the image.Therefore, the final data size that the algorithm is applied to is 206× 146×146.After preparing the desired data, we input it into the algorithm and perform noise removal according to the proposed method.Finally, we combine the results obtained from applying the algorithm to each group and obtain the final denoised image.
Table 1: Lists the functions used in the program.

Function Name Description Func_Kmeans()
Performs initial classification using the K-Means algorithm.

Func_reclassification().
Performs final grouping based on spectral band positions Func_Matrix2D) ( Converts each group to a 2D matrix based on the desired segmentation.

RESULTS AND DISCUSSION:
The results of the experiment on the Indian Pines dataset with a size of 8x8 and a band width of 8, when performed with only one repetition, are as follows.The threshold value was manually selected and set to Const=1/15, τ_b=Const.σ_b=1.15.σ_b, and the parameter λ was set to 30/σ_b.Different quantitative indices are available to assess the results of the experi-

Fig. 1 :
Fig. 1: Three-dimensional spectral cube constructed by 2D spatial-spectral scanning lines.As a result, damage and distortion occur in the spectral dimension, and the spectral signature of materials in the image will not be well recovered.Therefore, more advanced methods were introduced that utilize both spectral and spatial information simultaneously.These methods can be classified into two categories: domain transform-based methods (Goodfellow et al., 2014) and spatial domain-based methods (He et al., 2016).Domain transform-based methods try to separate noise-free signals from noisy data by the introducing various transforms such as the principal component analysis, frequency transform, and wavelet transform.Spatial domain-based methods, on the other hand, aim to reduce noise in hyperspectral images by constructing a multi-dimensional spectral-spatial noise removal model.These methods can be divided into two categories: filter-based algorithms and regularization-based algorithms.Filter-based noise removal algorithms for hyperspectral images usually consider the hyperspectral data as a three-dimensional array and then separate the noise from the signal by multidimensional analysis (Jain et al., 1999).When the subspaces of the signal and noise are very close to each other, it becomes very difficult to extract all useful information, and it may lead to loss of spatial accuracy in the recovered hyperspectral image.Regularizationbased on the algorithms (He et al., 2016), consider the hyperspectral image recovery as an ill-posed inverse problem, and remove the noise from hyper-spectral images by solving an optimization function with appropriate regularization terms.These algorithms can

Fig. 2 :
Fig. 2: Re-grouping based on the spectral location of the bands.