A Method and System for Identifying the Origin of Pinellia ternata Based on Multi-Scale Feature Deep Neural Networks

By using a hybrid iterative network combining a multi-scale feature deep neural network with MBConv and Swin Transformer modules, the problems of accuracy and efficiency in identifying the origin of Pinellia ternata were solved, achieving rapid and accurate identification of the origin of Pinellia ternata.

CN116229455BActive Publication Date: 2025-12-02SICHUAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310223762.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2025-12-02
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify Pinellia ternata from different origins, existing equipment is inefficient and relies on specialized equipment, and there is a lack of effective machine learning models.

Method used

A method based on multi-scale feature deep neural networks is adopted, which combines the MBConv module and the Swin Transformer module in a hybrid iterative network to identify the place of origin of Pinellia ternata through fine-grained images, extract multi-level features and perform feature fusion.

Benefits of technology

It enables rapid and accurate identification of the origin of Pinellia ternata, improves the identification accuracy rate, reduces the dependence on professional equipment, and is applicable to the identification of Pinellia ternata from different origins.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116229455B_ABST
    Figure CN116229455B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of medicinal herb identification technology, specifically relating to a method and system for identifying the origin of Pinellia ternata based on a multi-scale feature deep neural network. The method includes the following steps: Step 1, inputting a fine-grained image of Pinellia ternata; Step 2, inputting the fine-grained image of Pinellia ternata into a machine learning model to obtain the origin identification result; wherein, the machine learning model is a hybrid iterative network integrating an MBConv module and a Swin Transformer module; Step 3, outputting the origin identification result of Pinellia ternata. This invention further provides a system for implementing the above method. The model provided by this invention can achieve rapid and accurate identification of the origin of Pinellia ternata and has good application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medicinal material identification technology, specifically involving a method and system for identifying the origin of Pinellia ternata based on a multi-scale feature deep neural network. Background Technology

[0002] Pinellia ternata, Thunb., is the dried tuber of the plant Pinellia ternata in the Araceae family. It has various pharmacological functions, especially antiemetic and antitussive effects. [71-72] In practical applications, the efficacy of Pinellia ternata varies depending on its origin. Pinellia ternata prefers a warm and humid environment and is susceptible to high temperatures, drought, and strong sunlight. Due to differences in origin and the influence of soil, climate, and other natural environmental factors, the effective components it contains also differ. Its main production areas are Gansu and Guizhou, with production also occurring in more than 10 provinces including Sichuan, Yunnan, Guangxi, Hubei, Anhui, Shandong, and Henan. Reports indicate that the characteristics of Pinellia ternata and its processed products from different origins are highly inconsistent and difficult to identify. For example, processed Pinellia ternata, processed with different techniques and auxiliary materials, can be counterfeited. Water-processed Pinellia ternata is often used by merchants as raw or processed Pinellia ternata in the market. Ginger-processed Arisaema heterophyllum, a processed form of Arisaema heterophyllum, is often identified as a counterfeit of ginger-processed Pinellia ternata in the market. Therefore, accurate identification of Pinellia ternata has become an urgent need in practical applications.

[0003] In existing technologies, the identification of Chinese medicinal materials from different origins is typically achieved by detecting active ingredients such as organic acids and flavonoids as specified in the Pharmacopoeia of the People's Republic of China. However, physicochemical identification and biological evaluation are insufficient to accurately identify the origin of Chinese medicinal materials using only a limited number of compounds. Furthermore, they rely on specific references and are time-consuming. Manual identification of Pinellia ternata is subjective and unreliable. As an effective alternative, the combination of intelligent sensory technologies (electronic nose, electronic tongue, electronic eye) and chemometric methods for Pinellia ternata identification has attracted significant attention. However, these methods require specialized equipment and are inefficient. Therefore, achieving non-destructive and accurate identification of Pinellia ternata has become an important research topic.

[0004] With the development of deep learning (DL) and convolutional neural networks, research in food technology has received widespread attention. The significant role of DL-based algorithms in tracking image classification has been widely recognized in the identification of food, plants, agriculture, and medicine. Therefore, applying deep learning to images of Chinese medicinal herbs for identification is undoubtedly a promising direction. However, different deep learning algorithms and model structures have a significant impact on the accuracy of image recognition. Currently, machine learning applications for the identification of Chinese medicinal herbs are limited, especially for the identification of the origin of Pinellia ternata (Pinellia ternata), where relevant research is lacking. There is an urgent need in this field to design new model structures to achieve the identification of the origin of Pinellia ternata. Summary of the Invention

