A seedling deficiency detection method, system, electronic device and storage medium

CN122990487APending Publication Date: 2026-10-27GUANGDONG UNIV OF PETROCHEMICAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611197571.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]然而,现有检测方法普遍依赖于预先设定的固定参数来进行缺秧判断,这意味着其隐含假设所有待检测图像中的秧苗在视觉尺度、密度和空间排布规整程度上具有高度一致性

Benefits of technology

处理器,当所述一个或多个计算机程序被所述处理器执行时,实现上述第一方面所述的一种缺秧检测方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990487A_ABST
    Figure CN122990487A_ABST
Patent Text Reader

Abstract

The application relates to the field of seedling image recognition, in particular to a seedling shortage detection method and system, an electronic device and a storage medium, the method comprising: collecting a seedling field image and image geometric data; detecting seedlings and setting a detection frame through a seedling detection model; extracting seedling spatial discrete features and shooting scale features according to the center point data and the geometric data of the detection frame, and inputting the two features into a seedling parameter prediction model to obtain a clustering width and a seedling shortage interval threshold coefficient; dividing seedling rows according to the clustering width and obtaining an adjacent interval; obtaining a seedling shortage interval threshold according to the seedling shortage interval threshold coefficient and the adjacent interval; and obtaining a seedling shortage quantity and a seedling shortage position according to the adjacent interval and the seedling shortage interval threshold. Compared with the prior art, the application generates parameters matched with the actual shooting conditions of the current seedling field image, and then accurately divides seedling rows and determines seedling shortages, thereby effectively realizing seedling shortage detection of a seedling field under different collection conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of seedling image recognition, and more specifically, to a method, system, electronic device, and storage medium for detecting missing seedlings. Background Technology

[0002] Mechanized rice transplanting is a core component of mechanized rice production, and its quality directly affects the number of effective panicles and the final yield. Among the defects, missing seedlings are one of the most common and significant quality deficiencies in mechanized transplanting, ultimately leading to reduced yield and quality. Therefore, quickly and accurately detecting and assessing missing seedlings in the field is a crucial agricultural monitoring task in rice production management. With the continuous development of aerial photography technology, existing methods for detecting missing seedlings typically involve acquiring images of the paddy field from a bird's-eye view, followed by image processing or target detection algorithms to identify the location of individual seedlings in the image.

[0003] However, existing detection methods generally rely on pre-set fixed parameters to determine missing seedlings, which implies an implicit assumption that all seedlings in the images being tested are highly consistent in visual scale, density, and spatial regularity. But in actual production, the aerial photography acquisition height is difficult to maintain absolutely constant, and the visual scale of seedlings in images acquired from different batches, different fields, and even different areas of the same field will vary significantly due to differences in acquisition height. Therefore, existing fixed-parameter missing seedling detection methods have insufficient generalization ability when facing complex and varied real-world field scenarios, making it difficult to achieve accurate and robust missing seedling determination. Summary of the Invention

[0004] This invention provides a method, system, electronic device, and storage medium for detecting missing seedlings in seedling fields.

[0005] According to a first aspect of this application, a method for detecting missing seedlings is provided, the method comprising: Collect aerial images of the rice seedling field to be monitored, as well as the image geometric data of the aerial images; The seedlings in the aerial view of the seedbed are detected by a pre-trained seedling detection model, and corresponding detection boxes are set for the detected seedlings. Collect the center point data and geometric data of the detection frame corresponding to the seedling; Based on the center point data, extract the spatial discrete features of the seedlings from the overhead view of the seedbed; The shooting scale features of the overhead view of the seedling field are extracted based on the image geometric data and the detection box geometric data; The spatial discrete features and shooting scale features of the seedlings are input into a pre-trained seedling parameter prediction model for prediction, and the cluster width and missing seedling spacing threshold coefficient are obtained. The seedlings are divided into several seedling columns in the longitudinal direction according to the cluster width, and the adjacent spacing between adjacent seedlings in the seedling column is obtained. The missing seedling spacing threshold of the seedling column is obtained based on the missing seedling spacing threshold coefficient and the adjacent spacing. The number and location of missing seedlings in the seedling column are obtained based on the adjacent spacing and the missing seedling spacing threshold.

[0006] By acquiring aerial images of seedling fields and using a pre-trained seedling detection model to automatically identify seedlings and set detection boxes, the model simultaneously acquires the center point data and geometric data of the detection boxes. It then extracts spatial discrete features reflecting the regularity of the seedling spatial arrangement and shooting scale features reflecting the distance of the aerial image acquisition perspective. These two types of features are input into a pre-trained seedling parameter prediction model, which adaptively obtains cluster width and missing seedling spacing threshold coefficients that match the actual shooting conditions of the aerial image. This allows for seedling column division and missing seedling determination, ensuring that the cluster width used in the detection process can adapt to changes in seedling scale at different flight altitudes, and that the missing seedling spacing threshold can adapt to the normal fluctuation range of seedling spacing under different scenarios. This effectively achieves missing seedling detection in seedling fields under different acquisition conditions, significantly improving the accuracy and robustness of missing seedling detection.

[0007] Optionally, the step of extracting the spatial discrete features of the seedlings from the overhead view of the seedbed image based on the center point data includes: Based on the center point data, obtain the set of horizontal and vertical coordinates of the center point of the detection box; Based on the set of horizontal coordinates, calculate the lateral standard deviation and lateral range of the detection frame; Based on the set of ordinates, calculate the longitudinal standard deviation and longitudinal range of the detection frame; The lateral standard deviation, lateral range, longitudinal standard deviation, and longitudinal range of the detection frame are used as the spatial discrete features of the seedlings.

[0008] By calculating the lateral standard deviation and lateral range, as well as the longitudinal standard deviation and longitudinal range, using the x-coordinate and y-coordinate sets of the center points of the detection boxes, the spatial distribution of seedlings in both the lateral and longitudinal dimensions can be comprehensively and quantitatively characterized. The lateral and longitudinal standard deviations accurately reflect the overall fluctuation of seedlings in their respective directions, while the lateral and longitudinal ranges effectively describe the maximum distribution span of seedlings in their respective directions. These four statistical measures, from different perspectives, jointly characterize the spatial discrete features of seedlings in the current aerial view of the seedbed. This allows the seedling parameter prediction model to accurately perceive the curvature of the seedling rows and the regularity of planting in the current field, thus providing accurate spatial discrete information for the subsequent adaptive prediction of cluster width and missing seedling spacing threshold coefficient.

[0009] Optionally, the detection box geometry data includes the width and height of the detection box, and the image geometry data includes the width and height of the overhead view of the seedling field image; The step of extracting the shooting scale features of the overhead view of the nursery image based on the image geometric data and the detection box geometric data includes: The area of ​​the detection frame is calculated based on its width and height, and the set of areas of the detection frame is obtained. Based on the set of areas of the detection boxes, obtain the mean and median areas of the detection boxes; The number of detection boxes is counted, and the total area of ​​the overhead view of the seedbed is calculated based on the width and height of the image. The detection density of the detection boxes is obtained based on the number of detection boxes and the total area of ​​the overhead image of the seedling field. The mean area, median area, and detection density of the detection boxes are used as the imaging scale features.

