Semantic guidance-based wave band adaptive hyperspectral image compression method

Through the band adaptive hyperspectral image compression method based on semantic guidance, the problems of semantic information loss and high model storage cost in the prior art are solved, and efficient semantic information retention and model universality are achieved.

CN119484833APending Publication Date: 2025-02-18HUBEI ENG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411414331.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing hyperspectral image compression method based on deep learning cannot effectively characterize the changes in the global spectral structure, resulting in loss of semantic information, and requires training different models to process images of different bands, increasing storage costs.

Method used

Adoptional hyperspectral image compression method based on semantic guidance, using the natural connection between the spectral curve and semantic categories, class constraints are applied to the spectral structure, guiding the generation of reconstructed image spectral information, reducing the loss of semantic information, and Suitable for processing hyperspectral images in any band.

Benefits of technology

It effectively reduces the loss of semantic information, saves bandwidth and storage resources, retains semantic information useful for subsequent hyperspectral image analysis and interpretation, and reduces the storage cost of the compressed model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484833A_ABST
    Figure CN119484833A_ABST
Patent Text Reader

Abstract

The invention relates to a wave band self-adaptive hyperspectral image compression method based on semantic guidance. According to the method, a compression task and a classification task are unified under the same framework, and a natural relation between a spectral curve and a semantic category is utilized to apply category constraint to a spectral structure, guide generation of spectral information of a reconstructed image, and relieve adverse effects of spectral structure mutation on a compression process and subsequent hyperspectral image analysis and interpretation. According to the method, semantic information of ground features under a high compression ratio is effectively reserved, and the adverse effect of lossy compression on downstream task analysis and interpretation is relieved while bandwidth and storage resources are saved. Besides, the compression framework can process the hyperspectral data of any wave band, and does not need to train an independent model according to the hyperspectral images of different wave bands, so that the storage cost of the compression model is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of hyperspectral image processing, and in particular to a band-adaptive hyperspectral image compression method based on semantic guidance. Background Art

[0002] Each pixel in a hyperspectral image contains a spectral curve that describes the information of the object category, and the spectral curves of different objects are usually quite different. Based on this feature, hyperspectral images can be used to assist in the distinction of different object information or the identification of material composition. They are widely used in fields such as surface resource exploration, precision agriculture, disaster prediction, and target recognition, greatly improving human ability to understand and explore the materials on the earth's surface. The spatial-spectral information of hyperspectral images has a natural connection with semantic content. Semantics mainly refers to information that can describe the identity of objects in hyperspectral images, that is, what types of objects exist in hyperspectral images and their distribution characteristics. In practical applications, hyperspectral images are usually reconstructed by encoding, and scene understanding of hyperspectral images is achieved based on relevant knowledge or semantics inferred from the images. Therefore, it is crucial to maintain the semantic information of hyperspectral images during the compression process, which directly affects the accuracy of downstream task analysis and interpretation. In recent years, deep learning has shown extraordinary potential. The hyperspectral image compression model based on deep learning is based on transform coding. It uses a large number of stacked recurrent neural networks or convolutional neural networks to fit nonlinear functions and replace the linear reversible transformation in the original transform coding. Driven by a large number of samples, by extracting the spatial and spectral features of hyperspectral images at multiple levels and scales, learning can effectively characterize the abstract expression or data distribution of hyperspectral images, so that an efficient compression model can be obtained without manually setting model parameters. However, most of the existing deep learning-based image compression methods use deep features or multiple specific image interpretation tasks to indirectly describe semantics, which cannot effectively characterize the global semantic relationship of objects. Studies have shown that GAN can capture the global semantic information and local texture characteristics of images through generative adversarial learning, thereby generating high-quality images. To this end, some GAN-based image compression algorithms have emerged and made good progress.

[0003] The defects of the prior art are:

[0004] 1. Existing technologies rely on spatial-spectral similarity to represent semantic information and cannot effectively characterize changes in the global spectral structure when compressing hyperspectral images.

[0005] 2. Existing technologies usually do not aim to accurately restore the identity of ground objects, but rather use the captured semantic information to improve the visual quality of images. They cannot guarantee the reliability of image content, which poses challenges to the subsequent accurate analysis and interpretation of hyperspectral images.

