Sugarcane seed bud detection method based on improved YOLOv8 model

By improving the YOLOv8 model, constructing a sugarcane seed sprout image dataset, and introducing spatial and channel reconstruction convolution modules, normalized attention modules, and Focal_CIoU loss functions, the problem of low efficiency in traditional manual screening of sugarcane seed sprouts was solved, achieving efficient and accurate sugarcane seed sprout detection.

CN121837596APending Publication Date: 2026-04-10GUANGXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional manual screening methods for sugarcane seedlings are inefficient and prone to damaging the seedlings, making them unsuitable for the needs of large-scale modern agricultural production. Existing target detection algorithms, such as Faster R-CNN, are slow and difficult to adapt to rapid detection scenarios.

Method used

An improved YOLOv8 model was adopted. By constructing a sugarcane seedling image dataset, spatial and channel reconstruction convolutional modules were embedded, a normalized attention module was introduced, and the Focal_CIoU loss function was used. After training the model, it was deployed to an industrial control computer for detection.

Benefits of technology

It has achieved efficient and automated detection of sugarcane seed buds, improved detection accuracy and speed, reduced the subjectivity of manual detection and the risk of sugarcane bud damage, and met the needs of large-scale production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837596A_ABST
    Figure CN121837596A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of agricultural machinery, in particular to a sugarcane seed bud detection method based on an improved YOLOv8 model, which comprises the following steps of: firstly, constructing a sugarcane seed bud image data set containing various types and polymorphisms, expanding the data set through a data enhancement technology, and then aiming at a baseline YOLOv8 model, introducing a space and channel reconstruction convolution module, so as to obtain a sugarcane seed bud image; according to the method, the space and channel redundancy of features in the convolutional neural network is effectively reduced, a normalized attention module is introduced to enhance the attention of a key area, when the model is trained, a FocalCIoU loss function is adopted to solve class imbalance and improve the positioning precision, and after training is completed, the model is deployed to an industrial personal computer for seed bud detection. The test result shows that the improved YOLOv8 model reaches 97.0% and 72.3% on the mAP (at) 0.5 index and the mAP (at) [0.5: 0.95] index respectively, the performance is superior to that of a YOLOv8 base line and other comparison models, and the detection speed is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of agricultural machinery, in particular to a sugarcane sprout detection method based on an improved YOLOv8 model. BACKGROUND

[0002] At present, according to the form of sugarcane seeds, sugarcane planting machines can be divided into whole rod type, pot seedling type and pre-cut seed type. The whole rod type sugarcane planting machine needs to be planted by hand, which has high labor intensity and is easy to damage the sprouts, thereby affecting the germination rate of sugarcane seeds. The pot seedling type sugarcane planting technology needs to invest in the construction of seedling raising facilities and provide corresponding management personnel, and the pot seedling machine itself is relatively complex in technology, plus the investment in seedling raising facilities, so the cost of the whole technology is very high. The pre-cut seed type sugarcane planting machine is the main research direction in China, which can complete the main process of sugarcane planting at one time by selecting excellent sugarcane seeds, sterilizing and planting. Therefore, efficient mechanized planting not only depends on advanced equipment, but also puts forward higher requirements for sugarcane seeds as the starting point of production. For the pre-cut seed type planting machine, sugarcane seeds are mainly divided into single bud segments, double bud segments and multiple bud segments. Compared with other types of sugarcane seeds, the core advantage of double bud segments is that it can significantly reduce the amount of sugarcane seeds while ensuring high germination rate and seedling success rate. Selecting double bud segments with good sprout state can improve the growth efficiency of sugarcane, thereby ensuring the yield and quality of sugarcane; it can also enhance the disease resistance of sugarcane seeds, reduce the loss and cost of sugarcane, prolong the cultivation period of sugarcane and improve the economic benefit of sugarcane.

[0003] The quality of sugarcane sprouts is the key to stable and high yield of sugarcane industry. The traditional manual screening method has problems such as low efficiency and strong subjectivity, and it is difficult to meet the demand of large-scale production of modern agriculture. The target detection technology based on deep learning provides a new solution. In the target detection algorithm, the two-stage model such as Faster R-CNN is excellent in accuracy, but the speed is slow, which is difficult to adapt to the rapid detection scene. SUMMARY

[0004] The purpose of the present application is to provide a sugarcane sprout detection method based on an improved YOLOv8 model, which aims to introduce an improved YOLOv8 model for screening sugarcane sprouts, to avoid the technical problems of low efficiency and easy secondary damage to sugarcane sprouts in the process of traditional manual screening of sugarcane sprouts, and to seriously affect the germination rate.

[0005] In order to achieve the above-mentioned purpose, the present application provides a sugarcane sprout detection method based on an improved YOLOv8 model, which comprises the following steps:

[0006] Step 1: Construct a sugarcane sprout image dataset;

[0007] Step 2: Embed spatial and channel reconstruction convolutional modules after the P3 detector head of the neck network of the YOLOv8 detection model;

