Tree species identification method based on bark image and lightweight deep learning model

Through the improved ConvNeXtV2 framework and feature refinement module, the problem that flower and leaf characteristics in tree species recognition is susceptible to seasonal changes and environmental interference, and efficient and stable tree species recognition is achieved in complex environments.

CN120495870APending Publication Date: 2025-08-15NANJING FORESTRY UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510462644.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Existing tree species recognition methods rely on flower and leaf characteristics to be susceptible to seasonal changes and environmental interference. Traditional machine learning methods are difficult to capture bark texture details. Traditional CNN models have large computational volume and limited local feature extraction capabilities, making it difficult to maintain stability and robustness in complex environments.

Method used

The improved ConvNeXtV2 framework is adopted, combining feature refinement module and normalization strategy, and efficient fusion of local details and global features is carried out through the SASE module and the AdGRN module to reduce the computational complexity and enhance the generalization ability of the model.

Benefits of technology

While maintaining or exceeding the accuracy of the existing model, it significantly reduces computing resource consumption, improves the ability to capture bark texture details, and improves the stability and robustness of the model in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495870A_ABST
    Figure CN120495870A_ABST
Patent Text Reader

Abstract

The invention discloses a tree species identification method based on a bark image and a lightweight deep learning model, and belongs to the crossing field of computer vision and forestry information technology, and the method comprises the steps: S1, collecting an image of a tree bark area; s2, preprocessing the collected data, and positioning and cutting a bark area based on an image segmentation technology; s3, using an improved lightweight deep learning model of a ConvNeXtV2 framework to carry out feature extraction on the preprocessed bark image; s4, after feature extraction is completed, features are integrated by using an adaptive feature fusion strategy, then tree species are classified, and a tree species identification result is output; s5, performing multi-dimensional verification and visual analysis on the model performance; according to the method, the calculation complexity is remarkably reduced, the generalization ability and stability of the model are kept, and reliable technical support is provided for practical application such as ecological monitoring, forest resource management and intelligent forestry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the intersection of computer vision and forestry information technology, and specifically relates to a tree species identification method based on bark images and a lightweight deep learning model. Background Art

[0002] Tree species identification is a crucial component of forestry ecological monitoring and resource management. In recent years, with the advancement of intelligent technology and mobile devices, image-recognition-based tree species identification tools (such as "Shape and Color" and "Flower Companion") have been increasingly used in forestry and public science outreach, providing a viable solution for rapid and convenient tree species identification.

[0003] Existing tree species identification schemes (such as APPs or identification frameworks) usually rely on the floral and leaf features of trees for identification. However, these features have certain limitations when dealing with problems such as seasonal changes (flowers and leaves falling off) and environmental interference (difficulty in stripping off background noise). In contrast, tree species identification methods based on bark show obvious advantages in these aspects and can provide more stable and reliable identification basis. The key advantages of bark include: (1) bark has high stability and is not easily affected by seasonal changes, which makes bark a reliable feature for tree species identification throughout the year; (2) bark is easier to obtain and observe in practical applications, especially when identifying tall trees. Unlike floral and leaf features that are difficult to reach and photograph, bark is usually located at the lower part of the tree, making it easier to observe and photograph; (3) The image quality of bark is not easily affected by factors such as ambient light and background, which provides higher robustness for tree species identification.

[0004] With the continuous deepening of research, bark features have gradually become an important subject of tree species identification research. In early studies, bark-based tree species identification methods were mainly traditional machine learning methods. Such methods mainly rely on extracting texture information from bark images, such as gray-level co-occurrence matrix (GLCM), local binary pattern (LBP) and histogram of oriented gradients (HOG). These methods quantitatively describe the local and global information of bark texture, and then combine it with classification algorithms such as random forest (RF) to identify and classify tree species. However, due to the high similarity of bark texture, and the fact that manually designed texture features often rely on image quality and feature expression under specific conditions, traditional machine learning methods face many challenges in tree species identification tasks.

[0005] In recent years, with the breakthroughs made by deep neural networks in the field of image processing, new methods and ideas have been provided for bark image recognition. In the existing technology, the BarkNet1.0 dataset is used and convolutional neural networks (CNN) are used for tree species recognition, which verifies the feasibility of identifying tree species through bark images. With the advancement of technology, data collection strategies and recognition methods have also been improved and expanded: (1) Systematically collect different bark images to build larger and more diverse datasets, such as BarkKR, IndianaBarkDataset and CentralBark datasets; (2) Add interfering noise and data enhancement techniques to the data to robustly train the CNN model and improve the generalization ability of the model. Through data enhancement methods such as geometric transformation and color transformation, the diversity of images is increased and the performance of the model is improved; (3) Different types of deep neural networks are introduced, such as (ViT) VisualTra nsformer, ResNet, patch-basedCNN and ConvNeXt, etc.; (4) Optimize the feature extraction framework. The feature extraction framework of bark images is mainly used to capture the texture and color features of the bark, which can effectively support tree species identification tasks, such as ILTP, CAM, or adding SE and CBAM modules to CNN to enhance the network's attention to key feature areas. In addition, multi-scale feature extraction and fusion methods can also be used; (5) Multimodal data fusion. Some studies have also attempted to aggregate features of bark images with other remote sensing images (such as lidar, hyperspectral and multispectral images) to assist in tree species identification.

[0006] However, the prior art still has the following problems and defects:

