Weed classification and detection method and system based on YOLOv8 improved algorithm

By improving the C2f-FADC module, DASI module, and task alignment detection head of the YOLOv8 algorithm, the problems of low feature extraction accuracy and efficiency in traditional target detection algorithms are solved, and higher accuracy weed classification and detection are achieved.

CN118762286BActive Publication Date: 2026-04-10SUQIAN COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUQIAN COLLEGE
Filing Date
2024-08-02
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional target detection algorithms suffer from low feature capture accuracy and low efficiency in feature extraction and processing, which affects the accuracy of weed classification and detection.

Method used

An improved YOLOv8-based algorithm is adopted, which improves the receptive field of convolution through the C2f-FADC module, performs adaptive selection and fine fusion of high and low dimensional features through the DASI module in the Neck network, and extracts task interaction features through the task alignment detection head to enhance weed detection performance.

Benefits of technology

It improves the accuracy of weed classification and detection, enhances the accuracy of detecting small targets, reduces the number of model parameters, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762286B_ABST
    Figure CN118762286B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of weed classification detection method and system based on YOLOv8 improved algorithm.The method comprises: the image to be detected containing weed is input to YOLOv8 improved algorithm model, the image data set after processing is input to the backbone network of YOLOv8 improved algorithm model, different scale image feature information is extracted by C2f-FADC module and input to Neck network, DASI module carries out low resolution high semantic information and high resolution low semantic information fusion, produces multi-scale semantic feature information and is transmitted to task alignment detection head, extracts different task interaction features, calculates classification features, obtains weed classification result.FADC module is used to replace Bottleneck module in C2f module, C2f-FADC module is proposed, and the module is integrated into backbone network, which can improve the receptive field of convolution;DASI module can well enhance the accuracy of small target detection by adaptive selection and fine fusion of high and low dimensional features, improve the performance of weed detection model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image recognition, in particular to a weed classification detection method and system based on a YOLOv8 improved algorithm. BACKGROUND

[0002] With the development of science and technology, various target detection algorithms have emerged. In the field of computer vision, convolutional neural networks (CNN) have become the main tool for image processing and feature extraction. However, with the increase in the number of convolutional layers and the deepening of the network depth, traditional convolutional networks have certain limitations in capturing high-frequency feature information. To this end, dilated convolution networks, multi-scale feature fusion networks, detection heads and other methods have been proposed to capture more accurate high-frequency feature information. The technical solution of dilated convolution has achieved good results in some applications. Dilated convolution expands the receptive field by inserting holes in the convolution kernel, thereby obtaining a larger feature map without increasing the number of parameters. Yolov8 uses a feature pyramid network (FPN) as a feature fusion network, which fuses features of different scales through a top-down path and horizontal connection. The detection head uses a parallel structure to capture features. However, for dilated convolution networks, as the dilation rate increases, the ability to capture high-frequency feature information gradually decreases, resulting in loss of detail in the feature map, and a fixed dilation rate cannot adapt to the needs of different frequency spectrum features. The top-down path and horizontal connection of the feature pyramid network can transmit high-level semantic information to low-level feature maps, but the information transmission efficiency is low, resulting in the loss of some feature information. FPN does not fully consider global context information in the feature fusion process, which affects the expression ability of the feature map and limits the performance of detection and classification. The feature fusion method of FPN is relatively simple and does not fully exploit and utilize the complementary information between different scale features, which affects the final detection accuracy. The traditional detection head uses a parallel structure that cannot fully utilize the context information of the feature map, has a large number of model parameters, and is inefficient, which limits the detection and classification accuracy.

[0003] Therefore, the traditional target detection method has low feature capture accuracy and low efficiency when extracting or processing features, which often affects the accuracy of target detection. SUMMARY

[0004] Therefore, in order to solve the above technical problems, a weed classification detection method and system based on a YOLOv8 improved algorithm are provided, which can improve the accuracy of weed classification detection.

[0005] A weed classification detection method based on a YOLOv8 improved algorithm, the method comprising:

[0006] The image to be detected containing various weeds is input into a YOLOv8 improved algorithm model, image preprocessing is performed through the YOLOv8 improved algorithm model, and a processed image data set is obtained.

[0007] The processed image data set is input into a backbone network in the YOLOv8 improved algorithm model, and different scale image feature information is extracted through a C2f-FADC module in the backbone network.

[0008] The different scale image feature information is input into a Neck network in the YOLOv8 improved algorithm model, a DASI module in the Neck network performs low-resolution high-semantic information and high-resolution low-semantic information fusion based on the different scale image feature information, and multi-scale semantic feature information is generated.

[0009] The multi-scale semantic feature information is transmitted to a task alignment detection head in the YOLOv8 improved algorithm model, different task interaction features are extracted through the task alignment detection head, classification features are calculated based on the interaction features, the classification features are input into a classification convolution to extract weed features for classification, and a weed classification result is obtained.

[0010] In one embodiment, the image preprocessing through the YOLOv8 improved algorithm model to obtain the processed image data set comprises:

[0011] The input layer in the YOLOv8 improved algorithm model performs scaling processing on the image to be detected to obtain a scaling-processed image to be detected.

[0012] The input layer performs a data enhancement operation on the scaling-processed image to be detected to obtain the processed image data set.

[0013] In one embodiment, the C2f-FADC module includes an adaptive dilation rate AdaDR module, an adaptive kernel AdaKern module, and a frequency selection FreqSelect module, and the different scale image feature information is extracted through the C2f-FADC module in the backbone network.

[0014] The adaptive dilation rate AdaDR module dynamically adjusts the convolution kernel dilation rate in a spatially varying manner, calculates the high-frequency power, and assigns different dilation rates to each pixel in the processed image data based on the high-frequency power;

[0015] The adaptive kernel AdaKern module adaptively adjusts the convolution kernel, decomposes the weight parameters of the convolution kernel into high and low frequency bands according to the dilation rate, and adjusts the frequency of the high and low frequency bands based on dynamic weighting.

[0016] The frequency selection module balances the high and low components of the frequency-adjusted feature map.

[0017] In one embodiment, the DASI module in the Neck network fuses low-resolution high semantic information and high-resolution low semantic information based on the image feature information of different scales, including:

[0018] The DASI module divides the image feature information of different scales into convolution groups through group convolution operation, and each convolution group includes low-dimensional features, high-dimensional features, and current features.

[0019] The DASI module calculates the activation function of the current features in each convolution group, and merges the low-dimensional features and high-dimensional features.

[0020] The merged features in each convolution group are fused and output.

[0021] In one embodiment, the method further includes:

[0022] The DASI module aligns the channels of each feature map based on the image feature information of different scales.

[0023] The aligned channel dimensions are divided through group convolution operation to obtain low-dimensional features, high-dimensional features, and current features after group convolution.

[0024] According to the current features after group convolution, the low-dimensional features and high-dimensional features after group convolution are fused to obtain fused features.

[0025] In one embodiment, the task alignment detection head extracts different task interaction features based on the task, and calculates classification features based on the interaction features, including:

[0026] The task alignment detection head learns task interaction features from multiple convolution layers through a feature extractor.

[0027] The localization branch in the task alignment detection head generates the offset and mask of deformable convolution using deformable convolution and the interaction features, and the classification branch uses the interaction features for dynamic feature selection to obtain classification features.

[0028] The classification features are input into a classification convolution to extract and classify weed features.

[0029] In one embodiment, the method further includes:

[0030] input the interaction features into a positioning convolution, output positioning features, and extract weed position information;

[0031] scale the positioning features through a scale layer, and detect an actual weed area.

[0032] In one embodiment, after the task alignment detection head extracts different task features, the method further includes:

[0033] The task alignment detection head extracts different task features, processes the different task features through a shared convolution and an activation function in the task alignment detection head, and calculates cross-layer task interaction features.

[0034] The cross-layer task interaction features are used to capture dependency relationships to assist in weed classification.

[0035] A weed classification and detection system based on a YOLOv8 improved algorithm, the system comprising:

[0036] An image processing module configured to obtain a to-be-detected image containing various weeds, input the to-be-detected image into a YOLOv8 improved algorithm model, and perform image preprocessing on the to-be-detected image through the YOLOv8 improved algorithm model to obtain a processed image dataset.

[0037] A feature information extraction module configured to input the processed image dataset into a backbone network in the YOLOv8 improved algorithm model, and extract image feature information of different scales through a C2f-FADC module in the backbone network.

[0038] An information fusion module configured to input the image feature information of different scales into a Neck network in the YOLOv8 improved algorithm model, and perform low-resolution high-semantic information and high-resolution low-semantic information fusion based on the image feature information of different scales through a DASI module in the Neck network to generate multi-scale semantic feature information.

[0039] A weed classification and detection module configured to transmit the multi-scale semantic feature information to a task alignment detection head in the YOLOv8 improved algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on the interaction features, input the classification features into a classification convolution to extract weed features for classification, and obtain a weed classification result.

[0040] The aforementioned weed classification and detection method and system based on the improved YOLOv8 algorithm improves the YOLOv8 algorithm by replacing the Bottleneck module in the C2f module with the FADC module, proposing the C2f-FADC module, and integrating this module into the backbone network. This improves the receptive field of the convolution, enabling it to better capture multi-dimensional feature information while reducing bandwidth reduction, allowing the model to better capture high-frequency feature components. The DASI module in the Neck network enhances the accuracy of small target detection through adaptive selection and fine fusion of high and low-dimensional features, further improving the model's performance in weed detection, thereby improving the accuracy of weed classification and detection. Attached Figure Description

[0041] Figure 1 This is an application environment diagram of a weed classification and detection method based on an improved YOLOv8 algorithm in one embodiment.

[0042] Figure 2 This is a flowchart illustrating a weed classification and detection method based on an improved YOLOv8 algorithm in one embodiment.

[0043] Figure 3 This is a schematic diagram of the structure of the improved YOLOv8 algorithm in one embodiment;

[0044] Figure 4 This is a schematic diagram of the FADC frequency adaptive convolution structure;

[0045] Figure 5 This is a comparative diagram of the C2f algorithm structure and the C2f-FADC algorithm structure;

[0046] Figure 6 A schematic diagram of the Global Fusion Diffusion Pyramid Network (GFDPN) structure;

[0047] Figure 7 This is a schematic diagram of the DASI module.

[0048] Figure 8 This is a schematic diagram of the traditional algorithm detection head structure;

[0049] Figure 9 A schematic diagram of the improved task alignment detection head ATDDH structure;

[0050] Figure 10 A schematic diagram of the task alignment predictor;

[0051] Figure 11 This is a partial structural diagram of the GFF-YOLOV8 algorithm;

[0052] Figure 12 Schematic diagram of partial images of various weeds and negative samples;

[0053] Figure 13 PR curve diagram of the GFF-YOLOv8 model;

[0054] Figure 14 Confusion matrix diagram of the GFF-YOLOv8 algorithm model;

[0055] Figure 15 YOLO series model comparison diagram;

[0056] Figure 16 、 17 GFF-YOLOv8 and benchmark model YOLOv8 in the training process Comparison experiment diagram of the GFF-YOLOv8 and benchmark model YOLOv8 in the training process;

[0057] Figure 18 、 19 The visualization result of the weed classification detection based on the weed classification detection method of the YOLOv8 improved algorithm;

[0058] Figure 20 The structure block diagram of the weed classification detection system based on the YOLOv8 improved algorithm in an embodiment;

[0059] Figure 21 The design process diagram of the GFF-YOLOv8 weed supervision platform;

[0060] Figure 22 The overall process diagram of the weed detection and counting based on the weed classification detection system based on the YOLOv8 improved algorithm;

[0061] Figure 23 The schematic diagram of the GFF-YOLOv8 weed supervision platform interface display;

