Rice growth uniformity calculation digital model construction method and related device

Through the digital model construction method, image processing and machine learning technology are used to solve the problems of inefficient and insufficient representativeness of rice seedling neatness survey, and more efficient and accurate assessment of rice seedling uniformity is achieved.

CN119649209APending Publication Date: 2025-03-18JIANSANJIANG BRANCH OF BEIDAHUANG AGRICULTURAL RECLAMATION GROUP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411597772.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When investigating the neatness of rice seedlings in the prior art, there is a problem that manual investigation is time-consuming, labor-intensive, inefficient, and difficult to fully reflect the neatness of the entire plot.

Method used

A digital model construction method for calculating rice growth uniformity is adopted. By obtaining rice images for pre-processing, the number of leaves is obtained and the tillering grade is determined based on leaf age, image recognition and image frame segmentation are performed, cover and coefficient of variation are calculated to represent the uniformity of rice seedling emergence.

Benefits of technology

It improves the efficiency and accuracy of rice seedling neatness survey, can more comprehensively reflect the emergence of the entire plot, and provides reliable consistency data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649209A_ABST
    Figure CN119649209A_ABST
Patent Text Reader

Abstract

The invention relates to a rice growth uniformity calculation digital model construction method and a related device, and the method comprises the following steps: obtaining a rice image, and carrying out the preprocessing of the rice image; obtaining the number of leaves based on the rice image, and obtaining a tillering level in combination with leaf age; performing image recognition and image frame segmentation on the rice image by taking the tillering level as a prior condition to obtain a minimum bounding box of the single rice image; calculating the horizontal distance between the circumscribed frames according to the minimum circumscribed frame of the single-plant rice image, and calculating the coverage according to the ratio of the horizontal distance to the width of the adjacent minimum circumscribed frame; based on each calculated coverage, a coefficient of variation of the coverage in the image is calculated to represent the uniformity, the coefficient of variation CV = standard deviation / average value. The method has the advantages that the investigation efficiency, accuracy and comprehensiveness of rice seedling emergence uniformity investigation are improved, and agricultural management and decision making can be better guided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart agriculture, and in particular to a method for constructing a digital model for calculating rice growth uniformity and related devices. Background Art

[0002] At present, the investigation of rice seedling uniformity mainly relies on manually selecting several areas, conducting seedling count surveys in these areas, and then calculating the coefficient of variation of the seedling count in these areas to reflect the uniformity of the seedlings. This method has many problems in practical application.

[0003] First, manual surveys are time-consuming, labor-intensive and inefficient. Investigators need to select areas one by one, manually count the number of seedlings, and record and calculate the data. This not only requires a lot of manpower, but is also prone to inaccurate data due to operational errors or human factors.

[0004] Secondly, manual surveys are one-sided and it is difficult to fully reflect the uniformity of seedling emergence in the entire plot. Due to the limited survey area, the survey results can only reflect the emergence of seedlings in the selected area, but cannot fully cover the entire plot. This limitation affects the representativeness and reliability of the survey results.

[0005] In order to overcome the shortcomings of manual surveys, some people have proposed using graphic recognition methods to identify rice in rice fields. However, the direct use of graphic recognition methods also faces many challenges. Since rice tillers differently at different growth stages, image recognition results are easily affected by differences in tillering levels, which in turn affects the assessment of uniformity of emergence. For example, rice has fewer tillers in the early growth stage, while rice has more tillers in the later growth stage. If the image recognition model does not take these differences into account, it is easy to cause recognition errors. To make matters more complicated, the roots of rice are usually hidden underwater, which increases the difficulty of image recognition. At different tillering stages, if the image recognition model fails to properly adapt to tillering differences, it will lead to incorrect recognition of plant density, which in turn affects the assessment of uniformity of emergence. For example, rice plants with high tillering levels may be misidentified as multiple rice plants, while rice plants with low tillering levels may be misidentified as single rice plants or plants with lower density, resulting in misleading uniformity assessment results. Summary of the invention

[0006] In order to improve the efficiency, accuracy and comprehensiveness of the rice seedling uniformity survey so as to better guide agricultural management and decision-making, the present application provides a method for constructing a digital model for calculating rice growth uniformity and related devices.

[0007] In the first aspect, the present application provides a method for constructing a digital model for calculating rice growth uniformity, which adopts the following technical solution:

[0008] A method for constructing a digital model for calculating rice growth uniformity comprises the following steps:

[0009] S1. Acquire a rice image and preprocess the rice image;

[0010] S2. Obtain the number of leaves based on the rice image, and obtain the tillering level in combination with the leaf age;

[0011] S3. Perform image recognition and image frame segmentation on the rice image with the tillering level as a priori condition to obtain the minimum external bounding box of the single rice plant image;

[0012] S4. Calculate the horizontal distance between the bounding boxes according to the minimum bounding box of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum bounding box;

[0013] S5. Based on each calculated coverage, the coefficient of variation (CV) of the coverage in the image is calculated to indicate uniformity, and the formula is: CV = standard deviation / mean value; wherein, the smaller the CV value, the more uniform the emergence of seedlings; the larger the CV value, the more uneven the emergence of seedlings.

[0014] Optionally, S1 includes the following sub-steps:

[0015] S11. Acquire an image with rice plants on the flight path of the UAV and a background image without rice plants on the same flight path, and perform background correction on the image with rice plants based on the background image;

