Abstract
The authentication of wood species is of paramount significance to market regulation and product quality control in the construction industry. While classification based on microscopic wood cell structures serves as a critical reference for this task, the high inter-class similarity of cell structures and the inherent biological anisotropy of fine textures pose significant challenges to existing methods. Due to their generic design, standard deep learning models often struggle to capture these fine-grained directional features and suffer from catastrophic feature loss during global pooling, particularly under limited sample conditions. To bridge this gap between general-purpose architectures and the specific demands of wood texture analysis, this paper proposes CM-EffNet, a lightweight fine-grained classification framework based on an improved EfficientNetV2 architecture. Firstly, a data augmentation strategy is employed to expand a collected dataset of 226 wood species from 3673 to 29,384 images, effectively mitigating overfitting caused by small sample sizes. Secondly, a Coordinate Attention (CA) mechanism is integrated to embed positional information into channel attention. This allows the network to precisely capture long-range dependencies between cell walls and vessels cavities, successfully decoding the challenge of textural anisotropy. Thirdly, a MixPooling strategy is introduced to replace traditional global average pooling, enabling the collaborative extraction of background context and salient fine-grained details to prevent the loss of critical micro-features. Systematic experiments demonstrate that CM-EffNet achieves a recognition accuracy of 96.72% and a training accuracy of 98.18%. Comparative results confirm that the proposed model offers superior learning efficiency and classification precision with a compact parameter size. This makes it highly suitable for deployment on mobile terminals connected to portable microscopes, providing a rapid and accurate solution for on-site timber market regulation and industrial quality control.
1. Introduction
Wood, characterized by its renewability, serves as a fundamental material in construction, furniture manufacturing, papermaking, and the packing industry. The correct differentiation of wood species is of significant value to the regulation of the timber market and quality control in manufacturing. Classification based on microscopic wood cell structure provides a fundamental and current scientific basis for wood identification. However, traditional manual feature recognition is heavily dependent on subjective experience and is time-consuming. Furthermore, the accuracy of manual identification for wood species with similar textures is significantly compromised by inter-class similarities. Conventional methods often struggle with cross-species morphological fluctuations and variations in growth environments, typically resulting in classification accuracies below 75%. While Halime Ergun [1] applied traditional Convolutional Neural Networks (CNNs) to image classification, deep networks suffer from surging computational loads, and single-scale features often fail to distinguish similar cellular structures, making it difficult to meet the industry’s core requirements for “speed, precision, and low cost.” In contrast, the end-to-end feature extraction capabilities of deep learning offer the potential to overcome the limitations of manual experience and traditional techniques, providing core technical support for this fundamental problem. This paper utilizes an improved EfficientNetV2 model to achieve efficient classification of wood cells.
Existing machine vision approaches for wood classification primarily fall into two categories. The first focuses on learning macroscopic features such as color, texture, and growth rings using traditional machine learning. These methods mainly extract mainstream texture features, such as gray-level co-occurrence matrices [2], local binary patterns [3,4], and Gabor filters [5,6]. The second utilizes spectral imaging technology, extracting feature band information through hyperspectral or near-infrared spectroscopy and combining it with component analysis or partial least squares for species identification [7,8].
In recent years, computer vision and deep learning technologies have developed rapidly, finding wide application in the recognition of crops such as maize [9], tomato [10], and citrus [11], as well as wood defect detection. Significant advancements have also been made in automated wood species identification. For instance, Fabijańska et al. [12] proposed a residual convolutional neural network to identify tree species from macroscopic wood core images, effectively handling variable input sizes. At the microscopic level, Ergun [13] successfully applied the U-Net model to segment wood rays, demonstrating the capability of CNNs in extracting fine-grained anatomical features. While these studies and parallel advancements in medical pathological imaging [14] demonstrate the potential of deep learning in microscopic analysis, wood cell recognition presents a unique challenge due to the inherent biological anisotropy and high aspect ratio of cellular micro-structures. Unlike isotropic objects (e.g., fruits or everyday items), the discriminative visual cues of wood—such as the radial arrangement of vessels and the longitudinal extension of cell walls—are strictly directional. Therefore, we need to introduce CA [15,16].
Standard deep learning models and conventional attention mechanisms (e.g., SE, CBAM) typically rely on Global Average Pooling (GAP) to model channel interdependencies. However, GAP is mathematically ill-suited for this task: it aggressively compresses global spatial dimensions () into a single scalar. This operation effectively ‘squashes’ the elongated, directional features of wood cells into a dimensionless point, causing a loss of spatial alignment information. Consequently, general-purpose models struggle to distinguish wood species that share similar textures but differ in spatial orientation. Although attention mechanisms such as CBAM have performed well in the image classification task of corn ears [17], their channel attention modules compress features through global average pooling, resulting in severe loss of positional information. To reconcile this mismatch between wood’s geometric properties and standard pooling operations, it is imperative to adopt a mechanism capable of preserving long-range positional dependencies along orthogonal directions. Therefore, this study integrates the CA mechanism. Unlike GAP, CA decomposes channel attention into two parallel 1D feature encoding processes. This allows the network to capture long-range dependencies along one spatial direction while preserving precise positional information along the other, perfectly aligning with the directional nature of wood textures. Subsequently, a MixPooling module is introduced to address the issue of significant feature loss during pooling operations [18].
Based on these improvements, this study constructs a dataset comprising 3673 RGB images across 226 wood species, expanded to 29,384 images via augmentation. The proposed framework improves upon the EfficientNetV2 architecture by integrating CA and MixPooling modules into the MBConv block. By inserting CA before the SE and ProjectConv layers, the model performs dual optimization of channel and space on the basis of primary screening. The spatial attention of CA precisely localizes key cellular regions, while channel attention reinforces category-relevant features, significantly mitigating the feature confusion prevalent in traditional models.
To overcome the aforementioned challenges, this paper proposes CM-EffNet, a domain-specific architecture tailored for fine-grained wood cell recognition, which aims to distinguish subtle morphological differences among highly similar wood species. Specifically, we first address the inherent directionality of wood textures by integrating a CA mechanism [19,20]. Unlike standard CNNs which possess translation invariance but lack direction awareness, our approach explicitly models the anisotropic nature of wood cell textures, successfully capturing long-range dependencies along the cell growth direction. Furthermore, to prevent the loss of high-frequency micro-features, we introduce a MixPooling strategy that replaces the low-pass filtering of global average pooling. This module preserves salient cues—specifically microscopic pits and vessel boundaries—ensuring they remain distinct amidst background noise during feature aggregation. Finally, we demonstrate that this lightweight CNN, optimized with domain-specific inductive biases, offers a superior balance between accuracy and efficiency compared to heavy-weight Transformers, when validated on a systematically constructed dataset of 226 wood species.
2. Data Sources and Preprocessing
The experimental dataset utilized in this study was sourced from the InsideWood database (http://insidewood.lib.ncsu.edu/search (accessed on 13 September 2025)) [21]. Following the exclusion of categories with insufficient sample sizes (defined as fewer than 20 original images), a total of 226 distinct wood species were selected, as illustrated in Figure 1. A sufficient volume of training data is critical for mitigating overfitting and effectively enhancing the recognition rate and stability of the model. Consequently, data augmentation techniques were employed to expand the dataset. By incorporating both the augmented and original images into the training process, the robustness and environmental adaptability of the model were further improved [22,23].
Figure 1.
Dataset of wood images.
Data Enhancement Strategy
To simulate the diverse disturbances encountered in real-world image acquisition, this study employs a systematic data augmentation strategy to enhance model generalization. As illustrated in Figure 2, seven distinct transformations are applied: (1) saturation adjustment, (2) contrast modification, (3) grayscale conversion, (4) salt-and-pepper noise injection, (5) brightness attenuation, (6) brightness enhancement, and (7) random rotation. Data augmentation was strictly applied only to the training set to prevent data leakage.
Figure 2.
Data Preprocessing.
These techniques are specifically designed to improve scene adaptability by modeling physical environmental factors. Specifically, saturation and contrast adjustments mimic chromatic variations arising from color temperature shifts and wood moisture content. Brightness modifications (attenuation and enhancement) simulate extreme illumination scenarios, ensuring robustness against varying light intensities. Salt-and-pepper noise replicates artifacts caused by sensor aging or surface dust, while grayscale conversion forces the network to focus on structural texture patterns by suppressing color interference. Finally, random rotation ensures invariance to sample orientation. By transcending the limitations of ideal imaging conditions, this strategy enriches the dataset with realistic feature perturbations, thereby effectively mitigating overfitting and enhancing the model’s robustness in fine-grained wood texture classification.
3. Improvement of the Design of EfficientNetV2 Model
3.1. Improved EfficientNetV2 Architecture
In this paper, the proposed architecture is termed CM-EffNet, and its specific workflow is described as follows:
The input image, after undergoing dimension standardization and channel adaptation preprocessing, is first fed into the Stem module, where a convolution operation performs preliminary shallow feature extraction and downsampling. Subsequently, the network enters the shallow feature extraction phase (Stages 1–3), employing the Fused-MBConv module [24]. This module discards depthwise separable convolutions in favor of standard convolutions to directly encode the geometric contours and global morphological features of wood cells, thereby balancing inference efficiency with feature expression capability in the shallow layers.
Deep feature extraction (Stages 4–6) is facilitated by the MBConv module. Feature maps are first mapped to a high-dimensional space via an expansion convolution (Expansion Conv) and are then processed by depthwise separable convolutions to capture fine-grained texture details [25]. At this stage, a CA module is introduced to replace the traditional Squeeze-and-Excitation (SE) module. The CA module aggregates features along the horizontal and vertical directions via parallel 1D feature encoding. This mechanism enables the model to embed long-range positional information—such as the radial extension of cell walls and the spatial distribution of vessels—during the recalibration of channel weights. Consequently, this enhances sensitivity to directional texture features while suppressing background slice noise.
After dimensionality reduction via projection convolution, if the input and output dimensions match, the feature map is superimposed with the original input through a residual connection (Shortcut) to mitigate the vanishing gradient problem. Finally, features from each stage are aggregated into the improved classification head. This module adopts a MixPooling strategy, which fuses Global Average Pooling and Global Max Pooling to simultaneously account for overall background information and local salient features. The aggregated feature vectors undergo flattening and Dropout regularization before being passed through a fully connected layer to output the predicted probabilities for the 226 wood cell categories. The detailed model architecture is illustrated in Figure 3, and the convolutional layer specifications are provided in Table 1.
Figure 3.
Network Diagram of the Improved EfficientNetV2-S based on CA and MixPooling.
Table 1.
Feature layer information.
Input Image is the preprocessed input image (); Stem is a standard convolutional layer for preliminary feature extraction and downsampling; FusedMBConv is the fused mobile inverted residual convolution module designed for efficient shallow geometric feature extraction, where Exp denotes the channel expansion ratio, C is the output channel count, and s2 indicates a downsampling operation with a stride of 2; MBConv+CA is the mobile inverted residual module integrated with CA proposed in this paper [26], utilized to precisely capture texture directionality and positional information of wood cells in deep networks; Improved Head (MixPooling) is the modified classification head employing a mixed pooling strategy; Global AvgPool is the global average pooling layer (aggregating global background context); Global MaxPool is the global max pooling layer (extracting salient detail features such as cell pits); Concatenate represents the channel-wise concatenation operation to fuse dual-branch features; Flatten & Dropout denotes the multidimensional feature flattening and dropout layers to mitigate overfitting; Classifier is the fully connected classification layer, outputting the predicted probabilities for 226 wood cell categories.
3.2. Fused-MBConv and Stochastic Depth Mechanism
The Fused-MBConv module (Figure 4) serves as the fundamental building block for the shallow network stages (Stages 1–3) in EfficientNetV2. This design addresses the insufficient hardware utilization of traditional depthwise separable convolutions on modern GPU/TPU accelerators. By restructuring the convolutional operation flow, the module operates in two distinct modes based on the expansion ratio:
Figure 4.
Structural details of the Fused-MBConv module operating in two modes: (a) the standard residual mode with an expansion ratio of 1 and (b) the fused expansion mode with an expansion ratio 1.
Standard Residual Mode (Expansion Ratio = 1): When the input features require no channel expansion, the module functions as a standard residual block. The input feature map undergoes spatial encoding directly via a standard convolution, followed by Batch Normalization (BN) and the SiLU activation function. This mode is primarily utilized in Stage 1 to minimize computational cost during preliminary feature extraction. The process is formalized as:
where denotes the convolution operation, represents batch normalization, denotes the SiLU activation function, and denotes the DropPath (Stochastic Depth) regularization.
Fused Expansion Mode (Expansion Ratio 1): When channel up-dimensioning is required, the module adopts a fused strategy. Unlike the traditional inverted bottleneck which separates point-wise expansion from depthwise convolution, this mode employs a single fused method.
convolution is needed to simultaneously perform channel expansion and spatial feature extraction. Although this design increases the parameter count per layer, it significantly reduces Memory Access Cost (MAC) and enhances parallel computing efficiency. Subsequently, a projection convolution compresses the features to the target channel dimension. The mathematical formulation is defined as:
where represents the fused expansion convolution, and denotes the projection convolution.
Stochastic Depth Regularization:
In both operational modes, a Stochastic Depth mechanism (Figure 5), denoted as is integrated into the residual path to mitigate the vanishing gradient problem in deep networks. Distinct from standard Dropout which deactivates individual neurons, Stochastic Depth randomly drops the entire residual branch with a probability during training, while retaining the complete path during inference [27]. This mechanism effectively simulates an ensemble of sub-networks with varying depths, thereby enhancing the model’s generalization capability.
Figure 5.
The Fused-MBConv module constitutes the core of the shallow architecture. By restructuring the convolutional workflow, it effectively circumvents the high memory access overhead associated with depthwise convolutions in shallow layers. This design ensures high inference throughput while establishing a robust feature foundation for the subsequent extraction of fine-grained texture information via the MBConv and CA modules.
3.3. Coordinate Attention-Integrated MBConv Module
In the deep hierarchical stages (Stages 4–6) of EfficientNetV2, the model is tasked with precisely identifying subtle structural discrepancies in wood cells from high-dimensional semantic features. To this end, we propose an enhanced MBConv module by integrating the Coordinate Attention (CA) mechanism to replace the conventional Squeeze-and-Excitation (SE) block [26,28,29]. This structural optimization specifically addresses the loss of spatial positional information inherent in traditional channel attention mechanisms. The architecture of the improved module is illustrated in Figure 6.
Figure 6.
Architecture of the proposed MBConv module integrated with the CA mechanism.
Structurally, the module adheres to the efficient “Expand-Convolve-Squeeze” design paradigm. The input feature map is initially mapped to a high-dimensional space via a expansion convolution, enriching the nonlinear expressiveness of the channels. Subsequently, a depthwise convolution is employed to extract spatial features while maintaining channel independence. This design strategy effectively preserves the receptive field essential for deep networks while significantly reducing parameter count and computational complexity.
Crucially, given the significant directionality inherent in wood cell textures—such as the radial arrangement of vessels and the orientation of cell walls—the CA module is introduced immediately following the depthwise convolution. Distinct from the SE module [30], which compresses spatial features into a single scalar via global average pooling, CA decomposes channel attention into two parallel 1D feature encoding operations along the horizontal () and vertical () spatial directions. Formally, for an input feature map , the aggregated features (height-wise) and (width-wise) for the -th channel are computed as:
This decomposition strategy enables the network to simultaneously capture long-range spatial dependencies and preserve precise positional information. The resulting feature maps from both directions are concatenated, transformed via convolution, and activated by a Sigmoid function to generate direction-aware attention weight maps. These weights are then utilized to recalibrate the original features, compelling the model to focus on discriminative regions while effectively suppressing background noise.
Finally, the feature map, enhanced by the CA mechanism, is compressed back to a low-dimensional space via a projection convolution. To ensure effective gradient propagation and training stability, a residual connection with DropPath regularization is applied when the input and output dimensions are consistent. The final output can be formulated as:
where denotes the Coordinate Attention operation. This seamless integration ensures that the model extracts high-level semantic representations of wood cells with both high precision and robustness.
4. Experiment Setup
4.1. Experimental Environment and Hyperparameters
To guarantee the fairness and reproducibility of the experimental results, all experiments were conducted on a standardized hardware and software platform. The hardware infrastructure relied on a high-performance computing workstation equipped with an AMD Ryzen 7 9700X 8-Core processor (3.80 GHz) and an NVIDIA GeForce RTX 5060 Ti GPU (16 GB VRAM). The CUDA 11.8 architecture was utilized to accelerate the training and inference of the deep neural networks. The software environment was established on the Windows 11 operating system, with the model implemented using the PyTorch 2.0.1 deep learning framework and Python 3.9.
Regarding the training strategy, input images were standardized to a resolution of pixels to align with the optimal input dimensions of the EfficientNetV2-S backbone. The training process spanned 100 epochs with a batch size of 16. We employed the Stochastic Gradient Descent (SGD) optimizer with an initial learning rate of 0.01. A Cosine Annealing strategy was implemented to dynamically adjust the learning rate, with a decay factor set to 0.01. Furthermore, to mitigate overfitting, Label Smoothing regularization ( was adopted, and the Cross-Entropy Loss function was utilized to guide model convergence.
4.2. Evaluation Metrics
To comprehensively evaluate the performance of the proposed model, the following metrics were employed: Training Accuracy (), Validation Accuracy (), Recall (), Precision (), and F1-Score ().
4.3. Dataset Preprocessing
During the model input phase, a sequential three-step data processing pipeline was implemented, comprising Image Resizing, Normalization, and Channel Adaptation.
Specifically, Image Resizing standardizes all input images to a fixed resolution of pixels, as required by the model architecture, ensuring dimensional consistency for subsequent feature extraction. Normalization is applied to standardize the distribution of pixel values, thereby eliminating scale discrepancies; this step effectively accelerates model convergence and enhances the stability of the feature extraction process. Finally, Channel Adaptation converts single-channel microscopic wood images into a three-channel format to align with the input channel requirements of the network. Collectively, these preprocessing steps provide inputs that are unified in scale, statistically stable, and compatible in channel dimensions, laying a solid foundation for the effective extraction of fine-grained wood cell features.
4.4. Convergent Prediction
As shown in Figure 7, The training trajectory initiates with a rapid adaptation phase spanning epochs 0 to 20, characterized by a steep ascent in both Training and Validation accuracies. It is particularly noteworthy that the validation accuracy marginally surpasses the training accuracy within the first 15 epochs. This phenomenon is primarily attributed to the rigorous data augmentation strategy applied to the training set, which introduces additional complexity relative to the unaugmented validation set, thereby demonstrating the strong initial transferability of the pre-trained weights regarding wood texture features.
Figure 7.
Model Convergence Test Image.
Subsequently, the model transitions into an oscillatory ascent phase (epochs 20–50). As the feature extraction mechanism deepens, the network begins to encode finer-grained anatomical characteristics, such as cell walls and pits. During this period, the validation accuracy exhibits minor fluctuations while maintaining an overall upward trend. Such oscillations are characteristic of Stochastic Gradient Descent (SGD) when navigating non-convex loss surfaces in search of a global optimum [31], and further reflect the inherent challenge in discriminating between the subtle features of highly similar wood species.
Ultimately, the training enters a steady-state convergence phase (epochs 50–100). Upon reaching epoch 60, the training accuracy gradually converges to approximately 99%, indicating that the model has fully fitted the underlying data distribution. Concurrently, the validation accuracy stabilizes within the high-performance range of 90%–92% with negligible variance. Crucially, the absence of any significant degradation in validation performance serves as compelling evidence that the integration of the MixPooling strategy and Label Smoothing has effectively mitigated overfitting, thereby guaranteeing the model’s robust generalization capability.
5. Results and Discussion
5.1. Ablation Experiment
To quantify the individua contribution of the proposed improvement strategies to the fine-grained classification performance of wood cells, we conducted stepwise ablation experiments on the EfficientNetV2-S baseline model. The experiments targeted the univariate and combined effects of two core modules: MixPooling and CA. The specific results are presented in Table 2.
Table 2.
Comparison of Model Performance with and without Different Modules.
Initially, the baseline evaluation demonstrates that the feature extraction efficiency of the EfficientNetV2-S significantly surpasses that of the V1 version. Even without the introduction of any modification modules, the original EfficientNetV2-S achieved a classification accuracy of 93.34% and an F1-score of 91.85%. This high baseline performance validates the adaptability of the Fused-MBConv module to microscopic wood images: this structure effectively encodes the global morphology and geometric contours of cell slices through the direct mapping of convolutions, providing a robust feature space for subsequent fine-grained feature mining. Consequently, EfficientNetV2-S was selected as the robust baseline for this study.
Subsequently, regarding the impact of Coordinate Attention on directional structures, integrating the CA module alone into the baseline resulted in a significant individual performance boost, with accuracy surging to 95.42% and the F1-score reaching 95.84%. Wood anatomical structures exhibit high directional dependency, such as the radial or tangential arrangement of vessels and the extension direction of rays. Traditional channel attention mechanisms compress spatial features into a single scalar, inevitably losing this critical positional information. In contrast, the CA module embeds precise positional awareness into the channel weighting process via a decomposition-aggregation strategy along horizontal and vertical directions. This mechanism compels the model to attend to the spatial alignment patterns of cellular structures, thereby exhibiting higher sensitivity when distinguishing tree species with similar textures but distinct spatial distributions.
Furthermore, the introduction of the MixPooling strategy demonstrates its fidelity in preserving texture details, raising the accuracy to 94.31% and increasing the F1-score by 4.99%. Traditional Global Average Pooling (GAP) essentially functions as a low-pass filter, tending to smooth out high-frequency information in feature maps, which causes minute but discriminative texture details in wood cells to be diluted by background noise. MixPooling, by incorporating a Global Max Pooling (GMP) branch, forces the network to retain local salient features with the strongest responses. The synergistic operation of GAP and GMP enables the model to recover smoothed texture edge information while aggregating global background context, effectively reducing misclassification caused by feature loss.
Ultimately, the complete model integrating both CA and MixPooling achieved the highest accuracy of 96.32% and an F1-score of 97.57% outperforming any single-module improvement version. This indicates that the two improvement strategies possess complementarity in the feature dimension: the CA module resolves the spatial localization problem of “where the features are,” while MixPooling addresses the detail retention problem of “what the features are.” Their synergistic effect enables the network to construct a complete feature pyramid ranging from global directional perception to local texture details, maximizing the representation capability of the model on complex wood cell images.
5.2. Comparative Performance Analysis
To comprehensively evaluate the competitiveness of the proposed architecture in fine-grained wood cell classification, we benchmarked it against five representative deep learning models. These include the lightweight MobileNetV3-Large [32], classic convolutional architectures (ResNet-50, DenseNet-121) [33,34], the cutting-edge Vision Transformer (Swin-T) [35], and the original baseline (EfficientNetV2-S). The comparative results, illustrating both classification accuracy and model complexity, are presented in Figure 8.
Figure 8.
Comparison of accuracy and model parameters across different architectures.
Regarding classification precision, as depicted by the blue bars, the proposed CM-EffNet achieved a peak accuracy of 96.32%, significantly outperforming all baseline comparisons. While the parameter count exceeds that of MobileNetV3, it is important to note that wood cell identification is typically conducted on servers or high-performance terminals, where the demand for extreme lightweighting is less critical than in real-time video processing. Crucially, our model maintains a lower parameter footprint (22.8 M) compared to Swin-T (28.3 M) and ResNet-50 (25.6 M) while achieving superior precision. Despite being representative deep networks, ResNet-50 and DenseNet-121 lagged behind with accuracies of 95.80% and 96.15%, respectively. This suggests that merely increasing network depth or feature reuse is insufficient to resolve the fine-grained identification challenges of microscopic wood textures. Notably, the proposed method even surpassed the self-attention-based Swin Transformer. A critical finding from our comparative analysis is the superior performance of CM-EffNet over the Swin Transformer (Swin-T). While Transformers generally excel in regime-heavy data scenarios due to their dynamic attention span, they lack the specific inductive biases required for learning from limited biological samples. Our results suggest that for specialized biological datasets with constrained sample sizes, a CNN with optimized inductive biases—specifically the direction-aware constraints imposed by Coordinate Attention—offers superior data efficiency compared to the purely data-driven self-attention mechanism of Swin-T.
The Swin-T model, lacking inherent assumptions about local connectivity and directionality, requires massive amounts of data to learn the spatial invariants that are already ‘hard-wired’ into our CM-EffNet. Therefore, by embedding the prior knowledge of wood anisotropy directly into the network structure via CA, our model achieves faster convergence and higher precision without the prohibitive data costs associated with Vision Transformers.
In terms of model efficiency, the red line in the figure intuitively reflects the parameter efficiency of each model. Although DenseNet-121 excels in parameter count, its high memory access cost during inference limits deployment flexibility, and its accuracy remains suboptimal. In contrast, the proposed model stabilizes at approximately 22.8 M parameters. Compared to the original EfficientNetV2-S baseline, the integration of MixPooling and CA modules incurred a marginal parameter increase of only 1.3 M. However, this negligible computational cost yielded a significant accuracy improvement of 2.98%, demonstrating an extremely high cost-performance ratio. Collectively, the proposed model achieves an optimal balance between accuracy and complexity, proving to be an ideal solution for large-scale wood cell classification tasks that demand both efficiency and precision.
5.3. Confusion Matrix Analysis
To further visualize the specific impact of the proposed improvement strategies on wood cell classification performance and to analyze the misclassification details, this study plotted the confusion matrices for both the baseline and the improved models (as shown in Figure 9 and Figure 10). To clearly present the model’s performance on “hard-to-distinguish” categories, the figure employs a mixed sampling strategy, highlighting easily confused classes alongside representative high-accuracy ones.
Figure 9.
Confusion matrix of the original EfficientNetV2-S model. (Red numbers represent recognition accuracy less than 0.5.).
Figure 10.
Confusion matrix of the CM-EffNet model. (Red numbers represent recognition accuracy less than 0.5.).
The confusion matrix of the baseline model (as shown in Figure 9) reveals that the network struggles to distinguish wood species with highly similar texture patterns. While the model exhibits reasonable sensitivity for categories with distinct features—such as Betula pendula (Class 43, 0.85) and Tilia platyphyllos (Class 202, 0.86)—it suffers from severe misclassification on texturally complex “hard samples.” Specifically, for Abies alba (Class 2) and Tsuga canadensis (Class 215), the classification accuracies are only 0.33 and 0.43, respectively. As indicated by the distinct dark patches in the off-diagonal regions, the model tends to confuse these categories with closely related species sharing similar texture structures. Biologically, both A. alba and T. canadensis are non-porous softwoods lacking resin canals, characterized by a homogeneous matrix of tracheids. This structural uniformity creates highly similar “visual fingerprints, “suggesting that the original convolutional features fail to capture the “visual fingerprints” needed to differentiate these subtle local texture details and directional information.
In contrast, the confusion matrix of the improved CM-EffNet (as shown in Figure 10) demonstrates a remarkable improvement in diagonal concentration, indicating a substantial boost in prediction confidence. The darker blue diagonal blocks confirm that the model effectively mitigates the interference of background noise and similar texture features, achieving classification accuracies exceeding 90% for the vast majority of categories. Most notably, the recognition accuracy for the previously “hard-to-distinguish” long-tail categories has increased drastically. For instance, the accuracy for Class 2 surged from 0.33 to 0.81, and Class 215 improved from 0.43 to 0.91. The significant reduction in off-diagonal noise confirms that the model effectively suppresses misclassification while ensuring high recall, achieving dual optimization in terms of “recognition precision” and “discrimination clarity”.
These improvements can be attributed to the synergistic effects of the proposed modules. The CA module establishes a spatial orientation for feature extraction, while MixPooling enhances the fidelity of detail retention. Consequently, the collaborative action of these two strategies enables the network to construct a high-performance classification framework with strong interpretability, effectively addressing the fine-grained classification bottleneck inherent in wood texture analysis.
To further evaluate the robustness of the proposed architecture, we specifically isolated the top-5 most challenging wood species where the baseline model struggled to achieve satisfactory recognition rates (accuracy below 60%). As illustrated in Figure 11, the baseline EfficientNetV2-S exhibits significant limitations in distinguishing these categories, particularly for Class 2 and Class 215, where classification sensitivities stagnated at a mere 0.33 and 0.43, respectively. This underperformance suggests that the standard convolutional operations in the baseline model fail to capture the subtle discriminative features required to separate these highly similar wood textures.
Figure 11.
Performance comparison on challenging wood species. The bar chart highlights the significant accuracy improvements of the proposed CM-EffNet (Ours) over the Baseline EfficientNetV2-S on the five most difficult categories. The specific values indicate the normalized sensitivity (recall) for each class.
In sharp contrast, the proposed CM-EffNet achieves a remarkable performance leap across all these difficult categories. Most notably, the recognition accuracy for Class 86 reached perfection (1.00), while Class 215 witnessed a substantial improvement of nearly 48 percentage points, jumping to 0.91. Similarly, Class 2 saw its accuracy more than double, rising from 0.33 to 0.81. These gains are not merely numerical improvements but directly validate the effectiveness of the architectural enhancements. The integration of Coordinate Attention (CA) plays a pivotal role here by embedding long-range positional information into the feature maps. This allows the model to capture the specific directional arrangement of vessels and rays, which are features that are crucial for distinguishing these specific species but were previously ignored by the baseline. Furthermore, the MixPooling strategy ensures that the faint, fine-grained texture details of these “hard” samples are preserved during downsampling rather than being smoothed out. Consequently, the proposed model successfully disentangles these visually confusing categories, verifying its superior capability in handling fine-grained classification bottlenecks.
5.4. Visualization Analysis of Feature Attention
To intuitively verify the effectiveness of the improved model in capturing fine-grained features of wood, this study employed the Grad-CAM technique to visualize the decision-making regions of both the baseline ResNet34 and the improved ResNet34 model. We selected six representative wood species samples, divided into three groups based on their texture characteristics: (1) tracheid arrangement, (2) sparse vessels with light backgrounds, and (3) dense textures with abundant vessels. Figure 12 compares the heatmaps generated by the two models.
Figure 12.
Visualization analysis of feature attention regions for six typical wood cells arrangements. Subfigures (a,b) correspond to the category of (1) tracheid arrangement; (c,d) correspond to (2) sparse vessels with light backgrounds; (e,f) correspond to (3) dense textures. For each subfigure, the three columns represent the Original microscopic image, the visualization result of Baseline (V2-S), and the visualization result of Ours (CA-MixPool), respectively.
To deeply investigate the specific mechanisms of the proposed improvement strategies in handling complex anatomical characteristics of wood, we utilized Grad-CAM to conduct a comparative heatmap analysis on three categories of representative samples with distinct structural differences. As shown in Figure 11, each row corresponds to a typical anatomical scenario: (1) uneven staining with bubble interference, (2) typical cross-laminated texture, and (3) irregular cell arrangement rich in vessels. The columns display the original image, the heatmap from the baseline EfficientNetV2-S, and the heatmap from the proposed CM-EffNet, respectively. These samples encompass three typical challenges: preparation quality artifacts, highly compact and anisotropic cellular patterns, and irregular microstructures, aiming to verify the feature focusing capability of the CA and MixPooling modules under different recognition difficulties.
(1) Enhanced Interference Resistance and Noise Suppression: The first row illustrates a scenario characterized by uneven slice staining and bubble artifacts. As observed in specific a, the original image contains distinct bubble pseudo-shadows and non-uniformly stained regions. In the absence of improvement modules, the heatmap of the baseline model exhibits significant divergence, erroneously assigning high response values to bubble edges and deeply stained non-cellular areas. This indicates that the original network is easily misled by preparation flaws and struggles to decouple effective features from background noise. In contrast, the heatmap of the improved model demonstrates an extremely high signal-to-noise ratio; the highlighted regions precisely lock onto the blurred cell wall structures, completely ignoring the bubble interference. This result confirms that the MixPooling strategy, by reinforcing the response weights of salient features through the max-pooling branch, enables the model to penetrate the noise layer of low-quality images and robustly extract critical anatomical features.
(2) Precise Encoding of Directional Textures: The second row features samples with typical cross-laminated textures and extremely high cell density. The baseline model’s heatmap presents a disordered, clumped distribution on such samples, failing to reflect the geometric regularity of the wood cell arrangement. Conversely, the improved model integrated with the CA module exhibits a distinctly different attention pattern: the heatmap shows clear strip-like extensions along the direction of cell growth, highly consistent with the radial and tangential textures of the wood. This acute capture of directional features is attributed to the spatial decomposition mechanism of the CA module. By aggregating features along the X and Y axes respectively, the network successfully encodes long-range positional dependencies, thereby enabling correct decision-making based on the spatial topological structure of cell arrangements even when textures are extremely similar.
(3) Capture of Micro-Details and Structural Complexity: Regarding the samples in the third row, which feature irregular cell arrangements and complex micro-textures, the baseline model’s attention often omits scattered anatomical details, focusing solely on local large-area fiber tissues. On the other hand, the improved model’s heatmap displays strong point-like activations at distinct cell lumen locations and adapts flexibly to the irregularity of the cell arrangement, covering all key anatomical points. This demonstrates a synergistic effect between the positional awareness of the CA module and the detail retention capability of MixPooling: the former assists the model in localizing irregularly distributed target regions, while the latter ensures that minute structural features are not lost during downsampling, significantly enhancing the identification precision for complex anatomical structures.
In conclusion, the visual analysis of these six typical wood cell categories reveals that the proposed improvement strategies successfully resolve the issues of “attention divergence” and “detail loss” prevalent in traditional convolutional networks for wood cell recognition. The Coordinate Attention module establishes the spatial orientation for feature extraction, while MixPooling enhances the fidelity of detail retention. Their synergistic action constructs a high-performance classification model with strong interpretability.
6. Conclusions
This study addressed the challenge of fine-grained classification in wood cell images, a task complicated by high inter-class textural similarity and the difficulty of capturing subtle micro-features. Built upon the lightweight EfficientNetV2-S architecture, we proposed an enhanced framework integrating CA and MixPooling strategies, aiming to investigate how to achieve high-precision representation of microscopic wood structures under limited computational resources.
Experimental results demonstrate that the proposed model achieves superior classification performance on a dataset of 226 wood cell types, attaining an accuracy of 96.72%. This significantly outperforms mainstream architectures such as ResNet-50, MobileNetV3, and Swin Transformer. Ablation studies confirmed that the CA module, by embedding direction-aware information, effectively resolved the positional loss inherent in traditional channel attention mechanisms, thereby significantly enhancing the model’s sensitivity to cell arrangement orientation. Concurrently, the MixPooling strategy successfully preserved key micro-structures, such as pits, by fusing global background context with local salient features, overcoming the issue of feature dilution. Theoretically, this research provides evidence that for specific biological texture tasks, a convolutional network with strong inductive biases combined with spatial attention mechanisms offers higher data efficiency compared to general-purpose Transformer architectures. Practically, the model achieves high-performance recognition with a minimal parameter footprint of approximately 22.8 M, providing a viable technical path for developing low-power, real-time handheld wood identification devices. This holds significant value for maintaining timber market order and enhancing construction quality control.
Nevertheless, certain limitations remain. First, the current dataset relies on slice images acquired under standard laboratory lighting; the model’s robustness under complex on-site illumination or poor slice quality requires further verification. Second, while representative, the coverage of 226 tree species is still insufficient compared to the vast global library of wood types.
Future research will focus on two directions: constructing an open dataset covering a broader range of species and varying preparation qualities to further extend the model’s generalization boundaries; and exploring lightweight deployment technologies to deploy the model onto mobile devices for offline inference, thereby truly driving the intelligence and popularization of wood anatomical identification.
Author Contributions
Conceptualization, C.G. and L.Z.; methodology, C.G. and L.Z.; software, C.G.; validation, C.G. and L.Z.; formal analysis, C.G.; investigation, C.G.; resources, L.Z.; data curation, C.G.; writing—original draft preparation, C.G.; writing—review and editing, C.G. and L.Z.; visualization, C.G.; supervision, L.Z.; project administration, L.Z.; funding acquisition, L.Z. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Central Guidance on Local Science and Technology Development Fund (grant number 23-3-1-zyyd-nsh), the Shandong Provincial Key Research and Development Program (grant number 2024TSGC0205), and the Science and Technology Key Project of the Division and City (grant number 2024GG1502).
Data Availability Statement
Publicly available datasets were analyzed in this study. This data can be found here: http://insidewood.lib.ncsu.edu/search (accessed on 13 September 2025).
Conflicts of Interest
The authors declare no conflict of interest.
References
- Ergun, H. Wood identification based on macroscopic images using deep and transfer learning approaches. PeerJ 2024, 12, e17021. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hu, Y.; Wang, Z.; Fan, X.; Li, J.; Gao, A. Material microstructures analyzed by using gray level Co-occurrence matrices. Chin. Phys. B 2017, 26, 098104. [Google Scholar] [CrossRef] [Scilit]
- Pan, Z.; Wu, X.; Li, Z. Scale-adaptive local binary pattern for texture classification. Multimed. Tools Appl. 2019, 79, 5477–5500. [Google Scholar] [CrossRef] [Scilit]
- Yin, H.; Chen, Y.; Xiong, J.; Xia, R.; Xie, J.; Yang, K. An improved local binary pattern method for pollen image classification and recognition. Comput. Electr. Eng. 2021, 90, 106983. [Google Scholar] [CrossRef] [Scilit]
- Yang, X. Gabor Filter Optimization Design for Iris Texture Analysis. J. Bionic Eng. 2004, 1, 72–78. [Google Scholar] [CrossRef] [Scilit]
- Jia, L.; Chen, C.; Liang, J.; Hou, Z. Fabric defect inspection based on lattice segmentation and Gabor filtering. Neurocomputing 2017, 238, 84–102. [Google Scholar] [CrossRef] [Scilit]
- Park, S.-Y.; Kim, J.-H.; Kim, J.-C.; Yang, S.-Y.; Yeo, H.; Choi, I.-G. Classification of softwoods using wood extract information and near infrared spectroscopy. BioResources 2021, 16, 5301–5312. [Google Scholar] [CrossRef] [Scilit]
- Huang, Y.; Meng, S.; Hwang, S.-W.; Kobayashi, K.; Sugiyama, J. Neural network for classification of Chinese zither panel wood via near-infrared spectroscopy. BioResources 2019, 15, 130–141. [Google Scholar] [CrossRef] [Scilit]
- Cai, J.; Pan, R.; Lin, J.; Liu, J.; Zhang, L.; Wen, X.; Chen, X.; Zhang, X. Improved EfficientNet for corn disease identification. Front. Plant Sci. 2023, 14, 1224385. [Google Scholar] [CrossRef] [Scilit]
- Wen, J.; He, J. Agricultural development driven by the digital economy: Improved EfficientNet vegetable quality grading. Front. Sustain. Food Syst. 2024, 8, 1310042. [Google Scholar] [CrossRef] [Scilit]
- Rukuna, A.L.; Zambuk, F.U.; Gital, A.Y.; Bello, U.M. Citrus diseases detection and classification based on efficientnet-B5. Syst. Soft Comput. 2025, 7, 200199. [Google Scholar] [CrossRef] [Scilit]
- Fabijańska, A.; Danek, M.; Barniak, J. Wood species automatic identification from wood core images with a residual convolutional neural network. Comput. Electron. Agric. 2021, 181, 105941. [Google Scholar] [CrossRef] [Scilit]
- Segmentation of Rays in Wood Microscopy Images Using the U-Net Model: BioResources. Available online: https://bioresources.cnr.ncsu.edu/ (accessed on 4 January 2026).
- Ding, J.; Yue, C.; Wang, C.; Liu, W.; Zhang, L.; Chen, B.; Shen, S.; Piao, Y.; Zhang, L. Machine learning method for the cellular phenotyping of nasal polyps from multicentre tissue scans. Expert Rev. Clin. Immunol. 2023, 19, 1023–1028. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Li, X.; Wu, Y.; Tang, C.; Fu, Y.; Zhang, L. Improving generalization of convolutional neural network through contrastive augmentation. Knowl.-Based Syst. 2023, 272, 110543. [Google Scholar] [CrossRef] [Scilit]
- Ren, K.; Tao, Q.; Han, H. A lightweight object detection network in low-light conditions based on depthwise separable pyramid network and attention mechanism on embedded platforms. J. Frankl. Inst. 2023, 360, 4427–4455. [Google Scholar] [CrossRef] [Scilit]
- Xu, J.; Lan, J.; Lv, G.; Ma, D. Corn variety identification based on improved EfficientNet lightweight neural network. Front. Plant Sci. 2025, 16, 1603073. [Google Scholar] [CrossRef] [Scilit]
- Tong, Z.; Tanaka, G. Hybrid pooling for enhancement of generalization ability in deep convolutional neural networks. Neurocomputing 2019, 333, 76–85. [Google Scholar] [CrossRef] [Scilit]
- Guan, X.; Zhu, S.; Wan, X.; Wu, Y. STARNeT: Multidimensional spatial–temporal attention recall network for accurate encrypted traffic classification. J. Netw. Comput. Appl. 2025, 236, 104109. [Google Scholar] [CrossRef] [Scilit]
- Xiao, M.; Yang, B.; Wang, S.; Zhang, Z.; He, Y. Fine coordinate attention for surface defect detection. Eng. Appl. Artif. Intell. 2023, 123, 106368. [Google Scholar] [CrossRef] [Scilit]
- InsideWood. 2004-Onwards. Published on the Internet. Available online: http://insidewood.lib.ncsu.edu/search (accessed on 11 October 2025).
- Wheeler, E.A. InsideWood—A Web Resource for Hardwood Identification. IAWA J. 2011, 32, 199–211. [Google Scholar] [CrossRef] [Scilit]
- Wheeler, E.A.; Gasson, P.E.; Baas, P. Using the InsideWood Web Site: Potentials and Pitfalls. IAWA J. 2020, 41, 412–462. [Google Scholar] [CrossRef] [Scilit]
- Bang, J.-H.; Park, S.-W.; Kim, J.-Y.; Park, J.; Huh, J.-H.; Jung, S.-H.; Sim, C.-B. CA-CMT: Coordinate Attention for Optimizing CMT Networks. IEEE Access 2023, 11, 76691–76702. [Google Scholar] [CrossRef] [Scilit]
- Huang, X.; Qu, H.; Lv, M.; Yang, J. Fault Diagnosis of Rolling Bearings Based on Spectral Kurtosis Graph and LFMB Network. Russ. J. Nondestruct. Test. 2023, 59, 886–901. [Google Scholar] [CrossRef] [Scilit]
- Khan, Z.Y.; Niu, Z. CNN with depthwise separable convolutions and combined kernels for rating prediction. Expert Syst. Appl. 2021, 170, 114528. [Google Scholar] [CrossRef] [Scilit]
- Bui, T.D.; Pham, T.T.; Dang, T.L. CoNet: A lightweight color classification architecture using residual connection and MBConv. Neural Comput. Appl. 2025, 37, 9705–9720. [Google Scholar] [CrossRef] [Scilit]
- Huang, G.; Sun, Y.; Liu, Z.; Sedra, D.; Weinberger, K. Deep Networks with Stochastic Depth. arXiv 2016. [Google Scholar] [CrossRef] [Scilit]
- Xiao, G.; Yao, J.; Zhong, L.; Xiao, Z.; Lu, J. MB-ViT: MBConv vision transformer with time–frequency feature fusion for bearing fault diagnosis. Neural Comput. Appl. 2025, 37, 22801–22825. [Google Scholar] [CrossRef] [Scilit]
- Choi, J.; Seo, D.; Jung, J.; Han, Y.; Oh, J.; Lee, C. Cloud Detection Using a UNet3 Model with a Hybrid Swin Transformer and EfficientNet (UNet3 STE) for Very-High-Resolution Satellite Imagery. Remote Sens. 2024, 16, 3880. [Google Scholar] [CrossRef] [Scilit]
- Xin, R.; Khan, U.A.; Kar, S. An Improved Convergence Analysis for Decentralized Online Stochastic Non-Convex Optimization. IEEE Trans. Signal Process. 2021, 69, 1842–1858. [Google Scholar] [CrossRef] [Scilit]
- Yehulu, G.T.; Walle, Y.M.; Haile, M.B.; Yohannes, S.T.; Tegegne, A.G.; Tesfaye, D.G.; Baye, G.A. Mango fruit disease detection and classification using MobileNetV3_large model. Sci. Afr. 2025, 30, e03061. [Google Scholar] [CrossRef] [Scilit]
- Arulananth, T.S.; Prakash, S.W.; Ayyasamy, R.K.; Kavitha, V.P.; Kuppusamy, P.G. Chinnasamy, Classification of Paediatric Pneumonia Using Modified DenseNet-121 Deep-Learning Model. IEEE Access 2024, 12, 35716–35727. [Google Scholar] [CrossRef] [Scilit]
- Two Streams ResNet-50 Network for Infrared and Visible Image Fusion|Multimedia Tools and Applications, (n.d.). Available online: https://link.springer.com/article/10.1007/s11042-025-20869-0?utm_source=xmol&utm_medium=affiliate&utm_content=meta&utm_campaign=DDCN_1_GL01_metadata (accessed on 10 December 2025).
- GRA-Net: Group Response Attention for Deep Learning—ScienceDirect. Available online: https://www.sciencedirect.com/science/article/abs/pii/S0925231224010439?via%3Dihub (accessed on 10 December 2025).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.