[0010] By calculating the area of ​​each detection box using its width and height and obtaining an area set, the mean and median areas are statistically analyzed. Simultaneously, the detection density of the detection boxes is calculated. This approach characterizes the shooting scale features of the current aerial view of the seedling field from two dimensions: the central tendency and distribution density of the detection boxes. Specifically, the mean and median areas accurately reflect the overall projection scale of the seedlings in the image at the current flight altitude, while the detection density effectively represents the number of seedlings per unit area. These three factors corroborate and work together, enabling the seedling parameter prediction model to accurately perceive the viewing angle of the current aerial view of the seedling field, thus providing accurate shooting scale information for the adaptive prediction of cluster width and the threshold coefficient for missing seedling spacing.

[0011] Optionally, the step of dividing the seedlings into several seedling columns in the longitudinal direction according to the cluster width, and obtaining the adjacent spacing between adjacent seedlings in the seedling columns, includes: Based on the center point data, obtain the set of abscissas of the center point of the detection box corresponding to the seedling; Calculate the difference between any two x-coordinates in the set of x-coordinates; The seedlings are clustered based on the difference in the horizontal coordinate, and seedlings that are clustered together are marked as seedlings in the same column. The seedlings are divided into several seedling columns according to the seedling markers in the same column.

[0012] By utilizing center point data to obtain the set of abscissas of the detection box center points, and by calculating the difference between any two abscissas and clustering accordingly, seedlings clustered together are marked with a label indicating that they are in the same column. Finally, the seedlings are divided into several seedling columns based on this label. The comparison between the abscissa difference and the cluster width enables the automatic division of seedling columns. This allows for the accurate merging of seedling center points with similar left and right positions into the same seedling column without the need to preset the number of seedling columns. It can adapt to different numbers of seedling columns in different images, providing an accurate seedling column structure basis for subsequent adjacent spacing calculation and seedling missing determination.

[0013] Optionally, obtaining the missing seedling spacing threshold based on the adjacent spacing and the missing seedling spacing threshold coefficient includes: The median value of the spacing between adjacent seedlings in the seedling column is obtained and used as the reference seedling spacing of the seedling column. The baseline seedling spacing is adjusted according to the missing seedling spacing threshold coefficient to obtain the missing seedling spacing threshold.

[0014] By using the median distance between adjacent seedlings in each seedling column as the baseline seedling distance for that column, and adjusting it based on this baseline in conjunction with a missing seedling distance threshold coefficient, the missing seedling distance threshold for that seedling column is obtained. Using the median as the baseline effectively avoids interference from individual extreme distance values, making the baseline seedling distance more robust and reliable. Simultaneously, each seedling column independently calculates its own baseline seedling distance, ensuring that each column uses a judgment standard adapted to its actual growth state for missing seedling determination. Different columns do not interfere with each other, effectively preventing local anomalies in one column from affecting the judgment accuracy of other columns, thus significantly improving the accuracy of missing seedling determination results.

[0015] Optionally, the pre-training of the seedling parameter prediction model includes: Collect seedling field image samples, as well as image geometric sample data of the seedling field image samples; Based on the preset actual number of missing seedlings in the seedbed image sample, obtain the cluster width label value and the missing seedling spacing threshold coefficient label value; The seedlings in the seedbed image samples are detected by a pre-trained seedling detection model, and corresponding sample detection boxes are set for the detected seedlings. Collect the center point sample data and geometric sample data of the sample detection frame corresponding to the seedling; Based on the center point sample data, extract the spatial discrete sample features of the seedlings from the seedbed image samples; Based on the image geometric sample data and the detection box geometric sample data, the shooting scale sample features of the overhead view of the seedling field image are extracted; The spatial discrete sample features and shooting scale sample features of the seedlings are input into the seedling parameter prediction model to be trained for prediction, and the cluster width to be verified and the missing seedling spacing threshold coefficient to be verified are obtained. Calculate the first loss of the cluster width to be verified and the label value of the cluster width, calculate the second loss of the missing seedling spacing threshold coefficient to be verified and the label value of the missing seedling spacing threshold coefficient, and train the seedling parameter prediction model to be trained based on the first loss and the second loss to obtain the pre-trained seedling parameter prediction model.

[0016] By utilizing collected seedling field image samples and their geometric sample data, and combining the preset actual number of missing seedlings for each sample, the cluster width label value and the missing seedling spacing threshold coefficient label value are obtained. Simultaneously, the spatial discrete sample features of the seedlings and the sample features of the shooting scale are extracted. This is used to train the seedling parameter prediction model to be trained. During the training process, the generation of label values ​​is driven by the actual number of missing seedlings, so that the supervision signal used in the model training process is directly related to the actual missing seedling detection task. The trained seedling parameter prediction model can accurately predict the cluster width and missing seedling spacing threshold coefficient that match the current aerial seedling field image conditions after inputting sample features, thereby ensuring the model's adaptability and prediction accuracy in practical applications.

[0017] Optionally, obtaining the cluster width label value and the missing seedling spacing threshold coefficient label value based on the preset actual number of missing seedlings in the seedbed image sample includes: Set the first search range and first search step size for the cluster width label value, and set the second search range and second search step size for the missing seedling spacing threshold coefficient label value; Based on the first search step size, a search is performed within the first search range to obtain several candidate values ​​for cluster width; Based on the second search step size, a search is performed within the second search range to obtain several candidate values ​​for the missing seedling spacing threshold coefficient; For each of the cluster width candidate values, the cluster width candidate value is combined with each of the seedling gap threshold coefficient candidate values ​​to obtain several candidate parameter groups; The candidate parameter set is input into a preset seedling shortage determination algorithm for calculation to obtain the predicted number of seedling shortages corresponding to the candidate parameter set; Based on the predicted number of missing seedlings and the actual number of missing seedlings, a target parameter set is selected from the candidate parameter set; The candidate value of the cluster width in the target parameter group is used as the cluster width label value, and the candidate value of the missing seedling spacing threshold coefficient is used as the missing seedling spacing threshold coefficient label value.

[0018] Candidate values ​​are searched by setting two independent search ranges and search step sizes. Each candidate value for cluster width is combined with a candidate value for the threshold coefficient of seedling gap to form several candidate parameter groups. The predicted number of seedling gaps is calculated by inputting each group of candidate parameters into a preset seedling gap determination algorithm and compared with the actual number of seedling gaps. The optimal parameter group is selected as the label value. The optimal parameter combination can be automatically found in the parameter space through a grid search strategy, so that the acquisition of label values ​​does not depend on human experience setting, thus ensuring the objectivity and accuracy of the labels. At the same time, when there are multiple optimal combinations, the geometric center value can be selected to further ensure the robustness of the label values ​​and provide high-quality supervision labels for the training of the seedling parameter prediction model.