[0007] 1. Limitations of existing recognition schemes: Current mainstream tree species recognition schemes (such as mobile applications or image-based recognition frameworks) mainly rely on the floral and leaf features of trees for recognition, which can achieve good results during the flowering period or when the leaves are lush. However, in actual applications, the floral and leaf features of trees are significantly affected by seasonal changes and the ecological environment. For example, in autumn and winter or in special circumstances such as drought, pests and diseases, the floral and leaf features may partially fall off or not be obvious, which seriously affects the recognition accuracy. At the same time, complex background noise - such as surrounding vegetation, buildings or other non-target objects, will make the image segmentation and feature extraction process more difficult, further restricting the universality and robustness of existing schemes. Therefore, traditional recognition methods that rely on floral and leaf features have insufficient stability and adaptability in dynamic environments.

[0008] 2. Deficiencies of traditional learning methods: Traditional machine learning methods typically rely on manually designed feature extraction algorithms, which present many challenges in bark texture recognition. First, the subtle differences and high similarities in bark texture make it difficult for manually designed features to fully capture key details. Second, such methods have high requirements for image quality, acquisition angle, and lighting conditions. Once the actual acquisition conditions deviate significantly from expectations, the feature expression capability will be seriously affected. In addition, manually designed features often lack sufficient robustness and are difficult to maintain stable performance in complex environments, thus limiting the application effect and generalization ability of traditional methods in diverse scenarios.

[0009] 3. Limitations of traditional CNN models in processing complex texture features: Although deep learning methods based on convolutional neural networks (CNNs) have made significant progress in the field of image recognition, traditional CNN models still face the following limitations in bark texture recognition tasks: (1) Large number of parameters and high computational complexity: Large-scale CNN models show obvious disadvantages in parameter and computational resource requirements, which limits their real-time application in embedded devices and resource-constrained environments. (2) Limited local feature extraction capabilities: When processing fine-grained image features, traditional CNNs have difficulty in fully capturing local detail information such as cracks and grooves in the bark, which puts higher demands on identifying tree species with highly similar texture features. (3) Insufficient global feature normalization: The current model lacks a mechanism to effectively integrate and normalize the global feature distribution, resulting in insufficient stability and robustness of the model under different acquisition conditions, thereby affecting the overall recognition performance. Summary of the Invention

[0010] In response to the problems mentioned in the background technology, the present invention proposes a tree species identification method based on bark images and lightweight deep learning models, which utilizes the stability and uniqueness of bark texture to give full play to its advantages in tree species identification; through algorithm improvement, it realizes the efficient fusion of local and global features, reduces computational complexity, and enhances the model generalization ability, thereby providing a tree species identification technology solution that is efficient, stable and adaptable to practical application needs.

[0011] Technical solution: In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0012] A tree species identification method based on bark images and a lightweight deep learning model includes the following steps:

[0013] S1: Collect images of the bark area of trees;

[0014] S2: pre-process the collected data and locate and crop the bark area based on image segmentation technology;

[0015] S3: Use the lightweight deep learning model of the improved ConvNeXtV2 framework to extract features from the preprocessed bark image;

[0016] S4: After feature extraction, the adaptive feature fusion strategy is used to integrate the features, and then the tree species are classified and the tree species identification results are output;

[0017] S5: Perform multi-dimensional verification and visual analysis of model performance.

[0018] Preferably, in S2, the captured image is subjected to color correction, noise suppression and image enhancement processing.

[0019] As a preference, the specific process of S3 is:

[0020] S31: Using the feature refinement module, the local detail information in the bark is captured;

[0021] S32: Introduce the normalization module to uniformly control the global features.

[0022] Preferably, in S31, a feature refinement module is used to capture the local detail information in the bark. Specifically, the following contents are included:

[0023] S311: Introduce the SE module to use global context information to model each channel of the input feature;

[0024] S312: Introducing the CBAM module, through two complementary branches, modeling the channel dimension and spatial dimension of the input features respectively to generate attention distribution;

[0025] S313: Construct a SASE model and embed spatial attention directly into the structure of the SE module to achieve a close integration of the two mechanisms.

[0026] Preferably, in S313, the specific implementation process of the SASE model is:

[0027] Channel Attention Modeling: The SASE module first performs global average pooling on the input features and generates a weight distribution in the channel dimension through two layers of fully connected operations;

[0028] Spatial Attention Modeling: Based on channel attention, the SASE module further applies convolution operations to the input feature map to generate a two-dimensional spatial attention distribution;

[0029] Attention Fusion: The SASE module multiplies the weight distributions of channel attention and spatial attention element-wise to generate a comprehensive attention weight matrix.

[0030] Preferably, in S32, the normalization module includes AdGRN and 2sGRN;

[0031] AdGRN: Normalization is performed by combining local and global characteristics of input data by dynamically adjusting normalization parameters;

[0032] 2sGRN: Adds dual scales to improve the normalized fine-grained modeling capability by combining full-scale and half-scale feature distribution information.

[0033] Preferably, the 2sGRN first computes the global response of the input features at two different scales, including:

[0034] Full-scale response: The full-scale global response is obtained by directly calculating the second norm of the feature in the spatial dimension;

[0035] Half-scale response: After downsampling the input features, the second norm is calculated to obtain the local global response on a smaller receptive field;

[0036] Then, these two responses are fused through bilinear interpolation and weighting to generate the final global normalization factor.