[0005] To address the problems of existing technologies, this invention provides a method and system for identifying the origin of Pinellia ternata based on a multi-scale feature deep neural network. The purpose is to identify the origin of Pinellia ternata by using fine-grained images of Pinellia ternata as input images.

[0006] A method for identifying the origin of Pinellia ternata based on a multi-scale feature deep neural network includes the following steps:

[0007] Step 1: Input a fine-grained image of Pinellia ternata;

[0008] Step 2: Input the fine-grained image of Pinellia ternata into the machine learning model to obtain the Pinellia ternata origin identification result;

[0009] The machine learning model is a hybrid iterative network that integrates the MBConv module and the Swing Transformer module.

[0010] Step 3: Output the results of the Pinellia ternata origin identification.

[0011] Preferably, step 2 specifically includes the following steps:

[0012] Step 2.1: Input the fine-grained image of Pinellia ternata, extract its features and send them into the backbone MBConv module to obtain output patches of size H / 4×W / 4;

[0013] Step 2.2: The patches are processed by the PatchMerge layer to stitch together 2×2 groups of adjacent patches, which reduces the resolution while doubling the embedding dimension, and then the patches are transmitted into the first Swing Transformer module.

[0014] Step 2.3: Generate the first attention-based feature map by adding the result calculated by the MBConv module to the existing features through skip connections, thus obtaining the largest branch feature map F. s ;

[0015] Step 2.4: In the same manner, output the feature maps of different scales obtained by each MBConv module along with the higher-level features based on the SwinTransformer block feature mapping to obtain F. d ;

[0016] Step 2.5: The Swin Transformer calculates and updates the feature maps through multiple stages; in each stage, it is associated and fused with the feature layers after downsampling of the previous stage; then the feature maps of each stage are collected to obtain three multi-scale feature maps.

[0017] Step 2.6: After feature fusion of the multi-scale feature map, the result is processed by pooling layer, dropout layer and fully connected layer to obtain the origin identification result of Pinellia ternata.

[0018] Preferably, the resolution of the fine-grained image of Pinellia ternata is 224×224.

[0019] Preferably, there are three MBConv modules, which are used to acquire feature maps with resolutions of 14×14, 28×28, and 56×56, respectively.

[0020] Preferably, in the Swing Transformer module, the native MSA module is replaced by window-based multi-head self-attention and shift-based window-based multi-head self-attention.

[0021] Preferably, the MBConv module includes a single-connected 1×1 convolution, a 3×3 Depthwise Conv convolution, an SE module, a spatial attention module, a 1×1 convolution, and a Dropout layer.

[0022] Preferably, the spatial attention module is used to perform the following steps:

[0023] Step a: Perform a 1×1 Conv linear mapping on the input feature vector X to compress the number of channels and obtain different feature vectors;

[0024] Step b: Perform a SoftMax operation on the first linearly transformed feature vector to obtain the coefficients of Self-attention;

[0025] Step c: Multiply the coefficients of the self-attention by the feature matrix after the second linear mapping, and then perform a 7×7 convolution calculation.

[0026] Step d: After nonlinear activation using the Sigmoid function, the weighted attention feature values ​​are obtained.

[0027] This invention also provides a system for implementing the above-described method for identifying the origin of Pinellia ternata, comprising:

[0028] The input module is used to input fine-grained images of Pinellia ternata;

[0029] The calculation module integrates a machine learning model to calculate the origin identification result of Pinellia ternata based on the fine-grained image of Pinellia ternata; wherein, the machine learning model is a hybrid iterative network that integrates the MBConv module and the Swin Transformer module;

[0030] The output module is used to output the identification results of the origin of Pinellia ternata.

