Intelligent identification method for spartina alterniflora

By introducing EfficientViT and improved convolution module in the YOLOv8 algorithm, the problems of insufficient recognition accuracy, slow inference speed and poor adaptability in the existing mutual flower grass recognition methods are solved, and the recognition effect of high precision, fast and adaptability is achieved.

CN120107810APending Publication Date: 2025-06-06QINGDAO AGRI UNIV

Patent Information

Application Number
CN202411540246.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing mutual flower rice grass recognition methods have problems such as insufficient recognition accuracy, slow inference speed and poor adaptability, especially in complex backgrounds and different growth stages.

Method used

Using an intelligent identification method based on the lightweight YOLOv8 algorithm, EfficientViT is introduced as the backbone network and the improved C-MBConv and C2f_Dattention modules are introduced into the model, the convolution layer is optimized to GhostNet, and the feature extraction and fusion capabilities of the model are improved.

Benefits of technology

It improves the recognition accuracy of mutual flower rice grass, improves the inference speed, enables the system to meet the needs of real-time detection, and enhances the adaptability of the model under different environments and conditions.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision and deep learning, and particularly relates to a spartina alterniflora intelligent identification method, which comprises the steps of S1, data acquisition and data set establishment; s2, constructing a model; s21, a pre-training model YOLOv8 is downloaded; s22, modifying model configuration; s221, using an OfficientViT as a backbone network of the YOLOv8 model, wherein the OfficientViT Block comprises a lightweight MSA (Multi-Server Algorithm) and an improved C-MBConv (Carrier-Multicast Block Conv), and a YOLOv8 model is used as a backbone network of the YOLOv8 model; s222, before entering the SPPF, firstly entering the improved C2fDattetion module for processing, and after entering the SPPF, entering the improved C2fDattetion module for processing; s223, an optimized C2fGhostNet network is used as a convolution layer, and the C2fGhostNet network is used S23, carrying out model training and testing; and S3, identifying the spartina alterniflora. According to the method, the backbone network and the neck structure of the model are optimized, so that the recognition precision and the reasoning speed of the model under a complex background are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision and deep learning, and specifically relates to an intelligent identification method for Spartina alterniflora. Background Art

[0002] Spartina alterniflora is an extremely aggressive invasive plant, and its rapid spread poses a serious threat to wetland ecosystems. The plant significantly affects the ecological balance of invaded areas by changing the structure of native plant communities, altering sediment dynamics, and interfering with local hydrological conditions. Therefore, how to accurately and quickly identify and classify Spartina alterniflora is of great significance for controlling its spread and reducing ecological damage.

[0003] The invention patent with application number 202210423323.6 proposes a classification and identification method for Spartina alterniflora based on deep learning. This method utilizes a variety of classic convolutional neural network models, including AlexNet, VGG16, GoogleNet, ResNet50 and EfficientNetB0, to achieve the classification and identification of Spartina alterniflora. This method has achieved certain results in recognition accuracy and model efficiency, but due to the high similarity between Spartina alterniflora and other native plants in morphology and spectral characteristics, as well as its diverse characteristics at different growth stages, the existing technology still faces the challenges of insufficient recognition accuracy and real-time performance in practical applications, which are specifically manifested in:

[0004] 1. Insufficient recognition accuracy: Due to the high similarity in morphology and spectral characteristics between Spartina alterniflora and other native plants, especially when vegetation coverage is high or growing seasons overlap, existing models have difficulty effectively distinguishing these plants, resulting in low classification accuracy.

[0005] 2. Slow reasoning speed: Although existing convolutional neural networks have achieved certain results in accuracy, their reasoning speed is still insufficient in practical applications, especially in scenarios that require real-time recognition. Some deep network structures (such as VGG16 and ResNet50) have a large number of layers, resulting in large amounts of calculation, which in turn affects the efficiency of real-time detection.

[0006] 3. Poor adaptability: Spartina alterniflora exhibits different characteristics at different growth stages, and its growth environment is complex and changeable. Existing models have poor adaptability when dealing with these diverse scenarios, and it is difficult to stably provide high-precision recognition results under different environments and conditions. Summary of the invention

[0007] In order to solve the defects of insufficient recognition accuracy, slow reasoning speed and poor adaptability of the existing Spartina alterniflora recognition methods, the present invention proposes an intelligent recognition method of Spartina alterniflora based on a lightweight YOLOv8 algorithm, which adopts the following technical scheme: an intelligent recognition method of Spartina alterniflora based on a lightweight YOLOv8 algorithm, comprising:

[0008] S1. Data collection and dataset establishment

[0009] S2. Model construction

[0010] S21. Download the pre-trained model YOLOv8

[0011] S22. Modify model configuration