[0037] As a preference, the specific content of the full-scale response is:

[0038] Calculate the L2 norm of the input feature X directly in the spatial dimension, calculated by channel, specifically:

[0039]

[0040] Among them, R f (c) represents the global response of channel c at all scales; Represents the square of the value of the input feature at the cth channel, position (i, j); H represents the height and W represents the width.

[0041] As a preference, the specific content of the half-scale response is:

[0042] Downsample the input features to obtain the downsampled features X h , specifically:

[0043]

[0044] in, Represents the downsampled features of the input feature at the cth channel, position (i, j), X c,i,j Represents the value of the input feature at the cth channel, position (i, j);

[0045] Then calculate the L2 norm of the downsampled features:

[0046]

[0047] Among them, R h (c) represents the global response of channel c at half scale; Represents the downsampled feature value of the input feature at the cth channel and position (i, j), H represents the height, and W represents the width;

[0048] Subsequently, weighted fusion is used to generate the final global normalization factor μ; the two-scale responses are fused using the weight factor λ:

[0049] μ=λμ f +(1-λ)μ h ,

[0050] Among them, μ f represents the global normalization factor at all scales; μ h represents the global normalization factor at half scale.

[0051] As a preference, the specific process of S5 is:

[0052] S51: Test the model using the accuracy, recall, and F1-score metrics.

[0053] S52: Use heatmaps, attention maps, and feature maps to visualize the features extracted by the model;

[0054] S53: Compare and analyze the performance of the improved model with the traditional CNN model on multiple sets of experimental data.

[0055] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0056] (1) Traditional CNNs often have difficulty in fully capturing fine-grained features such as cracks, grooves, and texture orientation in bark image recognition, and these features are the key to distinguishing different tree species. To this end, the present invention proposes a feature refinement module that effectively improves the ability to express bark texture by adaptively weighting local details and global structural information at different scales. Specifically, the SASE module can focus on tiny and biologically significant features in the bark at a fine-grained level while maintaining a global perception of the overall image structure. This multi-level feature capture gives the model higher sensitivity and discrimination ability when distinguishing tree species with similar textures. Experimental results show that compared with the solution using traditional CBAM or SE modules, the SASE module significantly improves the classification accuracy.

[0057] (2) The normalization strategy is not only used to accelerate convergence in deep models, but also directly affects the consistency of feature distribution and model robustness. Traditional normalization methods (such as BatchNormalization) are often unable to achieve sufficient adaptability when dealing with data fluctuations caused by illumination changes, acquisition angle deviations, and background interference. The dynamic normalization module (AdGRN module) designed in the present invention can adaptively adjust the normalization parameters according to the features of the input image, thereby achieving stable feature expression in various complex scenes. Through the AdGRN module, the model can maintain high consistency and robustness under different environments and data quality conditions, ensuring the effective use of key texture features in subsequent classification. Experiments show that after the introduction of AdGRN, the generalization ability and stability of the model on a diverse test set have been significantly improved.

[0058] (3) The synergistic effect of the two module improvements in the present invention: the multi-scale attention mechanism not only enhances the capture of local features, but also provides a clearer feature expression for the normalization module; while the dynamic normalization strategy ensures that the fine-grained features extracted by SASE can be stably transmitted in each layer of the network. Through multi-dimensional analysis of visual feature activation, CAM heat map and class selectivity index, the experiment verified the advantages of the improved model in capturing key biological features such as cracks and grooves in bark. This synergistic effect ultimately enables the model to achieve higher classification accuracy and stronger robustness than the traditional baseline model and other classic modules while maintaining a lightweight parameter count of only 3.4M. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 Schematic diagram of the improved ConvNeXtV2 framework of the present invention;

[0060] Figure 2 is the visual feature activation map of the present invention;

[0061] Figure 3 is the CAM thermal map of the present invention;

[0062] Figure 4 is a CSI distribution characteristic diagram of the ConvNeXtV2-Baseline model in an embodiment of the present invention;

[0063] Figure 5 : is a CSI distribution characteristic diagram of the ConvNeXtV2-CBAM model in an embodiment of the present invention;

[0064] Figure 6 is a CSI distribution characteristic diagram of the ConvNeXtV2-SE model in an embodiment of the present invention;

[0065] Figure 7This is a CSI distribution characteristic diagram of the ConvNeXtV2-SASE model in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] 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.

[0067] 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.

[0068] The tree species recognition method based on bark images and a lightweight deep learning model provided in this embodiment aims to solve the problems existing in traditional CNN models when processing complex texture features. The main methods include: (1) using ConvNeXtV2 as the basic framework, extending it to the tree species recognition task, and exploring its applicability in the classification of complex bark textures; (2) introducing a feature refinement module and a normalization strategy to construct a lightweight model that can enhance the fine-grained feature capture capability with a small number of parameters and achieve classification accuracy similar to or higher than that of existing models; (3) verifying the improvements in feature extraction, attention distribution, and category discrimination capabilities of the improved model through accuracy evaluation and various visualization analysis techniques.

[0069] The specific implementation process in this embodiment is:

[0070] S1: Image acquisition: collecting images of tree bark areas;

[0071] First, the system uses a user's mobile device (such as a smartphone or tablet) to capture high-resolution images of the tree's bark area. The minimum resolution required is 512 x 512 pixels to fully capture the subtle differences in bark texture. The captured image data is then transmitted in real time via a wireless network to a data processing module, providing a reliable data foundation for subsequent feature extraction.

