Tree species identification method based on visual converter and ensemble learning
Through the combination of visual transformer and integrated learning, local and global feature extraction are improved, model weights are dynamically adjusted, and local feature dependence and computational complexity problems in tree species recognition are solved, and efficient and stable tree species recognition is achieved to adapt to diversity and environmental changes.
Patent Information
- Application Number
- CN202510448598.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-15
AI Technical Summary
The existing tree species recognition technology has problems such as local feature dependence, computational complexity, insufficient generalization ability of a single model and data imbalance, which is difficult to adapt to diversity and environmental changes, resulting in a decrease in recognition accuracy.
Using a combination of vision transformer and integrated learning, we can improve multi-head voting, cross-layer feature optimization and dynamic selection modules, integrate local and global features, dynamically adjust model weights, optimize training processes, and improve recognition accuracy and robustness.
It significantly improves the accuracy and robustness of fine-grained classification of tree species recognition, ensures the consistency and stability of identification results, adapts to different environmental changes, solves data imbalance problems, simplifies operational processes, and is suitable for large-scale applications.
Smart Images

Figure CN120495869A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision and forestry information technology, and in particular relates to a tree species recognition method based on a visual transformer and integrated learning. Background Art
[0002] Efficient tree species identification faces numerous challenges, such as the vast variety of tree species, phenotypic variability, and difficulty in data collection. Traditional tree species identification methods rely primarily on manual observation of tree morphological characteristics, such as leaves, canopy, branches, and flowers and fruits. However, these characteristics are significantly affected by seasonal variations and require specialized knowledge and experience. In contrast, bark, as a stable, reliable, and easily accessible tree characteristic, offers a more ideal strategy for tree species identification.
[0003] In recent years, the application of computer vision in tree species identification has increased significantly. In early studies, datasets were constructed using handheld devices and classic visual models were used for tree species identification, verifying the feasibility of bark-based identification. With the continuous advancement of technology, existing data collection strategies and identification methods have been improved and expanded. For example, larger and more diverse datasets are constructed, different data distillation and identification techniques are added, and deep neural network architectures are optimized. In addition to relying solely on bark images for identification, some studies have combined bark images with other remote sensing images (such as lidar and multispectral) to assist in identification. These studies have shown that image recognition models can show strong applicability in bark-based tree species identification.
[0004] As research deepens, it is discovered that due to the complexity and similarity of bark textures between different tree species, bark-based tree species identification should be considered a fine-grained recognition task. Unlike traditional multi-classification tasks, fine-grained image recognition (FGIR) models focus on identifying subtle differences within large categories, thereby distinguishing closely related subcategories. Research on FGIR applications in forestry has primarily focused on plant phenotyping and disease identification. For example, in phenotyping, existing technologies employ a jigsaw puzzle model with a hierarchical progressive training strategy, propose a multi-stream hybrid architecture combining coarse and fine-grained features, build an integrated deep learning architecture, and propose a time-series-based classifier fusion strategy. New methods have also been proposed for plant phenotyping based on dual-view leaf images. In plant disease and pest identification, some studies have proposed novel attention mechanisms, combining dilated convolution with dual-pooled channel attention, lightweight attention mechanisms with generative models, graph pyramid attention-based attention methods, and multi-granularity feature aggregation methods for identifying disease types. These studies have promoted the intelligent recognition of images in the forestry field, but there is a relative lack of research on tree species identification, and there are few reports on the application of the FGIR model in bark-based tree species identification.
[0005] Although the existing tree species recognition methods based on CNN and ViT have improved the accuracy of tree species recognition to a certain extent, there are still some significant shortcomings, as follows:
[0006] (1) Local feature dependency: Traditional CNN models rely primarily on the extraction of local features for tree species recognition. Although they can achieve good results in relatively simple tree species recognition tasks, they exhibit strong local sensitivity when dealing with complex tree species, seasonal changes, and external interference factors (such as illumination and occlusion). They are poor at handling long-range global feature dependencies, making it difficult for the model to adapt to diverse tree species recognition scenarios.
[0007] (2) Computational complexity of the self-attention mechanism: Although the Visual Transformer (ViT) can capture global dependency information in images, due to the high computational complexity of its self-attention mechanism, especially when processing high-resolution images, the model training and inference speed are often slow and require relatively large computing resources. Therefore, ViT faces the problem of high computational overhead in practical applications, which limits its application in large-scale tree species recognition.
[0008] (3) Generalization ability of a single model: Although ensemble learning methods improve classification performance by combining the prediction results of multiple models, most existing ensemble learning methods rely on single-category models and decision boundaries. Therefore, when dealing with more complex similar features between different tree species, misjudgment is prone to occur, resulting in a decrease in recognition accuracy.
[0009] (4) Data imbalance: The number of samples of different tree species in a tree image dataset is usually unbalanced. Some tree species may have only a small number of image samples, resulting in the features of some tree species being ignored during training or poor recognition results. Although ensemble learning can alleviate this problem to a certain extent, it is still difficult to completely eliminate the impact of data imbalance.
[0010] (5) Poor adaptability to environmental changes: The appearance characteristics of tree species (such as bark, leaves, flowers, etc.) vary with the environment, season, and growth status. Existing tree species recognition methods often rely on training data from specific scenarios and are difficult to adapt to different environmental conditions. Therefore, in practical applications, they are often affected by environmental changes, resulting in a decrease in recognition accuracy. Summary of the Invention
[0011] In response to the problems existing in the background technology, the present invention proposes a tree species identification method based on visual transformers and ensemble learning, which utilizes the stability and uniqueness of bark texture to give full play to its advantages in tree species identification; through algorithm improvement, it achieves efficient fusion of local and global features, reduces computational complexity, and enhances model generalization ability, thereby providing a tree species identification technology solution that is efficient, stable and adaptable to practical application needs.
[0012] Technical solution: In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0013] A tree species identification method based on visual transformers and ensemble learning includes the following steps:
[0014] S1: Image acquisition and analysis: Use mobile devices to collect bark texture images of different tree species and use the model to conduct in-depth analysis of the input images;
[0015] S2: Model framework improvement: optimize local and global feature extraction, introduce ensemble learning strategies, and fuse the prediction results of different models;
[0016] S3: Model training and optimization: Use ViT-B-16 as the base network and initialize model parameters through pre-trained weights;
[0017] S4: Output result: Output tree species recognition result, indicating the tree species classification corresponding to the input image.
[0018] Preferably, in S1, a mobile device is used to collect bark texture images of different tree species, including sample images of different tree species, different tree ages and seasons, and the collected image data is transmitted to the system processing module.
[0019] As a preference, the specific process of S2 is:
[0020] S21: Improvements to the multi-head voting module, introducing a dynamic weighted voting mechanism to evaluate and adjust each attention head;
[0021] S22: Improvements to the cross-layer feature optimization module, modifying the weighting mechanism and feature refinement strategy, and improving the quality of cross-layer information fusion through methods based on attention allocation and feature aggregation;
[0022] S23: Improvement of the dynamic selection module, which evaluates the importance of each attention head based on the feature contribution output by the multi-head voting module and dynamically allocates the number of patches.
[0023] As a preference, the specific process of S21 is:
[0024] S211: embed the input image block into the label vector, input it into the multi-head attention mechanism, use the attention head to calculate the score map and attention map, and then use the voting mechanism to obtain the initial category token;
[0025] S212: Using learnable weight vectors, a weighted voting mechanism is constructed based on the importance scores calculated by each attention head, and the weights are continuously optimized during learning.
[0026] S213: Use the updated weights for weighted voting, and obtain more accurate markings by aggregating the voting results.
[0027] Preferably, the specific process of S22 is:
[0028] S221: The output of the multi-head voting module is passed to the cross-layer feature optimization module, and a scaling factor related to the attention head is introduced to enable the model to adaptively adjust the label information based on the information of different layers;
[0029] S222: Extract information from different layers using the FPN strategy and concatenate it with the tags output by the multi-head voting module.
[0030] Preferably, in S222, the following steps are specifically included:
[0031] Add upsampling layers to unify the feature map sizes at different levels to facilitate feature aggregation;
[0032] Combine feature maps with category labels;
[0033] The feature maps of different levels are stacked in the channel dimension, and then the dynamic selection module is used to select the stacked features.
[0034] Preferably, the specific process of S23 is:
[0035] S231: Based on the output of the multi-voting module, evaluate the contribution of each layer of labeling to the model accuracy and relevance;
[0036] S232: Dynamically adjust the number of allocated patches based on the importance of each attention head;
[0037] S233: Integrate the dynamically selected feature vectors through the aggregation module and output the global feature expression.
[0038] Preferably, in S3, an SGD optimizer is used with a cross entropy loss function to evaluate the difference between the model output and the true label.
[0039] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0040] (1) The present invention combines the technology of visual transformer (ViT) and ensemble learning, and has significant advantages over the existing technology in the field of tree species identification. Compared with the existing technology, the main improvement brought by the present invention is that the fine-grained classification accuracy and robustness of tree species identification are significantly improved. By improving the key modules, the improved method can more accurately capture the global information and key details in the image, thereby more effectively locating and identifying tiny features on the bark. This improvement not only improves the performance of the model in diverse and complex scenarios, but also ensures that a high level of recognition stability can be maintained under adverse conditions such as environmental changes. The DELT model proposed in the present invention analyzes the global information of the image through the self-attention mechanism, and can accurately identify tree species in different environments.
[0041] (2) Improved consistency and stability of recognition results: Compared with existing technologies, when traditional recognition systems identify the same tree multiple times, the recognition results may be different and lack consistency due to environmental changes (such as changes in lighting, weather, or shooting angles). For example, sometimes trees may be identified as different species under different lighting conditions. The present invention combines the recognition results of multiple models through an ensemble learning method, making the recognition results more consistent and stable. The core advantage of the ensemble learning method is that it can avoid the limitations of a single model, reduce errors caused by environmental changes, and ensure that the same tree can obtain the same recognition results at different times or under different conditions.
[0042] (3) Stronger adaptability and solves the problem of data imbalance: In tree species recognition tasks, there is often a problem of sample imbalance, that is, the image samples of some tree species are much fewer than those of other tree species, which may cause the model to be biased towards certain large-sample tree species during training. Traditional methods often misidentify a minority of tree species in this case. The present invention can better handle the problem of data imbalance through an ensemble learning method, especially can effectively identify tree species with a small number of samples. Ensemble learning uses multiple different models to ensure that the characteristics of tree species with a small number of samples receive sufficient attention, thereby improving the recognition ability of a small number of tree species. Studies have shown that ensemble learning methods can significantly improve recognition accuracy in small-sample problems.
[0043] (4) Simple operation theory and strong applicability: Existing tree species identification systems usually require relatively complex parameter configuration and debugging, and have a high operating threshold. Our invention has been optimized in design, making the system easier to operate. Users only need to take a simple image, and the system will automatically analyze and give the identification results. The combination of integrated learning and visual transformers enables the model to automatically adapt to various environments without excessive user intervention. For ordinary users without a technical background, this simple operation process greatly improves the user experience.
[0044] (5) Strong scalability and suitability for large-scale applications: The present invention has excellent scalability and can be widely deployed in different environments. For example, in fields such as forest management and ecological monitoring, our tree species identification system can effectively process massive amounts of image data and adapt to a variety of different identification tasks. Due to its efficient computing power and low hardware requirements, the system can be deployed in application scenarios of various sizes to meet the needs of large-scale data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic diagram of the DELT workflow of the present invention;
[0046] Figure 2 is a schematic diagram of the MHV module of the present invention;
[0047] Figure 3 It is a schematic diagram of the CLR module of the present invention;
[0048] Figure 4 is an example of a portion of tree bark images in the dataset of the present invention;
[0049] Figure 5 This is an example of an image in the dataset of the present invention that does not contain valid bark texture information. DETAILED DESCRIPTION
[0050] The present invention will be further illustrated below with reference to specific examples. The examples are implemented based on the technical solutions of the present invention. It should be understood that these examples are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0051] Bark has significant advantages as an object for tree species identification. First, the texture and structural characteristics of bark remain relatively stable throughout the life cycle of the tree and are not affected by seasons and growth stages like leaves and flowers. This stability allows bark images to be collected throughout the year, ensuring data consistency and long-term availability. Secondly, bark has unique surface textures, such as cracks, grooves, and wart-like protrusions. These subtle features provide an obvious basis for distinguishing between different tree species. In addition, the texture characteristics of bark are more robust in the face of external interference (such as changes in light, occlusion, etc.), and can provide more reliable identification information. Therefore, compared with leaves and flowers, bark has higher stability and recognition accuracy in practical applications, and is particularly suitable for large-scale ecological monitoring and forest resource management.
[0052] Although existing tree species recognition methods based on deep learning have improved recognition accuracy to a certain extent, they still have the following shortcomings and require improved algorithms to enhance overall performance:
[0053] (1) Optimizing local and global feature extraction: Traditional models rely primarily on local features and have difficulty capturing the global distribution of bark texture. To address this issue, a technical solution needs to integrate local detail and global texture extraction strategies to enhance the ability to characterize the complex structure of bark.
[0054] (2) Improve model generalization and robustness: Existing single models are prone to misjudgment when faced with data imbalance and changes in different environments. The technical solution should use ensemble learning strategies to integrate the advantages of multiple models to build an efficient recognition system that takes into account both local and global information. At the same time, the training process should be optimized through data balancing strategies to improve the adaptability of the model in multiple scenarios.
[0055] The tree species identification method based on visual transformer (ViT) and ensemble learning provided in this embodiment is named DELT (Dynamic Ensemble Learning Transformer). It includes image acquisition and analysis, model structure setting, model training and optimization. Specifically,
[0056] S1: Image acquisition and analysis;
[0057] S11: Image Acquisition: Use a mobile device (e.g., a cell phone camera) to capture bark texture images of various tree species, ages, and seasons. The captured image data is transmitted to the system processing module, laying the foundation for feature extraction. The captured image resolution must be at least 512×512 pixels.
[0058] The collected dataset includes images collected in Nanjing city (about 24,000 images), and is combined with public bark datasets such as BarkVN50, BarkNet 1.0, and BarkKR. This allows the dataset to include tree species at multiple latitudes, expanding the application scenarios. Some images in the dataset are as follows: Figure 4 shown.
[0059] S12: Image Analysis: The system uses the DELT model to perform in-depth analysis of input images. Unlike traditional CNNs, which primarily rely on local feature extraction, the ViT model uses a self-attention mechanism to capture long-range dependencies in images, thereby comprehensively analyzing the overall image structure and details.
[0060] S2: Model framework improvement: Optimize local and global feature extraction, introduce ensemble learning strategies, and fuse prediction results from different models. The core improvements are concentrated in the following three modules:
[0061] S21: Improvements to the Multi-Head Voting (MHV) module;
[0062] In traditional models, the contribution of each attention head is typically considered equal. However, in bark images, different attention heads differ in their ability to capture local and global features. To address this, this paper introduces a dynamic weighted voting mechanism in the MHV module to re-evaluate and adjust the importance of each attention head. This allows the model to automatically select markers with higher discriminative power during training, thereby improving overall recognition accuracy.
[0063] S211: In the multi-head voting module (MHV), the input image block is embedded in the label vector and input into the multi-head attention mechanism. Each attention head acts as a weak classifier. The MHV module first calculates the score map and attention map by using the attention head, and then uses the voting mechanism to obtain the initial category label. The specific calculation process is as follows:
[0064] S=QK T ,
[0065] Where Q represents the query matrix, K represents the bond matrix, S represents a score mapping, S∈R n ×n , d k represents the dimension of the key vector; T represents the transpose operation.
[0066]
[0067] Among them, A represents the attention map, S represents the score map, and d k Indicates the dimension of the key vector.
[0068] S212: Using the learnable weight vector, a weighted voting mechanism is constructed based on the importance scores calculated by each attention head, and the weights are continuously optimized during learning. The specific calculation process is as follows:
[0069]
[0070] Among them, w i is the learnable weight of the i-th attention head, α i is the normalized weight, O i is the output of the i-th attention head, is the final representation after weighting. j is the learnable weight of the jth attention head.
[0071] S213: The updated weights are used for weighted voting. By aggregating the voting results, a more accurate label is obtained. The specific calculation process is as follows:
[0072]
[0073] Among them, W and b are the learnable parameters of the classification layer, is the weighted label representation, is the final predicted tag (taking the maximum probability after softmax normalization).
[0074] A weighted vote is performed based on the importance scores of each attention head, selecting the marker with the greatest contribution for feature aggregation. At this point, the ensemble size is 64, the number of votes is 12, and the dynamic update cycle is 5 epochs.
[0075] like Figure 2 As shown in the figure, the multi-head voting mechanism is similar to the working method of "ensemble learning". Each attention head can be regarded as a "sub-model", focusing on the details of the input image (such as bark texture) from different angles or different feature levels. The "Transformer Layers" part near the left side of the figure outputs the features or "heat maps" generated by multiple attention heads, and then these features are combined with their respective weights (Weight Vector) to form a weighted feature representation. Since each attention head is good at capturing different local or global features, the final voting (or weighted fusion) process is like combining the opinions of multiple "experts", which can locate the key areas in the bark image more comprehensively and accurately. The features after voting fusion will be input into the dynamic selection module for further patch selection and allocation.
[0076] S22: Improvements to the Cross-LayerRefinement (CLR) module;
[0077] Bark images have complex textures and multi-layered information. Effectively integrating cross-layer features is crucial for improving recognition performance. This paper modifies the weighting mechanism and feature refinement strategy of the CLR module. By leveraging attention allocation and feature aggregation, this approach improves the quality of cross-layer information fusion. This makes the model more accurate in integrating global and local features, effectively addressing the challenges posed by diverse environments and varying lighting conditions.
[0078] S221: The output (label) of the MHV module is passed to the CLR module, and a scaling strategy (scaling factor) related to the attention head is introduced to enable the model to adaptively emphasize or weaken the label information according to the information of different layers; the importance of the head is updated with the label passed by the MHV, thereby dynamically adjusting the input information of each head;
[0079] S222: Extract information from different layers using the FPN strategy and concatenate it with the markers output by MHV.
[0080] Based on the Feature Pyramid Network (FPN), this paper adopts a similar feature aggregation strategy to optimize channel combinations and refine multi-layer features. Specifically, it includes:
[0081] (1) Adding upsampling layers to unify the feature map sizes at different levels to facilitate feature aggregation;
[0082] (2) Combine the feature map with the class token;
[0083] (3) The feature maps of different levels are stacked in the channel dimension, and then the DS module is used to select the stacked features.
[0084] In the Cross-Layer Feature Refinement (CLR) module, the tags output by the MHV module are weighted and aggregated using a cross-layer attention mechanism. A dynamic upsampling mechanism is introduced to unify the size of feature maps, preventing information compression or loss during transmission. A feature pyramid aggregation strategy optimizes cross-layer features, improving the model's recognition accuracy.
[0085] S23: Improvements to the Dynamic Selection (DS) module;
[0086] Traditional methods often use a fixed strategy for patch allocation, making it difficult to adapt to the needs of different attention heads in feature extraction. To address this issue, the DS module in this paper focuses on dynamically adjusting patch allocation based on the importance of the tags. This allows the model to adaptively learn and allocate the number of patches required for each attention head, further optimizing the feature extraction process and improving the robustness and recognition efficiency of the overall system.
[0087] In the Dynamic Selection (DS) module, the importance of each Attention Head is evaluated based on the feature contributions output by the MHV module. The number of patches is dynamically allocated to ensure that computing resources are concentrated in key feature areas. Finally, the aggregation module integrates the dynamically selected feature vectors to output a global feature representation.
[0088] For the DS module, the present invention has made the following improvements:
[0089] S231: Based on the output of the MHV module, evaluate the contribution of each layer of labeling to the model accuracy and relevance;
[0090] S232: Dynamically adjust the number of patches allocated to each attention head based on its importance, ensuring that attention heads that contribute most to model performance or are more closely related to task requirements receive more resources. This allows for more accurate determination of the number of markers required for each layer. DELT in this application calls the DS module in two places: for marker selection and patch allocation.
[0091] S233: Integrate the dynamically selected feature vectors through the aggregation module and output the global feature expression.
[0092] S3: Model training and optimization: ViT-B-16 is used as the base network, and the model parameters are initialized through pre-trained weights.
[0093] The SGD (stochastic gradient descent) optimizer was used with a learning rate of 0.02 and a weight decay of 0.1 to avoid overfitting problems.
[0094] The cross entropy loss function is used to evaluate the difference between the model output and the true label. The specific calculation process is:
[0095]
[0096] Among them, y t is the encoding of the true label, is the probability distribution predicted by the model.
[0097] The weights in the MHV and DS modules are dynamically updated every five epochs to improve model adaptability. Training and testing are then performed using the BarkNetV3, BarkVN50, and BarkNet-G datasets. The batch size is set to 32, and the number of training iterations is set to 100 epochs.
[0098] Table 1 shows the accuracy difference between the DELT model and other classic models.
[0099] Table 1 Comparison of recognition accuracy of different models
[0100]
[0101] When verifying the results, the DELT model achieved a Top-1 accuracy of 99.73% on the BarkNetV3 dataset and 98.33% on the BarkNet-G dataset. When compared with traditional CNN models (such as ResNet and EfficientNet) and other Transformer models (such as MetaFormer), the DELT model achieved an average accuracy improvement of 2.5%. Attention Map visualization results confirmed that the model's focus areas were highly consistent with key bark texture features, consistent with the biological characteristics of the tree species.
[0102] S4: Output result: Output tree species recognition result, indicating the tree species classification corresponding to the input image.
[0103] Ultimately, after a series of processing steps, including image acquisition, feature extraction, and multi-model decision-making, the system outputs a tree species identification result. This result not only clearly indicates the tree species classification corresponding to the input image but also includes relevant confidence indicators, providing a scientific basis and decision-making support for subsequent practical applications such as ecological monitoring, forest resource management, and public science education.
[0104] The present invention uses a visual transformer to perform multi-layer feature extraction on bark images and integrates the advantages of multiple models through an ensemble learning strategy, thereby achieving efficient analysis and classification of complex bark textures while ensuring high recognition accuracy.
[0105] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A tree species identification method based on visual transformers and ensemble learning, characterized by: The following steps are involved: S1: Image acquisition and analysis: Use mobile devices to collect bark texture images of different tree species and use the model to conduct in-depth analysis of the input images; S2: Model framework improvement: optimize local and global feature extraction, introduce ensemble learning strategies, and fuse the prediction results of different models; S3: Model training and optimization: Use ViT-B-16 as the base network and initialize model parameters through pre-trained weights; S4: Output result: Output tree species recognition result, indicating the tree species classification corresponding to the input image.
2. The tree species identification method based on visual transformer and ensemble learning according to claim 1, characterized in that: In S1, a mobile device is used to collect bark texture images of different tree species, including sample images of different tree species, different tree ages and seasons, and the collected image data is transmitted to the system processing module.
3. The tree species identification method based on visual transformer and ensemble learning according to claim 1, characterized in that: The specific process of S2 is: S21: Improvements to the multi-head voting module, introducing a dynamic weighted voting mechanism to evaluate and adjust each attention head; S22: Improvements to the cross-layer feature optimization module, modifying the weighting mechanism and feature refinement strategy, and improving the quality of cross-layer information fusion through methods based on attention allocation and feature aggregation; S23: Improvement of the dynamic selection module, which evaluates the importance of each attention head based on the feature contribution output by the multi-head voting module and dynamically allocates the number of patches.
4. The tree species identification method based on visual transformer and ensemble learning according to claim 3 is characterized by: The specific process of S21 is as follows: S211: embed the input image block into the label vector, input it into the multi-head attention mechanism, use the attention head to calculate the score map and attention map, and then use the voting mechanism to obtain the initial category token; S212: Using learnable weight vectors, a weighted voting mechanism is constructed based on the importance scores calculated by each attention head, and the weights are continuously optimized during learning. S213: Use the updated weights for weighted voting, and obtain more accurate markings by aggregating the voting results.
5. The tree species identification method based on visual transformer and ensemble learning according to claim 3 is characterized in that: The specific process of S22 is as follows: S221: The output of the multi-head voting module is passed to the cross-layer feature optimization module, and a scaling factor related to the attention head is introduced to enable the model to adaptively adjust the label information based on the information of different layers; S222: Extract information from different layers using the FPN strategy and concatenate it with the tags output by the multi-head voting module.
6. The tree species identification method based on visual transformer and ensemble learning according to claim 5, characterized in that: In S222, it specifically includes: Add upsampling layers to unify the feature map sizes at different levels to facilitate feature aggregation; Combine feature maps with category labels; The feature maps of different levels are stacked in the channel dimension, and then the dynamic selection module is used to select the stacked features.
7. The tree species identification method based on visual transformer and ensemble learning according to claim 1, characterized in that: The specific process of S23 is as follows: S231: Based on the output of the multi-voting module, evaluate the contribution of each layer of labeling to the model accuracy and relevance; S232: Dynamically adjust the number of allocated patches based on the importance of each attention head; S233: Integrate the dynamically selected feature vectors through the aggregation module and output the global feature expression.
8. The tree species identification method based on visual transformer and ensemble learning according to claim 1, characterized in that: In S3, the SGD optimizer is used, and the cross entropy loss function is adopted to evaluate the difference between the model output and the true label.
Citation Information
Cited By
Double-flow layered brain image registration method and system based on state space model
CN121482114A