[0019] According to a second aspect of this application, a seedling shortage detection system is provided, the system comprising: The image data acquisition module is used to acquire overhead images of the rice seedling field to be monitored, as well as the image geometric data of the overhead images of the rice seedling field; The image detection module is used to detect seedlings in the overhead view of the seedbed using a pre-trained seedling detection model, and to set corresponding detection boxes for the detected seedlings. The detection frame data acquisition module is used to acquire the center point data and geometric data of the detection frame corresponding to the seedling; The discrete feature extraction module is used to extract the spatial discrete features of the seedlings in the overhead view of the seedbed based on the center point data. The scale feature extraction module is used to extract the shooting scale features of the overhead view of the seedling field image based on the image geometric data and the detection box geometric data; The parameter prediction module is used to input the spatial discrete features and shooting scale features of the seedlings into the pre-trained seedling parameter prediction model for prediction, and to obtain the cluster width and the missing seedling spacing threshold coefficient. The seedling division module is used to divide the seedlings vertically into several seedling columns according to the cluster width, and to obtain the adjacent spacing between adjacent seedlings in the seedling column; The missing seedling threshold calculation module is used to obtain the missing seedling spacing threshold of the seedling column based on the missing seedling spacing threshold coefficient and the adjacent spacing; The missing seedling marking module is used to obtain the number and location of missing seedlings in the seedling column based on the adjacent spacing and the missing seedling spacing threshold.

[0020] According to a third aspect of this application, an electronic device is provided, comprising: Memory, used to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements the seedling defect detection method described in the first aspect above.

[0021] According to a fourth aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the seedling missing detection method described in the first aspect above.

[0022] Based on any of the above aspects, the embodiments of this application provide a method, system, electronic device, and computer storage medium for detecting missing seedlings. This involves acquiring aerial images of a seedling field and automatically identifying seedlings in the image using a pre-trained seedling detection model, then setting detection boxes. Simultaneously, the center point data and geometric data of the detection boxes are acquired. Spatial discrete features reflecting the regularity of the seedling spatial arrangement and shooting scale features reflecting the distance of the aerial image acquisition angle are extracted. These two types of features are input into a pre-trained seedling parameter prediction model, which adaptively obtains a clustering width and a missing seedling spacing threshold coefficient that match the actual shooting conditions of the aerial image. This allows for the division of seedling rows and the determination of missing seedlings. The clustering width used in the detection process can adapt to changes in seedling scale at different flight altitudes, and the missing seedling spacing threshold can adapt to the normal fluctuation range of seedling spacing under different scenarios. This effectively achieves missing seedling detection in seedling fields under different acquisition conditions, significantly improving the accuracy and robustness of missing seedling detection. Attached Figure Description

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

[0024] Figure 1 This is a schematic diagram of the steps of the missing seedling detection method provided in this embodiment.

[0025] Figure 2 This is a schematic diagram of the steps for extracting spatial discrete features of seedlings provided in this embodiment.

[0026] Figure 3 This is a schematic diagram of the steps for extracting shooting scale features provided in this embodiment.

[0027] Figure 4 This is a schematic diagram illustrating the steps involved in dividing the seedling rows in this embodiment.

[0028] Figure 5 This is a schematic diagram illustrating the pre-training steps of the seedling parameter prediction model provided in this embodiment.

[0029] Figure 6 This is a flowchart illustrating the steps for obtaining the cluster width label value and the missing seedling spacing threshold coefficient label value provided in this embodiment.

[0030] Figure 7 This is a schematic diagram of the functional modules of the seedling shortage detection device provided in this embodiment.

[0031] Figure 8 This is a schematic diagram of the device structure of the electronic device provided in this embodiment. Detailed Implementation

[0032] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this application. To better illustrate the following embodiments, some components in the drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions of the product; it is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0035] Mechanized rice transplanting is a core component of mechanized rice production, and its quality directly affects the number of effective panicles and the final yield. Among the defects, missing seedlings are one of the most common and significant quality deficiencies in mechanized transplanting, ultimately leading to reduced yield and quality. Therefore, quickly and accurately detecting and assessing missing seedlings in the field is a crucial agricultural monitoring task in rice production management. With the continuous development of aerial photography technology, existing methods for detecting missing seedlings typically involve acquiring images of the paddy field from a bird's-eye view, followed by image processing or target detection algorithms to identify the location of individual seedlings in the image.

[0036] However, existing detection methods generally rely on pre-set fixed parameters to determine missing seedlings, which implies an implicit assumption that all seedlings in the images being tested are highly consistent in visual scale, density, and spatial regularity. But in actual production, the aerial photography acquisition height is difficult to maintain absolutely constant, and the visual scale of seedlings in images acquired from different batches, different fields, and even different areas of the same field will vary significantly due to differences in acquisition height. Therefore, existing fixed-parameter missing seedling detection methods have insufficient generalization ability when facing complex and varied real-world field scenarios, making it difficult to achieve accurate and robust missing seedling determination.

[0037] This embodiment provides a technical solution that can solve the above problems. The specific implementation of this application will be described in detail below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, this embodiment provides a method for detecting missing seedlings, which may include the following steps: S1: Collect aerial images of the rice seedling field to be monitored, as well as the image geometric data of the aerial images; In this embodiment, the overhead image of the seedling field is acquired by an imaging device mounted on a drone from a perspective directly above or approximately directly above the seedling field to be monitored. The image geometric data includes the width and height of the overhead image of the seedling field, in pixels, and is used to describe the overall size information of the overhead image of the seedling field.

[0039] Understandably, the aerial images of the rice paddies were captured within a time window, from the completion of machine transplanting to the seedlings' greening process. During this window, the seedlings have not yet begun tillering, and each seedling appears as an independent, distinguishable individual in the image, facilitating accurate identification and location of each seedling by subsequent target detection algorithms. The drone can plan its flight path based on the actual field area and a pre-set aerial route to ensure that the captured images cover the entire monitored area.

[0040] S2: Detect the seedlings in the overhead seedling field image using a pre-trained seedling detection model, and set corresponding detection boxes for the detected seedlings; In this embodiment, the seedling detection model is a deep learning-based object detection model. The seedling detection model is pre-trained using a constructed training dataset and is capable of detecting seedlings in the overhead view of the seedbed, outputting the bounding box coordinates of the detected seedlings, and then setting corresponding detection boxes for the seedlings based on these bounding box coordinates.

[0041] In one implementation, training the seedling detection model may include: First, images of rice seedlings before they turn green are acquired by drones in paddy fields. Then, each seedling in the images is labeled using an image annotation tool, marking the bounding box and center point coordinates of each seedling, forming a training image set containing the annotation information.

[0042] Then, a lightweight YOLO series object detection network can be used as the basic network structure of the seedling detection model. Hyperparameters during network training are adjusted based on the morphological features of rice seedlings. A transfer learning strategy is employed, using the network weights pre-trained on a general object detection dataset as initial parameters for fine-tuning on the constructed training image set. This allows the network to adapt to the specific morphological features of rice seedlings and the field imaging environment. After training, the seedling detection model can perform forward inference calculations on the input overhead images of the rice paddy and output the bounding box coordinates of each seedling in the image.

[0043] Understandably, as the foundational network structure of the seedling detection model, the target detection network may result in the same seedling being detected repeatedly by multiple detection boxes during the detection process due to multi-scale feature extraction or overlapping anchor boxes. To ensure that each seedling is counted only once, the detection results need to be cleaned after the seedling detection model outputs the detection boxes. In one embodiment, a distance pixel value threshold can be preset as an overlap determination criterion. For any two detection boxes, the pixel distance between their center points is calculated. If the distance is less than the distance pixel value threshold, the two detection boxes are determined to be duplicate detections, and only the detection box with the highest confidence is retained, while the remaining duplicate boxes are discarded. Through the above cleaning process, it can be ensured that each seedling is counted only once, guaranteeing the data purity for subsequent seedling missing determination.

