A rice tillering angle nondestructive detection method based on YOLO11
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH LIAONING
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-02
Smart Images

Figure CN122134659A_ABST
Abstract
Description
Technical Field
[0001] This invention patent relates to a non-destructive testing method for rice tillering angle based on YOLO11, which belongs to the field of artificial intelligence. Background Technology
[0002] As one of the world's major food crops, rice's yield and quality are directly related to food security [1]. Tillering is a key stage in the transition of rice from vegetative growth to reproductive growth. It not only determines the number of effective panicles, but the tillering angle (the angle between the tiller and the main stem) is also a core indicator affecting the compactness of the plant type. Upright tillers can improve field ventilation and light penetration, and reduce the occurrence of diseases. Prostrate tillers are prone to causing dense canopy, reducing photosynthetic efficiency and increasing the risk of lodging [2], which seriously affects the yield and quality of rice. In the study of rice growth status monitoring and yield prediction, the tillering angle is a key agronomic trait that reflects the plant type structure of rice and affects the photosynthetic efficiency and lodging resistance. Its accurate quantitative detection is of great significance for rice breeding screening, planting density optimization and growth status monitoring. However, the existing methods for measuring rice tillering angle mainly rely on manual sampling. Due to the irregular morphology of tillers and the fuzzy characteristics of small-scale tillers, traditional methods of manually measuring tiller angles suffer from low efficiency and strong subjectivity, which seriously affect the detection accuracy, are destructive, and are not easy to conduct on a large scale.
[0003] In computer vision technology, target detection has been widely used in plant species identification and feature extraction. Compared with traditional manual measurement methods, target detection methods can significantly improve detection efficiency without destroying the original tillering angle of rice. The traditional method of measuring tillering angle uses a protractor. However, the traditional method has certain limitations. Although the protractor measurement method is intuitive, it is time-consuming and laborious due to its reliance on manual operation. It is particularly difficult to measure the tillering angle of rice in practice. It is necessary to measure the horizontal distance between the central axis and the outer tillers multiple times in different directions at a height of 30cm above the ground of the plant and calculate the average value [3]. This process is difficult to operate and is prone to introducing significant errors.
[0004] In existing research, Tan Ying developed a three-dimensional reconstruction-based rice seedling trait extraction system. This system digs rice from the paddy field into a pot for three-dimensional photography and generates a three-dimensional image of the rice to identify traits such as tillering angle [4]. Although the tillering angle of rice can be measured from multiple angles, this operation is prone to destroying the original stem angle of the plant, interfering with its natural state, and may even lead to tillering atrophy or plant death after transplanting.
[0005] Therefore, there is an urgent need to propose a non-destructive detection method for rice tillering angle based on computer vision technology to solve the detection problem in the actual scene of rice field and under different lighting conditions. This is of great significance for improving the detection efficiency and accuracy of rice tillering angle detection.
[0006] References: [1] Liu Bin. Following the forefront of global scientific and technological development, molecular breeding of rice has achieved initial results—Progress of molecular breeding of rice at Guangdong Academy of Agricultural Sciences [J]. Guangdong Agricultural Sciences, 2020, 47(12):12. [2] Wang Zhaojun. Genome-wide association analysis and QTL mapping of dynamic changes in rice tillering angle [D]. Heilongjiang: Heilongjiang Bayi Agricultural Reclamation University, 2025. [3] Shen Shengquan, Zhuang Jieyun, Bao Jinsong, et al. QTL analysis of the maximum tillering angle of rice [J]. Journal of Agricultural Biotechnology, 2005, (01): 16-20. [4] Tan Ying. Research and system integration of rice seedling traits extraction based on three-dimensional reconstruction during the tillering stage [D]. Shandong Agricultural University, 2025. Summary of the Invention
[0007] To address the aforementioned issues, this invention proposes a non-destructive testing method for rice tillering angle based on YOLO11. This method solves the current lack of non-contact measurement methods for rice tillering angle in the field of computer vision technology, thus avoiding measurement errors and transplant death caused by damaging the original stem angle of rice. In this way, a more efficient measurement method with a measurement angle that more closely reflects the actual situation is achieved.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a non-destructive testing method for rice tillering angle based on YOLO11, the method comprising the following steps: S1. Take a picture of a single rice plant with a gray background at the tillering stage under natural light as the input rice image; S2. Perform light homogenization processing on the input rice image; S3. Construction and training of a rice tillering key point detection model based on YOLO11-Pose; S4. Use the trained YOLO11-Pose detection model to detect key tillering points and form two tillering feature lines; S5. Calculate the angle between the two tillering feature lines, which is the rice tillering angle, and visualize the tillering angle; In step S2, since rice is typically grown outdoors, the light intensity during the tillering stage varies significantly across different time periods within the same day, which can affect the acquired rice images. To avoid the impact of light on the recognition accuracy of the acquired images, the input rice images need to be processed using a light homogenization algorithm. First, the density of pixel intensity abrupt changes in the image is determined by calculating a statistic based on the proportion of pixels with significant gradients. Then, the input rice image is divided into blocks, and the difference between the average brightness of each block and the global average brightness is calculated to form a light deviation map. Finally, a low-frequency light deviation field is estimated and subtracted to achieve light homogenization of the image, effectively suppressing large areas of shadow or highlight. The specific steps are as follows: Step a: Grayscale image conversion Let the input rice image be The corresponding grayscale image is The conversion between the two is shown in equation (1): (1) Step b: Gradient magnitude calculation Calculate grayscale images using the Sobel operator. The gradients in the horizontal and vertical directions are denoted as follows: and As shown in equations (2) and (3): (2) (3) Find the gradient magnitude of the grayscale image As shown in equation (4): (4) Step c: Calculation of uneven illumination Set the gradient threshold for evaluating illumination uniformity. , Statistical grayscale images The proportion of pixels whose gradient magnitude is greater than the gradient threshold among all pixels. This is called the degree of uneven illumination, and its expression is shown in equation (5): (5) in, Between between, A higher value indicates more uneven lighting; The total number of pixels in the image , This is an indicator function; the indicator function takes the value 1 when the corresponding condition is true, and takes the value 0 otherwise. Step d: Extraction of the luminance channel in the HSV color space Input rice image Convert to HSV color space to obtain an HSV color space image As shown in equation (6): (6) From HSV color space images Separate the brightness channel As shown in equation (7): (7) Step e: Calculation of global average brightness Calculate the luminance channel mean As shown in equation (8): (8) Step f: Calculation of local image deviation The HSV color space image is divided into 1 grid, of which For the number of grid rows, For the number of grid columns, and The value is determined by the number of grid cells. The image size is determined as shown in equations (9) and (10): (9) (10) Image located in HSV color space line, number Network blocks of lines The corresponding average brightness for: (11) in, For grid blocks The number of pixels within; Grid blocks The deviation between the mean brightness and the global average brightness for: (12) The deviation values of all grid blocks in the HSV color space image are combined into a deviation matrix. for: (13) Step g: Illumination compensation mask smoothing low-resolution deviation matrix Upsampled to the original size of the input rice image To obtain the initial mask for: (14) For the initial mask Gaussian blur is applied to smooth out block effects, resulting in an illumination compensation mask. for: (15) Step h, brightness compensation and color space conversion If an image region exists If this is the case, it means the area is too bright. The corresponding value is positive, meaning it comes from the brightness channel of the original image. Subtract compensation mask This darkens the area to achieve illumination compensation, and vice versa; the corrected brightness channel for: (16) Finally, Replace to The brightness channel in the image is shown in Equation (17): (17) Will The image was converted back to the BGR color space to obtain a rice-compensated image. As shown in equation (18): (18) The specific construction process of the YOLO11-Pose detection model used for key point detection of rice tillering in step S3 is as follows: a) Training data acquisition and preprocessing Image Data Acquisition and Annotation: Under different lighting conditions, N images of individual rice plants with gray backgrounds were taken using a camera during the rice tillering stage. Manual annotation was performed using the Labelme data annotation tool, selecting the leafless or sparsely leafed stem portions of the rice plants using rectangular boxes. Since each image only contains the main stem of a single rice plant, all rectangular box labels were defined as "rice_stem". Tillering key points were annotated on the left and right sides of the selected area, with at least three leaves on each stem. Four tillering key points were annotated clockwise from the upper right to the upper left corner and named "rice_no1", "rice_no2", "rice_no3", and "rice_no4" respectively. After annotation, the generated JSON format label files were converted to TXT format label files, and the label files and corresponding images were placed in the same folder. Data augmentation was performed on the self-built dataset to increase the diversity of training data, ensure the generalization ability of the subsequent YOLO11-Pose detection model training, and prevent overfitting. Data augmentation included five methods: cropping, flipping, Gaussian blurring, brightness adjustment, and light homogenization processing described in step S2. Each data augmentation method was randomly applied to N sets of image data, and the image data generation factor was set to s, resulting in s·N sets of augmented datasets. The augmented datasets were divided into training set, validation set, and test set in an 8:1:1 ratio. b) Model architecture construction The designed YOLO11-Pose detection model adopts a single-stage detection framework, which includes four parts: Input layer, Backbone network, Neck network, and Head network. The Head network uses the Pose detection head to effectively extract and fuse features in rice images and improve the accuracy of tillering key point estimation in rice images. c) Model training parameter settings The training parameters for the YOLO11-Pose detection model include the number of training iterations, input image size, number of input batches, cache, optimizer, initial learning rate, optimizer momentum parameter, GPU warm-up initial momentum, number of GPU warm-up iterations, number of times mosaic enhancement is disabled, mosaic data augmentation, and final learning rate. Set the training parameters for the YOLO11-Pose detection model. d) Model training The images from the training set are fed into the constructed YOLO11-Pose detection model. Rice images are preprocessed at the input of the YOLO11-Pose detection model and then fed into the backbone network. The enhanced rice compensated images are sliced to extract features. Then, they are fed into the Neck network, which adopts a bidirectional FPN+PAN structure. Upsampling fuses high-level semantics and low-level details, while downsampling transmits localization information and optimizes multi-scale feature fusion. The head network adopts an anchor-free design and outputs detection coordinates and keypoint task results until the loss function converges, resulting in the trained YOLO11-Pose detection model. e) Verify whether the detection model meets the requirements. Based on the accuracy requirements for rice tiller angle detection in practical agricultural applications, the YOLO11-Pose neural network model trained was evaluated using a test set, and the mean accuracy (mAP) of keypoint detection was calculated. 50-95 Set the lower limit of the average accuracy threshold for keypoint detection to δ, and determine whether the detection model meets the actual detection requirements, specifically as follows: If mAP 50-95 > δIf this is not the case, it means that the detection model has not achieved the expected accuracy in key point localization. In this case, proceed to S3, increase the diversity of training data, adjust the model training parameters, and retrain the detection model. If mAP 50-95 > δ If the test is successful, it means that the detection model meets the expected accuracy requirements in key point localization. Jump to S4 to determine the key points of tillering and calculate the angle.
[0009] In step S4, the rice compensation image is input into the trained YOLO11-Pose detection model, which outputs four tillering key points for a single rice plant, namely "rice_no1", "rice_no2", "rice_no3", and "rice_no4". These are located at the root of the left edge stem, the part of the left stem near the leaf, the root of the right edge stem, and the part of the right stem near the leaf, respectively, with two-dimensional coordinates of [missing information]. , , and Connecting two key tillering points on the same side of a single rice plant forms two tillering characteristic lines; In step S5, the slopes of the two tillering characteristic lines on the left and right sides are calculated. and As shown in equations (19) and (20) respectively: (19) (20) Calculate tillering angle value As shown in equation (21): (twenty one) Output the tillering angle value of a single rice plant corresponding to the rice image. Meanwhile, the OpenCV2 computer vision library is used to display the key points of tillering, the extensions of the two feature lines, and the tillering angle values on the image.
[0010] The beneficial effects of this invention are as follows: 1. The non-destructive measurement method for rice tillering angle proposed in this invention does not require damaging the natural rice rootstock during the measurement process. It can complete the non-contact tillering angle measurement in different light and dark environments. Therefore, it is more efficient and the measurement angle is closer to the actual situation than other measurement methods.
[0011] 2. This invention employs a light homogenization algorithm to process the input rice image, effectively suppressing large areas of shadow or highlight to improve detection accuracy. Data augmentation is performed on the rice image, using super-resolution reconstruction to enhance subtle features of small targets, thereby improving the detection accuracy of blurred tillering regions.
[0012] 3. This invention requires only initial manual image capture; subsequent operations can be fully automated by introducing deep learning algorithms. Applied to agriculture, this technology helps improve the efficiency and consistency of tiller angle measurement, reduces labor costs and operational errors, provides reliable data support for rice phenotyping and precision paddy field management, and promotes the development of smart agriculture towards automation and intelligence.
[0013] 4. This invention uses the YOLO11 recognition algorithm to identify key tillers in rice. This algorithm adopts a single-stage network architecture and uses a Pose detection head to avoid the cumbersome image segmentation process. The model has low complexity and short training time. The constructed model can complete the identification of the tiller angle of a single rice plant within 3ms. It has small measurement error and fast speed, which can more efficiently complete the phenotypic analysis of rice and can be more easily embedded into agricultural detection systems. Attached Figure Description
[0014] For ease of explanation, the present invention will be described in detail below with reference to specific embodiments and accompanying drawings.
[0015] Figure 1 The flowchart shows a non-destructive testing method for rice tillering angle based on YOLO11. Figure 2 An image of rice generated through illumination compensation; Figure 3 Images of rice plants with manual annotations; Figure 4 The input image is used for training the YOLO11-Pose detection model; Figure 5 The graph shows the changes in loss function and recognition accuracy during the training and validation of the YOLO11-Pose detection model. Figure 6 The accuracy curve of the YOLO11-Pose detection model; Figure 7 Precision-recall curves for the YOLO11-Pose detection model; Figure 8 The F1 score-confidence curve of the YOLO11-Pose detection model; Figure 9 The recall-confidence curve of the YOLO11-Pose detection model; Figure 10 The image shows the recognition results of the trained YOLO11-Pose detection model on key points of tillering in rice images under five different conditions. Figure 11 The image shows the measurement results of the tillering angle of two rice plants obtained by the trained YOLO11-Pose detection model. Figure 12 A comparison chart of angles measured manually and by the YOLO11-Pose detection model; Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention patent clearer, the invention patent is described below with reference to specific embodiments shown in the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and not intended to limit the scope of this invention patent. Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of this invention patent.
[0017] Implementation Example 1: This invention provides a non-destructive testing method for rice tillering angle based on YOLO11, such as... Figure 1 The diagram shown is a flowchart of a non-destructive testing method for rice tillering angle based on YOLOv11 provided in this embodiment. This embodiment can be applied to perform non-contact measurement of rice tillering angle under different lighting conditions without damaging the original rice rootstock. The method includes the following steps: S1. Take a picture of a single rice plant with a gray background at the tillering stage under natural light as the input rice image; S2. Perform light homogenization processing on the input rice image; S3. Construction and training of a rice tillering key point detection model based on YOLO11-Pose; S4. Use the trained YOLO11-Pose detection model to detect key tillering points and form two tillering feature lines; S5. Calculate the angle between the two tillering feature lines, which is the rice tillering angle, and visualize the tillering angle; In step S2 of the method, since rice is usually grown outdoors, the light intensity during the key tillering stage varies significantly at different times of the same day, which can affect the acquired rice images. To avoid the light affecting the recognition accuracy of the acquired images, the input rice images need to be processed using a light homogenization algorithm. First, the density of pixel intensity abrupt changes in the image is determined by calculating a statistic based on the proportion of pixels with significant gradients. Then, the input rice image is divided into blocks, and the difference between the average brightness of each block and the global average brightness is calculated to form a light deviation map. Finally, a low-frequency light deviation field is estimated and subtracted to achieve light homogenization of the image, effectively suppressing large areas of shadow or highlight. The specific steps are as follows: Step a: Grayscale image conversion Let the input rice image be The corresponding grayscale image is The conversion between the two is shown in equation (1): (1) Step b: Gradient magnitude calculation Calculate grayscale images using the Sobel operator. The gradients in the horizontal and vertical directions are denoted as follows: and As shown in equations (2) and (3): (2) (3) Find the gradient magnitude of the grayscale image As shown in equation (4): (4) Step c: Calculation of uneven illumination Set the gradient threshold for evaluating illumination uniformity. , Statistical grayscale images The proportion of pixels whose gradient magnitude is greater than the gradient threshold among all pixels. This is called the degree of uneven illumination, and its expression is shown in equation (5): (5) in, Between between, A higher value indicates more uneven lighting; The total number of pixels in the image , This is an indicator function; the indicator function takes the value 1 when the corresponding condition is true, and takes the value 0 otherwise. Step d: Extraction of the luminance channel in the HSV color space Input rice image Convert to HSV color space to obtain an HSV color space image As shown in equation (6): (6) From HSV color space images Separate the brightness channel As shown in equation (7): (7) Step e: Calculation of global average brightness Calculate the luminance channel mean As shown in equation (8): (8) Step f: Calculation of local image deviation The HSV color space image is divided into 1 grid, of which For the number of grid rows, For the number of grid columns, and The value is determined by the number of grid cells. The image size is determined as shown in equations (9) and (10): (9) (10) Image located in HSV color space line, number Network blocks of lines The corresponding average brightness for: (11) in, For grid blocks The number of pixels within; Grid blocks The deviation between the mean brightness and the global average brightness for: (12) The deviation values of all grid blocks in the HSV color space image are combined into a deviation matrix. for: (13) Step g: Illumination compensation mask smoothing low-resolution deviation matrix Upsampled to the original size of the input rice image To obtain the initial mask for: (14) For the initial mask Gaussian blur is applied to smooth out block effects, resulting in an illumination compensation mask. for: (15) Step h, brightness compensation and color space conversion If an image region exists If this is the case, it means the area is too bright. The corresponding value is positive, meaning it comes from the brightness channel of the original image. Subtract compensation mask This darkens the area to achieve illumination compensation, and vice versa; the corrected brightness channel for: (16) Finally, Replace to The brightness channel in the image is shown in Equation (17): (17) Will The image was converted back to the BGR color space to obtain a rice-compensated image. As shown in equation (18): (18) The specific construction process of the YOLO11-Pose detection model for detecting key points of rice tillering in step S3 of the method is as follows: a) Training data acquisition and preprocessing Image Data Acquisition and Annotation: Under different lighting conditions, N images of individual rice plants with gray backgrounds were taken using a camera during the rice tillering stage. Manual annotation was performed using the Labelme data annotation tool, selecting the leafless or sparsely leafed stem portions of the rice plants using rectangular boxes. Since each image only contains the main stem of a single rice plant, all rectangular box labels were defined as "rice_stem". Tillering key points were annotated on the left and right sides of the selected area, with at least three leaves on each stem. Four tillering key points were annotated clockwise from the upper right to the upper left corner and named "rice_no1", "rice_no2", "rice_no3", and "rice_no4" respectively. After annotation, the generated JSON format label files were converted to TXT format label files, and the label files and corresponding images were placed in the same folder. Data augmentation was performed on the self-built dataset to increase the diversity of training data, ensuring the generalization ability of the subsequent YOLO11-Pose detection model training and preventing overfitting. Data augmentation included five methods: cropping, flipping, Gaussian blurring, brightness adjustment, and light homogenization as described in step S2. These data augmentation methods were applied randomly to the dataset. N Group image data, image data generation factor set to s Finally generated s · N The augmented dataset is divided into training, validation, and test sets in an 8:1:1 ratio. b) Model architecture construction The designed YOLO11-Pose detection model adopts a single-stage detection framework, which includes four parts: Input layer, Backbone network, Neck network, and Head network. The Head network uses the Pose detection head to effectively extract and fuse features in rice images and improve the accuracy of tillering key point estimation in rice images. c) Model training parameter settings The training parameters for the YOLO11-Pose detection model include the number of training iterations, input image size, number of input batches, cache, optimizer, initial learning rate, optimizer momentum parameter, GPU warm-up initial momentum, number of GPU warm-up iterations, number of times mosaic enhancement is disabled, mosaic data augmentation, and final learning rate. Set the training parameters for the YOLO11-Pose detection model. d) Model training The images from the training set are fed into the constructed YOLO11-Pose detection model. Rice images are preprocessed at the input of the YOLO11-Pose detection model and then fed into the backbone network. The enhanced rice compensated images are sliced to extract features. Then, they are fed into the Neck network, which adopts a bidirectional FPN+PAN structure. Upsampling fuses high-level semantics and low-level details, while downsampling transmits localization information and optimizes multi-scale feature fusion. The head network adopts an anchor-free design and outputs detection coordinates and keypoint task results until the loss function converges, resulting in the trained YOLO11-Pose detection model. e) Verify whether the detection model meets the requirements. Based on the accuracy requirements for rice tiller angle detection in practical agricultural applications, the YOLO11-Pose neural network model trained was evaluated using a test set, and the mean accuracy (mAP) of keypoint detection was calculated. 50-95 Set the lower limit of the average accuracy threshold for keypoint detection to δ, and determine whether the detection model meets the actual detection requirements, specifically as follows: If mAP 50-95 > δ If this is not the case, it means that the detection model has not achieved the expected accuracy in key point localization. In this case, proceed to S3, increase the diversity of training data, adjust the model training parameters, and retrain the detection model. If mAP 50-95 > δ If the test is successful, it means that the detection model meets the expected accuracy requirements in key point localization. Jump to S4 to determine the key points of tillering and calculate the angle.
[0018] In step S4 of the method, the rice compensation image is input into the trained YOLO11-Pose detection model, which outputs four tillering key points of a single rice plant, namely "rice_no1", "rice_no2", "rice_no3", and "rice_no4", located at the root of the left edge stem, the part of the left stem near the leaf, the root of the right edge stem, and the part of the right stem near the leaf, respectively, with two-dimensional coordinates as follows: , , and Connecting two key tillering points on the same side of a single rice plant forms two tillering characteristic lines.
[0019] In step S5 of the method, the slopes of the two tillering characteristic lines on the left and right sides are calculated. and As shown in equations (19) and (20) respectively: (19) (20) Calculate tillering angle value As shown in equation (21): (twenty one) Output the tillering angle value of a single rice plant corresponding to the rice image. Meanwhile, the OpenCV2 computer vision library is used to display the key points of tillering, the extensions of the two feature lines, and the tillering angle values on the image.
[0020] Implementation Example 2: To verify the effectiveness of the light homogenization compensation algorithm described in this invention, three different lighting conditions were selected for input rice images to undergo light homogenization processing, such as... Figure 2 The image shows the results of light homogenization. It can be seen that after light homogenization, the foreground and background can be better distinguished, making it easier to extract features from the YOLO11 network model.
[0021] Implementation Example 3: To verify the effectiveness of the YOLOv11-based non-destructive testing method for rice tillering angle, 272 single-plant gray-background images of rice were collected during the tillering stage. Manual annotation was performed using the Labelme data annotation tool, selecting leafless or sparsely leafed stem portions using rectangular bounding boxes. All bounding box labels were defined as "rice_stem". Tillering key points were labeled on the stems with at least three leaves on both sides of the selected area. Four tillering key points were labeled clockwise from the upper right to the upper left corner and named "rice_no1", "rice_no2", "rice_no3", and "rice_no4". An example of the labeled rice image is shown below. Figure 3 As shown; after annotation, convert the generated JSON format tag file into a TXT format tag file, and place the tag file and the corresponding image in the same folder; Data augmentation was performed on a self-built dataset, including five methods: cropping, flipping, Gaussian blurring, brightness adjustment, and light homogenization. Each augmentation method was randomly applied to 272 sets of image data, with the image data generation factor set to 5, ultimately generating 1360 augmented datasets. These augmented datasets were then divided into training, validation, and test sets in an 8:1:1 ratio, with 1088, 136, and 136 sets of data respectively. A batch of training input images is shown below. Figure 4 As shown; The basic architecture of the YOLO11-Pose detection model was constructed, and the environment for training and testing was set up: an Intel(R) Core(TM) i9-12900k processor, 32GB of memory, on a Windows 10 computer equipped with an NVIDIA GeForce RTX 5060 GPU. All programs in the method were implemented using Python 3.10 within the PyTorch deep learning framework. The relevant training parameters for the constructed YOLO11-Pose detection model are shown in Table 1, and the YOLO11-Pose detection model was then trained.
[0022] Table 1. Training parameter settings for the YOLO11-Pose detection model
[0023] After the YOLO11-Pose detection model is trained, the following results are obtained: Figure 5 The visualization shown illustrates the changes in key metrics during the training and validation process of the YOLO11-Pose detection model. It includes the variations of different loss functions for bounding boxes, keypoints, target confidence, classification, and focus distribution as the number of iterations during training and validation, as well as bounding box precision, bounding box recall, keypoint precision, keypoint recall, and bounding box mAP. 50 Accuracy, detection frame mAP 50-95 Accuracy, key point mAP 50 Accuracy, key point mAP 50-95 The accuracy varies with the number of iterations. Analysis of the loss function curve reveals that the training process of the YOLO11-Pose detection model is convergent, with no overfitting or underfitting, demonstrating the effectiveness of the model training. Training on 100 images took 1.058 hours, the resulting training weight model size was 5.7 MB, the average recognition speed was 2.9 ms, and the computational cost was 6.6 GFLOPs.
[0024] The precision curve, precision-recall curve, F1-confidence curve, and recall-confidence curve of the YOLO11-Pose detection model are shown below. Figure 6 ,7 As shown in Figures 8 and 9, a high recall rate is maintained in the low to medium confidence range (0.3~0.7), indicating that the detection model has a stable ability to detect most positive samples. The precision-recall curve represents the model's ability to achieve high recall while maintaining high precision. When the confidence threshold is close to 1, the precision curve of the model should approach 1, indicating that the model has high reliability for high-deterministic predictions, and the larger the area enclosed by the precision-recall curve, the better the model's performance.
[0025] The trained model was evaluated using a test set, and the mean accuracy (mAP) for tillering keypoint detection was calculated. 50-95 Set the lower limit of the precision threshold. δ =95%. The model's mAP was tested and found to be... 50-95 The accuracy rate reached 98.97%, which is higher than the threshold δ, indicating that the model meets the accuracy requirements in key point localization and can be used for subsequent tillering angle detection.
[0026] To verify the detection performance of key tillering points in rice images under different conditions, single rice plant images were tested under dark environment, bright environment, noise, offset, and illumination-compensated species conditions. The model automatically output the two-dimensional coordinates of four key tillering points: , , and The results of the detection of key points in rice tillering are obtained, corresponding to "rice_no1", "rice_no2", "rice_no3", and "rice_no4" respectively. Figure 10 As shown.
[0027] Using the four key tillering points obtained, connect the key tillering points on the same side to form a tillering characteristic line and extend it. Calculate the slope of the two tillering characteristic lines on the left and right sides. and Calculate the tillering angle value The detection results are visualized on the image using the OpenCV2 computer vision library, ultimately outputting a visualized image of the rice tillering angle detection results, such as... Figure 11 As shown, the tillering angle of rice in the two example images The angles are 31.3° and 35.0° respectively.
[0028] To verify the accuracy of the measurements, 20 rice samples were randomly selected for comparison between the accuracy of the detection model and manual measurements. The tillering angle measurements obtained manually using a protractor were compared with those obtained automatically by the detection model. Figure 12As shown, the overall average absolute error between the measurement results of this method and the manually measured values is 1.54°, indicating that the method proposed in this invention has high measurement accuracy and reliability, and can meet the needs of non-destructive and rapid detection of rice tillering angle in practical agricultural applications.
Claims
1. A non-destructive testing method for rice tillering angle based on YOLO11, characterized in that, Includes the following steps: S1. Take a picture of a single rice plant with a gray background at the tillering stage under natural light as the input rice image; S2. Perform light homogenization processing on the input rice image; S3. Construction and training of a rice tillering key point detection model based on YOLO11-Pose; S4. Use the trained YOLO11-Pose detection model to detect key tillering points and form two tillering feature lines; S5. Calculate the angle between the two tillering feature lines, which is the rice tillering angle, and visualize the tillering angle.
2. The method according to claim 1, characterized in that, The specific process of S2 is as follows: Since rice is typically grown outdoors, the light intensity during the crucial tillering stage varies significantly across different time periods within the same day, thus affecting the acquired rice images. To avoid the impact of light on the recognition accuracy of the acquired images, the input rice images need to be processed using a light homogenization algorithm. First, by calculating a statistic based on the proportion of pixels with significant gradients, the density of pixel intensity abrupt changes in the image is determined. Then, the input rice image is divided into blocks, and the difference between the average brightness of each block and the global average brightness is calculated to form a light deviation map. Finally, a low-frequency light deviation field is estimated and subtracted to achieve light homogenization of the image, effectively suppressing large areas of shadow or highlight. The specific steps are as follows: Step a: Grayscale image conversion Let the input rice image be The corresponding grayscale image is The conversion between the two is shown in equation (1): (1) Step b: Gradient magnitude calculation Calculate grayscale images using the Sobel operator. The gradients in the horizontal and vertical directions are denoted as follows: and As shown in equations (2) and (3): (2) (3) Find the gradient magnitude of the grayscale image As shown in equation (4): (4) Step c: Calculation of uneven illumination Set the gradient threshold for evaluating illumination uniformity. , Statistical grayscale images The proportion of pixels whose gradient magnitude is greater than the gradient threshold among all pixels. This is called the degree of uneven illumination, and its expression is shown in equation (5): (5) in, Between between, A higher value indicates more uneven lighting; The total number of pixels in the image , This is an indicator function; the indicator function takes the value 1 when the corresponding condition is true, and takes the value 0 otherwise. Step d: Extraction of the luminance channel in the HSV color space Input rice image Convert to HSV color space to obtain an HSV color space image As shown in equation (6): (6) From HSV color space images Separate the brightness channel As shown in equation (7): (7) Step e: Calculation of global average brightness Calculate the luminance channel mean As shown in equation (8): (8) Step f: Calculation of local image deviation The HSV color space image is divided into 1 grid, of which For the number of grid rows, For the number of grid columns, and The value is determined by the number of grid cells. The image size is determined as shown in equations (9) and (10): (9) (10) Image located in HSV color space line, number Network blocks of lines The corresponding average brightness for: (11) in, For grid blocks The number of pixels within; Grid blocks The deviation between the mean brightness and the global average brightness for: (12) The deviation values of all grid blocks in the HSV color space image are combined into a deviation matrix. for: (13) Step g: Illumination compensation mask smoothing low-resolution deviation matrix Upsampled to the original size of the input rice image To obtain the initial mask for: (14) For the initial mask Gaussian blur is applied to smooth out block effects, resulting in an illumination compensation mask. for: (15) Step h, brightness compensation and color space conversion If an image region exists If this is the case, it means the area is too bright. The corresponding value is positive, meaning it comes from the brightness channel of the original image. Subtract compensation mask This darkens the area to achieve illumination compensation, and vice versa; the corrected luminance channel for: (16) Finally, Replace to The brightness channel in the image is shown in Equation (17): (17) Will The image was converted back to the BGR color space to obtain a rice-compensated image. As shown in equation (18): (18)。 3. The method according to claim 1, characterized in that, The specific construction process of the YOLO11-Pose detection model for detecting key points of rice tillering in S3 is as follows: a) Training data acquisition and preprocessing Image Data Acquisition and Labeling: Under different lighting conditions, N images of individual rice plants with gray backgrounds were taken using a camera during the rice tillering stage. Manual labeling was performed using the Labelme data labeling tool, selecting leafless or sparsely leafed stem sections using rectangular boxes. Since each image only contains the main stem of a single rice plant, all rectangular box labels were defined as "rice_stem". Tillering key points were labeled on the left and right sides of the selected area, with at least three leaves on each stem. Four tillering key points were labeled clockwise from the upper right to the upper left corner and named "rice_no1", "rice_no2", "rice_no3", and "rice_no4" respectively. After labeling, the generated JSON format label files were converted to TXT format label files, and the label files and corresponding images were placed in the same folder. Data augmentation was performed on the self-built dataset to increase the diversity of training data, ensuring the generalization ability of the subsequent YOLO11-Pose detection model training and preventing overfitting. Data augmentation included five methods: cropping, flipping, Gaussian blurring, brightness adjustment, and light homogenization as described in step S2. These data augmentation methods were applied randomly to the dataset. N Group image data, image data generation factor set to s Finally generated s · N The augmented dataset is divided into training, validation, and test sets in an 8:1:1 ratio. b) Model architecture construction The designed YOLO11-Pose detection model adopts a single-stage detection framework, which includes four parts: Input layer, Backbone network, Neck network, and Head network. The Head network uses the Pose detection head to effectively extract and fuse features in rice images and improve the accuracy of tillering key point estimation in rice images. c) Model training parameter settings The training parameters for the YOLO11-Pose detection model include the number of training iterations, input image size, number of input batches, cache, optimizer, initial learning rate, optimizer momentum parameter, GPU warm-up initial momentum, number of GPU warm-up iterations, number of times mosaic enhancement is disabled, mosaic data augmentation, and final learning rate. Set the training parameters for the YOLO11-Pose detection model. d) Model training The images from the training set are fed into the constructed YOLO11-Pose detection model. Rice images are preprocessed at the input of the YOLO11-Pose detection model and then fed into the backbone network. The enhanced rice compensated images are sliced to extract features. Then, they are fed into the Neck network, which adopts a bidirectional FPN+PAN structure. Upsampling fuses high-level semantics and low-level details, while downsampling transmits localization information and optimizes multi-scale feature fusion. The head network adopts an anchor-free design and outputs detection coordinates and keypoint task results until the loss function converges, resulting in the trained YOLO11-Pose detection model. e) Verify whether the detection model meets the requirements. Based on the accuracy requirements for rice tiller angle detection in practical agricultural applications, the YOLO11-Pose neural network model trained was evaluated using a test set, and the mean accuracy (mAP) of keypoint detection was calculated. 50-95 Set the lower limit of the average accuracy threshold for keypoint detection to δ, and determine whether the detection model meets the actual detection requirements, specifically as follows: If mAP 50-95 If δ is not true, it means that the detection model has not achieved the expected accuracy in key point localization. Then, jump to S3, increase the diversity of training data and adjust the model training parameters, and retrain the detection model. If mAP 50-95 If δ is true, it means that the detection model meets the expected accuracy requirements in key point localization. Jump to S4 to determine the key points of tillering and calculate the angle.
4. The method according to claim 1, characterized in that, The specific process of S4 is as follows: The compensated image of rice is fed into the trained YOLO11-Pose detection model, which outputs four tillering key points for a single rice plant, namely "rice_no1", "rice_no2", "rice_no3", and "rice_no4". These are located at the base of the left edge stem, the left stem near the leaf, the base of the right edge stem, and the right stem near the leaf, respectively, with two-dimensional coordinates of [missing information]. , , and Connecting two key tillering points on the same side of a single rice plant forms two tillering characteristic lines.
5. The method according to claim 1, characterized in that, The specific process of S5 is as follows: Calculate the slopes of the two tillering characteristic lines on the left and right sides. and As shown in equations (19) and (20) respectively: (19) (20) Calculate tillering angle value As shown in equation (21): (21) Output the tillering angle value of a single rice plant corresponding to the rice image. Meanwhile, the OpenCV2 computer vision library is used to display the key points of tillering, the extensions of the two feature lines, and the tillering angle values on the image.