[0008] Step 3: Place the normalized attention module into the backbone network of the YOLOv8 detection model;

[0009] Step 4: Train and evaluate the improved YOLOv8 detection model;

[0010] Step 5: Use the improved YOLOv8 detection model after training for sugarcane seed sprout detection.

[0011] Optionally, in step 1, during the construction of the sugarcane seedling image dataset, the samples are divided into good seedlings and bad seedlings, and the samples are labeled using the Makesense tool. All samples are required to be taken against the same background with a resolution of 2448×2048.

[0012] Optionally, the spatial and channel reconstruction convolutional module in step 2 combines a spatial reconstruction unit and a channel reconstruction unit. The spatial reconstruction unit normalizes the feature map through a grouping normalization layer. The expression in the reconstruction process is as follows:

[0013]

[0014] Where W1 is the weight for values ​​greater than the threshold, and W2 is the weight for values ​​less than the threshold. This is element-wise multiplication; This is element-wise addition; , For feature sub-blocks with high information content; , Redundant feature blocks; , Features after cross summation; Characterized by its refined nature; For channel splicing;

[0015] The channel reconstruction unit will reconstruct the features of the space. Figure X W The feature maps are divided into two groups according to a ratio α, and a 1×1 convolution operation is performed on each group of feature maps to compress the number of channels in the two parts to αC and (1-α)C, respectively, thereby reducing the feature size. Figure X W Divided into upper channel features X up and lower channel features X low .

[0016] Optionally, in step 3, the normalized attention module is placed after two 3×3 convolutional layers of the Bottleneck structure within the C2f module of the backbone network. The normalized attention module includes a channel attention submodule and a spatial attention submodule. The final output feature expression of the channel attention submodule is as follows:

[0017]

[0018] Among them, W γ2 For channel attention weights; γ i is the scaling factor for the i-th channel;

[0019] The final spatial attention feature expression of the spatial attention submodule is as follows:

[0020]

[0021] Where λ is a learnable scaling factor.

[0022] Optionally, in step 5, the improved YOLOv8 detection model after training is used for sugarcane seed bud detection. This requires first deploying the model to an industrial control computer, using the ONNX format as an intermediate conversion format.

[0023] Optionally, in step 5, the improved YOLOv8 detection model after training is used for sugarcane seed bud detection. This requires first deploying the model to an industrial control computer, using the ONNX format as an intermediate conversion format.

[0024] This invention provides a sugarcane seed and sprout detection method based on an improved YOLOv8 model. First, a dataset of sugarcane seed and sprout images containing various types and morphologies is constructed and expanded using data augmentation techniques. Then, for the baseline YOLOv8 model, a spatial and channel reconstruction convolutional module is introduced to effectively reduce spatial and channel redundancy of features in the convolutional neural network. A normalized attention module is introduced to enhance attention to key regions. During model training, the Focal_CIoU loss function is used to address class imbalance and improve localization accuracy. After training, the model is deployed to an industrial control computer for seed and sprout detection. Experimental results show that the improved YOLOv8 model achieves 97.0% and 72.3% mAP@0.5 and mAP@[0.5:0.95] respectively, outperforming the YOLOv8 baseline and other comparative models, and also exhibiting higher detection speed. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram of a sugarcane seed sample for a sugarcane seed bud detection method based on an improved YOLOv8 model according to the present invention.

[0027] Figure 2 This is a schematic diagram of the baseline YOLOv8 structure.

[0028] Figure 3 This is a schematic diagram of the structure of SCConv of the improved YOLOv8 of this invention.

[0029] Figure 4 This is a schematic diagram of the SCConv insertion position of the improved YOLOv8 according to the present invention.

[0030] Figure 5 This is a schematic diagram of the channel attention submodule structure of the improved YOLOv8 of this invention.

[0031] Figure 6 This is a schematic diagram of the spatial attention submodule structure of the improved YOLOv8 of this invention.

[0032] Figure 7 This is a schematic diagram of the C2f_NAM module of the improved YOLOv8 and its insertion position according to the present invention.

[0033] Figure 8 This is a graph showing the variation of different loss functions in a specific embodiment of the present invention.

[0034] Figure 9 This is a schematic diagram comparing the good seed germination heatmaps of improved YOLOv8 and YOLOv11 in a specific embodiment of the present invention.

[0035] Figure 10 This is a schematic diagram comparing the heatmaps of the improved YOLOv8 and YOLOv11 in a specific embodiment of the present invention. Detailed Implementation

[0036] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0037] This invention provides a method for detecting sugarcane seed buds based on an improved YOLOv8 model, comprising the following steps:

[0038] Step 1: Construct a sugarcane seedling image dataset;

[0039] Step 2: Embed spatial and channel reconstruction convolutional modules after the P3 detector head of the neck network of the YOLOv8 detection model;

[0040] Step 3: Place the normalized attention module into the backbone network of the YOLOv8 detection model;

[0041] Step 4: Train and evaluate the improved YOLOv8 detection model;

[0042] Step 5: Use the improved YOLOv8 detection model after training for sugarcane seed sprout detection.