[0016] S12. Read the image and use filtering technology to remove noise in the image;

[0017] S13. Perform image enhancement processing.

[0018] Optionally, S2 includes the following sub-steps:

[0019] S21. Performing connected area analysis, and treating rice plants in several connected areas within a preset connected area interval as single rice plants;

[0020] S22. Using the pre-trained convolutional neural network image recognition model, extract the number of leaves from each individual plant image;

[0021] S23. Calculate the average number of leaves;

[0022] S24. Calculate leaf age based on the number of leaves and the number of days after transplanting;

[0023] S25. Determine the tillering level according to leaf age.

[0024] Optionally, the S21 includes the following steps:

[0025] S211. Calculate the green vegetation index ExG = 2*GRB for each pixel, where G, R, and B are the pixel values ​​of the green, red, and blue channels, respectively;

[0026] S212. Converting the ExG image into a binary image by a threshold segmentation method to distinguish vegetation from background;

[0027] S213. Connecting the broken leaf regions based on morphological operations and filling the holes to make the leaf regions more complete;

[0028] S214. Traverse each pixel of the binary image and mark the connected pixels as the same component;

[0029] S215. Using a recursive or iterative method, the connected pixels are classified into the same connected region and assigned the same label value;

[0030] S216. Record the features of each connected region, wherein the features include area, perimeter, and center position;

[0031] S217. Setting an upper area threshold and a lower area threshold, and excluding connected areas with too small an area and too large an area based on the upper area threshold and the lower area threshold, to filter out noise, non-target areas and overlapping areas of multiple rice seedlings;

[0032] S218. Mark each remaining connected region using a different color or marker value to visualize the location and range of each individual rice plant in the image.

[0033] Optionally, in S24, the number of growing days = image acquisition time - transplanting time, and the leaf age = the number of leaves + (the number of growing days / 5);

[0034] In S25, when the leaf age is less than 3, the tillering level is 1; when the leaf age is between 3 and 5, the tillering level is 2; when the leaf age is greater than 5, the tillering level is 3.

[0035] Optionally, S3 includes the following sub-steps:

[0036] S31. Preload pre-trained image recognition models corresponding to different tillering levels, wherein different image recognition models are trained based on different data sets, each of which corresponds to a tillering level of rice images;

[0037] S32. Based on the calculated tillering level of rice in the rice image, select an image recognition model corresponding to the tillering level;

[0038] S33. Calling the selected image recognition model to identify the rice image to obtain a single rice plant image frame area;

[0039] S34. performing semantic segmentation on each individual rice plant in the individual rice plant image frame region to obtain a contour line;

[0040] S35. Generate a minimum bounding box of the target on the rice image based on the image frame area and contour lines of the single rice plant.

[0041] In a second aspect, the present application provides a device for constructing a digital rice growth model, which adopts the following technical solution:

[0042] A rice digital growth uniformity calculation model construction device, comprising:

[0043] An image acquisition and preprocessing module, used for acquiring rice images and preprocessing the rice images;

[0044] Rice tillering recognition module, used to obtain the number of leaves based on rice images and obtain the tillering level in combination with the leaf age;

[0045] The rice instance segmentation module is used to perform image recognition and image frame segmentation on rice images based on the tillering level as a priori condition, and obtain the minimum external bounding box of a single rice plant image;

[0046] A coverage calculation module is used to calculate the horizontal distance between the external frames according to the minimum external frame of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum external frame;

[0047] The average degree calculation module is used to calculate the coefficient of variation (CV) of the coverage in the image based on each calculated coverage to express the uniformity. The formula is: CV = standard deviation / average value; wherein, the smaller the CV value, the more uniform the seedling emergence; the larger the CV value, the uneven the seedling emergence.

[0048] In a third aspect, the present application provides a computer device, which adopts the following technical solution:

[0049] A computer device comprising:

[0050] one or more processors;

[0051] Memory;

[0052] One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the above-mentioned rice digital growth uniformity calculation model construction method.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0054] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the above method.

[0055] The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement: the method for constructing a rice digital growth uniformity calculation model as described above.

[0056] In summary, the present application includes at least one of the following beneficial technical effects:

[0057] 1. A pre-trained convolutional neural network model is used to identify rice at different tillering levels, ensuring accurate identification of individual rice plants. The minimum bounding box technology is used to accurately delineate the range of each rice plant, and further semantic segmentation is performed to generate the contours of rice leaves and stems. The horizontal distance and coverage between the minimum bounding boxes are calculated to quantify the rice spacing and coverage, providing reliable consistency data support. The calculation of the coefficient of variation (CV) further accurately quantifies the uniformity of rice seedling emergence, reflecting the overall uniformity and consistency of rice seedling emergence.

[0058] 2. During the recognition process, the corresponding image recognition model is selected according to the calculated tillering level to adapt to the characteristic changes of rice in different growth stages, avoid the influence of tillering differences on the recognition results, and improve the accuracy of recognition and segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A schematic diagram of an application environment of a method for constructing a rice digital growth uniformity calculation model in an embodiment of the present invention is shown.

[0060] Figure 2 A flowchart of a method for constructing a rice digital growth uniformity calculation model according to an embodiment of the present invention is shown.

[0061] Figure 3 A flowchart of sub-step S1 according to an embodiment of the present invention is shown.

[0062] Figure 4 A flowchart of sub-step S2 according to an embodiment of the present invention is shown.

