A hyperspectral image classification method and device, electronic equipment and storage medium
By constructing a multi-channel voting classification model and various classifiers, combined with the bagging method and data transformation processing, the accuracy and stability problems of substance identification in hyperspectral images were solved, achieving high accuracy and stability classification of hyperspectral images.
Patent Information
- Application Number
- CN202211105012.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-09-09
AI Technical Summary
Existing technologies struggle to effectively address the accuracy and stability issues in substance identification from hyperspectral images, particularly due to the reduced classification accuracy caused by the high dimensionality of the data, feature redundancy, and imbalanced distribution.
A multi-channel voting classification model is constructed, combining various classifiers such as kernel extreme learning machine, support vector machine and multinomial logistic regression. The training data distribution is balanced by bagging and data transformation processing such as principal component analysis, thereby improving classification accuracy and stability.
In hyperspectral image classification, it improves the accuracy and stability of classification, and is suitable for a variety of remote sensing application scenarios, especially maintaining high accuracy when the amount of label data is small.
Smart Images

Figure CN115690595B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of remote sensing image processing, and particularly relates to a hyperspectral image classification method and device, electronic equipment and a storage medium. BACKGROUND
[0002] A hyperspectral image, i.e. a remote sensing image with high spectral resolution, uses hundreds of narrow bands to provide rich spectral information, each pixel point corresponds to a vector data composed of multi-band data values, which can improve the identification ability of ground surface ground material and structure, and has an important role in application fields such as target detection, agricultural monitoring, mineral mapping, and national defense construction. However, the high dimensionality of hyperspectral image data leads to the Hughes phenomenon (i.e. in the process of hyperspectral analysis, with the increase of the number of bands participating in operation, the classification accuracy "first increases and then decreases"), and the unbalanced distribution of training data also brings great difficulty to classification. Therefore, the current classification technology is difficult to accurately identify the substances presented in the hyperspectral image. SUMMARY
[0003] In order to solve the problem of poor accuracy of hyperspectral image classification and identification based on the prior art, the embodiments of the present application provide a hyperspectral image classification method, device, electronic equipment and storage medium, which can process hyperspectral image data with high dimension, feature redundancy and unbalanced distribution, and realize high accuracy and high stability of pixel point classification.
[0004] In a first aspect, the embodiments of the present application provide a hyperspectral image classification method, comprising:
[0005] Obtaining a hyperspectral image data set with classification labels, determining all classifications and pixel point data corresponding to each classification therein;
[0006] Determining the data volume of a training sample set to be selected;
[0007] Based on the data volume of the training sample set, the total number of all classifications and the pixel point data corresponding to each classification, obtaining the training sample set, and grouping the remaining pixel point data into a test sample set;
[0008] Constructing a classification model; the classification model comprises multiple voting channels and at least two classifiers, one classifier is arranged in each voting channel, which is used for classifying the input data, if the classifier is a kernel extreme learning machine, only one voting channel without data transformation processing in the classification model adopts this kind of classifier, if the classifier is not a kernel extreme learning machine, at least two voting channels in the classification model adopt this kind of classifier, one of which is a voting channel without data transformation processing, and the others are voting channels with data transformation processing; the classification model is used to obtain the final classification result through voting based on the classification result of each voting channel.
[0009] According to the total number of voting channels, the obtained training sample set is uniformly sampled with replacement by bagging to obtain a new training sample set;
[0010] Based on the obtained training sample set, each voting channel in the classification model is trained;
[0011] The trained classification model is tested based on the test sample set;
[0012] Obtain hyperspectral image data, input the classification model for recognition and classification, and obtain the corresponding classification result.
[0013] Optionally, the training sample set is obtained based on the data volume of the training sample set, the total number of all classifications, and the pixel point data corresponding to each classification.
[0014] Based on the data volume of the training sample set and the total number of all classifications, the sample extraction amount for each classification is determined.
[0015] According to the determined sample extraction amount, the pixel point data corresponding to each classification is sampled without replacement by average selection to obtain the training sample set.
[0016] Optionally, the sample extraction amount for each classification is determined based on the data volume of the training sample set and the total number of all classifications.
[0017] Let the data volume of the training sample set to be selected be N, and the total number of all classifications be M, then the sample extraction amount of a single classification is [N / M] data; [] represents rounding.
[0018] For a classification with pixel point data not less than [N / M], the sample extraction amount is determined as [N / M]; for a classification with pixel point data less than [N / M], the sample extraction amount is determined as [N / 2M];
[0019] According to the determined sample extraction amount, the pixel point data corresponding to each classification is sampled without replacement by average selection, including:
[0020] According to the corresponding sample extraction amount, the pixel point data corresponding to each classification is sampled without replacement;
[0021] If the data volume obtained after sampling and selecting all classifications is less than N, then the remaining pixel point data is randomly sampled to supplement the training sample set.
[0022] Optionally, the data transformation processing includes feature extraction or selection.
[0023] Optionally, the data transformation processing is principal component analysis.
[0024] Optionally, the classifier of the classification model includes kernel extreme learning machine, support vector machine and multinomial logistic regression.
[0025] Secondly, embodiments of the present invention also provide a hyperspectral image classification device, comprising:
[0026] The data acquisition module is used to acquire hyperspectral image datasets with classification labels, determine all categories and the corresponding pixel data for each category;
[0027] The sample size determination module is used to determine the amount of data in the training sample set to be selected.
[0028] The sample set determination module is used to obtain the training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, and to form the test sample set with the remaining pixel data.
[0029] A model building module is used to construct a classification model. The classification model includes multiple voting channels and at least two classifiers. Each voting channel has one classifier for classifying the input data. If the classifier is a kernel extreme learning machine (KEM), only one voting channel without data transformation processing uses this classifier. If the classifier is not a KEM, at least two voting channels in the classification model use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result through voting based on the classification results of each voting channel.
[0030] A new sample module is added to obtain a new training sample set by uniformly sampling with replacement from the training sample set obtained by the bagging method based on the total number of voting channels.
[0031] The training model module is used to train each voting channel in the classification model based on the obtained training sample set;
[0032] The test model module is used to test the trained classification model based on the test sample set;
[0033] The image recognition module is used to acquire hyperspectral image data, input it into the classification model for recognition and classification, and obtain the corresponding classification results.
[0034] Optionally, the sample set determination module is used to obtain the training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, including performing the following operations:
[0035] Based on the amount of data in the training sample set and the total number of all categories, determine the sample extraction amount for each category.
[0036] Based on the determined sample size, the training sample set is obtained by sampling the pixel data corresponding to each category without replacement through average selection.
[0037] Thirdly, embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the hyperspectral image classification method described in any embodiment of this specification.
[0038] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the hyperspectral image classification method described in any embodiment of this specification.
[0039] This invention provides a hyperspectral image classification method, apparatus, electronic device, and storage medium. The invention utilizes multiple classifiers to construct a classification model and trains the model with diverse training data through bagging and data transformation. Finally, the classification result is obtained through voting. This invention can integrate the advantages of single-class classifiers and balance the differences in classification accuracy caused by imbalanced training data distribution, thereby effectively improving the stability and accuracy of hyperspectral image classification. It is also applicable to various remote sensing image applications. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of a hyperspectral image classification method provided in an embodiment of the present invention;
[0042] Figure 2 This is a flowchart of another hyperspectral image classification method provided in an embodiment of the present invention;
[0043] Figure 3 This is a hardware architecture diagram of an electronic device provided in an embodiment of the present invention;
[0044] Figure 4 This is a structural diagram of a hyperspectral image classification device provided in an embodiment of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0046] Due to the high dimensionality, feature redundancy, and imbalanced distribution of hyperspectral image data, current classification techniques struggle to accurately identify the substances presented in these images. In view of this, the present invention provides a classification method, apparatus, electronic device, and storage medium for hyperspectral images. The classification model of the present invention includes multiple voting channels and at least two classifiers, which can combine the advantages of single-class classifiers and balance the differences in classification accuracy caused by the imbalanced distribution of training data.
[0047] The following describes the specific implementation of the above concept.
[0048] Please refer to Figure 1 This invention provides a hyperspectral image classification method, which includes:
[0049] Step 100: Obtain a hyperspectral image dataset with classification labels, and determine all classifications and the corresponding pixel data for each classification.
[0050] In a hyperspectral image dataset, each pixel corresponds to a vector data point, and the classification label indicates the category to which the point belongs, such as soil, tree, grassland, etc.
[0051] Step 102: Determine the amount of data in the training sample set to be selected;
[0052] The amount of data in the training sample set to be selected can be determined according to a preset value or according to the amount of data in the dataset. For example, 5% to 70% of the dataset can be used as the training sample set.
[0053] Step 104: Based on the determined amount of data in the training sample set to be selected, the total number of all categories, and the pixel data corresponding to each category, a training sample set is obtained, and the remaining pixel data in the hyperspectral image dataset is used to form a test sample set.
[0054] Step 106: Construct a classification model. The classification model includes multiple voting channels and at least two classifiers. Each voting channel has one classifier for classifying the input data. If the classifier is a kernel extreme learning machine, only one voting channel without data transformation processing uses this classifier. If the classifier is not a kernel extreme learning machine, at least two voting channels in the classification model use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result through voting based on the classification results of each voting channel.
[0055] In one specific embodiment, the classification model includes multiple voting channels and an output layer. Each voting channel includes an input layer and a classifier connected in sequence, or an input layer, a data transformation processing layer, and a classifier connected in sequence. When the classifier of the voting channel is a kernel extreme learning machine, the voting channel includes an input layer and a classifier. If the classifier of the voting channel is not a kernel extreme learning machine, the voting channel may include an input layer and a classifier, or it may include an input layer, a data transformation processing layer, and a classifier. Each classifier is connected to the output layer. The output layer obtains the final classification result through voting based on the classification results of each voting channel, thereby combining the processing advantages of a single classifier.
[0056] When voting to arrive at the final classification result, the weights of each channel can be equal or adjusted according to the actual situation.
[0057] Step 108: Based on the total number of voting channels, perform uniform sampling with replacement on the obtained training sample set using the bagging method to obtain a new training sample set.
[0058] By using the bagging method, a new training sample set can be added on the basis of the original training sample set. After adding the new training sample set in step 108, the total number of training sample sets should be the same as the number of voting channels of the classification model, so that a training sample set can be allocated to each voting channel during subsequent training.
[0059] Step 110: Based on the obtained training sample set, train each voting channel in the classification model;
[0060] This step 110 trains each voting channel and assigns the aforementioned training sample set to each voting channel;
[0061] Step 112: Test the trained classification model based on the test sample set;
[0062] The accuracy and stability of the classification model can be determined through testing;
[0063] Step 114: Acquire hyperspectral image data, input it into the classification model for recognition and classification, and obtain the corresponding classification results;
[0064] The newly acquired hyperspectral image data is input into the trained classification model, and the classification model can be used to achieve classification.
[0065] This invention utilizes multiple classifiers to construct a classification model, and employs bagging and data transformation to train the model with diverse training data. The classification result is then obtained through voting. The use of multiple classifiers allows for the integration of the advantages of single-class classifiers. Furthermore, the bagging and data transformation processes increase the diversity of training data, balancing the differences in classification accuracy caused by imbalanced training data distribution. Even with a small sample size in labeled datasets, this invention achieves high accuracy and stability, enabling target recognition and classification in remote sensing images.
[0066] Optionally, for step 104, obtaining the training sample set includes:
[0067] Based on the amount of data in the training sample set and the total number of all categories, determine the sample extraction amount for each category.
[0068] Based on the determined sample size, the training sample set is obtained by sampling the pixel data corresponding to each category without replacement through average selection.
[0069] Furthermore, determining the sample extraction quantity for each category based on the data volume of the training sample set and the total number of all categories includes:
[0070] Let the data size of the training sample set to be selected be N, and the total number of all categories be M. Then the number of samples to be extracted for a single category is [N / M] data; [] indicates rounding.
[0071] For classifications where the number of pixels is not less than [N / M], the sample size is determined to be [N / M]; for classifications where the number of pixels is less than [N / M], the sample size is determined to be [N / 2M].
[0072] Accordingly, the step of sampling without replacement of pixel data corresponding to each category by average selection based on the determined sample size includes:
[0073] Based on the corresponding sample extraction quantity, the pixel data corresponding to each category is sampled without replacement.
[0074] If the amount of data obtained after sampling all categories is less than N, then random samples are drawn from the remaining pixel data to supplement the training sample set.
[0075] The above embodiments use an average selection plus random selection method to obtain data samples covering all categories to form a training sample set, which can further optimize the difference in classification accuracy caused by the imbalance of training data distribution and obtain better classification accuracy.
[0076] Optionally, in the method of the present invention, the data transformation processing includes feature extraction or selection.
[0077] For classifiers that are not kernel-based extreme learning machines, two or more voting channels can be used. For example, one channel can be a voting channel without data transformation, where the data input to this channel goes directly into the classifier; another channel can be a voting channel with feature extraction, where the data input to this channel undergoes feature extraction before entering the classifier. The above embodiments achieve data transformation through feature extraction or selection, increasing the diversity of training data and helping to improve classification accuracy.
[0078] Furthermore, the data transformation process involves principal component analysis.
[0079] Principal component analysis (PCA), a commonly used feature extraction technique, can effectively obtain the features of data. By inputting the results obtained from PCA, it can help improve classification accuracy.
[0080] Optionally, the classifier is a kernel extreme learning machine, a support vector machine, or a multinomial logistic regression.
[0081] Furthermore, the classifiers of the classification model include kernel extreme learning machine, support vector machine and multinomial logistic regression.
[0082] Kernel Extreme Learning Machine (KELM), Support Vector Machine (SVM), and Multinomial Logistic Regression (MLR) offer advantages in hyperspectral image classification. Multinomial Logistic Regression provides greater flexibility in constructing nonlinear kernels, while KELM boasts fast computation speed, simple solution, and strong generalization ability. SVM is particularly advantageous for training with small sample sizes. However, no single classifier can solve a wide range of remote sensing application problems. This invention integrates the advantages of multiple classifiers to construct an ensemble classification model for hyperspectral images, further improving the accuracy and stability of hyperspectral image classification. Preferably, only the aforementioned three classes—KELM, SVM, and MLR—can be used. By adding different data transformation methods to increase voting channels, the diversity of training samples can be utilized to enhance classification accuracy and stability.
[0083] In a preferred embodiment, the classification model includes five voting channels and three classifiers: kernel extreme learning machine (KELM), support vector machine (SVM), and multinomial logistic regression (MLR). Except for KELM, which corresponds to one voting channel without data transformation, SVM and MLR each correspond to two voting channels: one without data transformation and the other after principal component analysis (PCA). In other words, the five voting channels of the classification model are: a KELM voting channel without data transformation, a SVM voting channel without data transformation, a SVM voting channel after PCA, a MLR voting channel without data transformation, and a MLR voting channel after PCA. This embodiment utilizes PCA to extract features from a portion of the training samples, obtaining dimensionality-reduced data. Then, using the dimensionality-reduced data and the remaining training samples, MLR, SVM, and KELM classifiers are trained respectively. This approach improves the accuracy and stability of hyperspectral image classification, addressing the characteristics of high dimensionality, feature redundancy, and imbalanced distribution in hyperspectral image data. It has been verified that, due to its inherent characteristics, using a voting channel with data transformation processing in the classification model of the kernel extreme learning machine classifier can actually affect the classification effect. Therefore, for the kernel extreme learning machine, only one voting channel without data transformation processing is allowed to use this classifier in the classification model.
[0084] like Figure 2 As shown, the present invention also provides a hyperspectral image classification method, comprising:
[0085] Step 200: Obtain a hyperspectral image dataset with classification labels, and determine all classifications and the corresponding pixel data for each classification.
[0086] Step 202: Determine the amount of data in the training sample set to be selected;
[0087] Step 204: Let the data size of the training sample set to be selected be N, and the total number of all categories be M. Then the number of samples to be extracted for a single category is [N / M] data; [] indicates rounding.
[0088] Step 206: For classifications where the number of pixel data points is not less than [N / M], determine the sample size as [N / M].
[0089] For classifications where pixel data is less than [N / M], the sample size is determined to be [N / 2M].
[0090] Step 208: Based on the corresponding sample extraction quantity, perform sampling without replacement on the pixel data corresponding to each category.
[0091] If the amount of data obtained after sampling all categories is less than N, then random sampling is performed from the remaining pixel data to supplement the training sample set.
[0092] Step 210: Compile the remaining pixel data into a test sample set;
[0093] Step 212: Construct a classification model. The classification model includes multiple voting channels and at least two classifiers. Each voting channel has one classifier for classifying the input data. If the classifier is a kernel extreme learning machine, only one voting channel without data transformation processing uses this classifier. If the classifier is not a kernel extreme learning machine, at least two voting channels in the classification model use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result through voting based on the classification results of each voting channel.
[0094] Step 214: Based on the total number of voting channels, perform uniform sampling with replacement on the obtained training sample set using the bagging method to obtain a new training sample set.
[0095] Step 216: Based on the obtained training sample set, train each voting channel in the classification model;
[0096] Step 218: Test the trained classification model based on the test sample set;
[0097] Step 220: Acquire hyperspectral image data, input it into the classification model for recognition and classification, and obtain the corresponding classification results.
[0098] To verify the reliability of the method provided in this invention, two widely used hyperspectral datasets (Indian pine and University of Pavia) were used for testing and evaluation. The Indian pine dataset contains two-thirds agricultural vegetation and one-third forest or other natural perennial vegetation, with 16 categories and 10,366 data samples. It includes two main dual-track highways, one railway line, some smaller roads, and low-density housing and other buildings. The University of Pavia dataset includes soil, trees, grassland, etc., with 9 categories and 42,776 data samples. For the two hyperspectral datasets, 5%, 10%, and 20% of the entire dataset were selected as training samples. A classification model with five voting channels and three classifiers was constructed. The diversity of training samples was increased using bagging and principal component analysis. The upper limit of the cumulative contribution rate of the principal components was set to 10, and the support vector machine was set to
[10] . -2 10 -1 ,…,10 4Search for the penalty parameter C within the range of
[10] . -3 10 -2 ,…,10 4 The kernel parameter γ is searched within the range of
[10] . The kernel limit learning machine searches within the range of
[10] . -3 10 -2 ,…,10 4 Search for the regularization coefficient C within the range of [2]. -3 ,2 -2 ,…,2 4 The kernel parameter γ is searched within a certain range. Four metrics are used to evaluate performance: overall accuracy, average accuracy, class-specific accuracy, and kappa coefficient. Overall accuracy is the ratio of correctly classified samples to all samples; class-specific accuracy is the ratio of correctly classified samples to all samples in a specific class; average accuracy is the average of class-specific accuracy across all classes; and the kappa coefficient measures classification accuracy. Based on the above data, hyperspectral image pixel classification experiments were conducted using the method proposed in this invention, as well as three single classifiers: Support Vector Machine, Kernel Extreme Learning Machine, and Multinomial Logistic Regression. The results show that the classification accuracy of the method proposed in this invention is better than that of the three compared single classifiers, and even with a small number of labeled samples, the method proposed in this invention exhibits satisfactory accuracy and stability.
[0099] like Figure 3 , Figure 4 As shown, this embodiment of the invention provides a hyperspectral image classification device. The device embodiment can be implemented through software, hardware, or a combination of both. From a hardware perspective, as... Figure 3 The diagram shown is a hardware architecture diagram of an electronic device containing a hyperspectral image classification device according to an embodiment of the present invention. (Except for...) Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, such as... Figure 4 As shown, a device in a logical sense is formed by the CPU of its electronic device reading the corresponding computer program from the non-volatile memory into memory and running it. This embodiment provides a hyperspectral image classification device, including a data acquisition module 401, a sample size determination module 402, a sample set determination module 403, a model construction module 404, a new sample addition module 405, a model training module 406, a model testing module 407, and an image recognition module 408; specifically, wherein:
[0100] The data acquisition module 401 is used to acquire a hyperspectral image dataset with classification labels, and to determine all the classifications and the pixel data corresponding to each classification.
[0101] The sample size determination module 402 is used to determine the data size of the training sample set to be selected;
[0102] The sample set determination module 403 is used to obtain the training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, and to form the test sample set with the remaining pixel data.
[0103] The model building module 404 is used to build a classification model. The classification model includes multiple voting channels and at least two classifiers. Each voting channel has a classifier used to classify the input data. If the classifier is a kernel extreme learning machine, only one voting channel without data transformation processing uses this classifier. If the classifier is not a kernel extreme learning machine, at least two voting channels in the classification model use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result through voting based on the classification results of each voting channel.
[0104] The new sample module 405 is used to perform uniform sampling with replacement on the obtained training sample set according to the total number of voting channels using the bagging method to obtain the new training sample set.
[0105] The training model module 406 is used to train each voting channel in the classification model based on the obtained training sample set;
[0106] The test model module 407 is used to test the trained classification model based on the test sample set;
[0107] The image recognition module 408 is used to acquire hyperspectral image data, input it into the classification model for recognition and classification, and obtain the corresponding classification results.
[0108] In this embodiment of the invention, the data acquisition module 401 can be used to execute step 100 in the above method embodiment, the sample size determination module 402 can be used to execute step 102 in the above method embodiment, the sample set determination module 403 can be used to execute step 104 in the above method embodiment, the model construction module 404 can be used to execute step 106 in the above method embodiment, the new sample addition module 405 can be used to execute step 108 in the above method embodiment, the model training module 406 can be used to execute step 110 in the above method embodiment, the model testing module 407 can be used to execute step 112 in the above method embodiment, and the image recognition module 408 can be used to execute step 114 in the above method embodiment.
[0109] Optionally, the sample set determination module 403 is used to obtain a training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, including performing the following operations:
[0110] Based on the amount of data in the training sample set and the total number of all categories, determine the sample extraction amount for each category.
[0111] Based on the determined sample size, the training sample set is obtained by sampling the pixel data corresponding to each category without replacement through average selection.
[0112] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on a hyperspectral image classification device. In other embodiments of the present invention, a hyperspectral image classification device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0113] The information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description of the method embodiment of the present invention, and will not be repeated here.
[0114] This invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a hyperspectral image classification method according to any embodiment of this invention.
[0115] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform a hyperspectral image classification method according to any embodiment of this invention.
[0116] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.
[0117] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.
[0118] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.
[0119] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0120] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.
[0121] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0122] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A hyperspectral image classification method, characterized in that, include: Obtain a hyperspectral image dataset with classification labels, determine all categories and the corresponding pixel data for each category; Determine the amount of data in the training sample set to be selected; The training sample set is obtained based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category. The remaining pixel data is then used to form the test sample set. A classification model is constructed. This model includes multiple voting channels and at least two classifiers. Each voting channel has a classifier used to classify the input data. If the classifier is a kernel extreme learning machine (KEM), only one voting channel without data transformation processing uses this classifier. If the classifier is not a KEM, at least two voting channels use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result based on the classification results of each voting channel through voting. The data transformation processing includes feature extraction or selection. The classifiers in the classification model include KEM, Support Vector Machine (SVM), and Multinomial Logistic Regression (MLR). Based on the total number of voting channels, the training sample set is uniformly sampled with replacement using the bagging method to obtain a new training sample set. Based on the obtained training sample set, the voting channels in the classification model are trained; The trained classification model was tested based on the test sample set; Acquire hyperspectral image data, input it into the classification model for identification and classification, and obtain the corresponding classification results.
2. The hyperspectral image classification method according to claim 1, characterized in that, The training sample set is obtained based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category. The training sample set includes: Based on the amount of data in the training sample set and the total number of all categories, determine the sample extraction amount for each category. Based on the determined sample size, the training sample set is obtained by sampling the pixel data corresponding to each category without replacement through average selection.
3. The hyperspectral image classification method according to claim 2, characterized in that, The determination of the sample extraction quantity for each category based on the amount of data in the training sample set and the total number of all categories includes: Let the data size of the training sample set to be selected be N, and the total number of all categories be M. Then the number of samples to be extracted for a single category is [N / M] data; [ ] indicates rounding. For classifications where the number of pixels is not less than [N / M], the sample size is determined to be [N / M]; for classifications where the number of pixels is less than [N / M], the sample size is determined to be [N / 2M]. The step of sampling without replacement of pixel data corresponding to each category by average selection based on the determined sample size includes: Based on the corresponding sample extraction quantity, the pixel data corresponding to each category is sampled without replacement. If the amount of data obtained after sampling all categories is less than N, then random samples are drawn from the remaining pixel data to supplement the training sample set.
4. The hyperspectral image classification method according to claim 1, characterized in that, The data transformation process is principal component analysis.
5. A hyperspectral image classification device, characterized in that, include: The data acquisition module is used to acquire hyperspectral image datasets with classification labels, determine all categories and the corresponding pixel data for each category; The sample size determination module is used to determine the amount of data in the training sample set to be selected. The sample set determination module is used to obtain the training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, and to form the test sample set with the remaining pixel data. A model building module is used to construct a classification model. The classification model includes multiple voting channels and at least two classifiers. Each voting channel has one classifier for classifying the input data. If the classifier is a kernel extreme learning machine (KEM), only one voting channel without data transformation processing uses this classifier. If the classifier is not a KEM, at least two voting channels in the classification model use this classifier, one of which is a voting channel without data transformation processing, and the rest are voting channels with data transformation processing. The classification model is used to derive the final classification result based on the classification results of each voting channel through voting. The data transformation processing includes feature extraction or selection. The classifiers in the classification model include KEM, Support Vector Machine (SVM), and Multinomial Logistic Regression (MLR). A new sample module is added to obtain a new training sample set by uniformly sampling with replacement from the training sample set obtained by the bagging method based on the total number of voting channels. The training model module is used to train each voting channel in the classification model based on the obtained training sample set; The test model module is used to test the trained classification model based on the test sample set; The image recognition module is used to acquire hyperspectral image data, input it into the classification model for recognition and classification, and obtain the corresponding classification results.
6. The apparatus according to claim 5, characterized in that, The module for determining the sample set is used to obtain the training sample set based on the amount of data in the training sample set, the total number of all categories, and the pixel data corresponding to each category, including performing the following operations: Based on the amount of data in the training sample set and the total number of all categories, determine the sample extraction amount for each category. Based on the determined sample size, the training sample set is obtained by sampling the pixel data corresponding to each category without replacement through average selection.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the hyperspectral image classification method as described in any one of claims 1-4.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed in a computer, it causes the computer to perform the hyperspectral image classification method according to any one of claims 1-4.
Citation Information
Patent Citations
Hyperspectral remote sensing collaborative representation ensemble learning classification method based on Bagging
CN110363221A
Breast cancer grading method based on DCE-mri
WO2022141201A1