[0044] S3: Collect the center point data and geometric data of the detection frame corresponding to the seedling; In this embodiment, the center point data may include the coordinates of the center point of the detection box on the plane of the overhead view of the seedling field image. For any detection box, the bounding box coordinates output by the seedling detection model can be represented as the coordinates of the upper left corner and the lower right corner, and the center point coordinates are calculated based on the coordinates of the upper left corner and the lower right corner. Specifically, the x-coordinate of the center point is half the sum of the x-coordinates of the upper left corner and the lower right corner, and the y-coordinate of the center point is half the sum of the y-coordinates of the upper left corner and the lower right corner. By collecting the center point data of the detection boxes, each detection box can be simplified to a single pixel, forming a set of seedling center point coordinates.

[0045] In this embodiment, the detection box geometry data may include the width and height of the detection box. The width of the detection box can be calculated based on the coordinate difference between the left and right boundaries of the bounding box, and the height of the detection box can be calculated based on the coordinate difference between the top and bottom boundaries of the bounding box.

[0046] S4: Extract the spatial discrete features of the seedlings from the overhead view of the seedbed based on the center point data; In this embodiment, the spatial discrete feature of the seedlings is used to describe the regularity or dispersion of the spatial distribution of seedlings in the overhead image of the seedbed. It is understood that when seedlings are planted according to a set pattern or when the number of seedlings is small, the center points of each seedling are arranged relatively neatly in both the horizontal and vertical directions, resulting in a lower degree of dispersion. Conversely, when seedlings are not planted according to a set pattern, or when there are many missing seedlings leading to poor planting quality, the position of the seedling center points deviates from the ideal row and column grid, resulting in a higher degree of dispersion.

[0047] Therefore, in this embodiment, as Figure 2 As shown, step S4 may include the following sub-steps: S41: Based on the center point data, obtain the set of horizontal coordinates and the set of vertical coordinates of the center point of the detection box; S42: Calculate the lateral standard deviation and lateral range of the detection frame based on the set of horizontal coordinates; S43: Calculate the longitudinal standard deviation and longitudinal range of the detection frame based on the set of ordinates; S44: The lateral standard deviation, lateral range, longitudinal standard deviation, and longitudinal range of the detection frame are used as the spatial discrete features of the seedlings.

[0048] In this embodiment, the horizontal standard deviation is the standard deviation of all horizontal coordinates in the set of horizontal coordinates, and the horizontal extreme value difference is the difference between the largest and smallest horizontal coordinates in the set of horizontal coordinates; correspondingly, the vertical standard deviation is the standard deviation of all vertical coordinates in the set of vertical coordinates, and the vertical coordinate range is the difference between the largest and smallest vertical coordinates in the set of vertical coordinates.

[0049] Understandably, the lateral standard deviation measures the degree of fluctuation of the center point of all seedlings in the horizontal direction relative to their average position. A larger value indicates a more dispersed distribution of seedlings in the horizontal direction, and a greater degree of bending or tilting in the seedling rows. The lateral range measures the maximum horizontal span of the center points of all seedlings, i.e., the lateral distance between the rightmost and leftmost seedlings. The longitudinal standard deviation and longitudinal range measure the degree of fluctuation and maximum vertical span of the seedlings, respectively. These four statistics collectively characterize the dispersion of the spatial distribution of seedlings from different dimensions.

[0050] S5: Extract the shooting scale features of the overhead view of the seedling field image based on the image geometric data and the detection box geometric data; In this embodiment, the shooting scale feature is used to describe the overall visual scale of the rice seedlings in the current aerial view of the rice paddy, reflecting the size of the rice seedlings in the image at the current aerial shooting height.

[0051] In this embodiment, as Figure 3 As shown, step S5 may include: S51: Calculate the area of ​​the detection frame based on its width and height, and obtain the set of areas of the detection frame; S52: Based on the set of areas of the detection boxes, obtain the mean area and median area of ​​the detection boxes; S53: Count the number of detection boxes, and calculate the total area of ​​the overhead view of the seedbed image based on the width and height of the image. S54: Obtain the detection density of the detection boxes based on the number of detection boxes and the total area of ​​the overhead view of the seedling field; S55: The mean area, median area, and detection density of the detection frame are used as the shooting scale features.

[0052] Understandably, when the drone flies at a low altitude, a single rice seedling occupies a larger pixel area in the image, resulting in a larger mean and median area. Simultaneously, the area covered by a single image is smaller, leading to a relatively low detection density. Conversely, when the drone flies at a high altitude, a single rice seedling occupies a smaller pixel area in the image, resulting in a smaller mean and median area. Simultaneously, the area covered by a single image is larger, leading to a relatively high detection density. Therefore, using the mean area, median area, and detection density of the detection boxes as the shooting scale features allows these features to effectively reflect the acquisition height information of the current overhead image of the rice paddy.

[0053] S6: Input the spatial discrete features and shooting scale features of the seedlings into the pre-trained seedling parameter prediction model for prediction to obtain the cluster width and the missing seedling spacing threshold coefficient; In this embodiment, the seedling parameter prediction model is a pre-trained model. Through training, the seedling parameter prediction model can predict the optimal parameters for judging the seedling missing status in the aerial view of the seedling field at the current aerial shooting height, namely the cluster width and the seedling missing distance threshold coefficient, based on the input spatial discrete features and shooting scale features of the seedlings.

[0054] In this embodiment, the cluster width is used to control the range of lateral clustering, that is, to determine how close the center points of two seedlings are in the lateral direction before they can be classified into the same seedling column. The missing seedling spacing threshold coefficient is used to control the sensitivity of missing seedling determination, that is, to determine how many times the spacing between adjacent seedlings exceeds the normal plant spacing before it is determined to be a missing seedling.

[0055] S7: Divide the seedlings into several seedling columns in the longitudinal direction according to the cluster width, and obtain the adjacent spacing between adjacent seedlings in the seedling column; As described above, by extracting the center point data of the detection box, the seedling can be simplified to a single center point. However, in the overhead image of the seedbed, it can be understood that the center points of all seedlings together constitute a two-dimensional point set. This point set only records the planar position of each seedling, but does not indicate which seedlings belong to the same row or which belong to adjacent rows. Furthermore, due to irregular planting and missing seedlings, the spacing between seedlings may be inconsistent, making it difficult to determine whether seedlings belong to the same row. To determine missing seedlings, it is necessary to first reconstruct the structure of the seedling rows, that is, to identify which seedlings belong to the same column horizontally.

[0056] However, due to variations in flight altitude leading to different seedling scales in the image, and differences in field flatness causing slight curvature in the seedling rows, it is impossible to use a fixed lateral distance threshold to uniformly determine the seedling row affiliation for all images. Therefore, this embodiment utilizes a pre-trained seedling parameter prediction model to predict an adaptive clustering width for the current image based on its scale and spatial discrete features. This clustering width is then used to laterally group the scattered seedling center points, connecting center points with similar left and right positions to reconstruct an approximately vertically arranged seedling row structure.