[0063] Figure 5 A flowchart of sub-step S3 of an embodiment of the present invention is shown.

[0064] FIG. 6 illustrates the minimum external bounding boxes of rice plants of different grades according to an embodiment of the present invention.

[0065] Figure 7 A schematic diagram of a computer device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0066] The present application is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0067] In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the inventive concept. As part of this specification, some of the drawings in the drawings of the present disclosure represent structures and devices in the form of block diagrams to avoid making the disclosed principles complicated and difficult to understand. For the sake of clarity, not all features of the actual implementation are necessary to be described. In addition, the language used in this disclosure has been selected primarily for readability and instructional purposes, and may not be selected to delineate or limit the subject matter of the present invention, thereby resorting to the necessary claims to determine such inventive subject matter. References to "a specific implementation" or "specific implementations" in this disclosure mean that the specific features, structures or characteristics described in conjunction with the specific implementation are included in at least one specific implementation, and multiple references to "a specific implementation" or "specific implementations" should not be understood as necessarily referring to the same specific implementation.

[0068] Unless expressly limited, the terms "a", "an", and "the" are not intended to refer to a singular entity, but rather to include general categories of which specific examples may be used for illustration. Thus, the use of the terms "a" or "an" may mean any number of at least one, including "one", "one or more", "at least one", and "one or more than one". The term "or" means any of the alternatives and any combination of the alternatives, including all alternatives, unless the alternatives are expressly indicated to be mutually exclusive. The phrase "at least one of" when combined with a list of items refers to a single item in the list or any combination of the items in the list. The phrase does not require all of the listed items unless expressly limited to that.

[0069] The present application embodiment discloses a method for constructing a digital model for calculating the uniformity of rice growth. The method for constructing a digital model for calculating the uniformity of rice growth provided by the present invention can be applied in the following aspects: Figure 1In an application environment, the method for constructing a rice digital growth uniformity calculation model is applied in a rice digital growth uniformity calculation model construction system, and the rice digital growth uniformity calculation model construction system includes a client and a server, wherein the client communicates with the server through a network. The client, also known as the user end, refers to a program corresponding to the server that provides local services to the client. Furthermore, the client is a computer-side program, an APP program for a smart device, or a third-party applet embedded in other APPs. The client can be installed on, but not limited to, various computer devices such as personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.

[0070] Reference Figure 2 The method for constructing a digital model for calculating rice growth uniformity includes the following steps S1-S5.

[0071] S1. Obtain a rice image and preprocess the rice image.

[0072] Specifically, refer to Figure 3 , S1 includes the following sub-steps S11-S13.

[0073] S11. Acquire an image with rice plants on a flight path of the UAV and a background image without rice plants on the same flight path, and perform background correction on the image with rice plants based on the background image.

[0074] By acquiring images with rice plants and background, background interference can be effectively reduced and image purity can be improved. Background correction can remove background noise and make rice plants more prominent, which is convenient for subsequent image processing and analysis.

[0075] Specifically, in this step, the path planning of the drone can be performed first to ensure that the flight path of the drone is planned to ensure coverage of the entire rice field area. At the same time, the flight altitude and shooting angle of the drone are determined to ensure the clarity and resolution of the image. It should be noted that the flight altitude here should be able to ensure that the camera will frame a single field, and the drones all fly along the extension direction of the field ridges and take pictures along the extension direction of the field ridges. Image acquisition is performed on the flight path to ensure that high-resolution images with rice plants are obtained.

[0076] Then, on the same flight path, capture images of areas without rice plants to obtain background images. Ensure that the acquisition conditions (such as lighting and angle) of the background images are the same as those of the images with rice plants to facilitate background correction.

[0077] After the images are collected, the image with the rice plants and the background image are aligned to ensure that the two images are operated in the same coordinate system. Feature point matching and transformation (such as affine transformation) methods are used to achieve accurate alignment of the images. The aligned background image is subtracted from the image with the rice plants to obtain the corrected image.

[0078] For example, a drone flies along a predetermined path and captures high-resolution images at a height of 10 meters above the rice field. The drone flies along parallel lines in the north-south direction, covering the entire rice field area. An image is taken every 5 meters, ensuring that there is a certain overlap between the images for subsequent stitching and processing. Then at the same moment, another drone carrying a camera with the same parameters flies again along the same flight path, but this time chooses to capture an area without rice plants. The drones fly at the same altitude and shooting angle to ensure that the background image and the image with rice plants are consistent in lighting conditions and shooting angles.

[0079] After collecting the photos, the system uses a feature point detection algorithm (such as SIFT or SURF) to detect feature points in the image with rice plants and the background image. By matching the feature points, the corresponding point pairs in the two images are found. The transformation matrix is ​​calculated, and the background image is aligned to the image with rice plants using an affine transformation. The aligned background image is then subtracted from the image with rice plants to obtain the corrected image. The specific operation here is to subtract the background value of each pixel from the corresponding pixel value with rice plants. For example, for each pixel (i, j), the corrected pixel value I corrected (i,j) can be expressed as: corrected (i,j)=I original (i,j)-I background (i,j).

[0080] S12. Read the image and use filtering technology to remove noise in the image.

[0081] By using filtering techniques to remove noise from an image, the quality and clarity of the image can be improved. For example, a background-corrected image can be read and smoothed using a Gaussian filter to remove high-frequency noise and retain the main structure and edge information of the image.

