Pseudo-ginseng flower maturity detection method based on improved YOLOv11 model

By improving the YOLOv11 model, the problems of missed detection of small targets and false detection due to occlusion of branches and leaves in Panax notoginseng flower detection were solved, and accurate detection of the growth stage of Panax notoginseng flowers was achieved, which promoted the intelligent upgrade of the Panax notoginseng industry and the development of picking robots.

CN120726468APending Publication Date: 2025-09-30KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510715405.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing technologies for detecting Panax notoginseng flowers in natural environments have problems such as missed detection of small targets, false detection of occlusion by branches and leaves, and difficulty in classifying the flowering and seed-setting periods. Traditional methods have weak anti-interference capabilities, and deep learning models have deficiencies in small target detection and occlusion processing, making it difficult to meet real-time and accuracy requirements.

Method used

An improved YOLOv11 model is adopted to improve the model's feature extraction capability and detection accuracy in complex backgrounds by optimizing the model structure and training strategy, including replacing the backbone network with FasterNet, adding a P2 small target detection layer, and introducing the WIoUv3 loss function.

Benefits of technology

It significantly reduces missed detection and false detection rates, improves detection accuracy and speed, achieves precise positioning and classification of Panax notoginseng flowers during their growth stages, meets the actual needs of intelligent picking robots, and enables real-time detection on mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726468A_ABST
    Figure CN120726468A_ABST
Patent Text Reader

Abstract

The invention discloses a pseudo-ginseng flower maturity detection method based on an improved YOLOv11 model, belongs to the field of agricultural intelligent detection and deep learning application, and relates to deep learning algorithm improvement with YOLOv11 as a baseline model, mainly to optimize and enhance three aspects of backbone network replacement, neck network optimization and loss function improvement. On the premise of slightly increasing the complexity of the model, the detection speed is kept to adapt to edge equipment, and the real-time operation requirement of the picking robot is met. A core detection method is provided for intelligent picking of the panax notoginseng flowers, the detection technology blank of small-target and easily-confused growth stages in a complex field environment is filled, and the method has engineering application value for promoting automatic upgrading of the panax notoginseng industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural intelligent detection and deep learning applications, and in particular to a method for detecting the maturity of Panax notoginseng flowers based on an improved YOLOv11 model. Background Art

[0002] As a traditional rare medicinal plant in China, Panax notoginseng has a significantly higher saponin content in its flower spikes than in its roots, stems, leaves and other organs, and has extremely high medicinal value. The medicinal value of Panax notoginseng flowers at different growth stages (flowering period, seed setting period, seed collection period) varies significantly, and accurate detection of maturity is crucial to the development of picking robots and the upgrading of the industrial chain. However, the detection of Panax notoginseng flowers in natural planting environments faces multiple challenges: in natural environments, the light in Panax notoginseng plantations fluctuates dramatically, and the background colors of leaves, branches, and other backgrounds are very close to those of flowers, which can easily interfere with feature extraction; Panax notoginseng flowers are small in size (1-3 cm in diameter), and there are occlusions from branches and leaves, and overlapping flowers, resulting in a high risk of missed detection; in addition, the morphology of Panax notoginseng flowers in the flowering and seed setting periods is similar, making it difficult to accurately distinguish them using traditional methods, and efficient intelligent detection technology is urgently needed.

[0003] Currently, crop maturity detection methods primarily include traditional machine learning and deep learning. Traditional methods have weak anti-interference capabilities in complex scenarios, while existing deep learning models (such as YOLOv11) have shortcomings in small target detection and occlusion handling. Two-stage detection algorithms (such as FasterR-CNN) are complex and slow, failing to meet real-time requirements. Single-stage algorithms (such as the original YOLOv11), while fast, lack accuracy for small targets and overlapping occlusions. These methods struggle to balance speed and accuracy, making them inadequate for Panax notoginseng flower detection.

[0004] Therefore, establishing a scientific and efficient method for detecting the maturity of Panax notoginseng flowers and achieving accurate positioning and classification of flowers at different growth stages has important practical significance for promoting the intelligent upgrading of the Panax notoginseng industry and the development of harvesting robot technology. Summary of the Invention