[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon for implementing the above-described method for identifying the origin of Pinellia ternata.

[0032] This invention addresses the visual identification of Pinellia ternata from different origins using fine-grained images. It proposes a novel hybrid iterative model by combining the depthwise separable convolutional network's ability to model local information in the MBConv module with the multi-layered structure of the Swin Transformer module, which compensates for network nonlocality losses. This model acquires features from different image levels, fusing shallow features such as shape, color, and texture as prior knowledge with higher-level semantic information. Experimental data demonstrates that the proposed method is more effective at capturing rich image details, thus achieving rapid and accurate identification of Pinellia ternata's origin.

[0033] In a preferred embodiment, the present invention also introduces a convolutional block attention module into the model, which can further improve the model's recognition performance.

[0034] Obviously, based on the above description of the present invention, and according to common technical knowledge and conventional methods in the field, various other modifications, substitutions or alterations can be made without departing from the basic technical concept of the present invention.

[0035] The following detailed embodiments further illustrate the above-described content of the present invention. However, this should not be construed as limiting the scope of the present invention to the following examples. All technologies implemented based on the above-described content of the present invention fall within the scope of the present invention. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the structure of the machine learning model of the present invention;

[0037] Figure 2 This is a comparison diagram of the MBConv module structure of the present invention and the existing MBConv module structure, wherein (A) is the network structure diagram of the MBConv module in the prior art, and (B) is the network structure diagram of the MBConv module of the present invention.

[0038] Figure 3 This is a structural diagram of the attention mechanism module SLA of the present invention;

[0039] Figure 4 These are some fine-grained images of Pinellia ternata from the Pinellia ternata dataset used in Experiment Example 1 of this invention; among them, (A) Sichuan (B) Hubei (C) Jiangxi (D) Gansu (E) Guizhou (F) Shanxi (G) Hebei;

[0040] Figure 5 The results are the confusion matrix from Experiment Example 1 of this invention.

[0041] Figure 6 The results of the ROC experiment in Experiment Example 1 of this invention are shown, where the numbers from 0 to 9 correspond to different categories from A to J;

[0042] Figure 7 The heatmaps are for attention visualization of Pinellia ternata from different origins in Experiment Example 1 of this invention. Each category heatmap is randomly selected. The first column is the original fine-grained image of Pinellia ternata, the second column is the heatmap without attention mechanism, the third column is the heatmap using SENet, and the fourth column is the heatmap using the CBAM module of Example 1. Detailed Implementation

[0043] It should be noted that the algorithms for data acquisition, transmission, storage and processing steps not specifically described in the embodiments, as well as the hardware structures and circuit connections not specifically described, can all be implemented using content already disclosed in the prior art.

[0044] Example 1: A Method and System for Identifying the Origin of Pinellia ternata Based on Multi-Scale Feature Deep Neural Networks

[0045] The system provided in this embodiment includes:

[0046] The input module is used to input fine-grained images of Pinellia ternata;

[0047] The calculation module integrates a machine learning model to calculate the origin identification result of Pinellia ternata based on the fine-grained image of Pinellia ternata; wherein, the machine learning model is a hybrid iterative network that integrates the MBConv module and the Swin Transformer module;

[0048] The output module is used to output the identification results of the origin of Pinellia ternata.

[0049] The machine learning model (a hybrid iterative network integrating the MBConv module and the Swin Transformer module) in this embodiment has the following structure: Figure 1 As shown, specifically: the MBConv module employs Depthwise Convolution, which reduces the number of parameters compared to traditional convolution; simultaneously, this module uses an "inverted bottleneck" structure, so that the computed features undergo both dimensionality upscaling and dimensionality reduction processes, thereby improving the model's learning ability. The core idea of ​​the Swin Transformer network is to compensate for the inherent loss of nonlocality in the Transformer by generating feature maps at different scales through a multi-layered structure.

[0050] In the Swin Transformer, the native MSA module is replaced by window-based multi-head self-attention (W-MSA) and shifted window-based multi-head self-attention (SW-MSA). In the W-MSA module, self-attention is calculated for a local window of size M×M; on the other hand, SW-MSA is introduced, which utilizes a window configuration shifted relative to the input to realize cross-window connections and enhance the modeling ability of the model. The calculation process of the module is shown in the following formulas (1)-(4):

[0051] c l =WMSA(LN(C l-1 ))+C l-1 (1)

[0052] C l =MLP(LN(c l ))+c l (2)

[0053] c l+1 =SWMSA(LN(C l ))+C l (3)

[0054] C l+1 =MLP(LN(c l+1 ))+c l+1 (4)

[0055] Given an input image with a resolution of 224×224, features are extracted from the input image and fed into the backbone MBConv module, resulting in output patches of size H / 4×W / 4. These patches are then processed by the PatchMerge layer, concatenating 2×2 adjacent patches to reduce resolution while doubling the embedding dimension. This processed patch is then fed into the first Swin Transformer module for better integration, generating the first attention-based feature map. Through skip connections, the results calculated by the MBConv module are added to the existing features, resulting in the largest branch feature map F. s Then, in the same manner, the feature maps of different scales obtained from each MBConv module are output along with higher-level features based on the Swin Transformer block feature map to obtain F. d .

[0056] The Swin Transformer computes and updates feature maps through multiple stages; in each stage, it correlates and fuses the feature maps with the downsampled feature layers from the previous stage; subsequently, it collects feature maps from each stage, resulting in three multi-scale feature maps. By combining the ability of both to capture local and global information, it obtains features at different levels of the image, and fuses shallow features with high-level semantic features for modeling and analysis. Shallow features are directly derived from image pixels, mostly extracted from visual features such as shape, color, and texture. These are used as prior knowledge and fused with high-level semantic information, highlighting the key points of feature extraction in traditional image processing techniques while integrating and strengthening multi-level features. Finally, the fused features are passed through pooling layers, dropout layers, and fully connected layers to output the identification and classification of different origins of Chinese medicinal herbs in fine-grained images.

[0057] MBConv module such as Figure 2 As shown, this module first performs 1×1 convolution to increase the dimensionality of the input features, then passes them through a 3×3 Depthwise Conv convolution and the SE module to reduce the number of parameters while enhancing the focus on features. Finally, a 1×1 ordinary convolution is used to reduce the dimensionality of the features, connecting to a "bottleneck" structure of convolutional modules with dropout layers. The first 1×1 layer is used to increase the dimensionality and focus more on effective features, while the last 1×1 layer is used to reduce the dimensionality. The introduction of the SE module adds attention weight to the features. This embodiment improves upon the MBConv module by proposing a new global spatial attention module applied after the SE, forming a new structure of channel attention module combined with spatial attention module. By aggregating the spatial information of the feature map, the spatial dimension of the input feature map is compressed to generate a channel attention map. After weighting the input feature channels, the weight of spatial direction is further increased. This embodiment uses the feature map extracted by the hybrid structure as the input of the subsequent network, which can improve the network's ability to learn image features.

[0058] Spatial attention mechanisms refer to using attention mechanisms to locate regions of interest in the spatial dimension of the original image, enhancing the representation of spatial information in the original image, focusing on and retaining key feature information, suppressing unnecessary features, and forming a weighted spatial feature representation. In the MBConv module of this embodiment, a novel global spatial attention module (Spatial local attention module) is proposed and integrated into the SE module, forming a new structure of a channel-attention hybrid spatial attention module. Existing spatial attention mechanisms typically involve averaging the input image from C×H×W to 1×H×W by calculating the average value of each channel for the same pixel, and then performing convolution and upsampling to calculate the attention weights in the spatial dimension, thereby assigning different weights to pixels in each layer of spatial features. The attention network SLA structure proposed in this embodiment is as follows: Figure 3 As shown.

[0059] First, the input feature vector X is linearly mapped using a 1×1 Conv algorithm to compress the number of channels, resulting in different feature vectors. Then, a SoftMax operation is performed on the first linearly transformed feature vector to obtain 0-1 weights for different spatial dimensions, i.e., the coefficients of the Self-attention. Next, the coefficients of the Self-attention are multiplied by the feature matrix after the second linear mapping, followed by a 7×7 convolution. Finally, a non-linear activation sigmoid function is applied to obtain the weighted attention feature values. This process can be abstracted mathematically as follows:

[0060] (1) Global attention: using a 1×1 convolution W n Multiply by the SoftMax function to obtain the self-attention weights in the spatial dimension, and then perform a 1×1 convolution W. m The product is used to obtain global attention features.

[0061]

[0062] Where X represents the input feature, Z′ represents the output, and C(X) is defined as the normalization factor, W k With W v It is a 1×1 linear transformation matrix.

[0063] (2) Feature extraction: 7×7 convolution W v Feature extraction is performed, and then the spatial attention weights with one channel are obtained by activating the Sigmoid function.

[0064] Z″=σ(Z′× W v (6)

[0065] Where σ represents the nonlinear Sigmoid function, and Z″ represents the weighted output.

[0066] (3) Feature aggregation: Multiply the attention weight value Z″ with the original input feature map X to obtain the attention-weighted feature map X′. By calculating the attention weight values ​​of different spatial dimensions, the dependencies between spatial dimensions can be captured.

[0067] X′=Z″×X (7)

[0068] The technical solution of the present invention will be further illustrated by the following experiments. In the following experimental examples, the model structure or method steps not specifically described are the same as those described in Example 1.

[0069] Experiment Example 1: Model's ability to identify the origin of Pinellia ternata

[0070] I. Experimental Methods

[0071] 1. Banxia dataset

[0072] Pinellia ternata was sourced from seven production areas including Hebei, Shanxi, Guizhou, Gansu, and Sichuan, and came from different medicinal herb markets. All samples were identified and confirmed by experts from the Affiliated Hospital of Chengdu University of Traditional Chinese Medicine. All fine-grained images of Pinellia ternata were taken under consistent environmental conditions. All images were annotated and filtered, removing incomplete, blurry, and inappropriate images. A portion of the Pinellia ternata dataset is shown below. Figure 4 As shown, the correspondence between the marking symbols and the place of origin is as follows: (A) Anhui, (B) Chengde, Hebei, (C) Anyang, Henan, (D) Wild Henan, (E) Shanxi, (F) Huixian, Henan, (G) Weifang, Shandong, (H) Pingyi, Shandong, (I) Feixian, Shandong, (J) Jiangsu.

[0073] The quantities of Pinellia ternata from different producing areas are shown in Table 1.

[0074] Table 1. Specific quantities of Pinellia ternata from different production areas.

[0075]

[0076] 2. Identification Models and Systems

[0077] The model and system described in Example 1 are used.

[0078] 3. Implementation method

[0079] The experiment used the open-source PyTorch as the basic framework, developed based on PyTorch 1.8.1 and Python 3.9. The algorithm model was trained on a PC (Intel i7 processor and 11GB VRAM) with an Nvidia GeForce RTX 2080 Ti graphics card. The AdamW optimizer was used for iterative optimization of the model. A cosine annealing decay strategy was employed to periodically change the learning rate. For the pre-training phase, the minimum learning rate was 0, the initial learning rate (blr) was 1e-3, the batch size was 8, the learning rate weight decay factor was 0.05, the input image size was 224×224, the random number seed was 1024, and 200 iterations were performed. Each iteration completely traversed all data. The final trained model was obtained after 200 iterations. Considering the possibility of class imbalance, FocalLoss was used as the loss function for model training, with gamma set to 0.25 and alpha to 2.

[0080] II. Experimental Results

[0081] 1. Identify experimental results

[0082] Using 80% of the data samples as the training set and the remaining 20% ​​for testing the model's performance, the proposed method achieved an overall classification accuracy of 95.918%. The specific classification results for each class are shown in Table 2. For multi-class classification studies, accuracy, recall, and specificity were used to evaluate the model's recognition performance.

[0083] Table 2 Model Recognition Results

[0084]

[0085] In addition, this experiment also calculated the confusion matrix and ROC curve to measure the model's ability to distinguish Pinellia ternata from different origins. The results are as follows: Figure 5 and Figure 6 As shown in the figure. The experimental results above demonstrate that the method of this invention has good distinguishing ability for Pinellia ternata samples from seven different production areas.

[0086] 2. Comparison of recognition performance of different network models

[0087] To verify the performance of the proposed method, it was compared with several different ConvNets and Transformers. These included VGG (Neurocomputing, 2018, 314:336-346.), ResNet (Neurocomputing, 2018, 314:336-346.), DenseNet (Neurocomputing, 2018, 314:336-346.), EfficientNet (Tan, MX, & Le. QV EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks[J].arXiv:1905.11946v5.2018.), MobileNet (Neurocomputing, 2018, 314:336-346.), and CoAtNet (Dai, Z., Liu, H., Le, QV, & Tan, M. CoAtNet: Marrying Convolution and Attention for All Data). Sizes[J].2021.) all chose Focalloss as the loss function; at the same time, various state-of-the-art Transformer algorithms were also compared with the method proposed in this invention, including ViT (Han,K.,Wang,YH,Chen,HT,Chen,XH,Guo,Liu,JY,et al.A Survey on Vision Transformer.IEEE T.Pattern Anal.2022.), MaxViT (Tu,ZZ,Talebi,H.,Zhang,H.,Yang,F.,Milanfar,PM,Bovik,AL,et al.MaxViT:Multi-Axis VisionTransformer[J].arXiv:2204.01697v1.2022.), Swing–Transformer (Liu,Z.,Lin,YT,Cao,Y.,Hu,H.,Wei,YX,Zhang,Z.,et al.Swin Transformer:Hierarchical VisionTransformer using Shifted Windows[C]. CVPR, 2021.) and FocalNet (Yang, JW, Li, CY, & Gao, JFFocal Modulation Networks[J].The references are arXiv:2203.11926v1.2022., CMT (Guo JY, Han K, Wu H, et al. CMT: Convolutional Neural Networks Meet Vision Transformers [C]. IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022.), CvT (Wu HP, Xiao B, Codella N, et al. CvT: Introducing Convolutions to Vision Transformers [C]. IEEE International Conference on Computer Vision and Pattern Recognition (CVPR). 2021.), and PVT (Wang WH, Xie EZ, LiX, et al. Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions [C]. IEEE International Conference on Computer Vision (ICCV), 2021.). To ensure fairness in evaluating the models, the baseline was based on the improved model, while the remaining trained parameters remained unchanged in the comparative experiments. .

[0088] Table 3 shows the comparison results between the method in Example 1 and different ConvNets methods in the classification and identification of Pinellia ternata datasets from different production areas.

[0089] Table 3 Comparison of Model Recognition Performance

[0090]

[0091]

[0092] As shown in the table above, the method proposed in this invention still has the best discrimination performance on the Banxia dataset, with an improvement of 8.441% compared to VGG, 4.545% compared to ResNet, 5.472% compared to DenseNet, and 3.061% compared to CoAtNet.

[0093] Table 4 Comparison of Model Recognition Performance

[0094]

[0095] The table above shows a comparison between the method proposed in Example 1 and the latest Transformer-based methods. The experimental results show that the method proposed in this invention outperforms the ViT network by 2.875%, the MaxViT network by 2.246%, and the Swin Transformer by 1.063%, which is still superior to other algorithm models.

[0096] The above experimental results demonstrate that the hierarchical structure method proposed in this invention is more suitable for the classification and recognition of fine-grained images. By capturing multi-level features of fine-grained images, the network learns more effective feature details, thereby achieving fine classification of the origin of Pinellia ternata from a visual perspective.

[0097] 3. Ablation test

[0098] To verify the effectiveness of the attention mechanism, this experiment compared different attention mechanisms. The three experimental groups employed a no-attention mechanism, a spatial attention module (SPA) (Woo SH, Park JC, Lee JY, et al. CBAM: Convolutional Block Attention Module [C]. arXiv preprint arXiv 1807:06521v2.2018.), and the attention mechanism module (SLA) from Example 1, respectively. This comparative experiment used a controlled variable method. The baseline model in the ablation was based on the model proposed in this paper, and the remaining training parameters remained unchanged in the comparative experiment. The classification accuracy is shown in Table 5.

[0099] Table 5 Comparative experimental results based on different attention mechanisms

[0100]

[0101]

[0102] As shown in Table 5, the attention mechanism model proposed in this paper achieves the highest recognition accuracy of 89.306%, which is 0.65% higher than that using SPA. Furthermore, compared to not adding a spatial attention mechanism, it can be confirmed that adding the spatial attention mechanism module improves the model's performance by 1.392%.

[0103] To better verify the effectiveness of the attention module, further visualization heatmaps of different production areas were plotted on... Figure 7 In China. Through Figure 7The differences in the regions of interest (ROIs) of images observed by different attention mechanism modules are clearly visible. All models can focus on the ROIs of the image. Compared to SENet, the CBAM attention module covers a deeper and broader range of ROIs, focusing on more regions. However, for the ROIs with lower recognition accuracy (B) Chengde, Hebei; (G) Weifang, Shandong; and (H) Pingyi, Shandong, the different models focus on slightly different ranges, demonstrating that the regions focused by different attention models are inconsistent, and the learned features also differ significantly. The method proposed in this invention makes it easier to obtain discriminative regions in images, thereby helping the network learn more effective features, focusing on the feature details of local image regions to complete fine-grained image classification and recognition, and improving the model's recognition accuracy.

[0104] As can be seen from the above embodiments and experimental examples, this invention constructs a hybrid iterative network integrating the MBConv module and the SwinTransformer module, which can identify fine-grained images of Pinellia ternata and achieve rapid and accurate identification of its origin. This invention can reduce the experience requirements of relevant personnel in the identification of Pinellia ternata origin and has good application prospects.

Claims

1. A method for identifying the origin of Pinellia ternata based on a multi-scale feature deep neural network, characterized in that, Includes the following steps: Step 1: Input a fine-grained image of Pinellia ternata; Step 2: Input the fine-grained image of Pinellia ternata into the machine learning model to obtain the Pinellia ternata origin identification result; The machine learning model is a hybrid iterative network that integrates the MBConv module and the Swing Transformer module. Step 3: Output the identification result of the origin of Pinellia ternata; Step 2 specifically includes the following steps: Step 2.1: Input the fine-grained image of Pinellia ternata, extract its features and send them into the backbone MBConv module to obtain output patches of size H / 4×W / 4; Step 2.2: The patches are processed by the PatchMerge layer to stitch together 2×2 groups of adjacent patches, which reduces the resolution while doubling the embedding dimension, and then the patches are transmitted into the first Swing Transformer module. Step 2.3: Generate the first attention-based feature map by adding the result calculated by the MBConv module to the existing features through skip connections, thus obtaining the largest branch feature map F. s ; Step 2.4: In the same manner, output the feature maps of different scales obtained by each MBConv module along with the higher-level features based on the SwinTransformer block feature mapping to obtain F. d ; Step 2.5: The Swin Transformer calculates and updates the feature maps through multiple stages; in each stage, it is associated and fused with the feature layers after downsampling of the previous stage; then the feature maps of each stage are collected to obtain three multi-scale feature maps. Step 2.6: After feature fusion of the multi-scale feature map, the result is processed by pooling layer, dropout layer and fully connected layer to obtain the origin identification result of Pinellia ternata.

2. The method for identifying the origin of Pinellia ternata according to claim 1, characterized in that: The resolution of the fine-grained image of Pinellia ternata is 224×224.

3. The method for identifying the place of origin of Pinellia ternata according to claim 1, characterized in that: The number of MBConv modules is 3, and the MBConv modules are used to acquire feature maps with resolutions of 14×14, 28×28 and 56×56 respectively.

4. The method for identifying the place of origin of Pinellia ternata according to claim 1, characterized in that: In the Swing Transformer module, the original MSA module is replaced with window-based multi-head self-attention and shift-based window-based multi-head self-attention.

5. The method for identifying the place of origin of Pinellia ternata according to claim 1, characterized in that: The MBConv module includes a single-connected 1×1 convolution, a 3×3 Depthwise Conv convolution, an SE module, a spatial attention module, a 1×1 convolution, and a Dropout layer.

6. The method for identifying the place of origin of Pinellia ternata according to claim 5, characterized in that: The spatial attention module is used to perform the following steps: Step a: Perform a 1×1 Conv linear mapping on the input feature vector X to compress the number of channels and obtain different feature vectors; Step b: Perform a SoftMax operation on the first linearly transformed feature vector to obtain the coefficients of the Self-attention. Step c: Multiply the coefficients of the self-attention by the feature matrix after the second linear mapping, and then perform a 7×7 convolution calculation. Step d: After nonlinear activation using the Sigmoid function, the weighted attention feature values ​​are obtained.

7. A system for implementing the method for identifying the origin of Pinellia ternata according to any one of claims 1-6, characterized in that, include: The input module is used to input fine-grained images of Pinellia ternata; The calculation module integrates a machine learning model to calculate the origin identification result of Pinellia ternata based on the fine-grained image of Pinellia ternata; wherein, the machine learning model is a hybrid iterative network that integrates the MBConv module and the Swin Transformer module; The output module is used to output the identification results of the origin of Pinellia ternata.

8. A computer-readable storage medium, characterized in that: It stores a computer program for implementing the Pinellia ternata origin identification method according to any one of claims 1-6.

Citation Information

Patent Citations

  • An artificial intelligence-based traditional Chinese medicinal material planting origin identification method

    CN109948676A

  • Method and system for detecting face forgery of double-stream video based on multiple clues

    CN114596608A

  • Target identification method of extremely narrow pulse radar based on category and feature auxiliary neural network

    CN115685114A