[0072] S2: Image preprocessing and region segmentation: preprocess the collected data and locate and crop the bark area based on image segmentation technology;

[0073] To remove potential uneven lighting, noise, and background interference, the system preprocesses the captured images, including color correction, noise suppression, and image enhancement. Next, it uses image segmentation technology to precisely locate and crop the bark area, ensuring that the subsequent feature extraction phase focuses on the target area, thereby improving recognition accuracy and robustness.

[0074] S3: Feature extraction and lightweight model construction: Use the lightweight deep learning model of the improved ConvNeXtV2 framework to extract features from the preprocessed bark images;

[0075] This paper uses the advanced ConvNeXtV2 as its basic framework and extends its application to tree species identification tasks. Traditional image classification models often focus on extracting general features, while bark images have highly similar texture patterns and subtle differences. Local features such as cracks and grooves are often easily overlooked. Therefore, while maintaining the original global and local feature fusion advantages of ConvNeXtV2, this paper adjusts the network structure and parameter configuration to specifically optimize the fine-grained features in bark images, accurately capturing the subtle texture differences between different tree species, and comprehensively evaluating the model's robustness under different lighting, angles, and background noise conditions.

[0076] The system adopts a lightweight deep learning model based on the improved ConvNeXtV2 framework to perform in-depth feature extraction on the preprocessed bark images.

[0077] Unlike traditional CNN models that primarily rely on local feature extraction, the improved model achieves multi-scale and multi-angle capture of complex bark textures by fusing local details (such as cracks, grooves, and texture orientation) with global structural information. At the same time, the introduction of efficient feature refinement modules and normalization strategies enables the model to achieve or exceed the classification accuracy of existing mainstream models while maintaining a small number of parameters, providing technical support for resource-constrained embedded applications. Specifically, this includes:

[0078] S31: Using the feature refinement module, the local detail information of the bark (such as texture direction, crack distribution, etc.) is captured in multiple levels and angles.

[0079] ConvNeXtV2 uses pure convolutional operations to extract features, which extract local features through standard convolutional layers. In fine-grained classification tasks like bark images, traditional convolutional operations can struggle to capture the intricate details of bark texture. To address this, the present invention designs a Texture-Specific Feature Refinement module, which aims to improve the performance of deep neural networks in texture feature extraction, particularly in modeling complex texture variations.

[0080] 1. SE module;

[0081] As a first step in improving the framework, we introduce the Squeeze-and-Excitation (SE) module to enhance the model's ability to perceive the importance of channel features. The SE module is a lightweight attention mechanism that dynamically adjusts the weight of each channel to enhance the model's expressiveness on specific features. The core idea of this module is to leverage global contextual information to model each channel of the input features.

[0082] 2. CBAM module;

[0083] To address the shortcomings of the SE module in capturing spatial features, this paper introduces the Convolutional Block Attention Module (CBAM), which combines channel-wise and spatial-wise attention mechanisms to provide the model with more comprehensive feature enhancement capabilities. The core design concept of the CBAM module is to model the channel and spatial dimensions of the input features separately through two complementary branches, generating a more detailed attention distribution.

[0084] 3. SASE module;

[0085] Based on the construction ideas of the SE and CBAM modules, this paper further constructs an improved SE module (SpatialAttention Squeeze-and-Excitation, abbreviated as SASE) to more efficiently combine the advantages of channel attention and spatial attention. Unlike the separate attention modeling of the CBAM module, the SASE module directly embeds spatial attention into the structure of the SE module, thus achieving a close integration of the two mechanisms.

[0086] The construction of the SASE module includes the following key steps:

[0087] (1) Channel attention modeling: The SASE module first performs global average pooling on the input features and generates a weight distribution in the channel dimension through two layers of full connection operations. The specific calculation process is:

[0088]

[0089] in, is the input feature map, C, H, and W are the number of channels, height, and width respectively. c is the average pooling value of channel c, and the channel vector is obtained X c,i,j Represents the value of the input feature at the cth channel, position (i, j).

[0090] Then, the channel weights are calculated through two layers of full connection (MLP), and nonlinear mapping is performed using ReLU and Sigmoid activation functions, specifically:

[0091] s=σ(W2δ(W1z)),

[0092] in, is the weight matrix of the two fully connected layers, C is the dimension, and r is the channel compression ratio. δ(·) represents the ReLU activation function, and σ(·) represents the Sigmoid activation function. is the normalized channel attention weight.

[0093] Finally, channel attention is applied to the input features:

[0094] X′ c,i,j =s c ×X c,i,j ,

[0095] Among them, X′ c,i,j It represents the feature after channel attention adjustment, which is multiplied by the original feature X to obtain the adaptive weighted result at the channel level; c represents the attention weight of the c-th channel; X c,i,j Represents the value of the input feature at the cth channel, position (i, j).

[0096] (2) Spatial Attention Modeling: Based on channel attention, the SASE module further applies convolution operations to the input feature map to generate a two-dimensional spatial attention distribution. Compared with the relatively complex spatial modeling strategy in the CBAM module, the spatial attention of the SASE module is implemented through a simple layer of 1×1 convolution, which has lower computational complexity.

[0097] First, the global spatial features are obtained by calculating the maximum pooling and average pooling of the channel dimension, specifically:

[0098]

