1. Introduction
Sun-dried wild ginseng is an essential medicinal herb in traditional Chinese medicine. It possesses various pharmacological activities and nutritional components. It is believed to have a solid qi-boosting effect, enhancing the body’s resistance and immune function. Therefore, it is often used to prevent and treat various diseases, particularly chronic illnesses, in individuals with weakened immunity. It is also regarded as an effective remedy for combating fatigue and aging. It is suitable for those experiencing physical and mental fatigue, helping restore energy and delay aging, positively impacting human health. The primary part of ginseng is its root, which has unique medicinal value [
1]. The root is long and conical, with a light yellow or brown surface and a firm texture [
2].
Traditional classification of wild ginseng relies mainly on morphological characteristics, such as root shape, epidermal color, and internal structure. These methods are time-consuming, labor-intensive, and require high expertise from the identifier, making them susceptible to subjective factors. Although chemical composition analysis can provide accurate classification, the process is complex, costly, and destructive to samples, making it unsuitable for large-scale applications. By employing image classification technology, one can utilize features such as shape, color, and texture from images to assist in determining the variety and quality of ginseng, thus improving classification accuracy and efficiency. Additionally, wild ginseng cultivation is a vast industry where different varieties and origins significantly vary in market value. Therefore, image classification technology can rapidly identify wild ginseng products, helping consumers purchase products that meet their needs, preventing counterfeit and inferior products, and protecting consumer rights [
3]. Finally, as an essential medicinal herb, wild ginseng has significant application value in the informatization management of medicinal materials, production quality control, and scientific research in medicinal material cultivation. By analyzing and processing image data of sun-dried wild ginseng, more botanical features, pharmacological active ingredients, and their correlations can be discovered, aiding in the in-depth study of the pharmacological effects and medicinal value of sun-dried wild ginseng, promoting scientific advancement in related fields [
4].
Li et al. enhanced a self-built dataset by introducing an attention mechanism and using a Focal Loss function, addressing the issue of dataset imbalance, ultimately improving the recognition accuracy by 1.72% compared to the original model, with promising experimental results [
5]. In 2023, Zhai et al. used a self-built dataset and proposed replacing the original activation function GELU with the PReLU activation function [
6]. This change enhanced the nonlinear representation capability of the neural network, significantly improving the model’s performance and efficiency and validating the importance of deep learning in medicinal material classification. Liao et al. proposed a rice disease image classification method based on transfer learning built on the VGG19 convolutional neural network [
7]. By utilizing the VGG19 network pre-trained on the ImageNet dataset, they transferred and adjusted relevant parameters, establishing a technical process for rice disease image classification and achieving high model accuracy. Wang et al. improved fine-grained feature extraction by integrating features from EfficientNet-B0 and DenseNet121 models and introducing a Focal Loss function combined with label smoothing, enabling accurate identification of small and similar characteristic apple leaf spots in natural environments [
8]. Although the improved model is more significant and inference time is longer than a single model, its average precision increased by 12.29%.
In 2017, Howard et al. introduced MobileNets, a lightweight deep neural network based on a streamlined architecture using depthwise separable convolutions. They introduced two simple global hyperparameters for practical trade-offs between latency and accuracy, maintaining strong performance compared to other ImageNet classification models at the time [
9]. Xie et al. improved ResNet with the concept of grouped convolutions, resulting in the iterative convolutional neural network ResNeXt, which uses fewer parameters and achieves lower error rates with the same computational load, yielding better results in image classification [
10]. V. Krishna Pratap et al. adapted the final fully connected layer and output neurons of EfficientNetB4 to differentiate various chili leaf diseases meticulously, employing data preparation techniques like scaling, pixel normalization, and augmentation to enhance model resilience, enabling the model to recognize image variations in chili leaves due to light, angles, and disease severity, achieving an improved average accuracy of 91.2%, demonstrating deep learning’s potential in addressing specific agricultural issues and extending its applications to different crops [
11].
In 2023, Li et al. used AlexNet as a base model to study 10 types of medicinal herbs, employing ridge regression and transfer learning to effectively alleviate overfitting and analyze multiple common data, achieving a high recognition accuracy of 95.4% [
12]. Han et al. improved the DenseNet-201 model, using 50 types of medicinal slices as a dataset [
13]. To prevent overfitting due to excessive parameters in the fully connected layer, they used dropout, randomly setting 50% of the elements, enriching feature learning diversity, enhancing each feature’s contribution to model prediction, and strengthening the regularization effect during training. Wang et al. proposed a method for identifying medicinal materials based on an improved TCM-Net, introducing an attention mechanism and improved mobile inverted bottleneck convolution modules, ensuring network lightness while significantly enhancing the accuracy of medicinal material recognition [
14]. Zhang et al. used SE-MobileNetV2 as a base model, employing the Momentum optimization algorithm and ReLU6 activation function, training the network model for the recognition task of traditional Chinese medicine powder microscopic identification images [
15]. Experimental results showed an overall recognition accuracy of 97.5% in the eight tested types of medicinal powder microscopic identification images.
Based on previous experiments and literature review, we determined that convolutional neural networks can classify and identify medicinal materials, addressing issues such as excessive reliance on manual classification and traditional methods’ relatively low accuracy and slow classification speed. Considering computational load, parameter count, and model size, the ResNeXt50 model was chosen as the base model. This experiment designed an improved ResNeXt50 model to achieve fast and accurate classification of sun-dried wild ginseng grades. The critical improvement involves replacing the three-layer convolution in the Bottleneck structure with the Ghost module, reducing computational load and increasing classification efficiency while ensuring accuracy. Additionally, the SE (Squeeze and Excitation) attention mechanism was used to highlight essential features of sun-dried wild ginseng and suppress irrelevant or unimportant features [
16]. The ELU (Exponential Linear Unit) activation function was employed to extract finer-grained features, enhancing the overall recognition accuracy of the model and thereby addressing the challenging problem of classifying sun-dried wild ginseng [
17].
6. Discussion
By classifying ginseng, a scientific quality evaluation system can be established to help the ginseng industry with quality control, ensuring product quality and safety. Using deep learning technology dramatically saves labor and avoids the subjectivity of manual classification, thereby improving the efficiency of ginseng classification and enabling sustainable development of the ginseng industry. This paper proposes an improved ResNeXt50 network model tailored to the features of forest-grown ginseng. The conclusions drawn from the experiments are as follows:
1. A ginseng dataset was constructed and classified into four different grades: premium-class, first-class, second-class, and ordinary ginseng. Data augmentation was performed on the dataset to enhance its diversity. ResNeXt50 was chosen as the base model, with the Ghost module replacing the three-layer convolution of the Bottleneck structure, maintaining excellent performance while reducing computational load. The ReLU activation functions after the three-layer convolution were replaced with ELU activation functions to avoid dead neurons and accelerate convergence. SE attention mechanisms were added to the second and third layers of the model to capture key ginseng features more accurately, improving the model’s accuracy and generalization ability.
2. The improved ResNeXt50 model achieved an accuracy of 93.14% and a recall of 91.75% on the self-constructed dataset. Its parameter size was 74.47MB, and each training epoch took only 76 s. The accuracy and F1 score improved by 9.76% and 8.99%, respectively.
3. The misclassification rate for ordinary ginseng is relatively high. Through an objective model analysis, the primary direction for future experiments is to enhance the model’s expressive capabilities further and balance the quantity of each class in the dataset, thereby increasing the correct classification rate for ordinary ginseng.
The improved model shows significant accuracy parameter size advantages and commendable convergence speed, contributing to the development of ginseng classification. In summary, the improvements positively enhance the model, demonstrating the feasibility of modifying the original model.