[0006] 3. The existing hyperspectral image compression model based on deep learning needs to train different models when processing images in different bands, which increases the model storage cost and is not conducive to the subsequent promotion and use of the hyperspectral image compression model. Summary of the invention

[0007] In view of the above problems, the present invention provides a band-adaptive hyperspectral image compression method based on semantic guidance, which aims to reduce the loss of semantic information; while saving bandwidth and storage resources, effectively retain semantic information useful for subsequent hyperspectral image analysis and interpretation, facilitate the application and promotion of lossy compression algorithms in hyperspectral images; and reduce the storage cost of the compression model itself.

[0008] To solve the above problems, the technical solution provided by the present invention is:

[0009] The band-adaptive hyperspectral image compression method based on semantic guidance includes the following steps:

[0010] S100. Using typical hyperspectral images, a data pool is prepared for pre-training the compression module; when preparing the data pool, the number of shortest spectral bands in the actual hyperspectral images is used as a reference, all the hyperspectral images are cropped into data blocks of a manually preset size without overlap, and each cropped image data is divided into a first training set, a first validation set, and a first test set according to a first manually preset ratio;

[0011] S200. Training a classifier; using a PCA algorithm to reduce the dimension of the test hyperspectral image to the shortest number of spectral bands, and dividing the reduced-dimensional data into training samples and test samples according to a manually preset sample ratio; S300. Performing semantically guided band adaptive compression training;

[0012] S400, using the encoder, quantization, entropy coding, super-prior module and generator after the parameter adjustment in step S3 to obtain the code stream and reconstructed image of the test sample in any band; using the classifier to predict the ground object category of the test sample, and verifying the degree of retention of the semantic information of the compressed image.

[0013] Preferably, the training process of the compression module in step S100 includes the following steps:

[0014] S110. The hyperspectral image is encoded to obtain a latent representation, and the probability distribution parameters of the latent representation are learned by the super prior module; the latent representation is expressed as follows:

[0015] Y=E(X)

[0016] Wherein: Y is used to characterize the latent layer representation; X is used to characterize the hyperspectral image;

[0017] S120. The bit stream is obtained through the quantization and the entropy coding, wherein the bit stream is expressed as follows:

[0018] R(Y)=-log(p(Q(Y)))

[0019] Wherein: R(Y) is used to characterize the bitstream; Q(Y) is used to characterize the latent representation after quantization; p(Q(Y)) is used to characterize the probability distribution of the discrete latent representation;

[0020] S130. During decoding, the generator is used to restore the image from the latent layer representation to the pixel domain, as expressed by the following formula:

[0021]

[0022] Among them: the variable with '~' on top indicates the output result after adding noise; for characterizing the latent layer representation; for characterizing the pixel domain;

[0023] S140. Utilize the rate-distortion function to jointly optimize the encoder, the generator and the super-prior module to determine the parameters of each module in the compression process.

[0024] Preferably, the rate-distortion function in step S140 is expressed as follows:

[0025]

[0026] Among them: the variable with '~' on top represents the output result after adding noise; R is used to represent the bit rate, which is estimated by the existing entropy model algorithm; It is used to characterize distortion. The mean square error is used in the experiment process. λ is used to characterize the hyperparameter. The bit rate used to characterize the latent representation; The code rate used to characterize the hyper-prior; Prior information used to characterize the latent representation; Used to characterize the degree of distortion.

[0027] Preferably, the cross entropy loss function of class balance used in the classification network optimization in step S200 is expressed as follows:

[0028]

[0029] Where: N is used to represent the total number of pixels involved in the calculation; n classes Used to represent the number of categories; w a The weight used to represent the a-th category is determined according to the proportion of the number of pixels of each category in the true value label to the total number of pixels; x kaIt is used to represent the symbol function, which is equal to 1 if the true category of the k-th pixel is a, otherwise it is equal to 0; ka Used to characterize the predicted probability that the kth pixel belongs to category a.

[0030] Preferably, the semantically guided band adaptive compression training in step S300 is generative adversarial training. The spatial dimension of the hyperspectral image to be tested is slid non-overlappingly according to an artificially preset window size, and each image data is divided into a second training set, a second validation set, and a second test set according to a second artificially preset ratio; the spectral dimension is slid according to the shortest number of spectral bands until the entire spectral information is traversed.