[0062] Figure 24 The internal structure diagram of the computer device in an embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0064] The weed classification detection method based on the YOLOv8 improved algorithm provided by the embodiments of the present application can be applied in the application environment as shown in Figure 1 The weed classification detection method based on the YOLOv8 improved algorithm provided by the embodiments of the present application can be applied in the application environment as shown in Figure 1As shown, the application environment includes a computer device 110. The computer device 110 can obtain an image to be detected containing various weeds and input it into the YOLOv8 improved algorithm model, perform image preprocessing through the YOLOv8 improved algorithm model, and obtain a processed image data set; the computer device 110 can input the processed image data set into the backbone network in the YOLOv8 improved algorithm model, and extract image feature information of different scales through the C2f-FADC module in the backbone network; the computer device 110 can input the image feature information of different scales into the Neck network in the YOLOv8 improved algorithm model, and the DASI module in the Neck network performs low-resolution high-semantic information and high-resolution low-semantic information fusion based on the image feature information of different scales to generate multi-scale semantic feature information; the computer device 110 can transmit the multi-scale semantic feature information to the task alignment detection head in the YOLOv8 improved algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on the interaction features, input the classification features into the classification convolution to extract weed features for classification, and obtain a weed classification result. The computer device 110 can be, but is not limited to, various personal computers, notebook computers, smart phones, robots, unmanned aerial vehicles, tablet computers and the like.

[0065] In one embodiment, as shown in Figure 2 a weed classification detection method based on a YOLOv8 improved algorithm is provided, including the following steps:

[0066] In step 202, an image to be detected containing various weeds is obtained and input into a YOLOv8 improved algorithm model, and image preprocessing is performed through the YOLOv8 improved algorithm model to obtain a processed image data set.

[0067] The image to be detected can contain various types of weeds, which are input into the YOLOv8 improved algorithm model for weed classification detection. The improved YOLOv8 algorithm can be referred to as a GFF-YOLOV8 algorithm, and the model based on the GFF-YOLOV8 algorithm is used for weed classification detection.

[0068] In one embodiment, the weed classification detection method based on the YOLOv8 improved algorithm can further include an image preprocessing process, and the specific process includes: performing scaling processing on the image to be detected through the input layer in the YOLOv8 improved algorithm model to obtain a scaled image to be detected; and performing data enhancement operations on the scaled image to be detected through the input layer to obtain a processed image data set.

[0069] Specifically, the input layer of the improved YOLOv8 algorithm model performs preprocessing operations on the image, so that the input image is adaptively scaled, and the data processing efficiency is improved, wherein the default image input size is 640*640. In this embodiment, in the input layer of the improved YOLOv8 algorithm model, the data set can be effectively expanded through data enhancement operations, and the robustness of the model can be enhanced.

[0070] In step 204, the processed image data set is input into the backbone network in the improved YOLOv8 algorithm model, and different scale image feature information is extracted through the C2f-FADC module in the backbone network.

[0071] The structure of the improved YOLOv8 algorithm, that is, the GFF-YOLOv8 algorithm, is as shown in Figure 3 The backbone network (backbone, bc) in the improved YOLOv8 algorithm model is composed of conv, C2f-FADC and sppf. The conv (standard convolution module) is composed of Conv2d, BN and SiLu. The C2f-FADC divides the output of the first convolution layer, and a part directly skips n Bottleneck, and the other part is linked to the last through cross-layer connection after each layer operation, and then performs concat operation with the previous part. The C2f is connected through multiple cross-layer connections, which not only ensures the lightweight of the model, but also enriches the gradient flow information of the model. The sppf is a reconstruction of SPP. The SPPF cascades multiple small poolings, so that the model has smaller calculation amount, and realizes the feature map fusion operation of local features and global features.

[0072] In one embodiment, the C2f-FADC module includes an adaptive dilation rate AdaDR module, an adaptive kernel AdaKern module, and a frequency selection FreqSelect module. The provided weed classification and detection method based on the improved YOLOv8 algorithm can further include a process of extracting image feature information, and the specific process includes: the adaptive dilation rate AdaDR module dynamically adjusts the convolution kernel dilation rate in a spatially varying manner, calculates the high-frequency power, and assigns different dilation rates to each pixel in the image data after high-frequency power processing; the adaptive kernel AdaKern module adaptively adjusts the convolution kernel, decomposes the weight parameters of the convolution kernel into high and low frequency bands according to the dilation rate, and adjusts the frequency of the high and low frequency bands based on dynamic weighting; and the frequency selection FreqSelect module balances the high and low components of the feature map after frequency adjustment.

[0073] Specifically, in this embodiment, the structure of the Frequency-Adaptive Dilated Convolution (FADC) frequency-adaptive convolution is as shown in Figure 4As shown, FADC mainly consists of three modules: Adaptive Dilation Rate (AdaDR), Adaptive Kernel (AdaKern), and Frequency Selection (FreqSelect). The AdaDR module dynamically adjusts the convolution kernel dilation rate in a spatially varying manner to balance effective bandwidth and receptive field size, assigning a different dilation rate to each pixel. The allocation formula is as follows: Where, Δp i It is the i-th position of the predefined network sampling, X(p+Δp) i ) represents the pixel value at position p, the center of the receptive field corresponding to the auxiliary feature map, and the pixel offset is Δp. i , It is predicted using a convolutional layer with parameter θ. HP represents high-frequency power. - and HP + These represent the minimum and maximum values ​​of high-frequency power, respectively, because for local features, the receptive field of the parameter and There is a positive correlation; however, as the receptive field increases, high-frequency information cannot be captured. Therefore, the lost frequency information is measured by calculating the high-frequency power, and optimization is performed. That is, the expansion rate is increased when the receptive field position of HP(p) is low, while the expansion rate is suppressed when the receptive field position of HP(p) is high, so as to reduce the loss of frequency information.

[0074] The AdaKern module adaptively adjusts the kernel to fully utilize bandwidth. After assigning a dilation rate to each pixel individually based on AdaDR, the weight parameters of the convolution kernel are also decomposed into high and low frequency bands, and the frequency response is adjusted through dynamic weighting. The calculation formula is as follows: in, The average weight of the convolution kernel is represented by , while the high-frequency components that decay easily are represented by . Indicates that λ l and λ h These are the dynamic weights of the channels, calculated through global pooling and convolutional layers, and dynamically adjusted based on the context. The ratio allows the network to focus on specific frequencies, making it more adaptable to complex visual tasks.