[0043] The following provides further explanation with reference to specific embodiments and execution processes:

[0044] Step 1: Construct a sugarcane seedling image dataset

[0045] (1) Sample collection

[0046] Images of three widely cultivated sugarcane varieties in Guangxi (Guitang 44, Yuetang 00236, and Yunzhe 0551) were collected from farmland in Laibin and Chongzuo, covering various soil types and planting management methods, which helped obtain seed bud samples with diverse morphologies. Collection took place in April and November 2024 (the planting times for spring and autumn sugarcane). After processing, the sugarcane buds were retained. Samples were categorized into good and bad buds based on appearance characteristics, and specific selection criteria were defined. A Hikvision industrial camera was used for image acquisition. The brightness of the supplementary lighting and camera exposure time were adjusted to ensure image clarity, and all samples were photographed against the same background to reduce background interference. A total of 2567 samples were collected, with a resolution of 2448×2048. Sugarcane variety samples are shown below. Figure 1 As shown.

[0047] (2) Dataset creation

[0048] The Makesense tool was used to label the samples, with good sprouts labeled as "1" and bad sprouts as "2", for a total of 1374 good sprouts and 1193 bad sprouts. Python scripts were used in conjunction with various data augmentation techniques (geometric transformation, noise addition, color transformation, etc.) to process the original dataset, resulting in 5134 images, which were then randomly sampled in an 8:1:1 ratio to form the training, validation, and test sets.

[0049] Steps 2 to 4 involve improving and training the YOLOv8 detection model, which will be explained below in conjunction with the basic structure of YOLOv8:

[0050] (3) YOLOv8 network structure

[0051] YOLOv8, as a representative version of the YOLO (You Only Look Once) series, builds upon the advantages of its predecessors while significantly improving and optimizing its network structure. This further enhances the accuracy and speed of object detection and demonstrates stronger performance in practical applications. The YOLOv8 network structure mainly consists of the following core components: Backbone, Neck, and Head. This structural design enables it to efficiently extract features from input images, fuse multi-scale information, and achieve more accurate object detection.

[0052] 1) Backbone: The backbone network is a key component for efficient feature extraction, employing the CSPDarknet structure. CSPDarknet uses an innovative cross-stage partial connection (CSP) strategy to segment the input feature map. One part undergoes intensive convolutional operations for deep feature extraction, while the other part is directly connected across stages and fused with the final features. This design effectively reduces repetitive gradient information, lowers computational redundancy, and significantly improves the network's feature learning ability. Internally, the backbone network consists of multiple stacked basic convolutional modules and downsampling layers. These convolutional modules typically consist of basic layers such as convolutional layers (Conv), batch normalization (BN), and activation functions (e.g., ReLU or SiLU), responsible for layer-by-layer transformation and abstraction of the feature map. The downsampling layers are responsible for reducing the feature map size, gradually increasing the network's receptive field, and extracting features at different spatial resolutions, ultimately forming a multi-scale feature map, providing rich and effective feature support for subsequent neck network and detection head.

[0053] 2) Neck Network: The neck network undertakes the crucial multi-scale feature fusion task and is located between the backbone network and the detection head. YOLOv8 uses PAN-FPN (Path Aggregation Network-Feature Pyramid Network) as the neck network. The PAN-FPN structure effectively combines top-down and bottom-up feature fusion paths. The top-down path (FPN path) upsamples the semantically rich feature maps extracted by the high-level network to the low-level feature maps, enhancing the semantic expressiveness of the low-level features. The bottom-up path (PAN path) downsamples the feature maps containing precise location information extracted by the low-level network to the high-level feature maps, enhancing the location awareness of the high-level features. During feature fusion, PAN-FPN typically uses feature map concatenation or element-wise addition to effectively integrate feature maps from different paths and levels. Through this multi-scale feature fusion mechanism, the neck network provides the subsequent detection head with multi-scale features that combine high semantic information and precise location information.

[0054] 3) Head Network: The head network employs a decoupled head structure, decoupling the target classification and target localization tasks and processing them using different branches. This decoupled structure reduces conflicts between tasks, improving model training efficiency and detection accuracy. Simultaneously, the head network also adopts an anchor-free detection method, abandoning the previous version's detection method based on preset anchor boxes. The anchor-free method reduces the number of hyperparameters the model needs to learn, better adapting to targets of different shapes and sizes, and improving the model's generalization ability. The YOLOv8 network structure is as follows: Figure 2 As shown.

[0055] (4) Spatial and Channel Reconstruction Convolution

[0056] To improve model accuracy and balance computational cost and parameter count, thereby enhancing overall efficiency, a Spatial and Channel Reconstruction Convolution (SCConv) module is introduced. This module effectively combines Spatial Reconstruction Units (SRUs) and Channel Reconstruction Units (CRUs), significantly reducing spatial and channel redundancy in features within the convolutional neural network. This design helps improve model performance while reducing computational cost. Its structure is as follows: Figure 3 As shown.