[0031] Preferably, the semantic guidance process used in step S300 specifically includes the following steps:

[0032] S310. Performing category complementarity constraints; using the classification network obtained in step S200 to obtain the spectral semantic feature map of the original hyperspectral image, and then fixing the parameters of the classifier to obtain the spectral semantic feature map represented by the latent layer; the category complementarity constraint loss function is expressed as follows:

[0033]

[0034] Where: S X A spectral semantic feature map for characterizing the original hyperspectral image; S Y A spectral semantic feature map used to represent the latent layer representation; H and W are used to represent the height and width of the hyperspectral image category prediction map, which are the same as the height and width of the hyperspectral image;

[0035] S320. Perform semantically guided generative adversarial training. In order to capture the global changes of spectral information, based on the rate-distortion loss, the generative adversarial training is constrained by the category distribution of the original image to limit the range of changes in the spectral structure and achieve effective aggregation of similar objects. At the same time, the latent features are used as constraints to strengthen the correspondence between the learned semantic information and the content of the objects. The loss function of semantically guided generative adversarial training is expressed as follows:

[0036]

[0037] Among them: λ is used to represent the hyperparameter used to balance pixel loss; Used to characterize the hyperparameters used to balance the generator loss; λ and The value of is set by the user according to the actual needs of the data set and image compression; the distortion function is the weighted sum of the category complementarity constraint loss function and the mean square error described in S310; V is used to characterize the conditional constraint;

[0038] The conditional constraints are expressed as follows:

[0039]

[0040] in: is used to characterize the latent layer representation after quantization; S is used to characterize the spectral category distribution map of the original image;

[0041] During model training, the discriminator is used to map the input data (X, V) to the conditional probability distribution p X|V On the samples, the generator, under the constraints of the conditional constraints, transforms the latent variables in the latent layer representation from the distribution Mapping to distribution p X|V ;

[0042] The latent variable is expressed as follows:

[0043]

[0044] in: Used to characterize the latent variable.

[0045] Preferably, the test data in step S400 may be a hyperspectral image of any band, that is, one model can process hyperspectral data of any band.

[0046] Preferably, the manually preset size in step S100 is expressed as follows:

[0047] A=L×H1×W1

[0048] Wherein: A is used to represent the manually preset size, H1 and W1 are used to represent the height and width of the data block respectively;

[0049] The value of the first manually preset ratio in step S100 is: the ratio of the first training set, the first validation set and the first test set is 8:1:1;

[0050] The method for setting the artificially preset sample ratio in step S200 is: randomly selecting 10% of the samples of each type of ground object as the training samples, and the rest as the test samples;

[0051] The value of the second manually preset ratio in step S300 is: the ratio of the second training set, the second validation set and the second test set is 8:1:1.

[0052] Compared with the prior art, the present invention has the following advantages:

[0053] 1. The present invention unifies the compression task and the classification task into the same framework, utilizes the natural connection between spectral curves and semantic categories, imposes category constraints on the spectral structure, guides the generation of reconstructed image spectral information, and thus reduces the loss of semantic information.

[0054] 2. While saving bandwidth and storage resources, the present invention effectively retains semantic information useful for subsequent hyperspectral image analysis and interpretation, facilitating the application and promotion of lossy compression algorithms in hyperspectral images.

[0055] 3. The present invention is suitable for processing hyperspectral images of any band, and there is no need to train separate models according to different bands, thereby reducing the storage cost of the compression model itself. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a network architecture of a semantically guided band-adaptive hyperspectral image compression method according to a specific embodiment of the present invention;

[0057] Figure 2 is a schematic diagram of a hyperspectral image classification network according to an embodiment of the present invention;

[0058] Figure 3 is a schematic diagram of a compression network encoder in an embodiment of the present invention;

[0059] Figure 4 is a schematic diagram of a conditional GAN ​​generator in an embodiment of the present invention;

[0060] Figure 5 is a schematic diagram of a conditional GAN ​​discriminator in an embodiment of the present invention;