[0005] This paper addresses the challenges of missing small targets, false detections due to foliage occlusion, and difficulty classifying flowering and seed-setting stages in natural environments. We propose a method for detecting the maturity of Panax notoginseng flowers based on an improved YOLOv11 model. By optimizing the model structure and training strategy, this method enables accurate detection of the growth stages of Panax notoginseng flowers in natural environments, significantly reducing missed and false detection rates, improving detection accuracy and speed, and meeting the practical needs of intelligent picking robots for locating and classifying Panax notoginseng flower maturity.

[0006] The detection method provided by the present invention comprises the following steps:

[0007] Step (1) collecting images of Panax notoginseng flowers at different growth stages in a natural environment and creating a data set;

[0008] Step (2) optimizing the YOLOv11 model to form an improved YOLOv11 model;

[0009] Step (3) training the improved YOLO model;

[0010] Step (4) deploys the model to the mobile terminal to obtain the detection results.

[0011] The dataset was constructed using a single-lens reflex camera from a Yunnan Panax notoginseng plantation between 10:00 AM and 3:00 PM, using three typical shooting angles: looking up (lens elevation angle 15°-30°), looking straight (horizontal viewing angle), and looking down (45°-60°). The images were captured at a macro distance of 15-40 cm under four lighting conditions: strong light (direct midday light), normal light (scattered morning light), weak light (oblique evening light), and dark light (shaded light). Images of Panax notoginseng flowers were collected during the flowering stage (petals unfurled), seed setting stage (green seeds emerging), and seed harvesting stage (red seeds mature). The dataset consisted of 2,000 original samples. To balance model training efficiency and feature integrity, the images were uniformly scaled to a resolution of 640×640 pixels using bilinear interpolation. This size preserves flower detail (with individual flower pixels accounting for ≥5%) while meeting the memory optimization requirements of GPU batch computing.

[0012] The dataset preparation also includes: in order to enhance the model's generalization ability for natural scenes, a composite data augmentation strategy is used to expand the original samples. Specifically, five basic enhancement methods are implemented: horizontal flip (simulating left-right perspective transformation), vertical flip (simulating up-down perspective transformation), contrast enhancement (adjustment coefficient 1.2-1.), Gaussian blur (kernel size 3×3-7×7), and brightness enhancement (gain factor 1.1-1.5). A Python script is used to randomly combine 2-3 enhancement methods to process a single image, such as the combination strategy of "horizontal flip + contrast enhancement + Gaussian blur". Two enhanced samples are generated for each original image, expanding the dataset size from 2,000 to 6,000. The newly added samples cover complex scenes such as petal shadow deformation (caused by brightness enhancement) and leaf occlusion simulation (Gaussian blur superposition and flipping). During the data enhancement process, the LabelImg annotation file is updated synchronously to ensure that the boundingbox coordinates are strictly aligned with the enhanced image to avoid annotation deviations caused by geometric transformations.

[0013] The dataset preparation also includes using stratified sampling to partition 6,000 images into a training set (4,200 images), a validation set (1,200 images), and a test set (600 images) in a 7:2:1 ratio. The distribution of samples from each growth stage across the three datasets is consistent (flowering stage: seeding stage: harvesting stage = 5:3:2). The training set is used for parameter iteration of the SGD optimizer (200 rounds), and mosaic data augmentation is used to further improve the model's detection of small objects. The validation set evaluates model performance after each round of training, triggering early stopping when the mAP@0.5 improvement is <0.3% for 10 consecutive rounds. The test set serves as an independent evaluation set, containing challenging samples such as small flower objects (diameter <1.5 cm) in bright light and overlapping flower clusters (overlap ratio >40%) in dim light, to verify the model's detection robustness in real-world scenarios. This partitioning ensures sufficient training data while also avoiding the risk of overfitting during model evaluation through an independent test set.

[0014] The optimization and improvement of the YOLOv11 model to form an improved YOLO model includes: replacing the backbone network of YOLOv11 with a FasterNet module.

[0015] FasterNetBlock, the core module of FasterNet, consists of partial convolution and two normal convolutions. PConv uses residual connection to effectively prevent the gradient disappearance problem. PConv is different from traditional convolution in that it only performs convolution operations on some channels, and the rest of the channels remain unchanged. For continuous or regular memory access, the first or last continuous c p The channels are calculated as representatives of the entire feature map. Then, the computational amount of FLOPs of a PConv is as follows:

[0016]

[0017] Typically, the ratio of the number of channels involved in a PConv convolution to the number of channels involved in a regular convolution is:

[0018]

[0019] Therefore, the FLOPs of a PConv is only 1 / 16 of that of a regular convolution. In addition, the calculation formula for the memory access of PConv is:

[0020]

[0021] Therefore, compared to ordinary convolution, the memory access volume of a PConv is only 1 / 4 of that of a regular convolution. By reducing computational effort and memory access, PConv significantly improves detection speed. Furthermore, by performing convolution operations on only a subset of the channels in the input feature map to extract spatial features and retain their pixels, PConv can more efficiently extract spatial features. To address the complex background interference in Panax notoginseng flower images, the spatial relationship between multiple targets, and the need for real-time detection, FasterNet was chosen as the feature extraction network for YOLOv11. This significantly enhances the network's ability to extract Panax notoginseng flower features from complex backgrounds, as well as its ability to distinguish flowers during the flowering and seed-setting periods, thereby improving detection accuracy. Furthermore, because FasterNet requires less memory access, it can improve network detection speed.

[0022] The improved YOLO model further includes the following steps: A special detection branch, the P2 small object detection layer, is introduced based on the original model to detect smaller objects. The P2 small object detection layer is a feature fusion path added after the original P3 layer, forming a multi-stage detection system from P2 to P3 to P4 to P5.

[0023] The P2 small target detection layer includes Figure 2 The Upsample, Concat, and C2f modules in the upper middle. Upsample amplifies the feature map of the P3 layer to a higher resolution and restores spatial details. Concat fuses the high-resolution feature map from the shallow layer of Backbone with the deep semantic features after Upsample, taking into account both details and semantics. The C2f module is improved from the C3 module and adopts a lightweight design. It extracts multi-scale features through cross-stage residual connections, reduces the number of parameters, and retains sensitivity to small targets to avoid feature blurring caused by the network being too deep. The P2 layer also contains a detection head, namely Figure 2 The topmost detection head is directly connected to the P2 layer, which can integrate more feature information and enhance the detection ability of small objects. P2 mainly adds a new P2 layer after the P3 layer to participate in feature fusion. Unlike other layers, the P2 layer performs fewer convolutions on the feature map, so the feature map output by the P2 layer is larger in size, which is more conducive to small object detection.

[0024] The said optimizing and improving the YOLOv11 model to form an improved YOLO v11 model also includes: the said optimizing and improving the YOLOv11 model to form an improved YOLO model also includes: introducing WIoU as a loss function based on the original YOLOv11 model, reducing the interference of low-quality anchor frames on detection performance through dynamic weight distribution, thereby improving detection accuracy; the loss function not only considers the centroid distance and overlapping area, but also incorporates a dynamic non-monotonic focusing mechanism, and realizes anchor frame quality evaluation through a gradient gain distribution strategy.

[0025] The performance of object detection models depends heavily on the design of the loss function. A well-defined loss function can significantly improve detection results. To this end, we introduced the Width Over Union (WIoU) loss function into the loss function calculation. Using a gradient gain allocation strategy, we enhanced the model's adaptability to low-quality anchor frames, improving overall performance in the Panax notoginseng flower detection scenario.

[0026] The WIoUv3 version used measures the quality of anchor frames by the outlier degree β and constructs a non-monotonic focusing coefficient r based on β. The smaller the β value, the higher the quality of the anchor frame, and its weight in the loss function is reduced accordingly. For anchor frames with poor quality, a smaller gradient gain is assigned to reduce the harmful gradient effects caused by low-quality anchor frames.

[0027] Due to the dynamic characteristics of LloU, the anchor box quality classification standard is also dynamically adjusted, enabling WIoUv3 to adaptively generate the current optimal gradient gain allocation strategy; for high-difficulty scenarios such as small targets, occlusions, and overlaps in Panax notoginseng flower detection, WIoUv3 can guide the model to focus on these difficult-to-identify samples, thereby improving detection performance. The specific calculation formula is as follows:

[0028] L WIoUv3 =r·R WIoU ·L IoU

[0029]

[0030] L IoU =1-IoU