[0057] The core of the SCConv module lies in the collaborative work of the SRU and CRU. The SRU first processes the input features... Figure X (X∈R) C×H×W The feature map (where C is the number of channels, H is the height, and W is the width) is standardized using a Group Normalization (GN) layer, resulting in a distribution with a mean of 0 and a variance of 1. Furthermore, SRU utilizes the scaling factor of the GN layer to evaluate the information content of different feature maps. The GN formula is as follows:

[0058] (1)

[0059] In the formula: σ - characteristic Figure X Standard deviation; μ-characteristic Figure X The mean; ε - constant; γ1, β1 - trainable scaling factors and offset parameters.

[0060] SRU uses the parameter γ output by the GN layer to measure the spatial pixel variance of each batch and channel, and obtains the normalized correlation weights through formula (1). The weights are then processed using the Sigmoid function, mapping them to the [0, 1] interval. To distinguish between important and redundant features, a threshold is applied, set to 0.5. The weights processed by the Sigmoid function are compared with the threshold. Weights greater than the threshold are considered "important," denoted as weight W1, and the corresponding feature maps are considered "information-rich." Weights less than the threshold are considered "unimportant," denoted as weight W1, and the corresponding feature maps are considered "information-poor" or "redundant." Based on the weights, the original features are... Figure X Multiply by W1 and W2 respectively to obtain and .

[0061] (2)

[0062] In the formula: Wi - the weight of the i-th channel.

[0063] To fully utilize the weighted information from different features and enhance the information interaction between them, SRU further employs a cross-reconstruction operation to make the information-rich features... With redundancy features Dynamic fusion is performed, combining sub-parts of different features to generate two new feature maps. Finally, the dynamically fused feature maps are stitched together along the channel dimension to form the spatially refined features. The entire reconstruction process can be summarized by the following formula:

[0064] (3)

[0065] In the formula: - Element-by-element multiplication; - Element-by-element addition; , - Feature sub-blocks with high information content; , - Redundant feature blocks; , -Features after cross-summing; - Refined characteristics; -Channel splicing.

[0066] Features after spatial reconstruction Figure X W (X) W ∈R C×H×W (Note: The channel dimension still has redundancy.) To further compress features, CRU will use X... W The feature maps are divided into two groups according to a ratio α (0≤α≤1), and a 1×1 convolution operation is performed on each group of feature maps to compress the number of channels in the two parts to αC and (1-α)C, respectively. This further reduces X... W Divided into upper channel features X up and lower channel features X low .

[0067] CRU for upper-layer features X up and lower-level features X low Different processing strategies are employed for X. up We perform k×k grouped convolution (GWC) and 1×1 pointwise convolution (PWC) to extract high-level representative information while reducing computational complexity. The outputs of the two convolutions are summed to obtain the feature map Y1.

[0068] (4)

[0069] Where: M G - The learnable weight matrix of GWC; - PWC's learnable weight matrix.

[0070] For X low CRU uses a relatively simple 1×1 PWC convolution to extract shallow detail features, as a reference for X. up This is a supplement. In addition, CRU will also include the original X. low The features generated by PWC convolution are concatenated to form feature map Y2, as shown in equation (5).

[0071] (5)

[0072] In the formula: - PWC's learnable weight matrix.

[0073] After the transformation is completed, the simplified SKNet method is used to adaptively merge the upper transform output features Y1 and the lower transform output features Y2. Global average pooling (GAP) is used to capture the global spatial information of each feature map. GAP compresses the spatial dimension of each feature map into a scalar value, thus obtaining channel descriptors S1 and S2∈R representing the global information of Y1 and Y2, respectively. C×1×1 To determine the relative importance of Y1 and Y2, S1 and S2 are stacked and attention weights β2 and β3 are generated through a Softmax operation. Finally, CRU fuses Y1 and Y2 into the final output feature map Y by weighted summation, as shown in Equation (6).

[0074] (6)

[0075] Sugarcane seedlings are relatively small targets in images. To fully utilize the feature information at different scales in the YOLOv8 network, this invention plans to embed the SCConv module after the P3 detection head of the YOLOv8 neck network, as shown in the figure. Figure 4 As shown, layer P3 is a shallower layer in the network. Due to fewer convolutions, the output feature map is larger. This larger feature map can retain more detailed information about small targets, which is crucial for detecting sprouts in images. Placing SCConv in this position can directly enhance the expressive power of small target features and reduce the probability of misclassifying background noise as targets by selectively focusing on key features and suppressing redundant information, thereby improving the accuracy and robustness of sprout detection.

[0076] (5) Normalization-based attention module

[0077] The batch normalization process is shown in Equation (7). First, the input data distribution is normalized to a standard normal distribution with a mean of 0 and a variance of 1. Then, the learnable scaling factor and offset factor are used to find the most suitable feature distribution.

[0078] (7)

[0079] In the formula: B out - Output of the BN layer; B in -Input to the BN layer; μ B -Minimum batch mean; σ B - Mini-batch variance; ε - constant; γ2, β4 - learnable scaling and offset factors;