[0082] S13. Perform image enhancement processing.

[0083] Image enhancement can improve the contrast and details of the image, making the rice plants more prominent in the image, thereby improving the subsequent segmentation and detection effects. For example, histogram equalization is performed on the filtered image to enhance the image contrast and make the contrast between the rice plants and the background more obvious.

[0084] S2. Obtain the number of leaves based on the rice image and obtain the tillering level in combination with the leaf age.

[0085] Leaves are one of the main characteristics of rice growth. By identifying the number and shape of leaves, the growth status and health of rice can be effectively evaluated. In image recognition, the number of leaves is an important indicator that can be used to characterize the growth status of rice and is also the most significant identification feature of rice.

[0086] Rice fields are usually flooded, and the roots of rice are submerged in water, which makes identification based on leaf count alone inadequate:

[0087] Tillering is one of the growth characteristics of rice. As tillers increase, rice will differentiate into multiple branches from the main stem base, each with leaves. This will significantly increase the number of leaves in the image. If the tillering level is not considered and only the number of leaves is used for identification, a rice plant with a high tillering level may be mistakenly identified as multiple rice plants.

[0088] In a rice field, multiple rice plants may grow very close to each other, or may temporarily be close to each other due to factors such as wind. If identification is performed only by the number of leaves, these multiple rice plants may be mistakenly identified as one rice plant.

[0089] In order to overcome the above problems, it is necessary to calculate the tillering level and use it as a priori condition to improve the accuracy of image recognition. The calculation of tillering level can provide growth information of each rice plant, thus helping to distinguish single and multiple rice plants during the recognition process and improving the recognition effect.

[0090] Specifically, refer to Figure 4 , S2 includes the following sub-steps S21-S25.

[0091] S21. Conducting connected region analysis, and treating rice in several connected regions within a preset connected region area interval as single rice plants.

[0092] Connected region analysis is an image processing technique used to identify and mark connected pixel regions in an image. These connected pixel regions are usually called connected components. The basic idea of ​​connected region analysis is to traverse each pixel of the image and mark all pixels connected to the current pixel as the same component, thereby distinguishing different target regions in the image.

[0093] Through connected region analysis, the rice plant area in the image can be automatically separated from the background area. This automatic segmentation can significantly reduce the workload of manual annotation and improve processing efficiency. However, when the number of rice leaves is large and the leaves are long, adjacent rice plants may have leaf crossings. Under wind, this leaf crossing phenomenon is more obvious, resulting in large errors in connected region analysis. The specific analysis is as follows:

[0094] When rice leaves cross, leaves from different plants are connected in the image to form a large connected area. This will cause the connected components of a single rice plant to be unable to be accurately segmented, and the recognition result includes multiple rice plants, increasing the error. When blown by the wind, the leaves will continue to swing, further exacerbating the situation of leaf crossing. Due to the crossing and overlapping of leaves, the area of ​​the connected area will become very large, exceeding the reasonable range of a single rice plant. In this case, the identified connected area cannot accurately reflect the actual situation of a single rice plant, affecting the subsequent growth analysis and uniformity calculation. Therefore, it is necessary to screen the area of ​​the connected area, and use the rice with the area of ​​the connected area within the preset interval as a single rice plant for subsequent analysis.

[0095] Specifically, S21 includes the following steps S211-S217.

[0096] S211. Calculate the green vegetation index ExG=2*GRB of each pixel, where G, R, and B are the pixel values ​​of the green, red, and blue channels, respectively.

[0097] S212. Convert the ExG image into a binary image by using a threshold segmentation method to distinguish vegetation from background.

[0098] For example, the Otsu threshold segmentation method is used to automatically select the optimal threshold, and pixels with ExG values ​​greater than the threshold are marked as white (foreground, i.e., rice plants), and pixels less than or equal to the threshold are marked as black (background).

[0099] S213. Connect the broken leaf regions based on morphological operations and fill the holes to make the leaf regions more complete.

[0100] Morphological operations are a technique in image processing, which is mainly used to analyze and process the shape structure of images. Common morphological operations include dilation, erosion, opening, and closing.

[0101] Specifically, Dilation: enlarge the target area in the image so that small gaps are filled.

[0102] Erosion: Shrink the target area in the image so that isolated small noises are removed.

[0103] Opening: first erode and then dilate, used to remove small noise.

[0104] Closing: dilation followed by erosion, used to fill small holes and connect broken areas.

[0105] For example, first take a binary image after threshold segmentation. The white area (pixel value is 255) in the image represents rice leaves, and the black area (pixel value is 0) represents the background. Then select a suitable structural element for morphological operations. Common structural elements include rectangles, circles, and ellipses. The size and shape of the structural element should be selected according to the characteristics of the image and the processing requirements.

[0106] Use the structural element to perform a dilation operation on the binary image. The dilation operation enlarges the target area in the image (i.e., the rice leaf) so that small gaps are filled and the broken leaf areas are connected. The dilation operation can make the leaf area more coherent and fill small breaks and gaps. Although this operation will make the leaf edge blurred, extracting a clear leaf image is not the purpose of this step, so it has no effect.

[0107] The same structural element is then used to perform an erosion operation on the dilated image. The erosion operation shrinks the target area in the image so that isolated small noise is removed while maintaining the coherence of the leaf area. The erosion operation can remove isolated noise in the image and restore the actual shape of the leaf.

