# A Multi-Scale Feature Extraction Algorithm for Chinese Herbal Medicine Image Classification
## 4 MSPyraNet Architecture Design  
### FACNBlock Design  
The ConvNeXt series architecture has demonstrated outstanding performance in computer vision as a pure convolutional architecture. In ConvNeXt v2 [19], a key convolutional unit (called CNBlock) uses \(7\times 7\) large-kernel depthwise separable convolution [20] to extract features. However, due to the limitation of the receptive field, this structure struggles to capture multi-scale features, resulting in poor performance in handling different levels of features. In Chinese herbal datasets, differences between herbs may be reflected in texture, overall shape, and other levels, making it difficult to distinguish similar herbs using only \(7\times 7\) convolution. Therefore, we improved the CNBlock and designed the FACNBlock, which replaces the original \(7\times 7\) large-kernel depthwise separable convolution [20] with a multi-scale representation module to address the issue of limited receptive fields and difficulty in capturing multi-scale features caused by single-size convolution kernels. As shown in Figure 5, the multi-scale representation module consists of three parallel branches, each maintaining the spatial dimensions of the feature map, capturing multi-scale features through different convolutions or atrous convolutions [26]. In existing multi-scale fusion pyramid structure research [27], researchers used \(1\times 1\) convolution combined with multiple \(3\times 3\) convolutions with different dilation rates (6, 12, 18) to extract features. However, since Chinese herbal samples often appear in stacked forms, this design results in feature maps with excessively large receptive fields, making it difficult to effectively capture the local features of individual samples. To address this issue, we optimized the convolution kernel size to better adapt to the needs of Chinese herbal image classification tasks, ensuring accurate extraction of individual target features in stacked samples. In this study, the first branch uses \(1\times 1\) convolution to capture local detail information; the second branch uses \(3\times 3\) convolution to expand the receptive field and capture medium-scale context information; the third branch uses \(3\times 3\) atrous convolution (dilation rate of 2) to  
Figure 4: This figure shows examples of morphological diversity in the newly added Chinese herbal medicines; (**a**) illustrates the diversity of raspberry in terms of color (black, red, white, brown) and texture (plump, shriveled); (**b**) shows the processed and unprocessed forms of poria cocos, as well as differences in shape under different processing methods (lump-like, slice-like); (**c**) demonstrates the morphological differences in rhizoma phragmitis in different parts and between processed and unprocessed forms; (**d**) shows differences in the shape (rolled, strip-like, slice-like) and color (reddish-brown, claybank, gray) of cinnamon. further expand the receptive field to five while reducing computational load. The output feature maps of the three branches are batch normalized [24] and ReLU activated, then concatenated with the original input and reduced to the same spatial dimensions as the input through \(1\times 1\) convolution. This pyramid structure effectively enhances the model's ability to extract multi-scale features. Finally, the output feature map is GELU activated, and the GRN part of the CNBlock [19] is retained to enhance the contrast and selectivity between channels, preventing feature collapse, and the feature transformation is completed through \(1\times 1\) convolution, followed by a residual network [17] connection. Specifically, the input tensor \(x\in R^{C_{\text{in}}\times H\times W}\) first undergoes a layer normalization [25] operation \(LN(\cdot)\), yielding the normalized result \(x^{*}\). By normalizing along the channel dimension, the input distribution can be stabilized, ensuring that the data across these dimensions within each sample has a mean of 0 and a variance of 1.