[0012] S221. Select the network architecture and use EfficientViT as the backbone network of the YOLOv8 model. The EfficientVit Block contains lightweight MSA and improved C-MBConv.

[0013] S222, before entering SPPF, first enter the improved C2f_Dattention module for processing;

[0014] S223, use the optimized C2f_GhostNet network as the convolutional layer;

[0015] S23. Model training and testing

[0016] S3. Identification of Spartina alterniflora.

[0017] Furthermore, in step S221, the improvement of C-MBConv includes: determining the convolution mode of MBConv as depthwise separable convolution, using a channel attention mechanism in the CABM attention mechanism, and adding a multi-layer perceptron (MLP) for nonlinear transformation, and obtaining a C-MBConv module through the adaptive combination of MBConv and CABM.

[0018] Furthermore, in step S222, the improvement of C2f_Dattention includes: based on the C2f module, retaining the original attributes and image processing steps, embedding Bottleneck_Dattention as an attention mechanism into the basic network structure of C2f, and stacking it n times.

[0019] Furthermore, the step S223 includes:

[0020] (1) Replace the convolutional layer and replace the C2f module in the YOLOv8 model with the C2f_GhostNett network;

[0021] (2) Integrate the GhostNet module. Based on the EfficientViT backbone network, use the Ghost bottleneck in GhostNet as the convolution layer of YOLOv8 to optimize the residual linear convolution operation.

[0022] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0023] 1. High recognition accuracy: By introducing a new network structure EfficientVit that combines the advantages of convolutional neural networks (CNN) and visual transformers (ViT), the YOLOv8 backbone network is improved, enabling the system to more accurately identify Spartina alterniflora in complex backgrounds. The network uses a self-attention mechanism to effectively capture long-distance dependencies in images and improve classification accuracy, especially when Spartina alterniflora is highly similar to other plants, accurate classification can be achieved.

[0024] 2. Fast reasoning speed: This invention significantly improves the reasoning speed of the system by optimizing the algorithm structure, so that it can meet the needs of real-time detection. The lightweight EfficientVit-YOLOv8 model reduces the amount of calculation while ensuring high accuracy, ensuring high efficiency in practical application scenarios.

[0025] 3. Strong model adaptability: The model of the present invention can better adapt to the performance of Spartina alterniflora in different growth stages and complex environments, improves its adaptability in various practical scenarios, and ensures the stability and reliability of classification and recognition results. DETAILED DESCRIPTION

[0026] The embodiments of the present application are described in detail below.

[0027] This embodiment proposes an intelligent identification method of Spartina alterniflora based on an improved lightweight YOLOv8 algorithm, including:

[0028] 1. Data collection and dataset establishment

[0029] 1. Collection method: The image information collection of the present invention includes remote sensing satellite image downloading, drone collection or field shooting to meet the needs of Spartina alterniflora management personnel in different scenarios.

[0030] 2. Image labeling: Use labelimg software to label the image, including information about the whole body, leaves, trunk, branches and leaves of Spartina alterniflora.

[0031] 3. Dataset establishment

[0032] (1) Data preprocessing: Data processing methods include cropping, brightness adjustment, mirroring, adding noise, and rotation.

[0033] (2) Preprocessing related analysis:

[0034] Cropping: Cropping in image processing usually involves four key coordinate values: the upper left corner (x1, y1) and the lower right corner (x2, y2) of the original image. The cropping area is the rectangular area surrounded by these four points. This embodiment intercepts the original image and calculates the width (w) and height (h) of the new image, as well as the new coordinates (x', y') using the following formula:

[0035] New image width (w) = x2-x1;

[0036] New image height (h) = y2-y1;

[0037] New upper left corner coordinates (x', y') = (x1, y1);

[0038] Then, we only need to extract the pixel data corresponding to the original image according to these new coordinates to obtain the cropped image.