[0108] S214. Traverse each pixel of the binary image and mark connected pixels as the same component.

[0109] Connected pixel regions are called connected components. Through recursive or iterative methods, connected pixels can be classified as the same connected region and assigned the same label value for subsequent processing and analysis. Connectivity can be divided into 4-connectivity and 8-connectivity. Among them, 4-connectivity means that each pixel is connected to the four pixels above, below, left and right; 8-connectivity means that each pixel is connected to the eight pixels around it, including the four pixels in the diagonal direction.

[0110] S215. Use a recursive or iterative method to classify connected pixels into the same connected region and assign the same label value.

[0111] Starting from the upper left corner of the image, traverse each pixel. If the current pixel is a rice leaf and is not marked, use a stack or queue to mark all its connected pixels with the current mark value. Initialize an empty stack or queue and push the current pixel position into the stack or queue. Take a pixel position from the stack or queue, mark the pixel at that position, and push all its connected and unmarked pixel positions into the stack or queue. Repeat this process until the stack or queue is empty.

[0112] S216. Record the features of each connected region, wherein the features include area, perimeter, and center position.

[0113] In connected region analysis, recording the features of each connected region helps to conduct detailed analysis and identification of targets in the image.

[0114] Area: The total number of pixels in a connected region, indicating the size of the region.

[0115] Perimeter: The total number of pixels on the border of a connected region, indicating the length of the border of the region.

[0116] Center position: The centroid of a connected region, which indicates the geometric center position of the region.

[0117] S217. Setting an upper area threshold and a lower area threshold, and excluding connected areas with too small an area and too large an area based on the upper area threshold and the lower area threshold, so as to filter out noise, non-target areas and overlapping areas of multiple rice seedlings.

[0118] In image processing and connected region analysis, the upper and lower area thresholds are set to exclude noise and non-target areas in the image. Connected regions with too small an area are usually noise or non-target areas, while connected regions with too large an area may be overlapping areas of multiple rice seedlings. By setting an appropriate area threshold, it can be ensured that only connected regions of reasonable size are retained.

[0119] S218. Mark each remaining connected region using a different color or marker value to visualize the location and range of each individual rice plant in the image.

[0120] S22. Use the pre-trained convolutional neural network image recognition model to extract the number of leaves from each individual plant image.

[0121] The single plant image here refers to the regional image with a high probability of being a single rice plant obtained from S21 through connected region analysis, and each regional image contains only one rice plant. The pre-trained CNN model has been trained on a large-scale data set and can effectively extract features from the image. This embodiment uses a pre-trained CNN model to identify the number of leaves in the rice plant image. By processing each single rice plant image, the CNN model can automatically identify and calculate the number of leaves.

[0122] For example, the training steps of this convolutional neural network image recognition model are as follows:

[0123] Collect a large amount of training data containing images of individual rice plants. Make sure the dataset is diverse, covering different lighting conditions, angles, and backgrounds. In addition, each image needs to be annotated to record the number of leaves on each rice plant. The annotated data is used for supervised learning to train the CNN model. In addition, the images can be resized to a fixed size (e.g. 224x224 pixels) and data augmentation can be performed, such as rotation, scaling, flipping, etc., to increase the diversity of the data.

[0124] Choose a pre-trained CNN model, such as ResNet50, VGG16, or InceptionV3. Load the pre-trained model and freeze all layers except the last few layers to preserve the pre-trained weights. Add a new output layer for predicting the number of leaves. The number of neurons in the output layer should be the same as the number of possible leaves.

[0125] Then perform model training and compile the model using an appropriate loss function (such as mean squared error) and optimizer (such as Adam). Train the model on the training data and monitor the model performance using the validation data. Set up early stopping and model checkpoints to prevent overfitting and save the best model.

[0126] S23. Calculate the average number of leaves.

[0127] In rice fields, rice plants in a single rice field are usually in a similar growth environment, so the growth conditions of these plants are usually similar. However, due to slight differences in environmental factors in different locations (such as light, soil moisture, nutrient distribution, etc.), the growth conditions of individual plants may be different, resulting in certain differences in the number of leaves. Calculating the average number of leaves for multiple rice plants can balance the differences between individual plants and provide an overall growth condition indicator. The average number of leaves reflects the overall growth of the rice field.

[0128] S24. Calculate the leaf age according to the number of leaves and the number of days after transplanting, where growth days = image acquisition time - transplanting time, and leaf age = number of leaves + (growth days / 5).

[0129] S25. Determine the tillering level according to the leaf age. When the leaf age is less than 3, the tillering level is 1; when the leaf age is between 3 and 5, the tillering level is 2; when the leaf age is greater than 5, the tillering level is 3.

[0130] Tillering Stage is an indicator that describes the tillering stage of rice growth. Tillers are branches that grow from the base of the main stem during rice growth. The quantity and quality of tillers have an important impact on rice yield. Tillering Stage is determined based on the leaf age of rice, which is calculated by the number of leaves and the number of growing days.

[0131] S3. Perform image recognition and image frame segmentation on the rice image with the tillering level as a priori condition to obtain the minimum external bounding box of a single rice plant image.

[0132] The minimum bounding box can circle each rice plant and determine its range. Since the drone takes pictures along the extension direction of the rice field ridges, the rice is arranged in a vertical grid. Therefore, after the rice plants are circled, the interval of the minimum bounding box is the interval of the rice. It should be noted that the more and longer the rice leaves are, that is, the more lush the rice is, the larger the size of the minimum bounding box will be and the smaller the interval of the minimum bounding box will be.