[0061] Figure 6a Schematic diagram of rate-distortion performance of peak signal-to-noise ratio (PSNR) of different algorithms on the PaviaU dataset in an embodiment of the present invention;

[0062] Figure 6b Schematic diagram of rate-distortion performance of multi-scale structural similarity MS-SSIM on the PaviaU dataset using different algorithms in an embodiment of the present invention;

[0063] Figure 6c Schematic diagram of rate-distortion performance of spectral angle SAM of different algorithms on PaviaU dataset in embodiments of the present invention;

[0064] Figure 7 It is a classification visualization diagram of reconstructing PaviaU images at a bit rate of about 0.05bpppb using different algorithms in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The present invention is further explained below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0066] like Figure 1 , 2 As shown in , 3, 4, and 5, the band-adaptive hyperspectral image compression method based on semantic guidance includes the following steps:

[0067] S100. Use typical hyperspectral images to create a data pool for pre-training the compression module; when creating the data pool, use the number of shortest spectral bands in the actual hyperspectral images as a benchmark, crop all hyperspectral images into data blocks of an artificially preset size without overlap, and divide each cropped image data into a first training set, a first validation set, and a first test set according to a first artificially preset ratio.

[0068] S200. Train the classifier; use the PCA algorithm to reduce the dimension of the test hyperspectral image to the shortest number of spectral bands, and divide the reduced data into training samples and test samples according to the manually preset sample ratio.

[0069] S300. Perform semantically guided band-adaptive compression training.

[0070] S400, using the encoder, quantization, entropy coding, super-prior module and generator after the parameter adjustment in step S3 to obtain the code stream and reconstructed image of the test sample in any band; using the classifier to predict the ground object category of the test sample, and verifying the degree of retention of the semantic information of the compressed image.

[0071] It should be noted that the technical route adopted by the present invention is: a band-adaptive hyperspectral image compression method based on semantic guidance. First, an independent classification network is designed, and then it is connected in parallel to the existing deep learning-based image compression architecture. Then, the network is trained in segments and the network parameters are obtained.

[0072] A three-stage optimization method is used when training the network:

[0073] First, the compression module is pre-trained using the rate-distortion loss function. This process can improve the feature discriminability of the latent representation and clarify the spatial structural relationship of the latent representation, thereby assisting in the distinction and description of objects with similar spectra but different categories, laying the foundation for maintaining the consistency of the category information of the same type of objects before and after encoding and decoding.

[0074] Secondly, a classification network is trained. The classification network is used to obtain the spectral semantic feature map S of the original hyperspectral image. X , then fix the classifier parameters and obtain the spectral semantic feature map S represented by the latent layerY , by narrowing the difference between the two, the spectral structure mutation caused by semantic loss is reduced.

[0075] Finally, conditional GAN ​​is used to effectively aggregate features of similar objects to achieve global semantic consistency within the class.

[0076] It should be noted that if Figure 1 As shown in the figure, Encoder represents encoder, Generator represents generator, Hyperprior represents hyper-prior module, Discriminator represents discriminator, and Classifier represents classifier.

[0077] It should be noted that the training process of the compression module in step S100 includes the following steps:

[0078] S110. The hyperspectral image is encoded to obtain a latent representation, and the probability distribution parameters of the latent representation are learned by the hyper-prior module; the latent representation is expressed as follows:

[0079] Y=E(X)(1)

[0080] Among them: Y is used to represent the latent layer representation; X is used to represent the hyperspectral image.

[0081] S120. After quantization and entropy coding, a bit stream is obtained, wherein the bit stream is expressed as follows:

[0082] R(Y)=-log(p(Q(Y))) (2)

[0083] Among them: R(Y) is used to represent the bitstream; Q(Y) is used to represent the quantized latent representation; p(Q(Y)) is used to represent the probability distribution of the discrete latent representation.

[0084] S130. During decoding, the generator is used to restore the image from the latent layer representation to the pixel domain, as expressed in Formula 3:

[0085]

[0086] Among them: the variable with '~' on top indicates the output result after adding noise; Used to characterize latent representations; Used to characterize the pixel domain.

[0087] S140. Utilize the rate-distortion function to jointly optimize the encoder, generator, and super-prior module to determine the parameters of each module in the compression process.