[0057] Therefore, in this embodiment, as Figure 4 As shown, step S7 may include: S71: Based on the center point data, obtain the set of abscissas of the center point of the detection frame corresponding to the seedling; S72: Calculate the difference between any two horizontal coordinates in the set of horizontal coordinates; S73: Cluster the seedlings according to the difference in the horizontal coordinate, and add a label for seedlings in the same column to the seedlings that are clustered together; S74: Divide the seedlings into several seedling columns according to the seedling markers in the same column.

[0058] In this embodiment, by clustering the seedlings, the originally scattered set of center points is divided into several clusters, each cluster corresponding to a row of seedlings in the overhead image of the seedbed. Since the cluster width is adaptively determined based on the visual scale of the current image, for images with higher flight altitudes and smaller seedling projection scales, the cluster width is correspondingly reduced to avoid incorrectly merging adjacent seedling rows; for images with lower flight altitudes and larger seedling projection scales, the cluster width is correspondingly increased to avoid incorrectly separating the same seedling row.

[0059] Furthermore, in one implementation, after dividing the seedlings into several seedling columns, for any given seedling column, the center points of all detection frames within that column can be rearranged according to their vertical coordinates from smallest to largest. The difference in the vertical coordinates between the center points of adjacent detection frames is then calculated sequentially, serving as the adjacent spacing sequence for that seedling column. Through these two operations—horizontal convergence and vertical sorting—the originally scattered center points are organized into a sequence of seedling columns with a clear topological structure. This establishes the spatial relationships between adjacent seedlings within the same seedling column, providing fundamental data for subsequent seedling shortage detection.

[0060] S8: Obtain the seedling gap threshold of the seedling column based on the missing seedling gap threshold coefficient and the adjacent gap; It is understandable that the actual spacing between different rows of seedlings may vary. This difference is likely due to normal variations caused by external, non-human factors such as the different transplanting passes for each row during the transplanting process and inconsistent field surface flatness, rather than being caused by missing seedlings. Therefore, before determining whether there are missing seedlings, it is necessary to establish a reference standard for normal seedling spacing for each row.

[0061] Therefore, in this embodiment, step S8 may include: The median value of the spacing between adjacent seedlings in the seedling column is obtained as the reference seedling spacing of the seedling column; the reference seedling spacing is adjusted according to the missing seedling spacing threshold coefficient to obtain the missing seedling spacing threshold.

[0062] As described above, the missing seedling spacing threshold coefficient is used to control the sensitivity of missing seedling determination, that is, how many times the spacing between adjacent seedlings exceeds the normal plant spacing to be determined as missing seedlings. Therefore, in this embodiment, after obtaining the reference seedling spacing of the seedling column, the missing seedling spacing threshold coefficient can be multiplied by the reference seedling spacing of the seedling column to obtain the missing seedling spacing threshold of the seedling column.

[0063] Understandably, each seedling row independently calculates its own baseline seedling spacing, ensuring that different seedling rows do not interfere with each other. This prevents spacing fluctuations in one seedling row caused by local anomalies from affecting the judgment criteria of other rows, thus effectively improving the accuracy of missing seedling determination. Furthermore, since the median is less susceptible to individual extreme values, using the median value of the spacing between adjacent seedlings as the baseline seedling spacing avoids the situation where an excessively large spacing value exists in a row due to missed detection. This would prevent the average value from being significantly skewed by the extreme value, resulting in an overly large baseline spacing for that row, potentially leading to missed instances of actual missing seedlings in subsequent missing seedling determinations.

[0064] S9: Obtain the number and location of missing seedlings in the seedling column based on the adjacent spacing and the missing seedling spacing threshold.

[0065] In this embodiment, for any seedling column, all adjacent spacings in the seedling column can be traversed, and adjacent positions with adjacent spacings greater than the missing seedling spacing threshold of the seedling column can be marked as missing seedling positions, and the number of missing seedlings can be counted.

[0066] Understandably, when an adjacent spacing exceeds the missing seedling spacing threshold, it indicates that the actual distance between the two adjacent seedlings has significantly exceeded the normal growing spacing range, thus indicating a missing seedling at that location. Based on the degree to which the adjacent spacing exceeds the missing seedling spacing threshold, the number of missing seedlings at that location can be further estimated. For example, if an adjacent spacing is 2.5 times the baseline seedling spacing, and the missing seedling spacing threshold coefficient is 1.5, then the location corresponding to that adjacent spacing may be missing one or more seedlings. The specific number of missing seedlings can be determined by comparing the actual spacing with the baseline seedling spacing.

[0067] As described above, the seedling parameter prediction model in step S6 of this embodiment is obtained through pre-training, wherein, for example... Figure 5 As shown, the pre-training of the seedling parameter prediction model may include the following steps: A1: Collect seedling field image samples, and image geometric sample data of the seedling field image samples; In this embodiment, the nursery image samples are multiple aerial images of nursery fields taken at different flight altitudes and under different field conditions. Each nursery image sample has corresponding image geometric sample data. The image geometric sample data includes the width and height of the nursery image sample.

[0068] Understandably, to ensure the diversity and representativeness of the training data, the seedling field image samples should cover different aerial photography heights, different field lighting conditions, different seedling density distributions, and different degrees of spatial dispersion, so that the trained seedling parameter prediction model has good generalization ability.

[0069] A2: Based on the preset actual number of missing seedlings in the seedbed image sample, obtain the cluster width label value and the missing seedling spacing threshold coefficient label value; In this embodiment, the actual number of missing seedlings is the total number of missing seedlings obtained by manually annotating the seedbed image samples, and serves as a supervisory signal for subsequent parameter search.

[0070] In this embodiment, as Figure 6 As shown, step A2 may include the following sub-steps: A21: Set the first search range and first search step size for the cluster width label value, and set the second search range and second search step size for the missing seedling spacing threshold coefficient label value; In this embodiment, the cluster width and the missing seedling spacing threshold coefficient are two key parameters affecting the missing seedling detection results. As mentioned above, the cluster width controls the range of lateral clustering, that is, how close two seedling center points are in the lateral direction to be classified as the same seedling column; the missing seedling spacing threshold coefficient controls the sensitivity of missing seedling determination, that is, how many times the adjacent spacing exceeds the baseline plant spacing before it is determined to be a missing seedling. These two parameters together determine that the same image will yield different missing seedling detection results under different parameter configurations.

[0071] However, for the same image, it is impossible to directly determine through theoretical calculation which set of parameters best approximates the actual situation regarding missing seedling detection. Therefore, a search method is needed to traverse all possible parameter combinations within a preset parameter value range, evaluate their detection effects one by one, and find the optimal one. In this embodiment, a first search range and a second search range can be set for the cluster width and the missing seedling spacing threshold coefficient, respectively, serving as the parameter value ranges corresponding to the cluster width and the missing seedling spacing threshold coefficient. The interval between each value taken during the search process within the first and second search ranges is set as the first search step size and the second search step size.

[0072] For example, the first search range can be 20 pixels to 55 pixels, and the first search step size can be 1 pixel; the second search range can be 1.05 to 1.95, and the second search step size can be 0.05.

[0073] A22: Based on the first search step size, a search is performed within the first search range to obtain several candidate values ​​for cluster width; Since the first search step size is the interval between each value taken within the first search range, in this embodiment, the first search step size can be used as the interval to perform discretization sampling within the first search range, obtaining all possible cluster width values ​​as the candidate cluster width values. For example, when the first search range is 20 to 55 pixels and the first search step size is 1 pixel, the candidate cluster width values ​​are 20, 21, 22, ..., 55, a total of 36 candidate cluster width values.