[0031]

[0032] Where r is the dynamic non-monotonic focusing coefficient, β is the outlier degree, R_WIoU is the distance metric, (x, y) and (x_gt, y_gt) are the coordinates of the center points of the predicted box and the real box respectively, w_g and h_g are the width and height of the minimum bounding rectangle, and L_IoU is the IoU loss.

[0033] WIoUv3 dynamically optimizes the loss weights of high- and low-quality anchor frames, guiding the model to focus on samples with average quality. Compared with the original loss function of YOLOv11, it can dynamically adjust the loss weights for targets of different scales in Panax notoginseng flower maturity detection, effectively improving the model detection performance.

[0034] The improved YOLO model, resulting from the training improvements, uses a GeForce RTX 4090 GPU with a uniform input image resolution of 640×640 pixels to balance training efficiency and feature integrity. The hardware environment is based on a GeForce RTX 4090 GPU, and the software environment is based on Python 3.8, CUDA 11.3, and the PyTorch 1.11.0 deep learning framework. Using YOLOv11 as the base model, the model's depth factor is set to 0.33, the width factor is set to 0.25, and the maximum number of channels is set to 1024 to construct a lightweight network architecture. The optimization strategy uses the SGD (stochastic gradient descent) optimizer with a cosine decay strategy to dynamically adjust the learning rate. The initial learning rate is set to 0.01, and training is repeated for 200 epochs. The batch size is set to 32, the momentum parameter is 0.937, and the weight decay is 0.0005. Pretrained weights are not used during training, and data augmentation methods such as HSV color transformation, translation and flipping, and mosaic stitching are used to increase sample diversity. Mosaic stitching involves randomly cropping and stitching four images together to effectively improve small object detection capabilities. The above parameters were used to train the original YOLOv11 model and the improved model. By monitoring the changes in indicators such as precision, recall, and mAP@0.5 during training, the performance improvement of the improved model in the Panax notoginseng flower maturity detection task was finally verified.

[0035] The aforementioned deployment of the model to a mobile terminal to obtain detection results refers to: evaluating the robustness and generalization of the model on a self-built dataset for detecting the maturity of Panax notoginseng flowers, lightweight optimization of the YOLOv11 model (compressing the model size to 8.7MB) through pruning, quantization, and other techniques, and deploying it on edge computing devices such as Jetson Nano to test the network's inference efficiency and memory usage under the ARM architecture. Using a camera mounted on a mobile device (such as an Android tablet), Panax notoginseng flower images are captured in real time and transmitted via Wi-Fi to the edge device where the model is deployed for real-time detection. The detection results are displayed in a visual interface (labeling the flower location, maturity category, and confidence level), and the detection results (including images, category labels, and timestamps) are stored in the device's local database. This deployment solution can achieve accurate positioning and classification of Panax notoginseng flower growth stages in natural environments, providing real-time visual decision support for intelligent picking robots. The detection speed reaches 117.69 FPS, meeting the real-time requirements of field operations.

[0036] Compared with the existing technology, the above technical solution has the following beneficial effects:

[0037] (1) The YOLOv11 model is improved in multiple dimensions for the task of detecting the maturity of Panax notoginseng flowers: the backbone network is replaced by FasterNet, and the computational complexity is reduced to 1 / 16 of the traditional convolution through partial convolution (PConv), thereby improving the feature extraction capability of small targets (1-3 cm Panax notoginseng flowers) under complex backgrounds; a P2 small target detection layer is added to the neck network, and the small target recall rate is increased by 1.8% through the fusion of high-resolution feature maps; the WIoUv3 loss function is introduced, and the positioning accuracy in occluded scenes is improved by 0.4% through the dynamic gradient gain allocation strategy, effectively solving the detection problems such as flower overlap and branch occlusion in natural environments.

[0038] (2) The proposed model and deployment scheme not only achieves accurate detection of the growth stages of Panax notoginseng flowers (flowering, seed setting, and seed harvesting) in natural environments (mAP@0.5 reaches 92.0%), but also adapts to edge devices such as Jetson Nano through a lightweight design (model size .7MB), supporting real-time field detection (117.69FPS). In addition, combined with mobile image acquisition and visual storage of detection results, it provides a complete visual solution for Panax notoginseng flower intelligent picking robots, promoting industrial automation upgrades. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is an overall flow chart of a method for detecting the maturity of Panax notoginseng flower based on an improved YOLOv11 model provided in an embodiment of the present application;