[0075] The FreqSelect module increases the receptive field of the convolutional kernel by balancing the high and low components of the feature map. Specifically, the high and low components are... The components of these four frequency bands. First, the features are decomposed into different frequency bands by using different masks in the Fourier domain: X b =F -1 (M b X F ), where F -1representing the inverse fast Fourier transform, M b is a binary mask for extracting the corresponding frequency. where φ b ,φ b+1 are thresholds from b+1 predetermined frequencies, and the subsequent frequency selection dynamically spatially weights different band components, where X(i,j) is the frequency balanced feature after feature selection, A b denotes the feature map of the bth band.

[0076] where the three strategies of AdaDR, AdaKern and FreqSelect are used to encourage the use of expansion rate of dynamic expansion convolution, so as to suppress high frequency attenuation and enhance spatial adaptability.

[0077] In this embodiment, the C2f-FADC module is proposed by replacing the Bottleneck module in the C2f module with the FADC module, and the module is integrated into the backbone network. The C2f algorithm structure (a) and the C2f-FADC algorithm structure (b) are shown in Figure 5 After continuous downsampling in the backbone network, low language information may be lost. In order to better preserve low frequency components while increasing the receptive field, the receptive field of convolution is improved by integrating the FADC module in C2f, which can better capture multi-dimensional feature information while reducing bandwidth reduction, so that the model can better capture high frequency feature components. It is particularly important for weed target detection. Weeds usually have similar color and texture features, so multi-dimensional feature components are very important for weed target detection. The backbone after the C2f-FADC module improves the feature extraction capability of the backbone network, and the output feature map will save more dimensional feature information, effectively improving the network's ability to classify and detect different types of weeds.

[0078] Step 206, input the image feature information of different scales into the Neck network in the improved YOLOv8 algorithm model. The DASI module in the Neck network fuses low resolution high semantic information and high resolution low semantic information based on image feature information of different scales to generate multi-scale semantic feature information.

[0079] In one embodiment, the provided weed classification and detection method based on the improved YOLOv8 algorithm can further include a feature information fusion process, and the specific process includes: the DASI module divides image feature information of different scales into various convolution groups through group convolution operation, and each convolution group includes low-dimensional features, high-dimensional features, and current features; the DASI module performs activation function calculation on the current features in each convolution group respectively, and performs feature merging according to the low-dimensional features and the high-dimensional features; and the merged features in each convolution group are subjected to fusion operation and output.

[0080] In one embodiment, the computer device can further perform channel alignment on various feature maps based on image feature information of different scales through the DASI module; divide the channel dimensions of the aligned channels by group convolution operation to obtain low-dimensional features, high-dimensional features, and current features after group convolution; fuse the low-dimensional features and the high-dimensional features after group convolution according to the current features after group convolution to obtain fused features; and output the fused features after convolution, batch normalization, and ReLu activation processing.

[0081] In the present embodiment, after multiple down-sampling of the input image, the high-dimensional features can lose the information of small targets, and the low-dimensional features cannot sufficiently provide context information. To solve this problem, the DASI fuses feature information of different dimensions through convolution and interpolation operation, and then divides the fused feature maps into four groups through group convolution operation. Each group of convolution is divided into low-dimensional features li and high-dimensional features hi and current features, and the current features obtain an a value through a Sigmoid activation function and are multiplied with the high-dimensional and low-dimensional features respectively. Specifically, if a>0.5, the model will give priority to fine-grained features, and if a<0.5, the model will emphasize the high-dimensional and low-dimensional features. After selecting appropriate high-dimensional and low-dimensional features, the features are merged, and finally the four groups of feature information are subjected to channel dimension fusion operation. The fused feature information is subjected to convolution, normalization, and ReLu activation to obtain the final output value. The DASI module can well enhance the accuracy of small target detection through adaptive selection and fine fusion of high-dimensional and low-dimensional features.

[0082] Specifically, after the input image passes through the backbone network, feature information of different scales will be sent to the neck structure. The main function of the neck structure is feature fusion and feature enhancement. By processing the multi-scale features extracted by the backbone network, more representative feature maps are generated. In order to better fuse multi-scale features and enhance the relevance of features of different dimensions, a global fusion diffusion pyramid network (GFDPN) structure is proposed in the present embodiment, and the GFDPN structure is as shown in Figure 6As shown, the DASI module fuses features of different scales along the channel dimension. Specifically, the DASI module first aligns the P3, P4, and P5 channels of the input feature map, and then divides the features into four equal channels using group convolution. The low-dimensional feature, high-dimensional feature, and current-dimensional feature of the current input are respectively: The features after grouped convolution are as follows: high-dimensional features low-dimensional features Current features Then, high- and low-dimensional features are finely fused based on the current feature channels to improve the saliency of small objects. The formula is: α = sigmoid(u i ),u′ i =αl i +(1-α)h i Where α is u i u′ is obtained through the sigmoid activation function. i It is the result of fusing high- and low-dimensional feature regions, through... Merging along the channel dimension to obtain fusion features Finally, the final output is obtained through convolution (Conv), batch normalization (BN), and ReLU activation (δ). Output The calculation formula is:

[0083] The structure of the DASI module is as follows: Figure 7 As shown, the channel partitioning mechanism adaptively selects appropriate features for fusion based on object size and characteristics. This strategy is particularly suitable for targets like weeds that vary in size but possess similar features. The fused multi-dimensional feature information is then processed through different upsampling, downsampling, and diffusion mechanisms. The feature map after upsampling is concatenated with the original input information and then fused with the multi-dimensional features after the next DASI pass through the diffusion mechanism. The feature information after the first concatenation is processed by C2f and then concatenated with the feature information transmitted through the diffusion mechanism after the previous sampling and the information fused and sampled by the next DASI module. Through multi-dimensional feature fusion and diffusion, the model can better capture detailed and global information, allowing the detection layer to obtain richer and more comprehensive feature representations, further improving the model's performance in weed detection.

[0084] Step 208: Transmit multi-scale semantic feature information to the task alignment detection head in the YOLOv8 improved algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on interaction features, input classification convolution to extract weed features for classification, and obtain weed classification results.

[0085] The performance of the detection head plays an important role in object classification and positioning, and the traditional algorithm detection head structure, as shown in Figure 8 Lacks interaction ability and occupies a large number of parameters in the entire network structure. In the embodiment, the traditional algorithm detection head is improved, and the improved task alignment detection head ATDDH structure, as shown in Figure 9 Balances the task interaction and task-specific functions. Through task alignment learning (TAL), the model is explicitly aware of the best anchor points for the two tasks during training through sample allocation schemes and task alignment losses.