[0099] in, X avg Indicates that the input feature X is averaged along the channel dimension to obtain a two-dimensional spatial graph, which represents the average response of each spatial position; Xc represents the input of the cth channel; X max represents the maximum value along the channel, reflecting the strongest activation at each spatial position. (Similar to argmax); C represents the number of channels; then a 1×1 convolution operation is performed to obtain the spatial attention distribution, specifically:

[0100] A spatial =σ(f conv1×1 ([X avg ,X max ])),

[0101] Among them, f conv1×1 represents a 1×1 convolutional layer, is the normalized spatial attention weight, X avg Indicates that the input feature X is averaged along the channel dimension to obtain a two-dimensional spatial graph, which represents the average response of each spatial position; X max represents the maximum value along the channel, reflecting the strongest activation at each spatial position; [X avg ,X max ] indicates splicing in the channel dimension and fusing the two pooling information.

[0102] Finally, the spatial attention is applied to the feature map, specifically:

[0103] X′ c,i,j =A spatial,i,j ×X c,i,j ,

[0104] Among them, X′ c,i,j A represents the feature after channel attention adjustment, which is multiplied by the original feature X to obtain the adaptive weighted result at the channel level; spatial,i,j Represents the attention value of spatial position (i, j).

[0105] (3) Attention Fusion: The SASE module multiplies the weight distributions of channel attention and spatial attention element by element to generate a comprehensive attention weight matrix. By weighting the input features with this matrix, the model can simultaneously enhance the response of specific channels and local spaces.

[0106] The final attention weight of the SASE module is the element-wise multiplication of channel attention and spatial attention, specifically:

[0107] A final,c,i,j =s c ×A spatial,i,j ,

[0108] Among them, A spatial,i,j A represents the attention value of the spatial position (i, j), which is applied uniformly to all channels. final,c,i,jrepresents the final attention weight of the SASE module; s c represents the attention weight of the c-th channel.

[0109] Finally, the input features are weighted according to the attention weight, specifically:

[0110] Y c,i,j =A final,c,i,j ×X c,i,j ,

[0111] in, is the final fused attention weight matrix, Y c,i,j It is the feature map after optimization by SASE module. c,i,j Represents the value of the input feature at the cth channel, position (i, j); A final,c,i,j Represents the final attention weight of the SASE module.

[0112] Compared to the original SE module, the SASE module improves upon its ability to simultaneously focus on both the channel importance and spatial distribution of features, thereby enhancing the model's ability to model complex textures and local features. Compared to the CBAM module, the SASE module employs a more compact fusion strategy, enabling multi-dimensional enhancement of input features while maintaining computational efficiency.

[0113] Table 1 Effect of improving the feature refinement module

[0114] Improved modules Top-1 Accuracy Rate of change Confidence Probability Rate of change SE+GRN 97.22% 0.33% 85.94% 0.59% CBAM+GRN 96.85% -0.04% 83.83% -1.52% SASE+GRN 97.41% 0.38% 86.21% 0.86% Baseline 96.89% - 85.35% -

[0115] Based on a multi-scale attention mechanism, the SASE module effectively improves the representation of bark texture by adaptively weighting local details and global structural information at different scales. Specifically, the SASE module is able to focus on tiny, biologically significant features in the bark at a fine-grained level while maintaining a global perception of the overall image structure. This multi-level feature capture gives the model greater sensitivity and discriminative power when distinguishing between tree species with similar textures. Experimental results show that the SASE module significantly improves classification accuracy compared to solutions using traditional CBAM or SE modules.

[0116] S32: Introduce an efficient normalization mechanism to uniformly regulate global features and ensure that the model maintains stable feature expression under different acquisition conditions.

[0117] The dynamic normalization module (AdGRN module) of this invention can adaptively adjust the normalization parameters based on the characteristics of the input image, thereby achieving stable feature expression in various complex scenarios. Through the AdGRN module, the model can maintain high consistency and robustness under different environmental and data quality conditions, ensuring the effective utilization of key texture features in subsequent classification. Experiments show that the introduction of AdGRN significantly improves the generalization ability and stability of the model on a diverse test set.

[0118] Normalization layers are an important component of deep neural networks, playing a key role in rescaling and optimizing the distribution of features. ConvNeXtV2 uses GlobalResponse Normalization (GRN) by default, which is highly efficient at processing global information but may have limitations in capturing local, fine-grained features.

[0119] To improve the model's performance in the bark image fine-grained classification task, the present invention uses two improved normalization modules to replace the GRN, including:

[0120] (1) AdaptiveGRN (Adaptive Global Response Normalization (layer)): Normalization is performed by dynamically adjusting the normalization parameters and combining the local and global characteristics of the input data.

[0121] AdGRN works by calculating the global response of the input features (using the L2 norm) and normalizing the input features according to the mean of the response. At the same time, AdGRN introduces a set of learnable weights that enable the model to adaptively adjust the strength of the normalization process based on the performance of the features. In contrast, the traditional GRN (global response normalization) module adopts fixed normalization parameters gamma and beta, and mainly relies on the global response of the input features to regularize the output. In this process, GRN lacks flexible adaptability to changes in feature response.

[0122] For input features (Calculated by channel) using the L2 norm, specifically:

[0123]

[0124] Among them, r c represents the global response of the c-th channel, that is, the L2 norm of all spatial positions on this channel. Represents the square of the value of the input feature at the cth channel and position (i, j).

[0125] Calculate the global response mean of all channels, specifically:

[0126]

[0127] Where μ represents the mean of the global response of all channels; C represents the number of channels; r c represents the global response of the c-th channel.

[0128] Normalize and introduce a learnable parameter ɑ c and β c Adjust the normalized intensity, specifically:

[0129]

[0130]

[0131] in, represents the normalized eigenvalue; X c,i,j Represents the value of the input feature at position (i, j) in the cth channel; ∈ represents a constant, a very small positive number (such as 0.0001), which is usually used for numerical stability. It prevents zero division errors when μ is very close to zero and ensures the stability of the normalization process. c,i,j Represents the final output features after processing by the AdGRN module.

[0132] (2) 2sGRN (Two-Scale GRN, two-scale global response normalization layer): Based on the GRN, a two-scale design is added to improve the normalized fine-grained modeling capability by combining the feature distribution information of the full scale and half scale. 2sGRN is a global normalization method based on a two-scale design. Its goal is to combine the global responses of different scales and improve the model's adaptability to fine-grained features.

[0133] 2sGRN first calculates the global response of the input features at two different scales, including:

[0134] (1) Full-scale response: The full-scale global response is obtained by directly calculating the L2 norm of the feature in the spatial dimension.

[0135] Calculate input features directly in the spatial dimension The L2 norm of (calculated by channel) is:

[0136]

[0137] Among them, R f (c) represents the global response of channel c at full scale, which is used to characterize the overall feature intensity of all spatial positions on the channel; f represents full, full scale; Represents the square of the value of the input feature at position (i, j) in channel c (describing the activation at that position). For each channel c, the squared values of all spatial positions in that channel are summed to obtain the total energy or response for that channel. H represents height, and W represents width.

[0138] (2) Half-scale response: First, downsample X (such as 2×2 average pooling) to obtain the downsampled features Specifically:

[0139]

[0140] in, represents the downsampled features with c channels, i height and j width, X c,i,j Represents the value of the input feature at the cth channel, position (i, j).

[0141] Then calculate the L2 norm of the downsampled features:

[0142]

[0143] Among them, R h (c) represents the global response of channel c at half scale; Represents the downsampled features of the input feature at the cth channel and position (i, j), H represents the height, and W represents the width.

[0144] Subsequently, weighted fusion is used to generate the final global normalization factor μ; the two-scale responses are fused using the weight factor λ (which can be fixed or learnable):

[0145] μ=λμ f +(1-λ)μ h

[0146] Here, λ is the weighting coefficient, 0≤λ≤1, μ f represents the global normalization factor at all scales; μ h Represents the global normalization factor at half scale. The weight factor λ determines the half scale μ h and full-scale μ f The proportion of information, which are aggregated together into the results.

[0147] Table 2 Effect of improving the normalization module

[0148] Improved modules Top-1 Accuracy Rate of change Confidence Probability Rate of change SE+AdGRN 97.32% 0.43% 85.98% 0.63% SE+2sGRN 97.14% 0.25% 85.75% 0.40% CBAM+AdGRN 96.76% -0.13% 83.83% -1.52% CBAM+2SGRN 96.93% 0.04% 83.83% -1.52% SASE+AdGRN 97.42% 0.53% 86.24% 0.89% SASE+2SGRN 97.24% 0.35% 86.19% 0.84% Baseline 96.89% - 85.35% -

[0149] Through the above strategies, the improved model significantly reduces computing resource consumption and improves the ability to capture complex texture details while maintaining or exceeding the classification accuracy of the existing model.

[0150] S4: Adaptive decision-making and result output: After completing feature extraction, the system integrates the output of the previous feature refinement module to accurately classify tree species at the decision layer.

[0151] Finally, the system outputs tree species identification results, including clear classification labels and corresponding confidence indicators.

[0152] S5: Multi-dimensional verification and visualization analysis of model performance;

[0153] To fully verify the improved model's performance in feature extraction, attention distribution, and category differentiation, this example uses systematic accuracy evaluation and multiple visualization analysis techniques. Specific methods include:

[0154] S51: Quantitative evaluation: Conduct rigorous statistical analysis of the model's performance on various test sets using metrics such as accuracy, recall, and F1-score to ensure the model has good classification performance in practical applications.

[0155] Table 3 Comparison of recognition accuracy of different models

[0156]

[0157] S52: Visualization methods: Using heat maps, attention maps, feature maps and other technologies, the bark texture features extracted by the model at different levels are intuitively displayed, thereby revealing the model's focus areas and judgment basis when distinguishing similar tree species.

[0158] 1. Visual feature activation;

[0159] The baseline model has the following deficiencies in capturing the bark contour features: Incomplete contour information: Although some channels respond to the general contour of the bark, the response area is discontinuous and the contour lines lack continuity. Uneven response intensity: Only a few channels show strong activation near the bark contour, and other channels hardly participate in contour modeling. The activation map after introducing the improved module has partially improved in capturing the bark contour features: It can be observed from the activation map that the improved model has significantly enhanced the response to the bark contour on multiple channels, and the lines are clearer and continuous, demonstrating the model's complete understanding of the overall contour structure. Background interference is reduced, and more channels in the improved model capture the contour features of the bark at the same time. These results indicate that the added module provides higher-quality feature representation for classification tasks.

[0160] 2. CAM heat map;