[0039] Brightness adjustment: Brightness adjustment in image processing usually involves the increase or decrease of pixel values. This embodiment adopts pixel-by-pixel operation. Assuming that the original pixel value is P, the pixel value after brightness adjustment is P', the formula can be expressed as: [P'=P+\delta], where (\delta) is a constant called brightness increment. If (\delta>0), the image will become brighter; if (\delta<0), the image will become darker. This formula is applicable to single-channel grayscale images. For color images, the same gain ((P'=P+\delta*channel)) is applied to the three channels of red, green and blue (RGB), or a linear transformation such as gamma correction is used to adjust the brightness of the entire color space.

[0040] Mirror: Horizontal mirror: For each pixel position (x, y), its coordinates after mirroring become (2x-x', y), where x' is the x value of the original position.

[0041] Add noise: add a random number sampled from a Gaussian distribution (mean 0, standard deviation σ) to each pixel value. The mathematical expression is approximately: [I_{noisy}(x,y)=I_{original}(x,y)+N(0,\sigma^2)], where (I_{noisy}) is the pixel value after adding noise, (I_{original}) is the original pixel value, and (N) is the Gaussian distribution.

[0042] 2. Model Construction

[0043] 1. System architecture

[0044] The overall architecture of the Spartina alterniflora intelligent recognition system of the present invention is based on the YOLOv8 model. YOLOv8 is a single-stage target detection model that can achieve fast and efficient target detection by performing a one-time global analysis of the input image. In order to enhance the performance of the model in the Spartina alterniflora recognition task, this embodiment optimizes the backbone network (Backbone) and the neck structure (Neck), and performs customized training on this basis.

[0045] 2. Fusion of model optimization and feature extraction

[0046] Model Optimization 1: Replace the backbone by using a cascaded attention mechanism

[0047] In the feature extraction stage, the backbone network of YOLOv8 is replaced with the EfficientVit network, and MBConv is improved to improve the backbone's ability to extract features and the model's receptive field. The EfficientVit Block contains lightweight MSA and improved C-MBConv to enhance the attention mechanism to integrate feature maps and optimize convolution operations. The model of this embodiment can more effectively identify and distinguish Spartina alterniflora from other plants when dealing with complex backgrounds, improve recognition accuracy, and maintain high reasoning efficiency.

[0048] Since the actual growth and recognition environment of Spartina alterniflora requires consideration of the angle (elevation, depression, and horizontal) and height (ground and low-altitude drone) of the collected image, the MBConv in the EfficientVit Block is adaptively improved. First, the convolution mode of MBConv is determined to be depth-separable convolution, and point-by-point convolution is no longer used (to reduce the amount of calculation and speed up the calculation), MaxPoolOut = GlobalMaxPooling2D (X) where X is the input feature map, Y is the input feature map, and depthwise is the output feature map after deep convolution, Y pointwise It is the final output feature map after point-by-point convolution. The CABM attention mechanism only uses and improves the correlation between the average pooling of the whole play and the global maximum pooling to learn the channels, that is, the channel attention mechanism, and adds a multi-layer perceptron (MLP) for nonlinear transformation. Among them:

[0049] Average pooling of the entire play: AvgPoolOut = GlobalAveragePooling2D(X)

[0050] Global maximum pooling: MaxPoolOut = GlobalMaxPooling2D(X)

[0051] Multilayer Perceptron: z = fc2(ReLU(fc1(AvgPoolOut)))+fc2(ReLU(fc1(MaxPoolOut)))

[0052] Channel attention weight: Mc(X) = σ(z)

[0053] Channel attention mechanism output: Mc(F) = σ(MLP(AvgPool(F)) + MLP(MaxPool(F)))

[0054] F is the input feature map, and σ represents the sigmoid activation function.

[0055] Through the adaptive combination of MBConv and CABM, the C-MBConv module is proposed.

[0056] Final output feature map: Yfinal = ResNetConn(X,Mc(MBConv(X))). MBConv(X) represents the output feature map of the MBConv module, Mc(MBConv(X)) represents the feature map after channel and spatial attention weighting by the CBAM module, and ResNetConn represents the residual connection operation.

[0057] The present invention enhances the model's ability to extract image features during the convolution process through the ReLU linear attention mechanism, while improving its ability to capture global and multi-scale information of the image, thereby improving the accuracy of classification and recognition without significantly increasing the amount of computation.

[0058] Model optimization 2: C2f_Dattention module introduced into the backbone

[0059] When extracting backbone features, the EfficientVit Block composed of C-MBConv will generate more feature maps. Directly entering SPPF for pooling operation will affect the subsequent feature fusion and increase the amount of calculation. Therefore, before entering SPPF, it first enters the improved C2f_Dattention module for processing. On the one hand, it further focuses on feature information to prevent overfitting; on the other hand, it can reduce the amount of calculation while maintaining high performance; furthermore, it can enhance the feature fusion capability.

[0060] The improvements to the C2f_Dattention module are as follows: First, based on the C2f module, the original attributes and image processing steps are retained, and Bottleneck_Dattention is embedded as an attention mechanism into the basic network structure of C2f, and stacked n times. Among them, Bottleneck_Dattention is designed to inherit the advantages of the Dattention attention mechanism in processing high-resolution images, sample the input feature map information through the predicted offset and reference point, and output a new feature quantity with half the number of channels after processing. Bottleneck_Dattention is mainly used as a screening bottleneck network, with more input and less output, thereby retaining important feature information.

[0061] Model optimization 3: In the feature fusion stage, the neck structure of YOLOv8 is replaced with an improved C2f_GhostConv module, aiming to improve the model’s feature fusion capability and feature information processing capability.

[0062] GhostNet introduces Ghost Module and uses 1×1 convolution and depth-wise separable convolution to generate more feature maps, thereby reducing computing resource consumption while maintaining the expressiveness of features. This method effectively improves the computational efficiency of the model.

[0063] Ghost Bottleneck structure: In C2f_GhostNet, a residual structure similar to ResNet (Ghost Bottleneck) is used to further optimize the feature fusion process of the model. By reducing the number of channels, using activation functions and batch normalization properly, feature fusion is made more efficient and stable.

[0064] The present invention significantly improves the efficiency of the model in processing large-scale image data, overcomes the computing bottleneck, and enables the system to operate effectively in a real-time environment.

[0065] Hyperparameter tuning: Through grid search or Bayesian optimization methods, the hyperparameters of the EfficientViT-YOLOv8 model (such as learning rate, batch size, weight decay coefficient, etc.) are tuned to obtain the best parameter combination to improve the efficiency of model training and recognition accuracy.

[0066] Data enhancement: OpenCV was used for data enhancement, including image flipping, rotation, brightness and contrast adjustment, noise addition, scaling and cropping, etc., to generate diverse training data and increase the generalization ability of the model, enabling it to robustly identify Spartina alterniflora in different environments.

[0067] 3. Model training and testing

[0068] The images that have undergone data augmentation are integrated into the training set, and training is performed in batches with gradually increasing difficulty, so that the model can gradually adapt to the characteristic changes of Spartina alterniflora in different growth stages and complex backgrounds, thereby improving the robustness and accuracy of recognition.

[0069] 4. Identification of Spartina alterniflora.

[0070] After feature fusion, the optimized feature map is input into the detection head of YOLOv8 for target detection and classification. The YOLOv8 detection head is improved by the present invention to quickly and accurately identify the specific location and category of Spartina alterniflora.

[0071] This invention further improves the accuracy of target detection by introducing EfficientViT as the backbone and adopting data enhancement technology with better adaptability. Compared with the original YOLOv8 network model, it can still accurately identify targets under complex backgrounds or occlusions, thereby improving the detection quality. By using the optimized GhostNet network as the convolutional layer to improve the detection capability of small targets, while reducing false detections and missed detections, the reliability of the recognition results is greatly improved, especially in practical applications such as agricultural weed recognition and flower recognition.

[0072] The present invention can reduce the reliance on high-performance hardware, thereby saving hardware costs and reducing overall investment. At the same time, due to the improvement of algorithm efficiency, the present invention can consume less power when performing the same task, which helps to achieve green computing and reduce carbon emissions.

[0073] The above-described embodiments of the present invention do not constitute a limitation on the protection scope of the present invention. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for intelligent identification of Spartina alterniflora based on lightweight YOLOv8 algorithm, characterized in that: include: S1. Data collection and dataset establishment S2. Model construction S21. Download the pre-trained model YOLOv8 S22. Modify model configuration S221, use EfficientViT as the backbone network of the YOLOv8 model, and the EfficientVit Block contains lightweight MSA and improved C-MBConv; S222, before entering SPPF, first enter the improved C2f_Dattention module for processing; S223, use the optimized C2f_GhostNet network as the convolutional layer; S23. Model training and testing S3. Identification of Spartina alterniflora.

2. The intelligent identification method of Spartina alterniflora based on the lightweight YOLOv8 algorithm according to claim 1, characterized in that: In step S221, the improvement of C-MBConv includes: determining the convolution mode of MBConv to be depth-separable convolution, using a channel attention mechanism in the CABM attention mechanism, and adding a multi-layer perceptron (MLP) for nonlinear transformation, and obtaining a C-MBConv module through the adaptive combination of MBConv and CABM.

3. The intelligent identification method of Spartina alterniflora based on the lightweight YOLOv8 algorithm according to claim 1, characterized in that, In step S222, the improvement of C2f_Dattention includes: based on the C2f module, retaining the original attributes and image processing steps, embedding Bottleneck_Dattention as the attention mechanism into the basic network structure of C2f, and stacking it n times.

4. The intelligent identification method of Spartina alterniflora based on the lightweight YOLOv8 algorithm according to claim 1, characterized in that, The step S223 includes: (1) Replace the convolutional layer and replace the C2f module in the YOLOv8 model with the C2f_GhostNett network; (2) Integrate the GhostNet module. Based on the EfficientViT backbone network, use the Ghostbottleneck in GhostNet as the convolution layer of YOLOv8 to optimize the residual linear convolution operation.

Citation Information

Patent Citations

  • Spartina alterniflora identification and early warning method

    CN114782842A

Cited By

  • Spartina alterniflora identification method and system

    CN121305371A