[0088] It should be further explained that the discriminator does not participate in the training process of the compression module in step S100.

[0089] It should be further explained that the probability distribution parameters of the latent layer representation in step S140 are learned by the super prior module.

[0090] It should be further explained that the rate-distortion function in step S140 is expressed as follows:

[0091]

[0092] Among them: the variable with '~' on top represents the output result after adding noise; R is used to represent the bit rate, which is estimated by the existing entropy model algorithm; It is used to characterize distortion. The mean square error is used in the experiment process. λ is used to characterize the hyperparameter. The bit rate used to characterize the latent representation; The code rate used to characterize the hyper-prior; Prior information used to characterize the latent representation; Used to characterize the degree of distortion.

[0093] In this specific embodiment, typical hyperspectral images such as Chikusei, Houston2018, PaviaC, and Washington DC are used to create a data pool for pre-training of the compression module. The process uses the 50 spectral bands of the Houston2018 data set as a benchmark, crops all hyperspectral images into data blocks of size 256×256×50 without overlap, and divides each cropped image data into the first training set, the first validation set, and the first test set in a ratio of 8:1:1.

[0094] It should be noted that the cross entropy loss function with balanced categories is expressed as follows in Formula 5 when optimizing the classification network in step S200:

[0095]

[0096] Where: N is used to represent the total number of pixels involved in the calculation; n classes Used to represent the number of categories; w a The weight used to represent the a-th category is determined according to the proportion of the number of pixels of each category in the true value label to the total number of pixels; x ka It is used to represent the symbol function, which is equal to 1 if the true category of the k-th pixel is a, otherwise it is equal to 0; ka Used to characterize the predicted probability that the kth pixel belongs to category a.

[0097] In this specific embodiment, a classifier is trained using the PaviaU dataset. In order to ensure the integrity of the spectral features and the adaptability of the image to the compression model, the PCA algorithm is used to reduce the dimension of the test hyperspectral image PaviaU to 50 bands, and the reduced data is divided into two parts: training samples and test samples. 10% of the samples of each type of ground feature are randomly selected as training samples, and the rest are used as test samples.

[0098] It should be noted that the semantic-guided band-adaptive compression training in step S300 is to generate adversarial training based on the compression model pre-trained in step S100. The spatial dimension of the test hyperspectral image is slid non-overlappingly according to the size of 64×64, and each image data is divided into the second training set, the second validation set and the second test set according to the ratio of 8:1:1; the process uses the original spectral band number 103 of the test hyperspectral image PaviaU. In order to ensure the integrity of the band information, the image is no longer segmented in the spectral dimension in advance during training. Since the model training in the previous two steps is trained according to 50 bands, in order to ensure that the model can adapt to data sets of different bands, during training, the spectral dimension is slid according to 50 bands until the entire spectral information is traversed. After the conditional GAN ​​converges, the parameters of the compression network at this time are saved.

[0099] It should be further explained that the semantic guidance process used in step S300 specifically includes the following steps:

[0100] S310. Perform category complementarity constraints; use the classification network obtained in step S200 to obtain the spectral semantic feature map of the original hyperspectral image, then fix the parameters of the classifier, and then obtain the spectral semantic feature map represented by the latent layer; the category complementarity constraint loss function is expressed as formula 6:

[0101]

[0102] Where: S X Spectral semantic feature map used to characterize the original hyperspectral image; S Y The spectral semantic feature map used to characterize the latent layer representation; H and W are used to characterize the height and width of the hyperspectral image category prediction map, which are the same as the height and width of the hyperspectral image.

[0103] S320. Perform semantically guided generative adversarial training. In order to capture the global changes of spectral information, based on the rate-distortion loss, the generative adversarial training is constrained by the category distribution of the original image to limit the range of changes in the spectral structure and achieve effective aggregation of similar objects. At the same time, the latent features are used as constraints to strengthen the correspondence between the learned semantic information and the content of the objects. The loss function of semantically guided generative adversarial training is expressed as Equations 7 and 8:

[0104]