[0074] A23: Based on the second search step size, a search is performed within the second search range to obtain several candidate values ​​for the missing seedling spacing threshold coefficient; Similar to step A22, in this embodiment, the second search step size can be used as an interval to perform discretization sampling within the second search range, obtaining all possible values ​​of the missing seedling spacing threshold coefficient, which are then used as candidate values ​​for the missing seedling spacing threshold coefficient. For example, when the second search range is 1.05 to 1.95 and the second search step size is 0.05, the candidate values ​​for the missing seedling spacing threshold coefficient are 1.05, 1.10, 1.15, ..., 1.95, totaling 19 candidate values.

[0075] A24: For each of the cluster width candidate values, the cluster width candidate value is combined with each of the seedling gap threshold coefficient candidate values ​​to obtain several candidate parameter groups; In this embodiment, all candidate values ​​for cluster width can be paired one-to-one with all candidate values ​​for seedling gap threshold coefficient to form a complete set of candidate parameter groups. Each candidate value for cluster width is combined once with each candidate value for seedling gap threshold coefficient to form a point in a two-dimensional parameter space. For example, when there are 36 candidate values ​​for cluster width and 19 candidate values ​​for seedling gap threshold coefficient, a total of 36 × 19 = 684 candidate parameter groups are formed.

[0076] A25: Input the candidate parameter group into a preset seedling shortage determination algorithm for calculation to obtain the predicted number of seedling shortages corresponding to the candidate parameter group; In this embodiment, the predicted number of missing seedlings corresponding to each candidate parameter group can be compared with the preset actual number of missing seedlings in the seedbed image sample, and the absolute value of the deviation between the predicted number of missing seedlings and the actual number of missing seedlings can be calculated. It is understood that the smaller the absolute value of the deviation, the higher the seedling detection accuracy of the candidate parameter group in the image. Furthermore, all candidate parameter groups can be traversed, and the group with the smallest absolute value of deviation can be selected as the target parameter group.

[0077] A26: Select the target parameter group from the candidate parameter group based on the predicted number of missing seedlings and the actual number of missing seedlings; Understandably, if multiple candidate parameter groups have the same minimum absolute deviation value, the geometric center value of the candidate cluster width in the multiple candidate parameter groups is taken as the target cluster width, and the geometric center value of the candidate seedling gap threshold coefficient in the multiple candidate parameter groups is taken as the target seedling gap threshold coefficient, so as to ensure the robustness of the selected parameter labels.

[0078] A27: Use the candidate value of the cluster width in the target parameter group as the cluster width label value, and use the candidate value of the missing seedling spacing threshold coefficient as the missing seedling spacing threshold coefficient label value.

[0079] In this embodiment, the cluster width value and the missing seedling spacing threshold coefficient value are extracted from the target parameter group and used as the true label of the seedbed image sample. This label value represents the parameter configuration that, for this image, makes the missing seedling count result closest to the true value under the preset missing seedling determination algorithm.

[0080] A3: Detect seedlings in the seedbed image samples using a pre-trained seedling detection model, and set corresponding sample detection boxes for the detected seedlings; In this embodiment, the pre-trained seedling detection model is the same as the seedling detection model used in step S2, with the same network structure and parameter configuration, to ensure consistent data distribution between the training and inference phases. The method for obtaining the sample detection boxes is the same as that for obtaining the detection boxes in step S2, and will not be repeated here.

[0081] A4: Collect the center point sample data and geometric sample data of the sample detection frame corresponding to the seedling; In this embodiment, the acquisition methods of the center point sample data and the detection box geometric sample data are the same as those of the center point data and the detection box geometric data in step S3, and will not be repeated here.

[0082] A5: Extract the spatial discrete sample features of the seedlings from the seedbed image samples based on the center point sample data; In this embodiment, the extraction method of the spatial discrete sample features of the seedlings is the same as the extraction method of the spatial discrete features of the seedlings in step S4. That is, the set of horizontal coordinates and the set of vertical coordinates of the center point of the sample detection box are obtained according to the center point sample data, and the horizontal standard deviation, the horizontal range, the vertical standard deviation and the vertical range are calculated respectively as the spatial discrete sample features of the seedlings.

[0083] A6: Extract the shooting scale sample features of the overhead view of the seedling field image based on the image geometric sample data and the detection box geometric sample data; In this embodiment, the method for extracting the shooting scale sample features is the same as the method for extracting the shooting scale features in step S5, that is, the area is calculated based on the width and height of the sample detection box, the area set is obtained, the mean area and the median area are calculated, the number of detection boxes is counted and the detection density is calculated, and the mean area, the median area and the detection density are used as the shooting scale sample features.

[0084] A7: Input the spatial discrete sample features of the seedlings and the sample features of the shooting scale into the seedling parameter prediction model to be trained for prediction, and obtain the cluster width to be verified and the threshold coefficient of the missing seedling spacing to be verified. In this embodiment, the spatial discrete sample features of the seedlings and the sample features of the shooting scale can be concatenated into a complete meta-feature vector, which is then input into the seedling parameter prediction model to be trained. The model performs forward calculation based on the input features and outputs the predicted value corresponding to the current sample, namely the cluster width to be verified and the threshold coefficient of the missing seedling spacing to be verified.

[0085] A8: Calculate the first loss of the cluster width to be verified and the label value of the cluster width, calculate the second loss of the threshold coefficient of the missing seedling spacing to be verified and the label value of the threshold coefficient of the missing seedling spacing, and train the seedling parameter prediction model to be trained according to the first loss and the second loss to obtain the pre-trained seedling parameter prediction model.

[0086] In this embodiment, the seedling parameter prediction model can adopt different machine learning models according to actual needs.

[0087] In one embodiment, the seedling parameter prediction model can be set as a random forest model. In this embodiment, the mean squared error of the cluster width to be verified and the label value of the cluster width can be calculated as the first loss, and the mean squared error of the missing seedling spacing threshold coefficient to be verified and the label value of the missing seedling spacing threshold coefficient can be calculated as the second loss. During the training process of the random forest model, at each model node, all possible features and splitting thresholds can be traversed, each splitting method can be tried, and the mean squared error of each child node after splitting can be calculated. The smaller the mean squared error, the more concentrated the label values ​​of the samples in the child node are, and the closer the predicted values ​​are to the true labels. Therefore, the child node with the smallest mean squared error among all splits is selected to achieve the training of the random forest model.

[0088] In one embodiment, the seedling parameter prediction model can be set as a neural network model. The mean square error of the cluster width to be verified and the label value of the cluster width can be calculated as the first loss, and the mean square error of the threshold coefficient of the missing seedling spacing to be verified and the label value of the threshold coefficient of the missing seedling spacing can be calculated as the second loss. During the training of the neural network model, the first loss and the second loss can be weighted and summed as the total loss. Then, the gradient of the weights of each layer is calculated using the backpropagation algorithm using the total loss. The network weights of the neural network model are then gradually updated along the gradient direction using the gradient descent optimization algorithm, so that the loss value gradually decreases with the increase of training rounds, and finally convergence is achieved.

