A Tamarix identification method based on attention mechanism and feature alignment
Through the attention mechanism and feature alignment method, the accuracy and cross-scene adaptability of Tamarix identification are improved, which solves the problems of low Tamarix recognition accuracy and insufficient cross-scene adaptability in existing technologies and realizes efficient Tamarix identification and classification.
Patent Information
- Application Number
- CN202411799449.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Existing remote sensing image classification methods make it difficult to achieve high-precision Tamarix identification, especially in mixed areas and cross-scene classification. Traditional methods lack adaptability to changes in spectral characteristics, resulting in low classification accuracy. Manual interpretation methods are costly and difficult to apply to large-scale multi-scene classification.
A method based on attention mechanism and feature alignment is adopted to extract deep features through ResNet50 and ECA channel attention mechanism. Combined with GOT graph feature alignment and MMD spatial feature alignment, spectral and spatial features are optimized to improve the recognition accuracy of Tamarix chinensis and its cross-scene migration capability.
The accuracy and cross-scenario adaptability of Tamarix classification are improved, the data annotation cost is reduced, the robustness and generalization ability of the model in complex environments are enhanced, and it is suitable for complex wetland environments.
Smart Images

Figure CN119723339B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vegetation classification, and in particular to a Tamarix identification method based on an attention mechanism and feature alignment. Background Art
[0002] Tamarix chinensis effectively prevents wind and sand erosion, stabilizes the surface of coastal wetlands, and improves saline-alkali land, playing a vital role in coastal wetland ecosystem restoration. It typically grows in coastal wetland environments, often intergrowing with other plants such as reeds, forming complex mixed vegetation zones. However, due to the similarities in spectral characteristics between Tamarix chinensis and other plants, traditional remote sensing classification methods struggle to accurately identify Tamarix chinensis, especially in mixed vegetation zones. These issues not only impact the accuracy of ecological monitoring but also hinder the effective management and protection of wetland resources.
[0003] Traditional field survey methods for remote sensing images rely primarily on manual interpretation techniques, requiring significant human, material, and financial resources, making them difficult to apply to large-scale, multi-scene remote sensing image classification. With the advancement of science and technology, machine learning methods have gradually been applied to wetland classification in remote sensing images. However, due to the complex and diverse nature of wetland types, traditional machine learning classification methods are unable to capture subtle spectral variations in remote sensing images. This results in large errors in classification using machine learning methods, necessitating manual correction, making the classification process cumbersome and inaccurate. Deep learning-based remote sensing image classification technology has made significant progress in vegetation classification in recent years, particularly the successful application of the Transformer model in image classification tasks. While a proposed improved Transformer method for Tamarix classification achieved high classification accuracy in some areas, accuracy remained low in areas with mixed vegetation (e.g., where Tamarix and Phragmites australis grow together). This suggests that existing deep learning-based classification methods have limitations when dealing with complex vegetation combinations and hyperspectral mixed areas, particularly when distinguishing similar vegetation types, where the model's performance falls short of expectations. Furthermore, while a multi-source feature embedding network proposed by some researchers has improved overall classification accuracy, the accuracy of individual Tamarix classifications remains far below ideal. This suggests that current technology still struggles to account for the variability between different vegetation species. In particular, existing techniques fail to fully account for the spatial heterogeneity and spectral variations in complex environments when integrating and optimizing high-resolution remote sensing imagery data with deep features, impacting Tamarix classification accuracy.
[0004] In addition to the classification problem in mixed areas, the accuracy of cross-scene classification is also a major bottleneck of current technology. Traditional domain adaptation methods, such as DAN (Domain-Adversarial Networks) and DSAN (Deep Subdomain Alignment Networks), are affected by differences in sample time and imaging environment in the cross-scene classification of the Yellow River Delta and other wetlands, resulting in a decrease in the performance of the model when dealing with spectral drift and distribution inconsistency. Therefore, traditional cross-scene adaptation methods are difficult to achieve accurate model transfer and adaptation in complex wetland environments. Although there are some improved methods, such as SSWADA (Spectral-Spatial Weighted Domain Adaptation), which can improve the cross-scene classification performance to a certain extent, the classification effect for mixed vegetation is still limited. This is mainly due to the lack of adaptability of these methods to changes in spectral characteristics, and they cannot effectively deal with the complex spectral feature differences in wetland environments. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a Tamarix identification method based on attention mechanism and feature alignment, so as to improve the classification accuracy of Tamarix in complex wetland environments.
[0006] To achieve the above object, the technical solution of the present invention is as follows:
[0007] A Tamarix identification method based on attention mechanism and feature alignment includes the following steps:
[0008] Step 1: Acquire multiple remote sensing images of the multi-temporal study area under different conditions and preprocess the remote sensing images;
[0009] Step 2: Extract typical vegetation indices (NDVI, RVI, MSAVI, and DVI) from each preprocessed remote sensing image and overlay them with the original remote sensing image to form a multi-channel image. Perform the above processing on all remote sensing images to obtain several multi-channel images, annotate the multi-channel images with Tamarix chinensis, and create a ground truth map. The several multi-channel images and their corresponding ground truth maps are divided into source domain and target domain image sets.
[0010] Step 3: Input the source domain and target domain image sets into the attention mechanism deep feature extraction module respectively to extract the deep features in the source domain and target domain images; input the extracted deep features into the dual feature alignment module to perform GOT graph feature alignment and MMD spatial feature alignment, and then perform weighted addition of the features after GOT graph feature alignment and MMD spatial feature alignment to obtain the new features of the source domain and target domain images;
[0011] Step 4: Input the new features of the source domain image and the source domain ground truth map into the neural network model to train the model; input the new features of the target domain image and the target domain ground truth map into the trained model to test the model;
[0012] Step 5: Acquire a remote sensing image of the area to be identified and perform preprocessing. Extract typical vegetation indices NDVI, RVI, MSAVI, and DVI from the preprocessed remote sensing image, and perform image superposition with the original remote sensing image to form a multi-channel image to be identified. Input the source domain image set obtained in step 2 and the multi-channel image to be identified into the deep feature extraction module of the attention mechanism to extract deep features in the source domain and the multi-channel image to be identified. Input the extracted deep features into the dual feature alignment module for GOT graph feature alignment and MMD spatial feature alignment, and obtain new features of the source domain and the multi-channel image to be identified by weighted addition of the features after the GOT graph feature alignment and the MMD spatial feature alignment. Input the new features of the multi-channel image to be identified into the qualified test model, and the model outputs the recognition result of Tamarix chinensis.
[0013] In the above scheme, the attention mechanism deep feature extraction module is composed of the ECA channel attention mechanism and the ResNet50 feature extraction module. The ResNet50 feature extraction module includes an input convolution layer, a batch normalization layer, a ReLU activation layer and a residual block. Each residual block contains a 1x1 convolution layer for compressing the number of channels, a 3x3 convolution layer and a 1x1 convolution layer for restoring the number of channels; the ECA channel attention mechanism is integrated into the ResNet50 feature extraction module to optimize the channels, and optimizes the channel weights by calculating the weight coefficients of each channel.
[0014] In the above solution, the dual feature alignment module includes a GOT graph feature alignment module and an MMD spatial feature alignment module, which are used to align the deep features of the source domain and the target domain.
[0015] In the above scheme, the GOT graph feature alignment module uses the graph features of the source domain and the target domain extracted by the attention mechanism deep feature extraction module as the input of the GOT graph feature alignment module, performs graph optimization transfer using the following formula, and calculates the result of the alignment of the source domain and target domain graph features:
[0016]
[0017] Among them, G s and G t Represents the graph features of the source domain and the target domain, s represents the source domain, t represents the target domain, and Represents the two pairs of nodes currently being processed, and Represent the characteristics of source domain node i and target domain node j respectively, and Respectively represent and The mapping of T ij and There are two pairs of nodes and The transformation matrix, Representatives from arrive The transmission cost, Representatives The cost matrix composed of GOT(G s ,G t ) represents the result of alignment of source domain and target domain graph features.
[0018] In a further technical solution, in the MMD spatial feature alignment module, the spatial features of the source domain and the target domain extracted by the attention mechanism deep feature extraction module are used as the input of the MMD spatial feature alignment module. By minimizing the MMD value, the spatial feature distribution is adjusted to be aligned to the maximum extent between the two domains, thereby reducing the spatial distribution difference between the source domain and the target domain. The MMD value calculation formula is as follows:
[0019]
[0020] in, are the spatial features of the source domain and the target domain respectively, X s 、X t are the spatial feature sets of the source domain and the target domain respectively, n s 、n t Represent the number of source domain samples and the number of target domain samples respectively; s represents the source domain, t represents the target domain, The spatial feature map representing the source domain, Represents the spatial feature map of the target domain, and H indicates that this operation is performed in a high-dimensional space.
[0021] In a further technical solution, in the neural network model, the feature vector from the dual feature alignment module is input into the fully connected layer, calculated using matrix multiplication, and biased, and then the output neuron eigenvalue is obtained; then, the Softmax activation function is used to obtain the tamarisk recognition probability feature vector of the neuron corresponding to each position in the image, each value in the feature vector represents the recognition probability of tamarisk, and the sum of all values in the feature vector is 1; the Softmax function expression formula is as follows:
[0022]
[0023] Among them, ω and b are weight coefficient and bias coefficient respectively, and b j represents the weight value and bias coefficient of the input neuron n classified as Tamarix type j, Y represents the value corresponding to the output recognition result of Tamarix type, P represents the probability, represents the feature of the nth neuron in the l-1th layer of the fully connected layer output, where n represents the element index, l represents the number of convolutional layers in the fully connected layer, K represents the attribute value corresponding to the Tamarix category label, and i represents the type of Tamarix. represent The transpose of .
[0024] In the above scheme, the typical vegetation indices NDVI, RVI, MSAVI and DVI are the normalized difference vegetation index, ratio vegetation index, modified soil adjusted vegetation index and difference vegetation index, respectively, and their calculation formulas are as follows:
[0025] NDVI = (NIR-R) / (NIR+R)
[0026] RVI=NIR / R
[0027]
[0028] DVI=NIR-R
[0029] Among them, NIR represents the reflectivity of the near-infrared band in the remote sensing image, and R represents the reflectivity of the red light band.
[0030] In the above scheme, in step 4, when testing the model, the recall rate (TPR) is used to evaluate the accuracy of each category. The calculation formula is as follows:
[0031]
[0032] Among them, TP represents the number of samples that correctly predict a certain category as a certain category, and FP represents the number of samples that incorrectly predict other categories as a certain category;
[0033] The overall accuracy OA is used to evaluate the overall classification accuracy of all categories, and its formula is:
[0034]
[0035] Among them, FN represents the number of samples that mistakenly predict a certain category as other categories, and FP represents the number of samples that correctly predict other categories as other categories;
[0036] The Kappa coefficient is used to quantitatively evaluate the overall performance of the classification method, and its formula is:
[0037]
[0038] Among them, Po is the overall accuracy, P e is an accidental consistency error.
[0039] Through the above technical solution, the present invention provides a method for identifying Tamarix chinensis based on attention mechanism and feature alignment, which has the following beneficial effects:
[0040] 1. Improved classification accuracy: The present invention combines ResNet50 with ECA for deep feature extraction. By introducing a self-attention mechanism, it can more effectively identify and distinguish subtle spectral differences between different types of Tamarix in complex environments, thereby improving classification accuracy.
[0041] 2. Enhanced cross-scenario migration capabilities: Through a dual feature alignment strategy, the present invention uses MMD and GOT to achieve joint alignment of spatial features and graph features. This multi-level feature alignment helps improve the model's generalization ability across different scenarios, allowing the classification model to maintain high accuracy in new scenarios.
[0042] 3. Wide range of applications: The technical solution of the present invention is applicable to wetland environments with complex and varied vegetation types and mixed growth of Tamarix chinensis vegetation, reflecting its wide applicability and strong expansion capability.
[0043] 4. Reduce costs: Through efficient feature extraction and transfer learning mechanisms, the present invention reduces the need for large amounts of labeled data, thereby significantly reducing the cost of data collection and labeling while ensuring high accuracy.
[0044] 5. Robustness in complex environments: The method of the present invention enhances its ability to identify and handle uncertainty, noise, and scene changes in complex environments through the deep feature extraction module of the attention mechanism and the multi-scale feature alignment strategy, thereby improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for describing the embodiments or the prior art.
[0046] Figure 1 This is a flow chart of a Tamarix identification method based on attention mechanism and feature alignment disclosed in an embodiment of the present invention.
[0047] Figure 2 are source domain and target domain images; (a) is the source domain image; (b) is the target domain image; (c) is the true value image of the source domain image; (d) is the true value image of the target domain image.
[0048] Figure 3 Schematic diagram of the deep feature extraction module of the attention mechanism.
[0049] Figure 4 Schematic diagram of the dual feature alignment module.
[0050] Figure 5 is the actual classification result; (a) is the true value map, and (b) is the classification result map obtained using the method of the present invention. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.
[0052] The present invention provides a method for identifying Tamarix chinensis based on attention mechanism and feature alignment, such as Figure 1 As shown, the following steps are included:
[0053] Step 1: Acquire several remote sensing images of the multi-temporal study area under different conditions and preprocess the remote sensing images.
[0054] This embodiment of the present invention acquires remote sensing image data of the Yellow River Estuary Wetland and collects drone aerial photography data on-site. The collected remote sensing images undergo image preprocessing, including radiometric calibration, atmospheric correction, orthorectification, and image cropping, to eliminate the effects of lighting, cloud cover, and other conditions, enhancing image stability and usability. The experimental sample set is created using the drone aerial photography data. Data augmentation techniques, such as rotation, scaling, and cropping, are employed to expand the dataset sample size and improve the model's generalization capabilities.
[0055] Step 2: Extract typical vegetation indices NDVI, RVI, MSAVI, and DVI from each preprocessed remote sensing image, and overlay them with the original remote sensing image to form a multi-channel image.
[0056] The vegetation distribution in the study area is complex, and different Tamarix mixed types are easily confused in classification. Furthermore, due to the uneven vegetation cover, the image features of some sparse vegetation are not clear. Direct classification using raw remote sensing imagery often results in low classification accuracy. Therefore, this paper introduces a typical vegetation index to enhance the characterization of mixed Tamarix forests, as shown in Table 1.
[0057] To address the problem of unclear image features of Tamarix forests in mixed growth conditions, the present invention selected the Normalized Difference Vegetation Index (NDVI) and the Ratio Vegetation Index (RVI), which are highly sensitive to vegetation. The Normalized Difference Vegetation Index (NDVI) can not only eliminate the influence of the sun's altitude angle, but also eliminate interference from factors such as the remote sensor's observation angle and terrain. It can highlight the differences between Tamarix and bare land, enhancing the contrast between vegetation, thereby providing more obvious image features for the accurate classification of Tamarix mixed areas. The Ratio Vegetation Index (RVI) is sensitive to the state of green vegetation. This characteristic enables RVI to effectively distinguish between thriving Tamarix and other surface cover types in coastal wetlands, such as sparse Suaeda salsa or bare land.
[0058] In response to the problem that the soil background will affect the information extraction results due to the different coverage densities of mixed Tamarix forests, the present invention selects the Modified Soil Adjusted Vegetation Index (MSAVI) and the Difference Vegetation Index (DVI) that can reduce the changes in soil reflectivity. In the mixed Tamarix areas of coastal wetlands, the color and texture of the soil may change greatly due to tidal effects, sediment deposition and human activities. These factors may make the traditional vegetation index less effective, but MSAVI has strong adaptability and robustness to these changes, and can provide more stable and reliable vegetation information, thereby improving the accuracy of classification of different mixed Tamarix areas; in complex ecosystems such as coastal wetlands, DVI helps to identify the distribution of plants such as Tamarix, especially in areas with denser vegetation coverage. The above vegetation index definitions are shown in the table, where NIR represents the reflectivity of the near-infrared band in the remote sensing image, and R represents the reflectivity of the red light band.
[0059] Table 1 Calculation formula of vegetation index
[0060]
[0061] All remote sensing images are processed as above to obtain several multi-channel images, which are annotated and ground truth maps are made. The multi-channel images and their corresponding ground truth maps are divided into source domain and target domain image sets. Figure 2 As shown in FIG, the source domain image has known the distribution information of Tamarix chinensis after field investigation and exploration, while the distribution information of Tamarix chinensis is unknown in most of the target domain images, and only the distribution information of a small part of Tamarix chinensis is known, which is used to test the model.
[0062] In step 3, the source domain and target domain image sets are respectively input into the deep feature extraction module of the attention mechanism to extract the deep features in the source domain and target domain images; the extracted deep features are input into the dual feature alignment module for GOT graph feature alignment and MMD space feature alignment, and the new features of the source domain and target domain images are obtained by weighted addition of the features after GOT graph feature alignment and MMD space feature alignment.
[0063] 1. Attention mechanism deep feature extraction module
[0064] like Figure 3 As shown in the figure, the attention mechanism deep feature extraction module consists of the ECA channel attention mechanism and the ResNet50 feature extraction module. The ResNet50 feature extraction module includes an input convolution layer, a batch normalization layer, a ReLU activation layer, and a residual block. Each residual block contains a 1x1 convolution layer to compress the number of channels, a 3x3 convolution layer, and a 1x1 convolution layer to restore the number of channels. The ECA channel attention mechanism is integrated into the ResNet50 feature extraction module to optimize the channels by calculating the weight coefficient of each channel. The ECA channel attention mechanism uses adaptive convolution kernel size for each channel to capture cross-channel dependencies.
[0065] 2. Dual Feature Alignment Module
[0066] like Figure 4 As shown in FIG, the dual feature alignment module includes a GOT graph feature alignment module and an MMD spatial feature alignment module, which are used to align the deep features of the source domain and the target domain.
[0067] In the GOT graph feature alignment module, the graph features of the source and target domains extracted by the attention mechanism deep feature extraction module are used as the input of the GOT graph feature alignment module. The following formula is used to perform graph optimization transfer and calculate the result of the alignment of the source and target domain graph features:
[0068]
[0069] Among them, G s and G t Represents the graph features of the source domain and the target domain, s represents the source domain, t represents the target domain, and Represents the two pairs of nodes currently being processed, and Represent the characteristics of source domain node i and target domain node j respectively, and Respectively represent and The mapping of T ij and There are two pairs of nodes and The transformation matrix, Representatives from arrive The transmission cost, Representatives The cost matrix composed of GOT(G s ,G t) represents the result of alignment of source domain and target domain graph features.
[0070] In the MMD spatial feature alignment module, the spatial features of the source and target domains extracted by the deep feature extraction module of the attention mechanism are used as the input of the MMD spatial feature alignment module. The spatial feature distribution is adjusted to the maximum extent possible by minimizing the MMD (maximum mean difference) value to reduce the spatial distribution difference between the source and target domains. The MMD value calculation formula is as follows:
[0071]
[0072] in, are the spatial features of the source domain and the target domain respectively, X s 、X t are the spatial feature sets of the source domain and the target domain respectively, n s 、n t Represent the number of source domain samples and the number of target domain samples respectively; s represents the source domain, t represents the target domain, The spatial feature map representing the source domain, Represents the spatial feature map of the target domain, and H indicates that this operation is performed in a high-dimensional space.
[0073] Step 4: Input the new features of the source domain image and the source domain ground truth map into the neural network model to train the model; input the new features of the target domain image and the target domain ground truth map into the trained model to test the model;
[0074] In the embodiment of the present invention, the neural network model used is ResNet50; in the neural network model, the feature vector from the dual feature alignment module is input into the fully connected layer, calculated using matrix multiplication, and biased, and then the output neuron eigenvalue is obtained; then the Softmax activation function is used to obtain the tamarisk recognition probability feature vector of the neuron corresponding to each position in the image, each value in the feature vector represents the recognition probability of tamarisk, and the sum of all values in the feature vector is 1; the Softmax function expression formula is as follows:
[0075]
[0076] Among them, ω and b are weight coefficient and bias coefficient respectively, and b j represents the weight value and bias coefficient of the input neuron n classified as Tamarix type j, Y represents the value corresponding to the output recognition result of Tamarix type, P represents the probability, represents the feature of the nth neuron in the l-1th layer of the fully connected layer output, where n represents the element index, l represents the number of convolutional layers in the fully connected layer, K represents the attribute value corresponding to the Tamarix category label, and i represents the type of Tamarix. represent The transpose of .
[0077] When testing the model, the recall rate (TPR) is used to evaluate the accuracy of each category. The calculation formula is as follows:
[0078]
[0079] Among them, TP (true positive) indicates the number of samples that correctly predict a certain category as a certain category, and FP (false positive) indicates the number of samples that incorrectly predict other categories as a certain category; taking the TRP value of Tamarix-Phragmites as an example (there are currently three categories in this classification system: Tamarix-Phragmites, Tamarix-Suaeda, and Tamarix-Phragmites-Suaeda), TP indicates the number of samples that correctly classify Tamarix-Phragmites as Phragmites-Tamias, and FP (false positive) indicates the number of samples that incorrectly classify Tamarix-Suaeda or Tamarix-Phragmites-Suaeda as Tamarix-Phragmites.
[0080] The overall accuracy (OA) is used to evaluate the overall classification accuracy of all categories. The overall accuracy (OA) represents the proportion of all correctly classified samples in the total labeled samples. It can intuitively reflect the overall performance of different models in all categories. The formula is:
[0081]
[0082] FN (false negative) represents the number of samples that were incorrectly predicted as belonging to a particular class, while FP (true negative) represents the number of samples that were correctly predicted as belonging to another class. Specifically, FN represents the number of samples that were incorrectly predicted as belonging to Tamarix-Phragmites as Tamarix-Suaeda or Tamarix-Phragmites-Suaeda, while FP represents the number of samples that were correctly predicted as belonging to Tamarix-Suaeda or belonging to Tamarix-Phragmites-Suaeda.
[0083] Finally, to more comprehensively compare the effects of cross-scenario classification, we use the Kappa coefficient to quantitatively evaluate the overall performance of the classification methods in the experiment. The Kappa coefficient takes into account the imbalance of category distribution during evaluation, providing a more fair and accurate performance evaluation method that can provide more accurate and comprehensive information than OA. Its formula is:
[0084]
[0085] Among them, P o is the overall accuracy, P e is an accidental consistency error.
[0086] The classification accuracy is shown in Table 2 below:
[0087] Table 2 Classification accuracy results
[0088]
[0089] The final classification results are as follows Figure 5 As shown in the figure, it can be seen that the classification result obtained by the method of the present invention is very close to the true value map and the accuracy is very high.
[0090] Step 5: Acquire a remote sensing image of the area to be identified and perform preprocessing. Extract typical vegetation indices NDVI, RVI, MSAVI, and DVI from the preprocessed remote sensing image, and perform image superposition with the original remote sensing image to form a multi-channel image to be identified. Input the source domain image set obtained in step 2 and the multi-channel image to be identified into the deep feature extraction module of the attention mechanism to extract deep features in the source domain and the multi-channel image to be identified. Input the extracted deep features into the dual feature alignment module for GOT graph feature alignment and MMD spatial feature alignment, and obtain new features of the source domain and the multi-channel image to be identified by weighted addition of the features after the GOT graph feature alignment and the MMD spatial feature alignment. Input the new features of the multi-channel image to be identified into the qualified test model, and the model outputs the recognition result of Tamarix chinensis.
[0091] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A Tamarix identification method based on attention mechanism and feature alignment, characterized in that: The steps include: Step 1: Acquire multiple remote sensing images of the multi-temporal study area under different conditions and preprocess the remote sensing images; Step 2: Extract typical vegetation indices (NDVI, RVI, MSAVI, and DVI) from each preprocessed remote sensing image and overlay them with the original remote sensing image to form a multi-channel image. Perform the above processing on all remote sensing images to obtain several multi-channel images, annotate the multi-channel images with Tamarix chinensis, and create a ground truth map. The several multi-channel images and their corresponding ground truth maps are divided into source domain and target domain image sets. Step 3: Input the source domain and target domain image sets into the attention mechanism deep feature extraction module respectively to extract the deep features in the source domain and target domain images; input the extracted deep features into the dual feature alignment module to perform GOT graph feature alignment and MMD spatial feature alignment, and then perform weighted addition of the features after GOT graph feature alignment and MMD spatial feature alignment to obtain the new features of the source domain and target domain images; Step 4: Input the new features of the source domain image and the source domain ground truth map into the neural network model to train the model; input the new features of the target domain image and the target domain ground truth map into the trained model to test the model; Step 5: Acquire a remote sensing image of the area to be identified and perform preprocessing. Extract typical vegetation indices NDVI, RVI, MSAVI, and DVI from the preprocessed remote sensing image, and perform image superposition with the original remote sensing image to form a multi-channel image to be identified. Input the source domain image set obtained in step 2 and the multi-channel image to be identified into the deep feature extraction module of the attention mechanism to extract deep features from the source domain and the multi-channel image to be identified. Input the extracted deep features into the dual feature alignment module to perform GOT graph feature alignment and MMD spatial feature alignment, and perform weighted addition of the features after GOT graph feature alignment and MMD spatial feature alignment to obtain new features of the source domain and the multi-channel image to be identified. The new features of the multi-channel image to be identified are input into the qualified model, and the model outputs the identification result of Tamarix chinensis.
2. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 1, characterized in that: The attention mechanism deep feature extraction module consists of an ECA channel attention mechanism and a ResNet50 feature extraction module. The ResNet50 feature extraction module includes an input convolution layer, a batch normalization layer, a ReLU activation layer, and a residual block. Each residual block contains a 1x1 convolution layer for compressing the number of channels, a 3x3 convolution layer, and a 1x1 convolution layer for restoring the number of channels. The ECA channel attention mechanism is integrated into the ResNet50 feature extraction module to optimize the channels. The weight of the channel is optimized by calculating the weight coefficient of each channel.
3. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 1, wherein: The dual feature alignment module includes a GOT graph feature alignment module and an MMD spatial feature alignment module, which are used to align the deep features of the source domain and the target domain.
4. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 3, wherein: In the GOT graph feature alignment module, the graph features of the source domain and the target domain extracted by the attention mechanism deep feature extraction module are used as the input of the GOT graph feature alignment module. The following formula is used to perform graph optimization transfer and calculate the result of the alignment of the source domain and target domain graph features: Among them, G s and G t Represents the graph features of the source domain and the target domain, s represents the source domain, t represents the target domain, and Represents the two pairs of nodes currently being processed, and Represent the characteristics of source domain node i and target domain node j respectively, and Respectively represent and The mapping of T ij and There are two pairs of nodes and The transformation matrix, Representatives from arrive The transmission cost, Representatives The cost matrix composed of GOT(G s ,G t ) represents the result of alignment of source domain and target domain graph features.
5. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 3, characterized in that: In the MMD spatial feature alignment module, the spatial features of the source domain and the target domain extracted by the attention mechanism deep feature extraction module are used as the input of the MMD spatial feature alignment module. The spatial feature distribution is adjusted to the maximum extent possible between the two domains by minimizing the MMD value, thereby reducing the spatial distribution difference between the source domain and the target domain. The MMD value calculation formula is as follows: in, are the spatial features of the source domain and the target domain respectively, X s 、X t are the spatial feature sets of the source domain and the target domain respectively, n s 、n t Represent the number of source domain samples and the number of target domain samples respectively; s represents the source domain, t represents the target domain, The spatial feature map representing the source domain, Represents the spatial feature map of the target domain, and H indicates that this operation is performed in a high-dimensional space.
6. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 1, characterized in that: In the neural network model, the feature vector from the dual feature alignment module is input into the fully connected layer, calculated using matrix multiplication, and biased, and then the output neuron eigenvalue is obtained. The Softmax activation function is then used to obtain the Tamarix identification probability feature vector of the neuron corresponding to each position in the image. Each value in the feature vector represents the probability of identification of Tamarix, and the sum of all values in the feature vector is 1. The Softmax function expression formula is as follows: Among them, ω and b are weight coefficient and bias coefficient respectively, and b j represents the weight value and bias coefficient of the input neuron n classified as Tamarix type j, Y represents the value corresponding to the output recognition result of Tamarix type, P represents the probability, represents the feature of the nth neuron in the l-1th layer of the fully connected layer output, where n represents the element index, l represents the number of convolutional layers in the fully connected layer, K represents the attribute value corresponding to the Tamarix category label, and i represents the type of Tamarix. represent The transpose of .
7. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 1, characterized in that: The typical vegetation indices NDVI, RVI, MSAVI and DVI are the normalized difference vegetation index, ratio vegetation index, modified soil adjusted vegetation index and difference vegetation index, respectively. The calculation formulas are as follows: NDVI = (NIR-R) / (NIR+R) RVI=NIR / R DVI=NIR-R Among them, NIR represents the reflectivity of the near-infrared band in the remote sensing image, and R represents the reflectivity of the red light band.
8. The method for identifying Tamarix chinensis based on attention mechanism and feature alignment according to claim 1, characterized in that: In step 4, when testing the model, the recall rate (TPR) is used to evaluate the accuracy of each category. The calculation formula is as follows: Among them, TP represents the number of samples that correctly predict a certain category as a certain category, and FP represents the number of samples that incorrectly predict other categories as a certain category; The overall accuracy OA is used to evaluate the overall classification accuracy of all categories, and its formula is: Among them, FN represents the number of samples that mistakenly predict a certain category as other categories, and FP represents the number of samples that correctly predict other categories as other categories; The Kappa coefficient is used to quantitatively evaluate the overall performance of the classification method, and its formula is: Among them, P o is the overall accuracy, P e is an accidental consistency error.
Citation Information
Patent Citations
Large-range cross-phenological-area crop drawing method based on time sequence remote sensing image
CN115439754A
Remote sensing image change detection method, device and equipment and readable storage medium
CN116168253A