[0086] In one embodiment, the improved YOLOv8 algorithm-based weed classification and detection method can further include a process of extracting interaction features through the task alignment detection head, which includes: the task alignment detection head learns task interaction features from multiple convolution layers through a feature extractor; the positioning branch in the task alignment detection head generates the offset and mask of deformable convolution using deformable convolution and the interaction features, and generates classification features through dynamic feature selection using the interaction features through the classification branch; and the classification features are input into classification convolution to extract weed features for classification.

[0087] In one embodiment, the interaction features can also be input into the positioning convolution to output positioning features and extract weed position information; and the positioning features are scaled through a scale layer to detect the actual weed area. Specifically, while using shared convolution, in order to deal with the problem of inconsistent target scales detected by each detection head, the scale layer is used to scale the features.

[0088] In one embodiment, the computer device can also extract different task features through the task alignment detection head, process the different task features through shared convolution and activation functions in the task alignment detection head, and calculate cross-layer task interaction features; and the cross-layer task interaction features are used to capture dependency relationships to assist in weed classification.

[0089] The neck structure fuses the extracted same feature channels The fusion is performed by shared convolution, and the fused interaction features are used to generate Mask and Offset to provide deformable convolution DCN2, which enhances the task interaction capability, and the fused interaction features are used for dynamic feature selection after task decomposition. Through the task alignment predictor, two different task features are extracted respectively, and finally the localization task is realized by using the deformable convolution, and the classification features are obtained by multiplying the weight parameters after dynamic feature selection and the results of another part of task prediction, and then sent to the classification convolution to extract the weed features for classification. Finally, in order to solve the problem of different target scales of each detection head, the scale layer is used to scale the features.

[0090] As shown in Figure 9 , TaskDecomposition, Conv_GN, DCNV2 are task alignment predictor, shared convolution and deformable convolution respectively. Since the targets of object classification task and positioning task are different, the types of features concerned are also different, therefore, a layer attention mechanism is proposed in the embodiment to encourage task decomposition by dynamically calculating the features of these specific tasks at the layer level, and the specific task features for each classification or positioning task are calculated separately.

[0091] The structure of the task alignment predictor is shown in Figure 10 , wherein w is calculated according to the cross-layer task interaction feature, which can capture the dependency between layers, w=σ(Conv2(δ(Conv1(x inter ))))), wherein x inter is the interaction feature obtained by inputting through global average pooling, Conv1 and Conv2 are two 1*1 shareable convolutions, δ is a Relu activation function, σ is a sigmoid activation function, and finally the classification or positioning result is predicted according to x task , X output =conv2(δ(conv1(X task ))).

[0092] In one embodiment, a weed classification and detection method based on a YOLOv8 improved algorithm is provided, which specifically includes: inputting a to-be-detected image containing various weeds into a YOLOv8 improved algorithm model, i.e., a GFF-YOLOV8 algorithm, for image preprocessing, and sending the processed image dataset into a backbone network BC; after the BC, the feature information of the input image will be sent into a Neck structure; the Neck network of the GFF-YOLOv8 algorithm combines the characteristics of FPN and HCF-Net. The Neck network fuses the low-resolution high-semantic information and the high-resolution low-semantic information in the BC network to generate multi-scale semantic-rich features for the detection head to detect the target. The detection head of the GFF-YOLOv8 algorithm is an adaptive task dynamic alignment detection head (ATDDH), which balances the task interaction and the task-specific function, combines the task alignment learning (TAL) mode, and through the sample allocation scheme and the task alignment loss, the model determines the best anchor point of the two tasks during training. Then, the same channel features are fused through shared convolution, and then task alignment predictors are used to extract two different task features, finally, the positioning task is realized using the variability convolution, the classification features are obtained by multiplying the weight parameters after the dynamic feature selection and the results of another part of the task prediction, and the classification convolution is used to extract the weed features for classification.

[0093] In the present embodiment, part of the structure of the GFF-YOLOV8 algorithm is as shown in Figure 11 Upsample represents the upsample operation, which usually expands the smaller feature map to a larger size through transposed convolution, so as to restore the details of the image; Conv is a convolution operation used to extract the features of the input image; C2f is an improved convolution operation, which aims to improve the network performance by partially connecting and gradually fusing the features of different stages; Concat represents aggregation, which is an operation of connecting multiple feature maps in a certain dimension.

[0094] In one embodiment, in order to verify the performance of the GFF-YOLOV8 algorithm model provided in the present application, experiments are carried out, and the specific process includes:

[0095] The dataset, consisting of 17,509 labeled weed images, was divided into three subsets: training (70%), validation (20%), and test (10%). During training, images were labeled with abbreviations for each class: chineeapple was replaced with C_App, Lantana with Lntna, PricklyAcacia with P_acacia, parthenium with P_nium, parkinonia with P_sonia, Rubber Vine with R_vine, siam weed with S_weed, snakeweed with Snk_wd, and negatives with Ngtv. Sample images of various weeds and negative samples are shown below. Figure 12 The following are listed: Chinee Apple (Fig. 8(a)), Lantana (Fig. 8(b)), Negatives (Fig. 8(c)), Prickly Acacia (Fig. 8(d)), Parthenium (Fig. 8(e)), Parkinsonia (Fig. 8(f)), Rubber Vine (Fig. 8(g)), Siam Weed (Fig. 8(h)), and Snake Weed (Fig. 8(i)). The 17,509 tagged weed images are shown in the table below:

[0096]

[0097] After using the GFF-YOLOv8 algorithm model from this application to perform weed classification and detection on each weed image in the dataset, the PR curve of the GFF-YOLOv8 model is as follows: Figure 13 As shown, the proposed GFF-YOLOV8 algorithm is particularly effective in detecting Parkinsonia and Rubber Vine weeds, achieving AP values ​​of 88.6% and 87.2% respectively, which are further improvements compared to the baseline models (Parkinsonia: 85.6% and Rubber Vine: 86.9%). Furthermore, in comparative experiments, the AP values ​​of the proposed GFF-YOLOV8 algorithm model are mostly higher than those of the baseline models.