[0133] Different tillering levels will affect image recognition. Therefore, taking tillering level as a priori condition can effectively improve the recognition accuracy and segmentation accuracy of single rice plants.

[0134] Specifically, refer to Figure 5 , S3 includes the following sub-steps S31-S36.

[0135] S31. Preload pre-trained image recognition models corresponding to different tillering levels, wherein different image recognition models are trained based on different data sets, and each data set corresponds to a rice image of a tillering level.

[0136] For example, the classification levels are 1, 2, and 3, corresponding to the first image recognition model, the second image recognition model, and the third image recognition model, respectively. The first image recognition model is trained with a data set of single rice plant images with a classification level of 1, the second image recognition model is trained with a data set of single rice plant images with a classification level of 2, and the third image recognition model is trained with a data set of single rice plant images with a classification level of 3. The training method of the image recognition model is similar to the above-mentioned convolutional neural network image recognition model, and other methods can also be used for training, which will not be repeated here.

[0137] S32. Based on the calculated tillering level of rice in the rice image, select an image recognition model corresponding to the tillering level.

[0138] The images of rice at each tillering level have significant differences in morphology and features, because tillers are branches that grow from the base of the main stem during the growth process of rice. Rice at tillering level 1 may have fewer and sparse leaves, while rice at tillering level 3 has lush and dense leaves. By selecting image recognition models that are specifically trained for different tillering levels, the recognition ability and accuracy of the model can be ensured to be higher. In addition, using models trained for different tillering levels can reduce the complexity and training difficulty of the model. Each model only needs to focus on the features of a specific tillering level, thereby optimizing the model performance and improving the recognition speed and efficiency.

[0139] S33. Call the selected image recognition model to recognize the rice image to obtain a single rice plant image frame area.

[0140] The goal of this step is to separate each rice plant from the image through segmentation technology and use an image frame to enclose the range of each rice plant. This step ensures the accurate recognition of each rice plant. During the recognition process, the interval of the minimum bounding box reflects the actual interval of the rice. However, it should be noted that since the image frame obtained in this step is the image frame area containing a single rice plant, the size of the image frame is not necessarily the smallest, and the calculation of the interval between image frames requires that the edge of the image frame just touches the rice, that is, the minimum image frame, so further processing is required later.

[0141] As an example, the preprocessed rice image is input into the selected image recognition model. The model performs image processing and outputs the image frame area of ​​each rice plant. These image frame areas include the boundary information of the rice plant, which is used to delineate the range of a single rice plant. Specifically, the image recognition model is a convolutional neural network (CNN) structure for rice image recognition, including:

[0142] Input layer: receives the preprocessed rice images.

[0143] Convolutional Layers are used to extract the spatial features of images.

[0144] Pooling Layers are used to reduce data dimensions and retain important features.

[0145] Fully Connected Layers: used to integrate features and output prediction results.

[0146] The output layer is used to generate prediction results for the image box area.

[0147] For example, the input image size can be 224x224 pixels with RGB three channels.

[0148] Convolution and pooling layers:

[0149] Convolutional layer 1: 32 3x3 convolution kernels, ReLU activation function, Same padding.

[0150] Pooling layer 1: 2x2 max pooling.

[0151] Convolutional layer 2: 64 3x3 convolution kernels, ReLU activation function, Same padding.

[0152] Pooling layer 2: 2x2 max pooling.

[0153] Convolutional layer 3: 128 3x3 convolution kernels, ReLU activation function, Same padding.

[0154] Pooling layer 3: 2x2 max pooling.

[0155] Fully connected layer:

[0156] Fully connected layer 1: 512 neurons, ReLU activation function.

[0157] Fully connected layer 2: 256 neurons, ReLU activation function.

[0158] Output layer:

[0159] Output layer: 4 neurons, used to regress the coordinates and size of the output image box.

[0160] S34. Perform semantic segmentation on each individual rice plant in the individual rice plant image frame area to obtain a contour line.

[0161] In this step, semantic segmentation is performed on individual rice plants in the image frame area to accurately extract the contours of the rice leaves and stems. Secondly, the use of semantic segmentation technology can better handle complex image features, such as overlapping leaves and complex backgrounds, to ensure the accuracy of the segmentation results. In addition, the contours obtained by semantic segmentation can be used to generate the minimum bounding box.

[0162] For example, extract the image frame regions of a single rice plant from the result of step S33. These regions contain the boundary information of each rice plant. Input the image frame regions of a single rice plant into the semantic segmentation model. The semantic segmentation model needs to be pre-trained to be able to identify and segment the leaves and stems of rice. The semantic segmentation model processes the image frame regions and outputs a segmentation mask. The segmentation mask is a binary image of the same size as the input image, where the white areas represent the rice leaves and stems, and the black areas represent the background. Based on the segmentation mask, an image processing algorithm is used to extract contour lines. The contour lines represent the boundaries of rice leaves and stems.

[0163] S35. Generate a minimum bounding box of the target on the rice image based on the image frame area and contour lines of the single rice plant.

[0164] In this step, it is necessary to generate a target minimum bounding box based on these contour lines. The minimum bounding box is the smallest rectangle that can completely surround a single rice plant and is used to determine the actual growth space and position of the rice.