[0105] Among them: λ is used to represent the hyperparameter used to balance pixel loss; Used to characterize the hyperparameters used to balance the generator loss; λ and The value of is set by the user according to the actual needs of the data set and image compression; the distortion function It is the weighted sum of the category complementarity constraint loss function and the mean square error in S310; V is used to characterize the conditional constraints.

[0106] The conditional constraints are expressed as formula 9:

[0107]

[0108] in: It is used to represent the latent representation after quantization; S is used to represent the spectral category distribution map of the original image;

[0109] During model training, the discriminator is used to map the input data (X, V) to the conditional probability distribution p X|V On the samples, the generator transforms the latent variables in the latent layer representation from the distribution under the constraints of the conditional constraints. Mapping to distribution p X|V .

[0110] The latent variable is expressed as follows:

[0111]

[0112] in: Used to characterize latent variables.

[0113] It should be further explained that the process of step S310 utilizes the complementarity of the category features of the original image and the object in the latent layer representation to align the semantic information at the pixel level and reduce the variance of the global spectral features, thereby alleviating the spectral structure mutation caused by the loss of category information in the existing compression method.

[0114] It should be noted that the test data in step S400 may be a hyperspectral image of any band, that is, one model can process hyperspectral data of any band.

[0115] It should be noted that if Figure 6a , 6b , as shown in 6c, Figure 6a , 6b 6c are the rate-distortion performances of different algorithms on the PaviaU dataset in the embodiments of the present invention.

[0116] It should be noted that if Figure 7As shown, different algorithms in the embodiments of the present invention reconstruct the classification visualization diagram of the PaviaU image at a bit rate of about 0.05bpppb, among which the semantic-guided band-adaptive hyperspectral image compression method SCGAN has the best classification effect, OA: 0.908, KC: 0.878.

[0117] It should be noted that the above process can be implemented using the deep learning framework Pytorch.

[0118] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0119] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0120] The above description includes examples of one or more embodiments. Of course, it is not possible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

[0121] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A band-adaptive hyperspectral image compression method based on semantic guidance, characterized in that: The following steps are involved: S100. Using typical hyperspectral images, a data pool is prepared for pre-training the compression module; when preparing the data pool, the number of shortest spectral bands in the actual hyperspectral images is used as a reference, all the hyperspectral images are cropped into data blocks of a manually preset size without overlap, and each cropped image data is divided into a first training set, a first validation set, and a first test set according to a first manually preset ratio; S200. Training classifier; The PCA algorithm is used to reduce the dimension of the test hyperspectral image to the shortest number of spectral bands, and the reduced-dimensional data is divided into training samples and test samples according to a manually preset sample ratio; S300. Perform semantically guided band adaptive compression training; S400, using the encoder, quantization, entropy coding, super-prior module and generator after the parameter adjustment in step S3 to obtain the code stream and reconstructed image of the test sample in any band; using the classifier to predict the ground object category of the test sample, and verifying the degree of retention of the semantic information of the compressed image.

2. The semantically guided band-adaptive hyperspectral image compression method according to claim 1, characterized in that: The training process of the compression module in step S100 includes the following steps: S110. The hyperspectral image is encoded to obtain a latent representation, and the probability distribution parameters of the latent representation are learned by the super prior module; the latent representation is expressed as follows: Y=E(X) Wherein: Y is used to characterize the latent layer representation; X is used to characterize the hyperspectral image; S120. The bit stream is obtained through the quantization and the entropy coding, wherein the bit stream is expressed as follows: R(Y)=-log(p(Q(Y))) Wherein: R(Y) is used to characterize the bitstream; Q(Y) is used to characterize the latent representation after quantization; p(Q(Y)) is used to characterize the probability distribution of the discrete latent representation; S130. During decoding, the generator is used to restore the image from the latent layer representation to the pixel domain, as expressed by the following formula: Among them: the variable with '~' on top indicates the output result after adding noise; for characterizing the latent layer representation; for characterizing the pixel domain; S140. Utilize the rate-distortion function to jointly optimize the encoder, the generator and the super-prior module to determine the parameters of each module in the compression process.