[0098] The confusion matrix of the GFF-YOLOv8 algorithm model is as follows: Figure 14 As shown in the figure, each column represents the predicted category, each row represents the actual category, and the sum of the columns is 1. It can be seen from the figure that the prediction is accurate for most targets, which shows that the GFF-YOLOv8 algorithm proposed in this application performs well in completing the weed detection task.

[0099] Next, in this embodiment, the ablation experiment was conducted on the algorithm. The experimental results are shown in the table below:

[0100]

[0101] In the algorithm backbone network, the C2-FADC module is added, then the neck of the algorithm is replaced with GFDPN, and finally the shared convolution and task alignment method is used in the detection head structure of the model to greatly reduce the parameter amount while further improving the model precision. The addition of the C2-FADC module increases the mAP of the model by 0.33%, then using GFDPN instead of the traditional neck, the mAP value of the algorithm increases by 0.9%, and the model parameters are reduced by 7.31% based on the benchmark model, finally using ATDDH algorithm to replace the traditional detection head of the model, the model reduces the model parameters to 85% of the original on the basis of further improving the accuracy by 0.13%.

[0102] In this embodiment, in order to prove the superiority of the GFF-YOLOv8 algorithm model in the present application, the GFF-YOLOv8 algorithm model in the present application is compared with a series of algorithms such as R-CNN and SSD, and the experimental results are as shown in the following table:

[0103]

[0104]

[0105] The mAP@0.5 and mAP@0.5-0.95 precision of the algorithm proposed in the present application are better than those of other algorithms, and the algorithm proposed in the present application has higher detection precision than previous series of yolo algorithms, as shown in the following table:

[0106]

[0107] As shown in Figure 15 , the previous series of yolo algorithms are compared with the algorithm proposed in the present application, the algorithm proposed in the present application shows higher mAP, proving that the algorithm proposed in the present application has higher weed recognition precision and robust stability.

[0108] As Figure 16 , 17As shown, the comparative experiments of GFF-YOLOv8 (orange curve) and the benchmark model YOLOv8 (blue curve) in the training process are shown. It is obvious that the loss function of the improved algorithm gradually converges after 100 epochs of training, and converges faster and has lower loss value on the validation set. In the last epoch of the validation set, the box_loss loss value of the original YOLOv8n algorithm is 0.65408, the cls_loss loss value is 0.68789, and the dfl_loss loss value is 1.3313. In contrast, in the last epoch on the validation set, the box_loss loss value of the GFF-YOLOv8n algorithm is 0.60933, the cls_loss loss value is 0.62072, and the dfl_loss loss value is 1.3355. This shows that in the improved algorithm, the loss values of box_loss, cls_loss and dfl_loss are reduced by 0.04475, 0.06717 and 0.00, respectively. The reduction of the loss function value indicates that the improved algorithm has a more accurate prediction result and better weed detection performance.

[0109] After using the weed classification and detection method based on the YOLOv8 improved algorithm in the present application for weed classification and detection, the visualization results are as shown in Figure 18 、 19 As shown, the YOLOv8 improved algorithm can accurately extract target features to obtain good detection results. The reason for the different detection accuracies is that smaller targets occupy fewer pixels in the image, making it difficult for the algorithm to extract enough feature information from these pixels, resulting in inaccurate target detection. Therefore, the detection accuracy of larger targets is usually significantly higher than that of smaller targets.

[0110] It should be understood that although each step in the above flowchart is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the above flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0111] In one embodiment, as Figure 20As shown, a weed classification detection system based on a YOLOv8 improved algorithm is provided, comprising: an image processing module 2010, a feature information extraction module 2020, an information fusion module 2030, and a weed classification detection module 2040, wherein:

[0112] The image processing module 2010 is configured to input an image containing various weeds to be detected into the YOLOv8 improved algorithm model, perform image preprocessing through the YOLOv8 improved algorithm model, and obtain a processed image dataset.

[0113] The feature information extraction module 2020 is configured to input the processed image dataset into a backbone network in the YOLOv8 improved algorithm model, and extract image feature information of different scales through a C2f-FADC module in the backbone network.

[0114] The information fusion module 2030 is configured to input the image feature information of different scales into a Neck network in the YOLOv8 improved algorithm model, and a DASI module in the Neck network performs low-resolution high-semantic information and high-resolution low-semantic information fusion based on the image feature information of different scales to generate multi-scale semantic feature information.

[0115] The weed classification detection module 2040 is configured to transmit the multi-scale semantic feature information to a task alignment detection head in the YOLOv8 improved algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on the interaction features, input the classification features into a classification convolution to extract weed features for classification, and obtain a weed classification result.

[0116] In one embodiment, the image processing module 2010 is further configured to perform scaling processing on the image to be detected through an input layer in the YOLOv8 improved algorithm model to obtain a scaled image to be detected, and perform a data enhancement operation on the scaled image to be detected to obtain the processed image dataset.

[0117] In one embodiment, the C2f-FADC module includes an adaptive dilation rate AdaDR module, an adaptive kernel AdaKern module, and a frequency selection FreqSelect module. The feature information extraction module 2020 is further configured to dynamically adjust the convolution kernel dilation rate in a spatially varying manner through the adaptive dilation rate AdaDR module, calculate the high-frequency power, and assign different dilation rates to each pixel in the processed image data based on the high-frequency power. The adaptive kernel AdaKern module adaptively adjusts the convolution kernel, decomposes the weight parameters of the convolution kernel into high and low frequency bands according to the dilation rate, and adjusts the frequency of the high and low frequency bands based on dynamic weighting. The frequency selection FreqSelect module balances the high and low components of the frequency-adjusted feature map.

[0118] In one embodiment, the information fusion module 2030 is further configured to divide image feature information of different scales into various convolutional groups through group convolution operations, each convolutional group containing low-dimensional features, high-dimensional features, and current features; calculate activation functions for the current features in each convolutional group through the DASI module, and merge features based on low-dimensional features and high-dimensional features; and perform a fusion operation on the merged features in each convolutional group and output them.