[0080] For the channel attention submodule, the weights are calculated directly using the scaling factor γ2, as shown in the equation. The weight of each channel is its corresponding scaling factor divided by the sum of the scaling factors of all channels. This is combined with the channel attention submodule. Figure 5After calculating the weights, the weights are multiplied element-wise with the feature maps of the corresponding channels of the original input features. This can be understood as important channels being multiplied by larger weights and thus enhanced, while unimportant channels are suppressed. The weighted features are then processed by a Sigmoid function to compress the output values ​​to (0, 1) before outputting the features, as shown in Equation (8).

[0081] (8)

[0082] In the formula: W γ2 -Channel attention weights; γ i - The scaling factor for the i-th channel.

[0083] In the spatial attention submodule, the Batch Normalization (BN) operation is applied to the spatial dimension (H, W). First, the mean and standard deviation of each channel are calculated in the spatial dimension, and these statistics are used to normalize each pixel. Subsequently, a learnable scaling factor λ is introduced, and the spatial attention weights W are calculated. λ As shown in equation (9). Combined with Figure 6 As shown, the obtained spatial attention weights and input features are weighted and combined, and the final spatial attention features are obtained through the Sigmoid function.

[0084] (9)

[0085] This invention integrates NAM into the YOLOv8 network to enhance its ability to detect sugarcane seed buds. After comprehensive consideration, the NAM module is placed after two 3×3 convolutional layers of the Bottleneck structure within the C2f module of the YOLOv8 backbone network, as follows: Figure 7 As shown, NAM combines channel attention and spatial attention mechanisms, which helps to filter feature channels and key parts related to seed quality. The two 3×3 convolutions in the Bottleneck structure have already refined the input features. Introducing NAM at this position allows the attention mechanism to act on features with stronger representational power, which will be more effective in distinguishing subtle differences in sugarcane seed buds.

[0086] (6) Focal_CIoU loss function

[0087] In the field of object detection, the loss function plays a core role in the training process. Its main significance lies in quantifying the deviation between the model's predicted output and the real annotation, and optimizing the model parameters through the backpropagation mechanism, thereby achieving accurate classification, localization, and confidence assessment of the target. In YOLOv8, the bounding box regression loss function is usually CIoU Loss, which is calculated as shown in Equation (10). CIoU comprehensively considers the overlap area, center point distance, and aspect ratio difference between the predicted box and the real box, and can more accurately reflect the degree of matching between the two.

[0088] (10)

[0089] Where: IoU - Intersection over Union (IoU) ratio of the predicted bounding box to the ground truth bounding box; l - distance between the center points of the predicted bounding box and the ground truth bounding box; C - diagonal distance of the minimum bounding rectangle; α v - Trade-off coefficient; v n - Consistent aspect ratio.

[0090] However, in the task of detecting sugarcane sprouts, class imbalance often occurs, such as fewer instances of bad sprouts than good sprouts. This imbalance causes the model to favor the majority class during training, thus reducing the detection performance for the minority class. To effectively address this issue, Lin et al. proposed the Focal Loss loss function, which adjusts the cross-entropy loss function by introducing a modulation factor to solve the problem of imbalanced positive and negative sample class ratios during training. To further optimize model performance, this invention integrates Focal Loss with CIoU, proposing the Focal_CIoU loss function to replace CIoU, reducing the impact of fewer bad sprout samples on the model. The calculation formula for LFocal_CIoU is shown in equation (11), with a modulation factor of 0.5.

[0091] (11)

[0092] In the formula: δ - modulation factor.

[0093] Step 5: Use the improved YOLOv8 detection model after training for sugarcane seed sprout detection.

[0094] To deploy the improved YOLOv8 model on an industrial control computer, model format conversion was performed. The ONNX format was used as an intermediate conversion format, leveraging its cross-platform compatibility. After the model generated from the PyTorch framework was converted to the ONNX format, it was encapsulated in C language to build an ONNX model inference interface based on C language, and compiled to generate the YOLOdetection tool that can be called by the VisionMaster platform.

[0095] Furthermore, this invention is also illustrated through experimental design, with the environment and process designed as follows:

[0096] 1) Test environment and parameter configuration

[0097] The operating system is Ubuntu 20.04, and the server configuration includes an AMD EPYC 9754 CPU, an NVIDIA RTX4090D GPU (24 GB), and 60 GB of memory. The deep learning environment is configured with PyTorch 2.0.0, Python 3.8, and CUDA version 11.8. The training parameters include training batches, epochs, input image size, number of data loading worker threads, optimizer, and learning rate.

[0098] 2) Model evaluation indicators

[0099] The model performance is evaluated from multiple aspects, including precision (P), recall (R), mean precision (mAP@0.5), mAP@[0.5:0.95], floating-point operations (FLOPs), number of model parameters (params), and frame rate (FPS), and the corresponding calculation formulas are given.

[0100] 3) Comparative experiment