3. The semantically guided band-adaptive hyperspectral image compression method according to claim 2, characterized in that: The rate distortion function in step S140 is expressed as follows: Among them: the variable with '~' on top represents the output result after adding noise; R is used to represent the bit rate, which is estimated by the existing entropy model algorithm; It is used to characterize distortion. The mean square error is used in the experiment process. λ is used to characterize the hyperparameter. The bit rate used to characterize the latent representation; The code rate used to characterize the hyper-prior; Prior information used to characterize latent representations; Used to characterize the degree of distortion.

4. The semantically guided band-adaptive hyperspectral image compression method according to claim 3, characterized in that: The cross entropy loss function with class balance used in the classification network optimization in step S200 is expressed as follows: Where: N is used to represent the total number of pixels involved in the calculation; n classes Used to represent the number of categories; w a The weight used to represent the a-th category is determined according to the proportion of the number of pixels of each category in the true value label to the total number of pixels; x ka It is used to represent the symbol function, which is equal to 1 if the true category of the k-th pixel is a, otherwise it is equal to 0; ka Used to characterize the predicted probability that the kth pixel belongs to category a.

5. The semantically guided band-adaptive hyperspectral image compression method according to claim 4, characterized in that: The semantically guided band adaptive compression training in step S300 is generative adversarial training; the spatial dimension of the hyperspectral image to be tested is slid non-overlapping according to an artificially preset window size, and each image data is divided into a second training set, a second verification set, and a second test set according to a second artificially preset ratio; the spectral dimension is slid according to the shortest number of spectral bands until the entire spectral information is traversed.

6. The semantically guided band-adaptive hyperspectral image compression method according to claim 5, characterized in that: The semantic guidance process used in step S300 specifically includes the following steps: S310. Performing category complementarity constraints; using the classification network obtained in step S200 to obtain the spectral semantic feature map of the original hyperspectral image, and then fixing the parameters of the classifier to obtain the spectral semantic feature map represented by the latent layer; the category complementarity constraint loss function is expressed as follows: Where: S X A spectral semantic feature map for characterizing the original hyperspectral image; S Y A spectral semantic feature map used to represent the latent layer representation; H and W are used to represent the height and width of the hyperspectral image category prediction map, which are the same as the height and width of the hyperspectral image; S320. Perform semantically guided generative adversarial training. In order to capture the global changes of spectral information, based on the rate-distortion loss, the generative adversarial training is constrained by the category distribution of the original image to limit the range of changes in the spectral structure and achieve effective aggregation of similar objects. At the same time, the latent features are used as constraints to strengthen the correspondence between the learned semantic information and the content of the objects. The loss function of semantically guided generative adversarial training is expressed as follows: Among them: λ is used to represent the hyperparameter used to balance pixel loss; Used to characterize the hyperparameters used to balance the generator loss; λ and The value of is set by the user according to the actual needs of the data set and image compression; the distortion function is the weighted sum of the category complementarity constraint loss function and the mean square error described in S310; V is used to characterize the conditional constraint; The conditional constraints are expressed as follows: in: is used to characterize the latent layer representation after quantization; S is used to characterize the spectral category distribution map of the original image; During model training, the discriminator is used to map the input data (X, V) to the conditional probability distribution p X|V On the samples, the generator transforms the latent variables in the latent layer representation from the distribution under the constraints of the conditional constraints. Mapping to distribution p X|V ; The latent variable is expressed as follows: in: Used to characterize the latent variable.

7. The semantically guided band-adaptive hyperspectral image compression method according to claim 6, characterized in that: The test data in step S400 may be a hyperspectral image of any band, that is, one model can process hyperspectral data of any band.

8. The semantically guided band-adaptive hyperspectral image compression method according to claim 7, characterized in that: The manually preset size in step S100 is expressed as follows: A=L×H1×W1 Wherein: A is used to represent the manually preset size, H1 and W1 are used to represent the height and width of the data block respectively; The value of the first manually preset ratio in step S100 is: the ratio of the first training set, the first validation set and the first test set is 8:1:1; The method for setting the artificially preset sample ratio in step S200 is: randomly selecting 10% of the samples of each type of ground object as the training samples, and the rest as the test samples; The value of the second manually preset ratio in step S300 is: the ratio of the second training set, the second validation set and the second test set is 8:1:1.

Citation Information

Cited By

  • Spectral gradient guided hyperspectral image compression and reconstruction method and system

    CN122156331A