[0119] In one embodiment, the information fusion module 2030 is further configured to align the channels of each feature map based on image feature information at different scales using the DASI module; divide the aligned channel dimensions by group convolution operation to obtain low-dimensional features, high-dimensional features, and current features after group convolution; fuse the low-dimensional features and high-dimensional features after group convolution based on the current features after group convolution to obtain fused features; and output the fused features after convolution, batch normalization, and ReLU activation processing.

[0120] In one embodiment, the weed classification and detection module 2040 is further configured to have a task alignment detection head learn task interaction features from multiple convolutional layers through a feature extractor; the localization branch in the task alignment detection head uses deformable convolution and the interaction features to generate the offset and mask of deformable convolution, and uses the interaction features through the classification branch to perform dynamic feature selection to obtain classification features; the classification features are input into the classification convolution to extract weed features for classification.

[0121] In one embodiment, the weed classification and detection module 2040 is further configured to input interactive features into a localization convolution, output localization features, and extract weed location information; and to detect the actual weed area by scaling the localization features through a scale layer.

[0122] In one embodiment, the weed classification and detection module 2040 is further configured to extract different task features through the task alignment detection head, process the different task features through the shared convolution and activation functions in the task alignment detection head, calculate cross-layer task interaction features, and capture dependencies based on the cross-layer task interaction features to assist in weed classification.

[0123] In one embodiment, such as Figure 21 The diagram illustrates the design flow of the GFF-YOLOv8 weed monitoring platform. The GFF-YOLOv8 weed monitoring platform is software designed as a bridge between users and imaging hardware and computer vision algorithms, primarily implementing two functions: image acquisition and weed detection. These two functions are achieved through a camera interface and the deployment of a deep learning model, respectively, detailed as follows:

[0124] As a bridge between users and imaging hardware and computer vision algorithms, the software has two main functions, namely image acquisition and weed detection, which are realized through camera interface and deployment of deep learning model respectively. In terms of camera interface, users can control the camera parameter settings that affect image acquisition, display and weed detection. Users can set camera parameters in detail through the software interface, such as exposure time, white balance, focus mode, ISO sensitivity, etc., which directly affect the quality of image acquisition and thus affect the subsequent weed detection effect. The software provides real-time display function, users can real-time view the image stream collected by the camera on the graphical user interface, to ensure the real-time and accuracy of image acquisition. In addition, users can set the frequency and other acquisition conditions of image acquisition to meet the needs of different scenarios.

[0125] In terms of model deployment, users can flexibly use the pre-trained GFF-YOLOv8 model for weed recognition and detection to detect weeds in image stream. The software interface allows users to select appropriate models and configure them according to actual application needs. Users only need to perform simple operations to complete model loading and deployment, and the software will automatically process image stream and perform real-time weed detection.

[0126] In addition, the graphical user interface also provides rich functions for displaying weed detection statistical data. Users can view the number, type and location of detected weeds, making it easy to analyze and evaluate the current detection results. The software also supports saving original images and detected images in real time, making it easy for users to subsequently evaluate and improve the performance of weed detection. Users can easily manage these image files through the software interface to achieve long-term tracking and research of detection results.

[0127] Through the above design, the GFF-YOLOv8 weed monitoring platform realizes seamless integration of image acquisition and weed detection, providing users with a powerful and flexible tool to help efficiently complete weed detection tasks.

[0128] Specifically, the overall process of weed detection and counting using the weed classification and detection system based on the improved YOLOv8 algorithm in the present application is as shown in Figure 22 The main purpose of data set preparation is to create a data set for training deep learning models, mainly involving image enhancement, image cropping, data augmentation and weed data labeling; image enhancement includes adjusting the brightness, contrast, saturation, etc. of the image to increase the diversity of the data; image cropping is to crop large images into small pieces so that the model can be processed more effectively; data augmentation further increases the amount of data through rotation, flipping, scaling, etc.; finally, weed data labeling is performed, manually labeling the position and category of weeds in the image to provide label data required for model training and verification.

[0129] The weed detection model construction module proposes a GFF-YOLOv8 algorithm. First, the GFF-YOLOv8 model is trained and verified on the prepared dataset to obtain the weed detection results of each image; during the training process, the model improves the recognition accuracy and recall rate of weeds through repeated iteration and optimization; during the verification process, the performance of the model is evaluated by comparing the model prediction results with the labeled data, and necessary parameter adjustment and improvement are made.

[0130] The duplicate component removal module is mainly responsible for splicing the detection results of each image back to the original size and removing the duplicates of the weed detection frames. This step restores the cropped image block detection results to the original image and uses algorithms to remove overlapping and duplicate detection boxes, ensuring that each weed is counted only once. Finally, the detected weed quantity and distribution are retrieved and counted from the original image, providing a reliable basis for subsequent data analysis and application.

[0131] Through the above process, the experiment can effectively create and utilize the weed detection dataset, train and verify the efficient detection model, and accurately count the detection results of weeds, providing support for further research and practical application. The final detection results can be displayed on the GFF-YOLOv8 weed monitoring platform interface as shown in Figure 23 .

[0132] In one embodiment, a computer device, which can be a terminal, has an internal structure diagram as shown in Figure 24 . The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a weed classification and detection method based on the improved YOLOv8 algorithm. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad provided on the computer device housing. It can also be an external keyboard, touchpad, or mouse, etc.

[0133] Those skilled in the art can understand, Figure 24The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0134] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the weed classification and detection method based on the improved YOLOv8 algorithm when executing the computer program.

[0135] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the processor implements the steps of the weed classification and detection method based on the improved YOLOv8 algorithm when executing the computer program.