[0101] Comparison of NAM with other attention mechanisms: A comparison of the performance of YOLOv8 models with NAM versus those with SE, CBAM, S2, and SimAM attention mechanisms.

[0102] 4) Comparison of loss functions

[0103] This study analyzes the performance differences between Focal_CIoU and loss functions such as CIoU, DIoU, EIoU, GIoU, and SIoU, by comparing the changes in loss values ​​and various performance indicators during the training process.

[0104] 5) Ablation test

[0105] The effectiveness of three improvement strategies—introducing the Spatial and Channel Reconstruction Convolutional Module (SCConv), adding the NAM attention mechanism to the C2f module of the backbone network, and replacing the loss function with Focal_CIoU—was verified.

[0106] 6) Performance comparison and analysis with other models

[0107] The improved YOLOv8 will be compared and tested with mainstream object detection models such as Faster R-CNN, YOLOv5, YOLOv9s, YOLOv10n, and YOLOv11.

[0108] 7) Visualization of model features

[0109] Heatmaps generated using Grad-CAM technology were compared with those of the improved YOLOv8 and YOLOv11 models. The results showed that the improved YOLOv8 has a more accurate perception of the sugarcane seed and sprout target area, can effectively suppress background interference, and can provide higher detection accuracy and lower false detection rate in real-world scenarios.

[0110] The data obtained is as follows:

[0111] (1) Comparison experiment between NAM and other attention mechanisms

[0112] Table 1. Performance Comparison of YOLOv8 Models under Different Attention Mechanisms

[0113]

[0114] As shown in Table 1, all models with added attention mechanisms affected the performance of the baseline YOLOv8 model to varying degrees. The model with NAM had the highest recall and mAP@0.5, at 94.5% and 95.5% respectively. Although its precision was slightly lower than the baseline, the floating-point computation and parameter count remained almost unchanged compared to the baseline model, and the parameter count was even reduced. Models with SE and SimAM showed a decrease in mAP@0.5 compared to the baseline model. Models with CBAM and S2, while achieving precision close to the baseline model, sacrificed recall and computational cost. In summary, models with the NAM attention mechanism improved the performance of YOLOv8 without significantly increasing model complexity, making them well-suited for the detection task of this invention.

[0115] (2) Comparison of loss functions

[0116] To verify the effectiveness of the Focal_CIoU loss function, this invention analyzes the performance differences between Focal_CIoU and CIoU, Distance Intersection over Union (DIoU), Enhanced Intersection over Union (EIoU), Generalized Intersection over Union (GIoU), and Spatial Intersection over Union (SIoU). Each loss function was added to YOLOv8, and the results were analyzed... Figure 8It can be seen that when EIoU is used as the loss function, the convergence speed of the model's loss value is significantly lagging, and the loss value remains at a relatively high level throughout the entire training iteration process. This indicates that the EIoU loss function exhibits certain limitations in the research project of this invention. The GIoU, SIoU, and DIoU loss functions showed little difference in convergence speed and final loss value in this experiment, while the CIoU loss function was slightly better than the other three. The Focal_CIoU loss function proposed in this invention showed outstanding performance in the experiment. Data shows that in the early stages of training, using the Focal_CIoU loss function can significantly accelerate the gradient descent process of the model, and it begins to converge stably around the 130th generation. Furthermore, after the model converges, the loss value of the Focal_CIoU loss function is significantly lower than that of other compared loss functions, fully demonstrating its excellent optimization potential.

[0117] Table 2 shows that YOLOv8 exhibits significant performance differences when using different loss functions. Overall, the Focal_CIoU loss function demonstrates the best overall performance, achieving excellent levels in precision (95.0%), recall (96.0%), and mAP@0.5 (96.2%). This is attributed to its combination of Focal Loss's ability to handle difficult samples and CIoU's precise bounding box regression characteristics. The CIoU loss function follows closely behind, providing balanced performance (P: 94.4%, R: 93.8%, mAP@0.5: 95.2%). GIoU performs well in terms of precision (95.0%), but its recall is relatively low (93.0%). SIoU, EIoU, and DIoU perform relatively poorly overall, with DIoU having a good recall of 94.0% but the lowest precision of 92.0%.

[0118] Table 2 Comparison of results for different loss functions

[0119]

[0120] (3) Ablation test