[0040] Figure 2 This is the data set of Panax notoginseng flower under different light conditions in the examples of this application;

[0041] Figure 3 This is the FasterNet process structure diagram in this application;

[0042] Figure 4 This is a schematic diagram of the four-level detection system module in this application;

[0043] Figure 5 This is the test result diagram of this application. DETAILED DESCRIPTION

[0044] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. The examples are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts are within the scope of protection of the present invention.

[0045] See also Figure 1A method for detecting the maturity of Panax notoginseng flowers based on an improved YOLOv11 model is provided in an embodiment of the present invention, specifically comprising the following steps:

[0046] Step (1): Capture images of the growth stages of Panax notoginseng flowers and create a dataset. First, image collection was carried out in the natural environment of the Yunnan Panax notoginseng plantation. The collection period was from 10 am to 3 pm, covering lighting conditions such as strong light, normal light, weak light, and dark light. The shooting angles included looking up, looking straight, and looking down. The distance was controlled within the range of 15-40 cm to ensure that the three mature forms of flowering, seed setting, and seed collection were covered. In order to conform to the actual situation of the natural planting environment, artificial screening was performed to delete blurred images caused by poor focus and abnormal samples interfered by human factors. In order to improve the stability and accuracy of model training, clear images under different angles, distances, and lighting conditions were selected to ensure sample diversity.

[0047] Furthermore, the images were uniformly compressed to 640×640 pixels to meet the requirements of model training. Data augmentation was performed using Python tools, including classic methods such as horizontal and vertical flipping, contrast enhancement, Gaussian blurring, and brightness enhancement. Each original image was augmented by two images using a random combination of one or two of these methods, expanding the dataset from 2,000 to 6,000 images. Random cropping and padding operations were used to simulate foliage occlusion to improve the model's ability to resist interference.

[0048] Finally, the Labelimg annotation tool was used for manual annotation. The flowering period was marked as "f", the green seeds in the seed-setting period were marked as "g", and the red seeds in the seed-collecting period were marked as "s". The annotation box used the minimum enclosing rectangle that included the entire Panax notoginseng flower, and a corresponding txt format file was generated, which included the category, center coordinates, width and height information.

[0049] Step (2): Optimize and improve the YOLOv11 model to form an improved YOLO model.

[0050] FasterNet is used to replace the original backbone feature extraction network in the backbone network of YOLOv11. In view of the characteristics of the high proportion of 1-3cm small targets (about 72%) and occlusion of branches and leaves (41% of samples with an overlap rate >30%) in the Panax notoginseng flower detection scene, the traditional CSPDarknet backbone network is prone to loss of flower detail features due to a large step size during the downsampling process. As an efficient and lightweight architecture, FasterNet gradually compresses the feature map size and expands the number of channels through four feature extraction stages (Stage1-Stage4). For example, Stage1 converts the 640×640×3 input into a 320×320×24 output, which can not only capture low-level features such as petal texture, but also distinguish the morphological differences between flowering and seeding periods through high-level semantic features. Its core module, FasterNetBlock, adopts a partial convolution (PConv) structure, performing 3×3 convolution operations on only 1 / 16 channels of the input feature map, and retaining the remaining channels directly. The calculation amount formula is:

[0051]

[0052] The memory access count (MAC) is:

[0053]

[0054] Compared with traditional convolution, the computational overhead is reduced by 93.75% and the memory access is reduced by 75%. While keeping the model lightweight (parameters increase by about 1.2MB), the feature extraction capability in complex backgrounds is significantly improved.

[0055] like Figure 2 As shown in the figure, the PConv module of FasterNet splits the input feature map X into two sub-feature maps, X1 and X2, along the channel dimension. It performs a 1×1 convolution on X1 to extract inter-channel dependencies. It performs a 2×2 max pooling followed by a 3×3 convolution on X2, and finally fuses the two features through a concat operation. This multi-branch structure introduces cross-channel information interaction. Experiments have shown that it can improve the feature differentiation between flowering and seed setting stages by 12.3%, effectively resolving the problem of false detection due to morphological similarities between the two.