[0089] Understandably, the seedling parameter prediction model is trained using a large number of training samples covering different aerial photography altitudes. During training, the model learns the mapping relationship between the shooting scale features and the spatial discrete features of the seedlings to the optimal decision parameters. Specifically, the model learns the decision logic that "when the average area is small and the detection density is high, it indicates a high aerial photography altitude, and the cluster width should be reduced accordingly to avoid incorrect merging of adjacent rice rows; when the average area is large and the detection density is low, it indicates a low aerial photography altitude, and the cluster width should be increased accordingly to avoid incorrectly separating the same rice row." Furthermore, in the online prediction stage, the pre-trained seedling parameter prediction model can directly convert the learned mapping relationship into specific parameter values ​​based on the feature input of the current image, achieving adaptive parameter prediction based on aerial photography altitude.

[0090] Understandably, the spatial discrete features of the rice seedlings further enhance the model's prediction accuracy: when the spatial discrete feature value is large, it indicates that the rice rows in the current field are curved or the planting is irregular. The model will appropriately increase the value when predicting the cluster width to prevent the same rice row from being incorrectly split due to excessive offset. Thus, the seedling parameter prediction model achieves adaptive parameter prediction for images under different aerial shooting heights and different field conditions by comprehensively sensing the current image's shooting scale and spatial discreteness.

[0091] like Figure 7 As shown in the illustration, this application also provides a seedling shortage detection system. Optionally, the system may include: Image data acquisition module 11 is used to acquire overhead images of the seedling field to be monitored, as well as the image geometric data of the overhead images of the seedling field; In this embodiment, the image data acquisition module 11 can be used to perform... Figure 1 For a detailed description of the image data acquisition module 11 shown in step S1, please refer to the description of step S1.

[0092] Image detection module 12 is used to detect seedlings in the overhead seedling field image using a pre-trained seedling detection model, and set corresponding detection boxes for the detected seedlings; In this embodiment, the image detection module 12 can be used to perform... Figure 1 For a detailed description of the image detection module 12 shown in step S2, please refer to the description of step S2.

[0093] The detection frame data acquisition module 13 is used to acquire the center point data and geometric data of the detection frame corresponding to the seedling; In this embodiment, the detection frame data acquisition module 13 can be used to perform... Figure 1 For a detailed description of the detection frame data acquisition module 13 shown in step S3, please refer to the description of step S3.

[0094] Discrete feature extraction module 14 is used to extract the spatial discrete features of seedlings from the overhead view of the seedbed image based on the center point data; In this embodiment, the discrete feature extraction module 14 can be used to perform... Figure 1 For a detailed description of the discrete feature extraction module 14 shown in step S4, please refer to the description of step S4.

[0095] The scale feature extraction module 15 is used to extract the shooting scale features of the overhead view of the seedling field image based on the image geometric data and the detection box geometric data; In this embodiment, the scale feature extraction module 15 can be used to perform... Figure 1 For a detailed description of the scale feature extraction module 15 shown in step S5, please refer to the description of step S5.

[0096] The parameter prediction module 16 is used to input the spatial discrete features and shooting scale features of the seedlings into the pre-trained seedling parameter prediction model for prediction, and obtain the cluster width and the missing seedling spacing threshold coefficient. In this embodiment, the parameter prediction module 16 can be used to perform... Figure 1 For a detailed description of the parameter prediction module 16 shown in step S6, please refer to the description of step S6.

[0097] The seedling division module 17 is used to divide the seedlings into several seedling columns in the longitudinal direction according to the cluster width, and to obtain the adjacent spacing between adjacent seedlings in the seedling column; In this embodiment, the seedling division module 17 can be used to perform... Figure 1 For a detailed description of the seedling division module 17 shown in step S7, please refer to the description of step S6.

[0098] The missing seedling threshold calculation module 18 is used to obtain the missing seedling spacing threshold of the seedling column based on the missing seedling spacing threshold coefficient and the adjacent spacing; In this embodiment, the missing seedling threshold calculation module 18 can be used to perform... Figure 1 For a detailed description of the missing seedling threshold calculation module 18 shown in step S8, please refer to the description of step S8.

[0099] The missing seedling marking module 19 is used to obtain the number and location of missing seedlings in the seedling column based on the adjacent spacing and the missing seedling spacing threshold.

[0100] In this embodiment, the missing seedling marking module 19 can be used to perform... Figure 1 For a detailed description of the missing seedling marking module 19 shown in step S9, please refer to the description of step S9.

[0101] This application provides an electronic device with the following structure: Figure 8 As shown.

[0102] The electronic device includes a memory 21, a processor 22, a communication module 23, and an input / output interface 24, etc. Optionally, the memory 21, the processor 22, the communication module 23, and the input / output interface 24 can be connected and communicate with each other through a bus 25.

[0103] The memory 21 is used to store one or more computer programs and to transfer the code of the computer programs to the processor 22; when the one or more computer programs are executed by the processor 22, the missing seedling detection method in this application embodiment is implemented.

[0104] Optionally, the electronic device can be connected to a network via communication module 23 to communicate with other devices, such as terminals or servers, to achieve data interaction. The electronic device can be various forms of digital computers, exemplarily such as desktop computers, servers, workbenches, mainframes, or other types of computers. The electronic device can also be various forms of mobile terminals, exemplarily such as smartphones, tablets, wearable devices (such as helmets, glasses, watches, etc.), and other similar mobile terminals.

[0105] Optionally, the electronic device can connect to required input / output devices, such as a keyboard or display device, via the input / output interface 24. The electronic device itself may have a display device, and other display devices can also be connected externally via the input / output interface 24. Optionally, a storage device, such as a hard disk, can also be connected via the input / output interface 24 to store data from the electronic device, read data from the storage device, or store data from the storage device in the memory 21. It is understood that the input / output interface 24 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 24 can be a component of the electronic device or an external device connected to the electronic device when needed.

[0106] Optionally, the memory 21 may be a volatile memory and / or a non-volatile memory. The volatile memory may be a random access memory, etc., and the non-volatile memory may be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory, etc.

[0107] Optionally, the computer program stored in the processor 22 can be divided into one or more modules, which are stored in the memory 21 and executed by the processor 22 to perform the method provided in this embodiment. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the electronic device.

[0108] Optionally, the processor 22 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 22 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, and can also be any suitable controller, microcontroller, processor, etc. The processor 22 executes the various methods and processes of this embodiment, exemplarily, such as a seedling defect detection method according to an embodiment of this application.

[0109] Optionally, the bus 25 may include a path for transmitting information. Depending on its function, the bus 25 may be divided into an address bus, a data bus, a control bus, etc.

[0110] In an optional implementation, this application embodiment also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods described in the above-described method embodiments. Part or all of the computer program can be loaded and / or installed on the memory 21 of an electronic device. When the computer program is executed by the processor 22, one or more steps of a missing seedling detection method according to an embodiment of this application can be performed.

[0111] Optionally, the computer-readable storage medium may be a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc.

[0112] Obviously, the above embodiments of this application are merely examples for clearly illustrating the technical solution of this application, and are not intended to limit the specific implementation of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of this application should be included within the protection scope of the claims of this application.

Claims