[0121] Ablation experiments were conducted using the YOLOv8 algorithm as a benchmark, and the detailed experimental results are summarized in Table 3. The YOLOv8 model was improved, and the contributions of the SCConv, NAM, and Focal_CIoU modules were evaluated through ablation experiments. The analysis results show that each improved module significantly enhances the performance of sugarcane seed detection. In single-module experiments, SCConv increased the precision (P) to 96.1%, mAP@0.5 to 96.6%, and mAP@[0.5:0.95] to 73.1%, indicating that SCConv significantly enhances the ability to extract small target features of sugarcane seed. When applied alone, Focal_CIoU increased the recall (R) to 96.0% while maintaining a high frame rate (150.83 FPS), indicating its positive impact on bounding box regression, which plays a crucial role in the accurate localization of sugarcane seed boundaries. In the dual-module combination, the combination of SCConv and NAM achieved 72.9% mAP@[0.5:0.95], demonstrating a significant improvement in the detection of sugarcane buds of different sizes, especially in the detection of multi-scale features such as buds and internodes. The combination of NAM and Focal_CIoU achieved an excellent performance of 96.8% mAP@0.5, but mAP@[0.5:0.95] decreased (69.5%), indicating that although this combination can accurately distinguish between the intact and damaged states of sugarcane buds, the detection of subtle bud features needs improvement. When all three modules were applied simultaneously, the model reached a maximum value of 97.0% mAP@0.5, which is crucial for classifying intact and damaged sugarcane buds. It also performed relatively well in the mAP@[0.5:0.95] index (72.3%), while the frame rate was also relatively balanced (129.84 FPS). Considering all indicators, adding all three modules resulted in the best overall performance, accurately detecting seed bud status while maintaining high processing efficiency. The combination of the three modules, however, performed best on the traditional evaluation metric (mAP@0.5), making it more suitable for sugarcane seed bud quality screening scenarios where high accuracy is required.

[0122] Table 3 Comparison of Ablation Tests

[0123]

[0124] (4) Performance comparison and analysis of improved YOLOv8 with other models

[0125] To effectively evaluate the performance advantages of the improved YOLOv8 proposed in this invention and to compare it with current mainstream object detection models, this experiment compared the improved YOLOv8 with Faster R-CNN, YOLOv5, YOLOv9s, YOLOv10n, and YOLOv11 models under a unified testing environment. The experimental results for each algorithm are detailed in Table 4.

[0126] Table 4 shows the performance comparison results of the improved YOLOv8 model of this invention with Faster R-CNN and other mainstream YOLO series detection models. The data shows that the improved YOLOv8 model exhibits excellent comprehensive performance in many key indicators. Faster R-CNN, as a traditional two-stage detection model, has advantages in specific scenarios, but its accuracy (76.7%) and recall (82.5%) are significantly lower than those of single-stage detectors. Moreover, its mAP@[0.5:0.95] is only 38.9%, the number of floating-point calculations is as high as 470.4 G, the number of parameters reaches 28,338,746, and its real-time performance is poor (12.14 FPS). These disadvantages seriously limit its application in resource-constrained or real-time-critical scenarios. In comparison, the improved YOLOv8 model of this invention maintains high precision (96.0%) and recall (95.3%) while achieving high average precision (97.0% mAP@0.5 and 72.3% mAP@[0.5:0.95]), low computational resource consumption (7.0 G), and excellent real-time performance (129.84 FPS). Experimental data shows that although YOLOv9s, YOLOv10n, and YOLOv11 are updated models released after YOLOv8, their overall performance does not significantly surpass the improved solution of this invention. In particular, the improved YOLOv8 model achieves a balance between high accuracy and real-time inference capability while maintaining low computational complexity, demonstrating the effectiveness of the improvement strategy proposed in this invention.

[0127] Table 4 Comparison of Detection Models

[0128]

[0129] (5) Visualization of model features

[0130] To clearly demonstrate the effectiveness of the improved YOLOv8 model in enhancing sugarcane seed detection capabilities, this invention employs Gradient Weighted Class Activation Mapping (Grad-CAM) technology to generate heatmaps. Grad-CAM is a technique that reveals which parts of an image a deep learning model "focuses" on; it achieves this by generating heatmaps through analysis of the model's gradient information. The brightness in the heatmap reflects the degree of influence of each region on the prediction. Visualization comparisons of the heatmaps are provided below. Figure 9 , Figure 10As shown in the diagram. A comparative analysis of the heatmaps of YOLOv11 and the improved YOLOv8 model reveals that in the heatmap of good seedlings, YOLOv11 exhibits a confidence level of 0.84, with a relatively dispersed heat distribution, blurred target boundaries, and heat diffusion. The improved YOLOv8 model not only has a slightly higher confidence level but also a more concentrated heat distribution, higher heat intensity in the target area, clearer boundaries, and effectively reduced background interference. In the heatmap of bad seedlings, the differences between the two are small. YOLOv11 has a slightly lower confidence level than the improved YOLOv8, and the improved YOLOv8 forms clear hotspots in the seedling area that continuously decay outwards, forming relatively clear boundaries. The YOLOv11 model's heatmap shows a smaller hotspot area compared to the improved YOLOv8 model. In conclusion, the improved YOLOv8 provides more accurate perception of the target area of ​​sugarcane seedlings, offering higher detection accuracy and a lower false detection rate in real-world scenarios.

[0131] In summary, the present invention has the following beneficial effects:

[0132] 1. By constructing an efficient sugarcane seed bud detection model, automated and intelligent detection of sugarcane seed buds was achieved, significantly improving detection efficiency and eliminating the subjectivity of manual detection.

[0133] 2. By expanding the dataset through data augmentation techniques (geometric transformation, noise addition, color transformation, etc.), the model can learn more diverse features, thereby improving the model's generalization ability and robustness, and reducing the model's dependence on specific image features.