[0165] For example, the contour data of each rice plant is obtained from the result of step S34. Based on the contour data, the minimum bounding box of each rice plant is calculated. The minimum bounding box is the minimum rectangle enclosing the contour line, ensuring that the boundary just touches the rice. Finally, the position (upper left corner coordinates) and size (width and height) of each minimum bounding box are recorded.

[0166] S4. Calculate the horizontal distance between the bounding boxes according to the minimum bounding box of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum bounding boxes.

[0167] Coverage, in agriculture and ecology, usually refers to the coverage ratio of plants or vegetation in a certain area. It reflects the degree of plant occupation in the area. Specifically in the rice growing environment, coverage can be expressed as the ratio of the coverage area of ​​the leaves and stems of the rice plants to the soil surface. By calculating the coverage, the growth density and uniformity of rice can be evaluated.

[0168] Reference Figure 6a-6d , the boxes in each picture of Figure 6 are the minimum external boxes. It should be noted that the pictures are selected for the convenience of displaying rice plants of different tillering levels. In fact, the drone aerial photography is a bird's-eye view, and there will be no front and back occlusion between different rice plants as shown in the figure. In addition, even if the image has the effect of near big and far small, it will not affect the calculation of coverage.

[0169] For each pair of adjacent minimum bounding boxes, calculate the horizontal distance between them. The horizontal distance can be determined by calculating the distance between the adjacent and opposite edges of the two bounding boxes on the horizontal axis. Then for each pair of adjacent minimum bounding boxes, calculate the ratio of the horizontal distance to the width of the adjacent bounding boxes.

[0170] For example, the minimum bounding box data obtained from step S3 is obtained. For example, minimum bounding box 1, minimum bounding box 2, and minimum bounding box 3 are arranged in sequence in the horizontal direction.

[0171] Minimum bounding box 1: position (x1, y1), size (w1, h1)

[0172] Minimum bounding box 2: position (x2, y2), size (w2, h2)

[0173] Minimum bounding box 3: position (x3, y3), size (w3, h3)

[0174] Calculate the horizontal distance D between bounding box 1 and bounding box 2 12 :

[0175] D 12 =|(x1+w1)-(x2)|

[0176] Calculate the horizontal distance D between bounding box 2 and bounding box 3 23 :

[0177] D 23 =|(x2+w2)-(x3)|

[0178] Calculate the ratio of horizontal distance to width:

[0179] For Bounding Frame 1 and Bounding Frame 2:

[0180] For Bounding Frame 2 and Bounding Frame 3:

[0181] S5. Based on each calculated coverage, the coefficient of variation (CV) of the coverage in the image is calculated to indicate uniformity, and the formula is: CV = standard deviation / mean value; wherein, the smaller the CV value, the more uniform the emergence of seedlings; the larger the CV value, the more uneven the emergence of seedlings.

[0182] The coefficient of variation (CV) is used to measure the uniformity of rice seedling emergence. By calculating and analyzing the CV value, the effectiveness of the current planting strategy can be evaluated and future optimization adjustments can be guided, such as adjusting the planting density, improving irrigation and fertilization strategies, etc.

[0183] Specifically, obtain the coverage data of each pair of adjacent minimum bounding boxes from the results of step S4. Calculate the average of all coverage values. The average coverage reflects the overall level of rice coverage in the image. Calculate the standard deviation of all coverage values. The standard deviation reflects the dispersion of coverage values. Use the formula The coefficient of variation was calculated, and the CV value was used to indicate the uniformity of rice seedling emergence.

[0184] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0185] In one embodiment, a device for constructing a rice digital growth uniformity calculation model is provided, and the device for constructing a rice digital growth uniformity calculation model corresponds to the method for constructing a rice digital growth uniformity calculation model in the above embodiment. The device for constructing a rice digital growth uniformity calculation model includes an image acquisition and preprocessing module, a rice tillering recognition module, a rice instance segmentation module, a coverage calculation module, and an average calculation module. The functional modules are described in detail as follows:

[0186] The image acquisition and preprocessing module is used to acquire rice images and preprocess the rice images.

[0187] The rice tillering recognition module is used to obtain the number of leaves based on the rice image and obtain the tillering level in combination with the leaf age.

[0188] The rice instance segmentation module is used to perform image recognition and image frame segmentation on rice images based on the tillering level as a priori condition, and obtain the minimum external bounding box of a single rice plant image.

[0189] The coverage calculation module is used to calculate the horizontal distance between the external frames according to the minimum external frame of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum external frame.

[0190] The average degree calculation module is used to calculate the coefficient of variation (CV) of the coverage in the image based on each calculated coverage to express the uniformity. The formula is: CV = standard deviation / average value; wherein, the smaller the CV value, the more uniform the seedling emergence; the larger the CV value, the uneven the seedling emergence.

[0191] The specific definition of the rice digital growth uniformity calculation model construction device can refer to the definition of the rice digital growth uniformity calculation model construction method above, which will not be repeated here. Each module in the above-mentioned rice digital growth uniformity calculation model construction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0192] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for data related to the method for constructing a rice digital growth uniformity calculation model. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for constructing a rice digital growth uniformity calculation model is implemented.

[0193] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for constructing a rice digital growth uniformity calculation model in the above embodiment is implemented. For example, Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the rice digital growth uniformity calculation model construction device in the above embodiment are realized. To avoid repetition, they are not described here.