1. A method for detecting missing seedlings, characterized in that, The method includes: Collect aerial images of the rice seedling field to be monitored, as well as the image geometric data of the aerial images; The seedlings in the aerial view of the seedbed are detected by a pre-trained seedling detection model, and corresponding detection boxes are set for the detected seedlings. Collect the center point data and geometric data of the detection frame corresponding to the seedling; Based on the center point data, extract the spatial discrete features of the seedlings from the overhead view of the seedbed; The shooting scale features of the overhead view of the seedling field are extracted based on the image geometric data and the detection box geometric data; The spatial discrete features and shooting scale features of the seedlings are input into a pre-trained seedling parameter prediction model for prediction, and the cluster width and missing seedling spacing threshold coefficient are obtained. The seedlings are divided into several seedling columns in the longitudinal direction according to the cluster width, and the adjacent spacing between adjacent seedlings in the seedling column is obtained. The missing seedling spacing threshold of the seedling column is obtained based on the missing seedling spacing threshold coefficient and the adjacent spacing. The number and location of missing seedlings in the seedling column are obtained based on the adjacent spacing and the missing seedling spacing threshold.

2. The method for detecting missing seedlings according to claim 1, characterized in that, The step of extracting the spatial discrete features of the seedlings from the overhead view of the paddy field image based on the center point data includes: Based on the center point data, obtain the set of horizontal and vertical coordinates of the center point of the detection box; Based on the set of horizontal coordinates, calculate the lateral standard deviation and lateral range of the detection frame; Based on the set of ordinates, calculate the longitudinal standard deviation and longitudinal range of the detection frame; The lateral standard deviation, lateral range, longitudinal standard deviation, and longitudinal range of the detection frame are used as the spatial discrete features of the seedlings.

3. The method for detecting missing seedlings according to claim 1, characterized in that, The detection box geometry data includes the width and height of the detection box, and the image geometry data includes the width and height of the overhead view of the seedling field image; The step of extracting the shooting scale features of the overhead view of the nursery image based on the image geometric data and the detection box geometric data includes: The area of ​​the detection frame is calculated based on its width and height, and the set of areas of the detection frame is obtained. Based on the set of areas of the detection boxes, obtain the mean and median areas of the detection boxes; The number of detection boxes is counted, and the total area of ​​the overhead view of the seedbed is calculated based on the width and height of the image. The detection density of the detection boxes is obtained based on the number of detection boxes and the total area of ​​the overhead image of the seedling field. The mean area, median area, and detection density of the detection boxes are used as the imaging scale features.

4. The method for detecting missing seedlings according to claim 1, characterized in that, The step of dividing the seedlings vertically into several seedling columns based on the cluster width, and obtaining the adjacent spacing between adjacent seedlings in the seedling columns, includes: Based on the center point data, obtain the set of abscissas of the center point of the detection box corresponding to the seedling; Calculate the difference between any two x-coordinates in the set of x-coordinates; The seedlings are clustered based on the difference in the horizontal coordinate, and seedlings that are clustered together are marked as seedlings in the same column. The seedlings are divided into several seedling columns according to the seedling markers in the same column.

5. The method for detecting missing seedlings according to claim 1, characterized in that, The step of obtaining the seedling gap threshold based on the adjacent spacing and the seedling gap gap threshold coefficient includes: The median value of the spacing between adjacent seedlings in the seedling column is obtained and used as the reference seedling spacing of the seedling column. The baseline seedling spacing is adjusted according to the missing seedling spacing threshold coefficient to obtain the missing seedling spacing threshold.

6. A method for detecting missing seedlings according to any one of claims 1-5, characterized in that, The pre-training of the seedling parameter prediction model includes: Collect seedling field image samples, as well as image geometric sample data of the seedling field image samples; Based on the preset actual number of missing seedlings in the seedbed image sample, obtain the cluster width label value and the missing seedling spacing threshold coefficient label value; The seedlings in the seedbed image samples are detected by a pre-trained seedling detection model, and corresponding sample detection boxes are set for the detected seedlings. Collect the center point sample data and geometric sample data of the sample detection frame corresponding to the seedling; Based on the center point sample data, extract the spatial discrete sample features of the seedlings from the seedbed image samples; Based on the image geometric sample data and the detection box geometric sample data, the shooting scale sample features of the overhead view of the seedling field image are extracted; The spatial discrete sample features and shooting scale sample features of the seedlings are input into the seedling parameter prediction model to be trained for prediction, and the cluster width to be verified and the missing seedling spacing threshold coefficient to be verified are obtained. Calculate the first loss of the cluster width to be verified and the label value of the cluster width, calculate the second loss of the missing seedling spacing threshold coefficient to be verified and the label value of the missing seedling spacing threshold coefficient, and train the seedling parameter prediction model to be trained based on the first loss and the second loss to obtain the pre-trained seedling parameter prediction model.

7. The method for detecting missing seedlings according to claim 6, characterized in that, The step of obtaining the cluster width label value and the missing seedling spacing threshold coefficient label value based on the preset actual number of missing seedlings in the seedbed image sample includes: Set the first search range and first search step size for the cluster width label value, and set the second search range and second search step size for the missing seedling spacing threshold coefficient label value; Based on the first search step size, a search is performed within the first search range to obtain several candidate values ​​for cluster width; Based on the second search step size, a search is performed within the second search range to obtain several candidate values ​​for the missing seedling spacing threshold coefficient; For each of the cluster width candidate values, the cluster width candidate value is combined with each of the seedling gap threshold coefficient candidate values ​​to obtain several candidate parameter groups; The candidate parameter set is input into a preset seedling shortage determination algorithm for calculation to obtain the predicted number of seedling shortages corresponding to the candidate parameter set; Based on the predicted number of missing seedlings and the actual number of missing seedlings, a target parameter set is selected from the candidate parameter set; The candidate value of the cluster width in the target parameter group is used as the cluster width label value, and the candidate value of the missing seedling spacing threshold coefficient is used as the missing seedling spacing threshold coefficient label value.

8. A seedling shortage detection system, characterized in that, The system includes: The image data acquisition module is used to acquire overhead images of the rice seedling field to be monitored, as well as the image geometric data of the overhead images of the rice seedling field; The image detection module is used to detect seedlings in the aerial view of the seedbed using a pre-trained seedling detection model, and to set corresponding detection boxes for the detected seedlings. The detection frame data acquisition module is used to acquire the center point data and geometric data of the detection frame corresponding to the seedling; The discrete feature extraction module is used to extract the spatial discrete features of the seedlings in the overhead view of the seedbed based on the center point data. The scale feature extraction module is used to extract the shooting scale features of the overhead view of the seedling field image based on the image geometric data and the detection box geometric data; The parameter prediction module is used to input the spatial discrete features and shooting scale features of the seedlings into the pre-trained seedling parameter prediction model for prediction, and to obtain the cluster width and the missing seedling spacing threshold coefficient. The seedling division module is used to divide the seedlings vertically into several seedling columns according to the cluster width, and to obtain the adjacent spacing between adjacent seedlings in the seedling column; The missing seedling threshold calculation module is used to obtain the missing seedling spacing threshold of the seedling column based on the missing seedling spacing threshold coefficient and the adjacent spacing; The missing seedling marking module is used to obtain the number and location of missing seedlings in the seedling column based on the adjacent spacing and the missing seedling spacing threshold.

9. An electronic device, characterized in that, include: Memory, used to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements the seedling defect detection method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the seedling missing detection method as described in any one of claims 1-7.