[0134] 3. The introduction of the Spatial and Channel Reconstruction Convolutional Module (SCConv) effectively reduces the spatial and channel redundancy of features in the convolutional neural network, enhances the feature expression ability of small targets, and significantly improves the detection accuracy of the model for small targets such as sugarcane seed sprouts.

[0135] 4. The integration of a normalized attention module (NAM) enables the model to focus more on key feature channels and locations of sugarcane seed buds, thereby improving the detection capability of subtle features and enhancing the model's detection performance.

[0136] 5. The Focal_CIoU loss function is designed. By combining Focal Loss and CIoU, the class imbalance problem is effectively solved, the detection performance of the minority class (bad buds) is improved, and the model is not overly biased towards the majority class (good buds) during training.

[0137] 6. Through ablation experiments, it was verified that the synergistic effect of the three improved modules (SCConv, NAM and Focal_CIoU) enabled the model to perform well in key indicators such as detection accuracy (97.0% mAP@0.5) and real-time performance (frame rate maintained at 129.84 FPS), achieving a balance between high detection accuracy and real-time inference capability.

[0138] 7. The improved YOLOv8 model was successfully converted to ONNX format and encapsulated into a C language interface. After being deployed on an industrial control computer, it achieved a significant performance improvement in the CPU environment. The total processing time was reduced by 75.3% compared to the original Vision Master built-in model. This effectively solved the performance bottleneck problem in environments without GPU support and provided an efficient and feasible technical solution for real-time sugarcane seedling detection in resource-constrained scenarios.

[0139] 8. Through Grad-CAM visualization analysis, it was confirmed that the improved model has a more accurate perception ability of the sugarcane seed and sprout target area, can effectively suppress background interference, and the generated heat map shows that it has higher confidence, more concentrated heat distribution, higher heat intensity of the target area and clearer boundary in both good seed and bad seed detection, which helps to reduce the false detection rate.

[0140] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A method for detecting sugarcane seed buds based on an improved YOLOv8 model, characterized in that, Includes the following steps: Step 1: Construct a sugarcane seedling image dataset; Step 2: Embed spatial and channel reconstruction convolutional modules after the P3 detector head of the neck network of the YOLOv8 detection model; Step 3: Place the normalized attention module into the backbone network of the YOLOv8 detection model; Step 4: Train and evaluate the improved YOLOv8 detection model; Step 5: Use the improved YOLOv8 detection model after training for sugarcane seed sprout detection.

2. The sugarcane seed bud detection method based on the improved YOLOv8 model as described in claim 1, characterized in that, In step 1, during the construction of the sugarcane seedling image dataset, the samples are divided into good seedlings and bad seedlings, and the samples are labeled using the Makesense tool. All samples are required to be taken against the same background with a resolution of 2448×2048.

3. The sugarcane seed bud detection method based on the improved YOLOv8 model as described in claim 2, characterized in that, The spatial and channel reconstruction convolutional module in step 2 combines spatial reconstruction units and channel reconstruction units. The spatial reconstruction unit normalizes the feature map through a grouping normalization layer. The expression in the reconstruction process is as follows: ; Where W1 is the weight for values ​​greater than the threshold, and W2 is the weight for values ​​less than the threshold. This is element-wise multiplication; This is element-wise addition; , For feature sub-blocks with high information content; , These are redundant feature blocks; , Features after cross summation; Characterized by its refined nature; For channel splicing; The channel reconstruction unit processes the feature map X after spatial reconstruction. W The feature maps are divided into two groups according to a ratio α, and a 1×1 convolution operation is performed on each group of feature maps to compress the number of channels in the two parts to αC and (1-α)C, respectively. This results in the feature map X being... W Divided into upper channel features X up and lower channel features X low .

4. The sugarcane seed bud detection method based on the improved YOLOv8 model as described in claim 3, characterized in that, In step 3, the normalized attention module is placed after two 3×3 convolutional layers of the Bottleneck structure within the C2f module of the backbone network. The normalized attention module includes a channel attention submodule and a spatial attention submodule. The final output feature expression of the channel attention submodule is as follows: ; Among them, W γ2 For channel attention weights; γ i Let be the scaling factor for the i-th channel; The final spatial attention feature expression of the spatial attention submodule is as follows: ; Where λ is a learnable scaling factor.

5. The sugarcane seed bud detection method based on the improved YOLOv8 model as described in claim 4, characterized in that, In step 4, during the evaluation process, the Focal Loss function and the CIoU Loss function are fused to propose the Focal_CIoU loss function to replace the CIoU Loss function. The corresponding calculation formula is as follows: ; Where δ is the modulation factor, which is 0.

5.

6. The sugarcane seed bud detection method based on the improved YOLOv8 model as described in claim 5, characterized in that, In step 5, the improved YOLOv8 detection model after training is used for sugarcane seed bud detection. The model needs to be deployed to an industrial control computer first, and the ONNX format is used as an intermediate conversion format during the process.