[0056] Furthermore, a P2 small target detection layer is added to the neck network of YOLOv11 to construct a four-level detection system of P2→P3→P4→P5. This layer upsamples the 0×0 feature map of the P3 layer to 160×160 through bilinear interpolation, and fuses it with the shallow features of the same size (160×160×C2) output by BackboneStage2 through Concat, and then extracts multi-scale features through the C2f module (including 3 bottleneck layers and Split operations). The detection head of the P2 layer is directly connected to the 160×160 feature map, reducing the number of downsampling times to retain small target details, and improving the recall rate of young flower buds with a pixel area of ​​<500 from 3.2% to 5.0%, effectively reducing the missed detection rate. The feature fusion process can be expressed as:

[0057] F P2 =C2f(Concat(Upsample(F P3 ,2),F shallow ))

[0058] Furthermore, we introduced WIoUv3 as a loss function based on the original YOLOv11 model to optimize bounding box regression for occlusion and overlap scenarios common in Panax notoginseng flower detection (e.g., multiple flower clusters with >50% overlap). WIoUv3 dynamically measures the quality of anchor boxes using the outlier measure β. When the predicted box has a low IoU with the ground-truth box (e.g., β > 1), its gradient gain is automatically reduced to mitigate the effects of harmful gradients. The calculation formula is:

[0059] ( Take the preset threshold 0.5)

[0060] The dynamic non-monotonic focusing coefficient r is:

[0061]

[0062] The distance metric R_WIoU imposes an exponential penalty on the center point offset:

[0063]

[0064] The final loss function is:

[0065] L WIoUv3 =r·R WIoU (1-IoU)

[0066] In test samples with an overlap rate > 50%, this loss function improves the positioning accuracy (IoU>0.5) by 0.6%, while increasing the computational complexity by only 1.2%. While ensuring the model inference speed (117.69FPS), it significantly improves the detection performance in occluded scenes.

[0067] Step (3): Train the improved YOLO model.

[0068] Model training was performed on a Windows 11 system with an Intel i9-13900KF CPU and an NVIDIA RTX 4090 GPU (24GB of video memory), developed in Anaconda 3 with PyCharm, and using the PyTorch 1.11.0 deep learning framework. Using YOLOv11 as the base model, we set a depth factor of 0.33, a width factor of 0.25, and a maximum number of channels of 1024 to construct a lightweight network architecture. The optimization strategy employed the SGD (stochastic gradient descent) optimizer with an initial learning rate of 0.01, dynamically adjusted using a cosine decay strategy. Training was performed for 200 epochs, with a batch size of 32, momentum of 0.937, weight decay of 0.0005, and a multi-thread worker count of 2. Pretrained weights were not used to accommodate the specific needs of Panax notoginseng flower detection.

[0069] The data augmentation strategies include HSV color transformation (hue change ±10, saturation change ±15%, and brightness change ±10%), translation and flipping (translation range ±5%, flipping probability 0.5), and mosaic stitching (randomly cropping and stitching 4 images). The mosaic operation effectively improves the detection effect of small-sized Panax notoginseng flowers by increasing the proportion of small target samples (to 35%).

[0070] At the same time, in order to evaluate the performance of the algorithm, we selected precision, recall, mean average precision (mAP), detection speed (FPS), and computational load (GFLOPs) as the evaluation indicators of the model. Precision refers to the ratio of correctly predicted positive samples to all predicted positive samples, as shown below:

[0071] Recall refers to the ratio of correctly predicted positive samples to all true positive samples, as shown below:

[0072] The real-time performance of the model is measured by the number of frames per second (FPS). The faster the detection speed, the higher the real-time performance of the model. The calculation formula is as follows: Where T pre is the image preprocessing time, T infer is the model inference time, T nms Post-processing time.

[0073] The key parameter for measuring the model is mAP, which is the average of AP (Average Precision), as shown below: The measurement indicators are divided into mAP50 and mAP50:95. mAP50 represents the average detection accuracy of all target categories when the IoU threshold is 0.5. mAP50:95 represents the average detection accuracy of all 10 IoU thresholds from 0.50 to 0.95 with a step size of 0.05.