[0161] In this example, we compare the heatmaps generated by three models, ConvNeXt, ConvNeXtV2, and the improved model (Ours) proposed in this paper, to evaluate the differences in their attention mechanisms. We use Smooth Grad CAM++ to draw the visual heatmaps of the two ConvNeXt models. The results are shown in Figure 2. Figure 3 As shown in the figure, each group of images includes the original image with labels and the heat map generated by the model. The heat map is generated by weighted averaging the feature map with the corresponding convolution weights. This visualization technique intuitively reveals the area that has the greatest impact on the model's recognition decision.

[0162] (1) Capturing biological features: In the original models (ConvNeXt and ConvNeXtV2), the high-value areas of attention are relatively scattered, especially at the edges of the bark or in areas with sparse texture, where attention leakage is common. The heat map of the improved model shows a significant concentration of features, and the high-value areas of attention are almost entirely focused on bark features with biological significance, such as obvious cracked areas, deep grooves, and parts with prominent bark texture. In the heat map of the improved model, it can be clearly seen that the high-value areas are precisely distributed in areas with significant biological features, especially the small cracks, deep grooves, and parts of the bark with drastic texture changes.

[0163] (2) Focus on target areas: ConvNeXt and ConvNeXtV2 have weaker ability to focus on small-scale structures, especially in areas with small texture gradients (such as shallow cracks and fine texture changes). Moreover, ConvNeXt's heatmap often covers a large range of non-target areas, such as the background around the bark or the bark surface without significant texture. Compared with other models, the improved model's attention value in these areas is significantly enhanced. The improved model can accurately locate the target area and avoid interference from other information, which is highly consistent with the fine-grained feature extraction requirements required for bark classification.

[0164] 3. Class selectivity index;

[0165] like Figure 4-Figure 7 As shown in Figure 2, this paper analyzes the distribution characteristics of the Class Selectivity Index (CSI) and evaluates the performance of different modules in capturing image features. By comparing the CSI distribution characteristics, we can gain a deeper understanding of the feature capture capabilities of each module and its contribution to classification performance. Experimental results show that SASE > SE > CBAM > Baseline, with the SASE module having a significant advantage in CSI performance.

[0166] In the baseline model, the distribution of CSI values is relatively dispersed, with most channels concentrated in the low- to medium-range (0.6-0.8). Drawbacks: Due to the low CSI, the model performs poorly in terms of activation specificity, resulting in insufficient channel discrimination for specific categories. This may limit the model's ability to capture fine-grained features. Adding the CBAM module improves the CSI distribution compared to the baseline model, with some channels beginning to concentrate in the 0.7-0.85 range. Compared to the SE and SASE modules, CBAM still has a smaller proportion of channels with high CSI values, indicating limited feature capture. The SE module significantly outperforms CBAM in CSI distribution, with more channels concentrating in the high CSI range (0.8-0.9). The SASE module achieves the best CSI distribution. This module, through its multi-scale attention mechanism, effectively improves channel activation specificity. The number of channels in the high CSI range (above 0.9) is significantly higher than in other modules. This high CSI distribution indicates that the model has a strong ability to capture categorical features at certain levels.

[0167] S53: Comparative analysis: Compare the performance of the improved model with that of the traditional CNN model on multiple sets of experimental data to further verify the advantages of introducing multiple feature refinement modules and normalization strategies, and provide an intuitive basis for model optimization.

[0168] In the present invention, the experiment is first carried out based on the ConvNeXtV2 baseline. ConvNeXtV2 introduced the Minkowski Engine library provided by Nvidia in the pre-training stage to implement sparse convolution operations, aiming to improve the computational efficiency of the model when processing sparse data (such as point clouds or sparse images). However, when conducting preliminary experiments on the bark image dataset, the results showed that the introduction of sparse convolution did not significantly improve the recognition performance, and its performance was similar to that of the baseline model that did not use sparse convolution. This result shows that the image characteristics of the bark dataset have not fully utilized the potential advantages of sparse convolution. To this end, the present invention removed all parameters and operations related to the Minkowski Engine library in the pre-training weights in the experiment, thereby reducing the total number of model parameters by approximately 16%. This adjustment not only simplifies the training and reasoning process of the model, but also effectively reduces the consumption of computing resources. At the same time, after removing the sparse convolution, the model architecture is more in line with the design logic of conventional convolutional networks, reduces unnecessary structural complexity, and lays a solid foundation for subsequent model improvements.

[0169] In subsequent experiments, the focus turned to improving the fine-tuning (large model fine-tuning) architecture to be closer to actual application needs. Using pre-trained weights with extremely low parameter count (3.7M) as the basis, the present invention improved two key modules in the experiment: the feature refinement module (Texture-Specific Module) and the normalization module (Normalize Module). The feature refinement module is specially designed for fine-grained texture features in bark images. Through multi-scale feature extraction and local attention mechanism, it can more accurately capture key biological features such as cracks, grooves, and texture directions; while the normalization module adopts a dynamic normalization strategy to adaptively adjust the feature distribution of different image samples to ensure that the model can maintain stable feature expression under various complex acquisition conditions.

[0170] Tables 1 to 3 of this embodiment show in detail the specific effects of the proposed model in various tasks. The data in the tables cover the following aspects: (1) showing the contribution of improvements in each key module to the overall classification accuracy improvement; (2) analyzing the differences in the accuracy improvement process of different modules and their respective mechanisms of action; (3) comprehensively comparing the proposed model with current common image recognition models, verifying the significant advantages of the proposed model in terms of recognition accuracy, robustness, and key area focusing ability in the bark image recognition task.