[0136] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium and can include the processes of the above-mentioned embodiments when executed. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0137] Each technical feature of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0138] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A weed classification and detection method based on a YOLOv8 improved algorithm, characterized in that, The method comprises: acquire the image containing various weeds to be detected input into the improved YOLOv8 algorithm model, and perform image preprocessing on the image through the improved YOLOv8 algorithm model to obtain a processed image dataset; input the processed image dataset into a backbone network in the improved YOLOv8 algorithm model, and extract image feature information of different scales through a C2f-FADC module in the backbone network; the C2f-FADC module comprises an adaptive dilation rate AdaDR module, an adaptive kernel AdaKern module, and a frequency selection FreqSelect module; the image feature information of different scales is extracted through the C2f-FADC module in the backbone network, which comprises: the adaptive dilation rate AdaDR module dynamically adjusts the convolution kernel inflation rate in a spatially varying manner, calculates the high-frequency power, and assigns different inflation rates to each pixel in the processed image data based on the high-frequency power; the adaptive kernel AdaKern module adaptively adjusts the convolution kernel, decomposes the weight parameters of the convolution kernel into high and low frequency bands according to the inflation rate, and adjusts the frequency of the high and low frequency bands based on dynamic weighting; the frequency selection FreqSelect module balances the high and low components of the frequency-adjusted feature map; input the image feature information of different scales into a Neck network in the improved YOLOv8 algorithm model, and a DASI module in the Neck network fuses low-resolution high-semantic information and high-resolution low-semantic information based on the image feature information of different scales to generate multi-scale semantic feature information; the DASI module in the Neck network fuses low-resolution high-semantic information and high-resolution low-semantic information based on the image feature information of different scales, which comprises: the DASI module divides the image feature information of different scales into convolution groups through group convolution operation, each convolution group comprising low-dimensional features, high-dimensional features, and current features; the DASI module calculates the activation function of the current features in each convolution group respectively, and merges the features according to the low-dimensional features and high-dimensional features; the merged features in each convolution group are fused and output; transmit the multi-scale semantic feature information to a task alignment detection head in the improved YOLOv8 algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on the interaction features, input the classification features into classification convolution to extract weed features for classification, and obtain weed classification results.

2. The weed classification and detection method based on the improved YOLOv8 algorithm according to claim 1, characterized in that, the improved YOLOv8 algorithm model to obtain a processed image dataset, comprising: scaling the image to be detected through an input layer in the improved YOLOv8 algorithm model to obtain a scaled image to be detected; perform data enhancement operation on the scaled image to be detected through the input layer to obtain a processed image dataset.

3. The weed classification and detection method based on the improved YOLOv8 algorithm according to claim 1, characterized in that, The method further comprises: aligning the respective feature maps in the channel dimension based on the image feature information of different scales through the DASI module; dividing the aligned channel dimension through a group convolution operation to obtain low-dimensional features, high-dimensional features, and current features after group convolution; fusing the low-dimensional features and the high-dimensional features after group convolution based on the current features after group convolution to obtain fused features; outputting after convolution, batch normalization, and ReLu activation processing of the fused features.

4. The weed classification and detection method based on the improved YOLOv8 algorithm according to claim 1, characterized in that, The task alignment detection head extracts different task interaction features and calculates classification features based on the interaction features, including: The task alignment detection head learns task interaction features from multiple convolution layers through a feature extractor; The localization branch in the task alignment detection head generates the offset and mask of deformable convolution using deformable convolution and the interaction features, and generates classification features through dynamic feature selection using the interaction features through the classification branch; The classification features are input into classification convolution to extract weed features for classification.

5. The weed classification and detection method based on the improved YOLOv8 algorithm according to claim 4, characterized in that, The method further comprises: The interaction features are input into localization convolution to output localization features and extract weed location information; The localization features are scaled through a scale layer to detect actual weed areas.

6. The weed classification and detection method based on the improved YOLOv8 algorithm according to claim 4, characterized in that, After the task alignment detection head extracts different task features, the method further comprises: The task alignment detection head extracts different task features, and the shared convolution and activation function in the task alignment detection head process the different task features to calculate cross-layer task interaction features; The cross-layer task interaction features capture dependency relationships to assist in weed classification.

7. A weed classification and detection system based on a YOLOv8 improved algorithm, characterized in that, The system comprises: An image processing module configured to input an image containing various types of weeds to be detected into a YOLOv8 improved algorithm model, and to perform image preprocessing on the image through the YOLOv8 improved algorithm model to obtain a processed image dataset; A feature information extraction module configured to input the processed image dataset into a backbone network in the YOLOv8 improved algorithm model, and to extract image feature information of different scales through a C2f-FADC module in the backbone network; the C2f-FADC module comprises an adaptive dilation rate AdaDR module, an adaptive kernel AdaKern module, and a frequency selection FreqSelect module; the C2f-FADC module extracts image feature information of different scales by: the adaptive dilation rate AdaDR module dynamically adjusts the convolution kernel dilation rate in a spatially varying manner, calculates the high-frequency power, and assigns different dilation rates to each pixel in the processed image data based on the high-frequency power; the adaptive kernel AdaKern module adaptively adjusts the convolution kernel, decomposes the weight parameters of the convolution kernel into high and low frequency bands according to the dilation rate, and adjusts the frequency of the high and low frequency bands based on dynamic weighting; and the frequency selection FreqSelect module balances the high and low components of the feature map after frequency adjustment. The information fusion module is configured to input the image feature information of different scales into a Neck network in the improved YOLOv8 algorithm model, and a DASI module in the Neck network is configured to perform low-resolution high-semantics information and high-resolution low-semantics information fusion based on the image feature information of different scales to generate multi-scale semantic feature information; the DASI module in the Neck network is configured to perform low-resolution high-semantics information and high-resolution low-semantics information fusion based on the image feature information of different scales, including: the DASI module divides the image feature information of different scales into convolution groups through group convolution operation, each convolution group containing low-dimensional features, high-dimensional features, and current features; the DASI module is configured to perform activation function calculation on the current features in each convolution group respectively, and perform feature merging according to the low-dimensional features and the high-dimensional features; and the DASI module is configured to perform fusion operation on the merged features in each convolution group and output the features. The weed classification and detection module is configured to transmit the multi-scale semantic feature information to a task alignment detection head in the improved YOLOv8 algorithm model, extract different task interaction features through the task alignment detection head, calculate classification features based on the interaction features, input the classification features into a classification convolution to extract weed features for classification, and obtain a weed classification result.

8. The weed classification and detection system based on the improved YOLOv8 algorithm according to claim 7, characterized in that, The image processing module is further configured to perform scaling processing on the to-be-detected image through an input layer in the improved YOLOv8 algorithm model to obtain a scaled to-be-detected image, and perform data enhancement operation on the scaled to-be-detected image to obtain a processed image data set.