Hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation
The hyperspectral image crop classification method using XGBoost and domain adaptation addresses high-dimensional and noisy label issues by aligning feature distributions and integrating multiple classifiers, enhancing classification accuracy and robustness in agricultural applications.
Patent Information
- Application Number
- CN202411206298.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-24
AI Technical Summary
Hyperspectral image classification in agriculture faces challenges due to high-dimensional characteristics, spectral mixing phenomena, domain differences, and noisy labels, leading to decreased generalization performance and classification accuracy, especially in different geographical regions with varying crop growth environments.
A hyperspectral image crop cross-scene classification method combining XGBoost and domain adaptation, utilizing deep embedding models, discriminator models, confidence learning, and integrated learning frameworks to align feature distributions, remove noise, and enhance classification robustness and accuracy.
Improves classification accuracy and robustness by effectively utilizing limited labeled samples, reducing noise, and aligning feature distributions across different scenes, resulting in improved generalization and stability of the classification model.
Smart Images

Figure CN119180983A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of remote sensing image classification, and in particular to a hyperspectral image crop cross-scene classification method based on XGBoost and domain adaptation. Background Art
[0002] Hyperspectral images (HSI) have rich information and subtle spectral differentiation capabilities, and are widely used in mineral identification, military reconnaissance, precision agriculture and other fields. In agriculture, hyperspectral images can accurately capture the growth status, diseases and nutrient distribution of crops, providing important support for crop management and yield prediction. However, although traditional classification algorithms, such as support vector machines and decision trees, have largely met the basic classification needs, the complexity of classification increases significantly when faced with the high-dimensional characteristics and spectral mixing phenomena of hyperspectral data, making these traditional methods face many challenges when processing such data. In addition, in practical applications, hyperspectral image classification also faces problems such as domain differences and scarcity of labeled samples. Especially in the agricultural field, the growth environment and spectral characteristics of different crops vary greatly, resulting in a decrease in the generalization performance of the classification model and difficulty in maintaining high accuracy in different fields. Current hyperspectral image classification methods usually rely on a large number of labeled samples for training, but in agricultural applications, obtaining enough labeled samples is both expensive and time-consuming, and in different geographical regions, the spectral characteristics of crops vary significantly, further increasing the difficulty of classification.
[0003] To this end, some researchers have tried to apply domain adaptation methods to hyperspectral image classification tasks to solve the above problems. Domain adaptation is a representative method of transfer learning. Its idea is to map different but similar scenes (such as two hyperspectral images taken at different times but in the same area) to the same feature space, and use source domain samples with rich labels to extract potential correlation information between different domains (i.e., domain invariant features), and classify the target domain that lacks labels. This classification method is called cross-scene classification. In addition, hyperspectral images in the source scene often reduce classification accuracy due to noise. In particular, when the label data itself is noisy, the performance of the classification model will be further impaired. This noisy label comes from sensor errors, data transmission problems, or human annotation errors. Therefore, how to achieve efficient and accurate hyperspectral image crop classification in the presence of noisy labels has become a key issue to improve model performance.
[0004] Therefore, this paper proposes a hyperspectral image crop cross-scene classification method based on XGBoost and domain adaptation. This method adopts the idea of ensemble learning, integrates the classification results of multiple single classifiers, and combines the confidence learning evaluation mechanism to remove the noise labels in the hyperspectral image to better adapt to the feature distribution of different fields. In addition, through the domain adaptive learning strategy, the limited labeled samples of the source domain and the target domain can be effectively utilized to improve the generalization ability of the classification model, thereby improving the accuracy and stability of the classification. Summary of the invention
[0005] The present invention combines XGBoost and the trust domain adaptive learning strategy, and shows significantly better classification accuracy and robustness than traditional methods and mainstream domain adaptive learning models on the Houston dataset, especially in the Grass healthy and Grass stressed categories of economic crops. This innovative method has verified its effectiveness in hyperspectral image crop classification, improved the accuracy and robustness of the classification model, and has important scientific and practical value for improving the performance of hyperspectral image crop classification and reliability in practical applications.
[0006] The object of the present invention is achieved in that:
[0007] A hyperspectral image crop cross-scene classification method based on XGBoost and domain adaptation includes the following steps:
[0008] Step a: Input the hyperspectral image (HSI) data to be classified as the source scene and the target scene, where the scene with rich labels is the source scene and the scene without labels is the target scene. Randomly select training samples to construct training set and test set.
[0009] Step b, inputting the data of the source scene and the target scene into the deep embedding model respectively, and embedding the hyperspectral data into a low-dimensional space to capture the intrinsic structure and distribution of the data;
[0010] Step c: To improve the distinguishability of different data, the representation of similar spectral data is made closer in the deep embedding model;
[0011] Step d: Design a discriminator model and introduce domain adaptation technology to reduce the differences in feature distribution in different scenes;
[0012] Step e: In order to enhance the alignment of feature distributions of data from different scenes, confidence learning is used to remove noise samples from data from different scenes.
[0013] Step f: Build an integrated learning framework, integrate multiple base classifier models, and use a voting combination strategy to integrate multiple base classifiers into a strong classification model to effectively capture the complex features in the data, reduce the bias of a single classifier, and improve the generalization ability and robustness of the overall model. Complete the HSI classification training and obtain the final classification result.
[0014] The above-mentioned hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation is characterized in that step b specifically includes the following steps:
[0015] Step b1: Patch extraction is performed on the training samples of the source scene and target scene data respectively, with a window size of 5×5×nBand.
[0016] Step b2: Build a deep embedding model, which includes 2D convolutional layer, batch normalization (BatchNormalization, BN), ReLU activation function, average pooling (AvgPool) and full connection layer (Full Connect, FC).
[0017] Step b3: In order to train limited samples more efficiently, the size of the convolution kernel is set to 1×1, with padding of 0 and stride of 1, the size of AvgPool of 5×5 and the size of FC of 1×128, and more refined features are gradually extracted.
[0018] The above-mentioned hyperspectral image cross-scene crop classification method based on XGBoost and domain adaptation is characterized in that, in the step c, in order to improve the distinguishability of different data, two models are set to output embedding spaces of the same size in the embedding space generated by the deep embedding model, thereby reducing the difference in the distribution of the source embedding space and the target embedding space.
[0019] The above-mentioned hyperspectral image cross-scene crop classification method based on XGBoost and domain adaptation is characterized in that in the step d, a discriminator model is designed, including a fully connected layer, a batch normalization layer, and a ReLU activation function, and the domain adaptation technology is combined to reduce the differences in feature distributions of different scenes.
[0020] The above-mentioned hyperspectral image cross-scene crop classification method based on XGBoost and domain adaptation is characterized in that, in the step e, in order to enhance the alignment of feature distributions of data from different scenes, the noise is estimated and the instances are sorted through a confidence learning evaluation mechanism to ensure that high-confidence data is used for training, thereby improving the classification accuracy of the target scene.
[0021] The above-mentioned hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation is characterized in that step f specifically includes the following steps:
[0022] Step f1: Design a new objective function and reduce the prediction error by optimizing the objective function. The formula is:
[0023]
[0024] Where: n is the number of samples, y i is the label of the i-th sample, is the predicted value of the ith sample, represents the loss function, K represents the number of trees, and f k represents the kth tree, and Ω is used to measure the complexity of the model.
[0025] Step f2: Integrate multiple base classifiers into a strong classification model by gradually building a series of decision trees. Each new tree fits the residuals of all previous trees to continuously reduce the prediction error.
[0026] Beneficial effects:
[0027] The present invention proposes a cross-scene classification method for crops in hyperspectral images based on XGBoost and domain adaptation, which involves the field of remote sensing image crop classification. First, the present invention inputs the Houston dataset of different scenes into a deep embedding model, and captures its intrinsic structure and distribution by embedding the hyperspectral data into a low-dimensional space, so that the representation of similar spectra in the low-dimensional space is closer. Subsequently, the present invention introduces the trust domain adaptation technology, reduces the difference in feature distribution of different scenes through the discriminator model, removes noise samples in the data, and strengthens the alignment of feature distribution of data in different scenes. Finally, through the integrated learning framework and the voting combination strategy, multiple base classifiers are integrated into a strong classification model, which effectively captures the complex features in the data, reduces the deviation of a single classifier, improves the overall generalization ability and robustness, and finally obtains the crop category. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is an overall flow chart of the cross-scene classification method of hyperspectral images of crops based on XGBoost and domain adaptation in the method of the present invention.
[0029] Figure 2 It is a pseudo-color image of the Houston dataset in the method of the present invention and its corresponding ground truth map.
[0030] Figure 3 It is a structural diagram of the deep embedding model in the method of the present invention.
[0031] Figure 4 It is the classification result diagram of the Houston data set in the method of the present invention. DETAILED DESCRIPTION
[0032] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.
[0033] A cross-scene classification of crops in hyperspectral images based on XGBoost and domain adaptation in a specific embodiment of the present invention is shown in the flowchart as follows: Figure 1 As shown, the following steps are included:
[0034] Step a: Input the hyperspectral image (HSI) data to be classified as the source scene and the target scene, where the scene with rich labels is the source scene and the scene without labels is the target scene. Randomly select training samples to construct training set and test set.
[0035] In a specific embodiment of the present invention, the Houston dataset is used as experimental data. The Houston dataset was collected on the campus of the University of Houston in Houston, Texas, USA, using different sensors, including Houston 2013 (source scene) and Houston 2018 (target scene). The Houston 2013 dataset contains 349×1905 pixels and has 144 spectral bands. Its spatial resolution is 2.5m. The Houston 2018 dataset contains 209×955 pixels and has 48 spectral bands. Its spatial resolution is 1m. The wavelength range of both is the same, which is 380~1050nm. Specifically, in the Houston 2013 dataset, we selected an overlapping area of 209×955 and 48 spectral bands, which correspond to the Houston 2018 dataset. Both contain seven categories, and the detailed information of the samples is shown in Table 1. Figure 2 Their pseudo-color images and ground-truth maps are shown.
[0036] Table 1. Houston dataset
[0037]
[0038] Step b: The present invention constructs a deep embedding model structure diagram as shown in Figure 3 As shown, hyperspectral data is embedded into a low-dimensional space to capture the intrinsic structure and distribution of the data;
[0039] The specific implementation is:
[0040] Step b1: Patch extraction is performed on the training samples of the source scene and target scene data respectively, with a window size of 5×5×nBand.
[0041] Step b2: Input the patch data of different scene data into the deep embedding model composed of 2D convolution layer, batch normalization (BatchNormalization, BN), ReLU activation function, average pooling (AvgPool) and full connection layer (Full Connect, FC) respectively, and embed the hyperspectral data into low-dimensional space to capture the intrinsic structure and distribution of the data.
[0042] The specific steps are as follows:
[0043] In the deep embedding model, CNN uses 2D convolution kernels to generate feature maps of the convolution layer on multiple continuous bands of the input layer to obtain the characteristics of crops. The value of the jth feature map of the i-th layer of the model at position (x, y) The value of is: Where: m represents the number of feature maps connected to the current feature map in layer i-1; is the connection weight of the mth feature map connected to the (p, q) position; P i and Q i represents the length and width of the convolution kernel; bi,j represents the bias of the jth feature map of the i-th layer; g(·) is the activation function.
[0044] Step b3: In order to train limited samples more efficiently, the size of the convolution kernel is set to 1×1, with padding of 0, stride of 1, AvgPool of 5×5, and FC of 1×128, to gradually extract finer features. Assuming the input sample is 5×5×nBand, the coarse features are extracted through the first layer of convolution, and a feature map of size 1×1×200 is output. Then, finer features are gradually extracted through the second, third, and fourth layers, generating a feature map of size 5×5×200. Then it is mapped to AvgPool to compress the sample size, and finally the FC layer outputs a feature map of size 1×128.
[0045] Step c, in order to improve the distinguishability of different data, the deep embedding model of the present invention consists of two sub-networks, namely CNN1 and CNN2. The layers and parameter settings of each sub-network are the same. The purpose is to obtain an embedding space with the same output size and reduce the difference in feature distribution between Houston 2013 (source scene) and Houston 2018 (target scene), so as to better guide the classification of the target scene.
[0046] Step d: Design the discriminator model, including the fully connected layer, BN layer, and ReLU activation function, and combine domain adaptation technology to reduce the differences in feature distribution in different scenes.
[0047] The specific implementation is:
[0048] The discriminator model consists of three fully connected layers, and each fully connected layer is followed by a BN layer and a ReLU activation function. The data after step C and the processing are respectively input into the discriminator model. First, the intermediate features are extracted through the first fully connected layer, and then further processed through the second layer, and finally the final feature vector for classification is output through the third fully connected layer. This output vector represents the score or probability of the category to which the input data belongs. In addition, in order to solve the problem of domain shift and alleviate the side effect of reduced feature distinguishability, a dual classifier domain adaptation method is used to align the source scene and the target scene. This invention uses the classifier deterministic difference to measure the classifier difference. Through this adversarial learning, the dual classifier domain adaptation part can align the feature distribution of the source scene and the target scene. The dual classifier domain adaptation loss function is as follows:
[0049]
[0050] Where, X s Represents the source scene data, Y s represents the target scene data, X tc Indicates high confidence samples.
[0051] In step e, in order to enhance the alignment of feature distributions of data from different scenes, the noise is estimated and the instances are sorted through a confidence learning evaluation mechanism to ensure that high-confidence data is used for training and improve the classification accuracy of the target scene.
[0052] The specific implementation is:
[0053] Confidence learning involves two steps: First, in order to evaluate the reliability of pseudo labels, it is necessary to estimate the joint distribution matrix of pseudo labels and true labels (since the true labels are unknown, they need to be estimated) Second, labels that lack sufficient confidence are identified and removed.
[0054] First, from and Get a confidence joint matrix Used to divide and count label errors. Specifically, for the target domain, Represents a pseudo label x t The actual true label is sample j. Here, Used to estimate This means that for the sample x t There is sufficient prediction probability The samples are marked, and this probability is determined by the threshold Here, t jis the threshold at which the mean probability of each class is equivalent. The automatic thresholding method makes confidence learning robust in dealing with class imbalance and heterogeneous class probability distribution. Therefore, the confidence joint matrix can be defined as follows:
[0055]
[0056]
[0057]
[0058]
[0059] Will Normalize to obtain the joint distribution matrix The estimated value of is as follows:
[0060]
[0061] Secondly, it is estimated Clean up the pseudo labels and obtain the true labels with high confidence.
[0062] Step f: Build an integrated learning framework, integrate multiple base classifier models, and use a voting combination strategy to integrate multiple base classifiers into a strong classification model to effectively capture the complex features in the data, reduce the bias of a single classifier, and improve the generalization ability and robustness of the overall model. Complete the HSI classification training and obtain the final classification result.
[0063] The specific implementation is:
[0064] Step f1: Design a new objective function and reduce the prediction error by optimizing the objective function. The formula is:
[0065]
[0066] Where: n is the number of samples, y i is the label of the i-th sample, is the predicted value of the ith sample, represents the loss function, K represents the number of trees, and f k represents the kth tree, and Ω is used to measure the complexity of the model.
[0067] Step f2: Integrate multiple base classifiers into a strong classification model by gradually building a series of decision trees. Each new tree fits the residuals of all previous trees to continuously reduce the prediction error.
[0068] The specific steps are as follows:
[0069] XGBoost is a distributed gradient boosting framework that improves Gradient Boosting. It is fast and efficient, and can make up for the time-consuming training of hyperspectral crop classification models. Its core principle is to use gradient boosting decision trees. By gradually building a series of decision trees, each new tree fits the residuals of all previous trees to continuously reduce the prediction error. t-1 After training, no further adjustments are made. t Make up for F t-1 (x) is the residual from the true value, where F t-1 It is an extreme gradient boosting model composed of the first t-1 trees. The formula for the tth tree is: When training the tth tree, the objective function is as follows:
[0070]
[0071] Where: It can represent the complexity of the first t-1 trees, which is a constant and does not affect the optimization results of the model. Therefore, the above formula can be obtained by Taylor expansion and removing the constant term. The formula is as follows:
[0072]
[0073] Where: g i = l′(y i ,F t-1 (x i )),h i = l′(y i ,F t-1 (x i )). For the convenience of discussion, Ω(f i ), the present invention makes the following definition: [w1,w2,…,w T ] represents the output vector of the leaf node, q(x) represents the mapping of samples to leaf nodes, then f t (x) = w q(x) Ω(f i ) can be defined as follows:
[0074]
[0075] Where: T represents the number of leaf nodes, w j represents the output of leaf node j, γ is the penalty coefficient of the number of leaf nodes, and λ is the regularization coefficient. The formula is as follows:
[0076]
[0077] Where: I jis the set of samples contained in the leaf with index j.
[0078] The classification accuracy of the Houston 2018 dataset used in this invention is shown in Table 2. The overall accuracy, average accuracy and Kappa coefficient are used as classification evaluation indicators. Figure 4 The experimental results show that the present invention has only a small amount of misclassification, is close to the actual crop distribution, and greatly reduces the area of misclassification.
[0079] The experimental environment of the present invention is Intel (R) Xeon (R) CPU E5-2620 v4 @ 2.10GHz processor, 128GB memory and NVIDIA GeForce RTX 2080Ti GPU graphics card. In addition, the deep learning framework is Pytorch, which uses Python as the programming language. The initial learning rate is set to 0.01, and the SGD optimization algorithm is used for optimization. The number of iterations is set to 100, and other methods follow the parameters set by the authors of the paper. At the same time, in order to reduce the randomness brought by the training samples, each test is repeated 10 times and the average value is taken as the final test result.
[0080] Table 2 Classification accuracy of Houston 2018 dataset classification methods
[0081]
[0082]
Claims
1. Hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation, characterized by: The following steps are involved: Step a: Input the hyperspectral image (HSI) data to be classified as the source scene and the target scene, where the scene with rich labels is the source scene and the scene without labels is the target scene. Randomly select training samples to construct training set and test set. Step b: construct a deep embedding model, input the data of the source scene and the target scene into the deep embedding model respectively, and embed the hyperspectral data into a low-dimensional space to capture the intrinsic structure and distribution of the data; Step c: To improve the distinguishability of different data, the representation of similar spectral data is made closer in the deep embedding model; Step d: Design a discriminator model and introduce domain adaptation technology to reduce the differences in feature distribution in different scenes; Step e: In order to enhance the alignment of feature distributions of data from different scenes, confidence learning is used to remove noise samples from data from different scenes. Step f: Build an integrated learning framework, integrate multiple base classifier models, and use a voting combination strategy to integrate multiple base classifiers into a strong classification model to effectively capture the complex features in the data, reduce the bias of a single classifier, and improve the generalization ability and robustness of the overall model. Complete the HSI classification training and obtain the final classification result.
2. The hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation according to claim 1, characterized in that: The step b specifically comprises the following steps: Step b1, perform patch extraction on the training samples of the source scene and target scene data respectively, with a window size of 5×5×nBand; Step b2: Build a deep embedding model, which includes 2D convolutional layer, batch normalization (BN), ReLU activation function, average pooling (AvgPool) and full connection layer (Full Connect, FC); Step b3: In order to train limited samples more efficiently, the size of the convolution kernel is set to 1×1, with padding of 0 and stride of 1, the size of AvgPool of 5×5 and the size of FC of 1×128, and more refined features are gradually extracted.
3. The hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation according to claim 1, characterized in that: In the step c, in order to improve the distinguishability of different data, in the embedding space generated by the deep embedding model, two models are respectively set to output embedding spaces of the same size to reduce the difference in distribution of the source embedding space and the target embedding space.
4. The hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation according to claim 1, characterized in that: In the step d, a discriminator model is designed, including a fully connected layer, a batch normalization layer, and a ReLU activation function, and domain adaptation technology is combined to reduce the differences in feature distributions of different scenes.
5. The hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation according to claim 1, characterized in that: In the step e, in order to enhance the alignment of feature distributions of data from different scenes, the noise is estimated and the instances are sorted through a confidence learning evaluation mechanism to ensure that high-confidence data is used for training, thereby improving the classification accuracy of the target scene.
6. The hyperspectral image crop cross-scene classification based on XGBoost and domain adaptation according to claim 1, characterized in that: The step f specifically comprises the following steps: Step f1: Design a new objective function and reduce the prediction error by optimizing the objective function. The formula is: Where: n is the number of samples, y i is the label of the i-th sample, is the predicted value of the ith sample, represents the loss function, K represents the number of trees, and f k represents the kth tree, and Ω is used to measure the complexity of the model; Step f2: Integrate multiple base classifiers into a strong classification model by gradually building a series of decision trees. Each new tree fits the residuals of all previous trees to continuously reduce the prediction error.
Citation Information
Cited By
Cross-domain hyperspectral image crop fine classification based on feature alignment
CN119942196A
A method and system for detailed mapping of urban functional areas using day and night multispectral and multidimensional fusion
CN122676099A