[0171] To more intuitively demonstrate the model's performance in practical applications, this paper further employs a variety of visualization strategies widely used in the field of deep learning. These visualizations, using methods such as CAM heatmaps, feature maps, and attention distribution maps, demonstrate the model's ability to capture key details (such as cracks and grooves) during bark texture feature extraction, as well as its ability to focus on target areas against complex backgrounds.

[0172] The present invention achieves more efficient tree species identification performance by optimizing the model structure and feature extraction mechanism. While reducing the number of parameters and computational overhead, it maintains or even exceeds the classification accuracy of existing models, providing a practical and efficient solution for tree species identification tasks.

[0173] 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 bark images and a lightweight deep learning model, characterized by: The following steps are involved: S1: Collect images of the bark area of trees; S2: pre-process the collected data and locate and crop the bark area based on image segmentation technology; S3: Use the lightweight deep learning model of the improved ConvNeXtV2 framework to extract features from the preprocessed bark image; S4: After feature extraction, the adaptive feature fusion strategy is used to integrate the features, and then the tree species are classified and the tree species identification results are output; S5: Perform multi-dimensional verification and visual analysis of model performance.

2. The tree species identification method based on bark images and a lightweight deep learning model according to claim 1 is characterized in that: In S2, the collected image is processed with color correction, noise suppression and image enhancement.

3. The tree species identification method based on bark images and a lightweight deep learning model according to claim 1, characterized in that: The specific process of S3 is: S31: Using the feature refinement module, the local detail information in the bark is captured; S32: Introduce the normalization module to uniformly control the global features.

4. The tree species identification method based on bark images and a lightweight deep learning model according to claim 3 is characterized in that: In S31, the feature refinement module is used to capture the local detail information in the bark. The specific contents include: S311: Introduce the SE module to use global context information to model each channel of the input feature; S312: Introducing the CBAM module, through two complementary branches, modeling the channel dimension and spatial dimension of the input features respectively to generate attention distribution; S313: Construct a SASE model and embed spatial attention directly into the structure of the SE module to achieve a close integration of the two mechanisms.

5. The tree species identification method based on bark images and a lightweight deep learning model according to claim 4 is characterized in that: In S313, the specific implementation process of the SASE model is as follows: Channel Attention Modeling: The SASE module first performs global average pooling on the input features and generates a weight distribution in the channel dimension through two layers of fully connected operations; Spatial Attention Modeling: Based on channel attention, the SASE module further applies convolution operations to the input feature map to generate a two-dimensional spatial attention distribution; Attention Fusion: The SASE module multiplies the weight distributions of channel attention and spatial attention element-wise to generate a comprehensive attention weight matrix.

6. The tree species identification method based on bark images and a lightweight deep learning model according to claim 3, characterized in that: In S32, the normalization module includes AdGRN and 2sGRN; AdGRN: Normalization is performed by combining local and global characteristics of input data by dynamically adjusting normalization parameters; 2sGRN: Adds dual scales to improve the normalized fine-grained modeling capability by combining full-scale and half-scale feature distribution information.

7. The tree species identification method based on bark images and a lightweight deep learning model according to claim 6, characterized in that: 2sGRN first calculates the global response of the input features at two different scales, including: Full-scale response: The full-scale global response is obtained by directly calculating the second norm of the feature in the spatial dimension; Half-scale response: After downsampling the input features, the second norm is calculated to obtain the local global response on a smaller receptive field; Then, these two responses are fused through bilinear interpolation and weighting to generate the final global normalization factor.

8. The tree species identification method based on bark images and a lightweight deep learning model according to claim 7, characterized in that: The specific content of the full-scale response is: Calculate the L2 norm of the input feature X directly in the spatial dimension, calculated by channel, specifically: Among them, R f (c) represents the global response of channel c at all scales; Represents the square of the value of the input feature at the cth channel, position (i, j); H represents the height and W represents the width.

9. The tree species identification method based on bark images and a lightweight deep learning model according to claim 7, characterized in that: The specific content of the half-scale response is: Downsample the input features to obtain the downsampled features X h , specifically: in, Represents the downsampled features of the input feature at the cth channel, position (i, j), X c,i,j Represents the value of the input feature at the cth channel, position (i, j); Then calculate the L2 norm of the downsampled features: Among them, R h (c) represents the global response of channel c at half scale; Represents the downsampled feature value of the input feature at the cth channel and position (i, j), H represents the height, and W represents the width; Subsequently, weighted fusion is used to generate the final global normalization factor μ; the two-scale responses are fused using the weight factor λ: μ=λμ f +(1-λ)μ h , Among them, μ f represents the global normalization factor at all scales; μ h represents the global normalization factor at half scale.

10. The tree species identification method based on bark images and a lightweight deep learning model according to claim 1, characterized in that: The specific process of S5 is as follows: S51: Test the model using the accuracy, recall, and F1-score metrics. S52: Use heatmaps, attention maps, and feature maps to visualize the features extracted by the model; S53: Compare and analyze the performance of the improved model with the traditional CNN model on multiple sets of experimental data.

Citation Information

Cited By

  • Wheat stripe rust grading identification method based on improved YOLOv11 and ConvNeXtV2 models

    CN121236543A

  • Weak supervision intraoral photograph detection and segmentation method for early decayed teeth

    CN121810635A