[0074] The YOLOv11 base model and the improved YOLO model were then trained using the aforementioned training parameters. The training results were compared across evaluation metrics, taking all indicators into consideration. Based on the training results and comparisons, the module structure and parameters were continuously refined to achieve the optimal model suitable for production use.

[0075] Step (4) deploys the model to the mobile terminal to obtain the detection results.

[0076] To further improve the applicability of the model in practical scenarios, we first conducted robustness and generalization evaluations on a self-built Panax notoginseng flower maturity detection dataset (including challenging samples such as strong light and occlusion) and a public flower dataset. We then achieved lightweight optimization through model pruning (pruning redundant channels) and quantization (INT quantization) techniques. Finally, we compressed the model to 8.7MB and deployed it on embedded devices such as Jetson Nano (ARM architecture) to test its inference efficiency and memory usage in a low-power hardware environment, thereby verifying its network portability.

[0077] The optimized model was ultimately deployed on mobile devices such as Android tablets. The device's camera captured real-time images of Panax notoginseng flowers, which were then transmitted via Wi-Fi to edge devices for inference detection. The detection results were displayed in a visual interface (labeled with flower location, maturity category, and confidence level), and the image, category label, timestamp, and other information were stored in a local database. This solution accurately locates and classifies Panax notoginseng flowers at their growth stages in natural environments (with a mAP@0.5 score of 92.0%), with a detection speed of 117.69 FPS, meeting the needs of real-time field operations.

[0078] To address the problems of missed small target detection, occlusion misdetection, and difficulty in stage classification in natural environment detection of Panax notoginseng flowers, this paper proposes a method for detecting the maturity of Panax notoginseng flowers based on an improved YOLOv11. The traditional convolutional layers of the backbone network are replaced by FasterNet to enhance the ability to extract small target features; a P2 small target detection layer is added to enhance multi-scale feature fusion; and the WIoUv3 loss function is introduced to optimize bounding box regression. Compared to the original YOLOv11 model, the improved YOLOv11 model has 15.3% fewer parameters, a 0.7% increase in inference speed, and a 2.2% improvement in detection accuracy. This effectively solves the technical challenges of Panax notoginseng flower detection in natural scenes and provides an efficient visual solution for intelligent harvesting robots.

[0079] This detection solution not only realizes the real-time acquisition of Panax notoginseng flower images and the display and storage of detection results in natural environments, but can also be combined with mechanical equipment such as drones to achieve long-distance, contactless inspections of large-scale plantations, greatly improving the efficiency and intelligence level of Panax notoginseng flower maturity detection.

[0080] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structures or equivalent process changes made using the description and drawings of the present invention are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting the maturity of Panax notoginseng flower based on an improved YOLOv11 model, characterized in that: The following steps are involved: Step (1) collecting images of Panax notoginseng flowers of different maturity levels and creating a data set; Step (2) optimizing and improving the YOLOv11 model to form an improved YOLOv11 model; Step (3) training the improved YOLOv11 model; Step (4) deploys the model to the mobile terminal to obtain the detection results.

2. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, characterized in that: Using a camera, we captured clear images of Panax notoginseng flowers at different growth stages between 10 a.m. and 8 p.m. at different angles, including looking up, looking straight, and looking down, at different distances of 15-40 cm, and under different lighting conditions, including strong light, normal light, weak light, and dark light. We also built a dataset for detecting the maturity of Panax notoginseng flowers, which mainly includes three forms: flowering period, seed setting period, and seed harvesting period.

3. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, wherein: After obtaining the Panax notoginseng flower images in a natural environment, in order to ensure the diversity and robustness of the dataset, one or more data augmentation methods such as horizontal flipping, vertical flipping, contrast enhancement, Gaussian blurring, and brightness enhancement were randomly used for data expansion. The Labelimg annotation tool was used to classify and label the Panax notoginseng flower images, with the flowering period labeled as f, the green seeds in the seed-setting period labeled as g, and the red seeds in the seed-collecting period labeled as s. The annotation box selected the minimum enclosing rectangle of the entire Panax notoginseng flower to reduce background influence. The above dataset was randomly divided into training set, validation set, and test set in a ratio of 7:2:

1.

4. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, wherein: The YOLOv11 model was optimized and improved to form an improved YOLO model, including: using the FasterNet network to replace the original backbone network in the YOLOv11 backbone network; FasterNet is an efficient neural network architecture that can be divided into four stages for feature extraction. Each stage is preceded by an embedding or merging layer composed of conventional convolutions for spatial upsampling and channel expansion; FasterNet's core module FasterNetBlock consists of partial convolution (PConv) and two ordinary convolutions. PConv uses residual connections to perform convolution operations only on some channels, while the remaining channels remain unchanged. By reducing the amount of computation and memory access, the detection speed is greatly improved, and spatial features can be extracted more efficiently, enhancing the network's ability to extract Panax notoginseng flower features from complex backgrounds and the ability to distinguish flowers in the flowering and seed-setting stages.

5. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 4, characterized in that: The optimization and improvement of the YOLOv11 model to form an improved YOLO model also includes: adding a P2 small target detection layer to the neck network of YOLOv11; the P2 small target detection layer is a feature fusion path newly added after the original P3 layer, forming a multi-level detection system of P2→P3→P4→P5, including Upsample, Concat and C2f modules. Upsample amplifies the feature map of the P3 layer to a higher resolution and restores spatial details. Concat fuses the high-resolution feature map from the shallow layer of Backbone with the deep semantic features after Upsample, taking into account both details and semantics. The C2f module adopts a lightweight design and extracts multi-scale features through cross-stage residual connections to reduce the number of parameters while retaining sensitivity to small targets. The P2 layer also includes a detection head directly connected to the P2 layer to fuse more feature information and enhance the detection ability of small targets such as Panax notoginseng flowers.

6. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, characterized in that: The optimization and improvement of the YOLOv11 model to form an improved YOLO model also includes: introducing WIoU as a loss function based on the original YOLOv11 model to improve the detection accuracy of the model in the case of branch occlusion and target overlap; WIoU not only considers the distance from the mass center and the overlapping area, but also introduces a dynamic non-monotonic focusing mechanism to evaluate the quality of the anchor frame through a reasonable gradient gain allocation strategy. The smaller the value, the higher the quality of the anchor frame, and the smaller the gradient gain assigned to it, so that the bounding box regression focuses on the anchor frame of average quality. On the contrary, the larger the value, the worse the anchor frame quality, and the smaller the assigned gradient gain, which effectively prevents low-quality samples from generating large harmful gradients. In the Panax notoginseng flower maturity detection task, the proportion of small targets, occlusions and overlapping samples is relatively high. The use of WIoU can make the model more focused on these difficult-to-identify samples, thereby improving the detection performance of the model.

7. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, characterized in that: The improved YOLO model includes: the image resolution is unified to 640×640 pixels to ensure the model training speed; the Windows 11 operating system, 13th Gen Intel Core i9-13900KF CPU, NVIDIA GeForce RTX 4090 GPU, 32G running memory, Anaconda3 configuration deep learning virtual environment, Python version 3.8, CUDA version 11.3, Pytorch version 1.11.0; the YOLOv11 model is used as the base model, and the SGD optimizer is selected. The momentum parameter is 0.937, the initial learning rate is 0.01, the weight decay is 0.0005, the number of multi-thread workers is 2, no pre-trained weights are used, the image input size is 640×640, the batch-size is 32, and the iteration rounds are 200. During the training process, five data augmentation methods, including horizontal flip, vertical flip, contrast enhancement, Gaussian blur, and brightness enhancement, are randomly combined to expand the image and label files. The above training parameters are used to train and optimize the original YOLOv11 model and the improved YOLOv11 model respectively. Finally, the training results are compared to draw conclusions.

8. The method for detecting the growth stage of Panax notoginseng flower based on the improved YOLOv11 model according to claim 1, characterized in that: Deploying the model to a mobile device to obtain detection results includes: evaluating the robustness and generalization of the trained network model on a self-built Panax notoginseng flower dataset, and optimizing the network for lightweighting; deploying the model on a mobile device and obtaining positioning and classification results for the growth stages of Panax notoginseng flowers, providing core visual algorithm support for Panax notoginseng flower picking robots.

Citation Information

Cited By

  • Dual-module cooperative corn maturity detection method based on domain self-adaption

    CN121147912A

  • Dual-module cooperative corn maturity detection method based on domain adaptation

    CN121147912B