[0194] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for constructing a rice digital growth uniformity calculation model in the above embodiment is implemented, for example Figure 2 Alternatively, when the computer program is executed by the processor, the functions of each module / unit in the rice digital growth uniformity calculation model construction device in the above device embodiment are realized. To avoid repetition, it will not be described here.

[0195] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments of the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM

[0196] (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM), etc.

[0197] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0198] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A method for constructing a digital model for calculating rice growth uniformity, characterized in that: The following steps are involved: S1. Acquire a rice image and preprocess the rice image; S2. Obtain the number of leaves based on the rice image, and obtain the tillering level in combination with the leaf age; S3. Perform image recognition and image frame segmentation on the rice image with the tillering level as a priori condition to obtain the minimum external bounding box of the single rice plant image; S4. Calculate the horizontal distance between the bounding boxes according to the minimum bounding box of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum bounding box; S5. Based on each calculated coverage, calculate the coefficient of variation of the coverage in the image to indicate uniformity; wherein, coefficient of variation CV = standard deviation / mean value, the smaller the CV value, the more uniform the seedling emergence; the larger the CV value, the more uneven the seedling emergence.

2. The method for constructing a digital model for calculating rice growth uniformity according to claim 1, characterized in that: The S1 comprises the following sub-steps: S11. Acquire an image with rice plants on the flight path of the UAV and a background image without rice plants on the same flight path, and perform background correction on the image with rice plants based on the background image; S12. Read the image and use filtering technology to remove noise in the image; S13. Perform image enhancement processing.

3. The method for constructing a digital model for calculating rice growth uniformity according to claim 1, characterized in that: The S2 comprises the following sub-steps: S21. Performing connected area analysis, and treating rice plants in several connected areas within a preset connected area interval as single rice plants; S22. Using the pre-trained convolutional neural network image recognition model, extract the number of leaves from each individual plant image; S23. Calculate the average number of leaves; S24. Calculate leaf age based on the number of leaves and the number of days after transplanting; S25. Determine the tillering level according to leaf age.

4. The method for constructing a digital model for calculating rice growth uniformity according to claim 3, characterized in that: The S21 comprises the following steps: S211. Calculate the green vegetation index ExG = 2*GRB for each pixel, where G, R, and B are the pixel values ​​of the green, red, and blue channels, respectively; S212. Converting the ExG image into a binary image by a threshold segmentation method to distinguish vegetation from background; S213. Connecting the broken leaf regions based on morphological operations and filling the holes to make the leaf regions more complete; S214. Traverse each pixel of the binary image and mark the connected pixels as the same component; S215. Using a recursive or iterative method, the connected pixels are classified into the same connected region and assigned the same label value; S216. Record the features of each connected region, wherein the features include area, perimeter, and center position; S217. Setting an upper area threshold and a lower area threshold, and excluding connected areas with too small an area and too large an area based on the upper area threshold and the lower area threshold, so as to filter out noise, non-target areas and overlapping areas of multiple rice seedlings; S218. Mark each remaining connected region using a different color or marker value to visualize the location and range of each individual rice plant in the image.

5. The method for constructing a digital model for calculating rice growth uniformity according to claim 4, characterized in that: In S24, the number of growing days = image acquisition time - transplanting time, and the leaf age = the number of leaves + (the number of growing days / 5); In S25, when the leaf age is less than 3, the tillering level is 1; when the leaf age is between 3 and 5, the tillering level is 2; when the leaf age is greater than 5, the tillering level is 3.

6. The method for constructing a digital model for calculating rice growth uniformity according to claim 1, characterized in that: The S3 comprises the following sub-steps: S31. Preload pre-trained image recognition models corresponding to different tillering levels, wherein different image recognition models are trained based on different data sets, each of which corresponds to a tillering level of rice images; S32. Based on the calculated tillering level of rice in the rice image, select an image recognition model corresponding to the tillering level; S33. Calling the selected image recognition model to identify the rice image to obtain a single rice plant image frame area; S34. performing semantic segmentation on each individual rice plant in the individual rice plant image frame region to obtain a contour line; S35. Generate a minimum bounding box of the target on the rice image based on the image frame area and contour lines of the single rice plant.

7. A device for constructing a rice digital growth uniformity calculation model, characterized in that: include: An image acquisition and preprocessing module, used for acquiring rice images and preprocessing the rice images; Rice tillering recognition module, used to obtain the number of leaves based on rice images and obtain the tillering level in combination with the leaf age; The rice instance segmentation module is used to perform image recognition and image frame segmentation on rice images based on the tillering level as a priori condition, and obtain the minimum external bounding box of a single rice plant image; A coverage calculation module is used to calculate the horizontal distance between the external frames according to the minimum external frame of the single rice plant image, and calculate the coverage according to the ratio of the horizontal distance and the width of the adjacent minimum external frame; The average degree calculation module is used to calculate the coefficient of variation (CV) of the coverage in the image based on each calculated coverage to express the uniformity. The formula is: CV = standard deviation / average value; wherein, the smaller the CV value, the more uniform the seedling emergence; the larger the CV value, the uneven the seedling emergence.

8. A computer device, characterized in that: It includes: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the method for constructing a digital model for calculating rice growth uniformity according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement: the method for constructing a digital model for calculating rice growth uniformity according to any one of claims 1 to 6.

Citation Information

Cited By

  • Rice root bud tracking method and system based on two-stage segmentation and topological feature fusion

    CN120599001A