Transplanting position quality evaluation method based on image analysis and geometric modeling

Through the method based on image analysis and geometric modeling, using technologies such as contrast learning and Delaunay triangulation, high-precision evaluation of rice transplanting locations and accurate identification of seedlings are achieved, which solves the problems of low accuracy of transplanting locations and single evaluation indicators in the existing technology, and provides a detailed evaluation report supporting precise agricultural management.

CN120107799APending Publication Date: 2025-06-06HARBIN INST OF TECH

Patent Information

Application Number
CN202510262343.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing drone remote sensing images have low accuracy in estimating the rice transplanting position, single evaluation indicators, and lack spatial positioning capabilities.

Method used

The transplanting position quality evaluation method based on image analysis and geometric modeling is adopted. RGB image data is collected through drones, and the encoder is pre-trained by a comparison learning strategy to train the target detection model of rice seedlings in farmland. Combined with Delaunay triangulation and adaptive local expected plant distance, seedling positioning, seedling shortage detection, quantity statistics and plant distance assessment are realized, and EXIF ​​information is used for geolocation.

Benefits of technology

It improves the accuracy and comprehensiveness of the quality evaluation of transplanting, realizes high-precision detection and positioning of seedlings, accurately identify and locate seedlings, provides a detailed quality evaluation report for transplanting, and supports precise agricultural management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107799A_ABST
    Figure CN120107799A_ABST
Patent Text Reader

Abstract

The invention relates to a transplanting position quality evaluation method based on image analysis and geometric modeling, in particular to a transplanting position quality evaluation method based on image analysis and geometric modeling. The invention aims to solve the problems of low precision, single evaluation index and lack of space positioning capability of the existing unmanned aerial vehicle remote sensing image rice transplanting position estimation. The method comprises the steps that S1, an unmanned aerial vehicle collects an RGB image data set of unmarked farmland seedling positions; s2, obtaining an RGB image data set marked with farmland seedling positions; s3, obtaining a pre-trained encoder; s4, obtaining a trained farmland rice seedling target detection model; s5, inputting to-be-detected RGB image data into the trained farmland rice seedling target detection model, and outputting farmland seedling positions in the to-be-detected RGB image data; s6, obtaining the transplanting spacing, judging whether seedlings are missing or not, and if not, ending; if not, estimating a seedling missing position; s7, the seedling missing position in the step S6 is converted into a geographic coordinate system. The method is used in the field of transplanting position estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a rice transplanting position quality assessment method based on image analysis and geometric modeling. Background Art

[0002] With the rapid development of smart agriculture, the demand for refined and intelligent farmland management continues to increase. As an important part of food production, the quality of rice transplanting has an important impact on the overall growth of crops and the final yield. However, in actual agricultural production, transplanting operations are often restricted by factors such as uneven terrain, insufficient mechanical precision, and human operation errors, resulting in uneven distribution of seedlings, bending and disorder of seedling rows, and missing seedlings during transplanting. Automated and refined monitoring of seedling distribution in the field is one of the important needs of precision agriculture.

[0003] Unmanned aerial vehicle remote sensing technology has gradually become a mainstream tool for farmland operation monitoring due to its wide coverage, high collection efficiency and non-contact monitoring. Equipped with high-resolution optical sensors, drones can quickly obtain image data of large areas of farmland, providing the possibility of monitoring crop growth conditions. However, how to accurately extract transplanting quality information from complex field environments still faces many technical challenges: First, in field images, rice seedlings are often mixed with background elements such as weeds, mud and water, which makes traditional threshold-based or rule-based image processing methods insufficient in recognition accuracy and robustness; second, existing technologies mainly focus on a single seedling detection function, and lack systematic solutions for deeper transplanting quality indicators such as missing seedling identification and plant spacing rationality analysis; in addition, in order to achieve accurate management of field operations, an effective solution is still needed to align image data with geographic coordinates to mark the spatial distribution of missing seedling areas. The target detection network based on deep learning has achieved excellent performance in general target detection, but when faced with complex backgrounds such as seedlings, weeds, mud and water in farmland, traditional target detection networks are often easily disturbed by sparsity and overlapping plants. In order to further improve the detection accuracy and robustness, it is necessary to design a pre-training strategy for the characteristics of rice seedlings in farmland. At the same time, when evaluating the quality of rice transplanting, not only accurate target detection results are required, but also the rationality of the seedling spacing and the precise positioning of the missing seedlings are automatically identified, so as to carry out timely seedling replacement operations and overall management. In addition, if the EXIF ​​metadata of drone images can be fully utilized to realize the geographic coordinate mapping of missing seedlings and problem areas, agricultural managers can intervene faster and more accurately. Summary of the invention

[0004] The purpose of the present invention is to solve the problems of low estimation accuracy of rice transplanting position in existing UAV remote sensing images, single evaluation index and lack of spatial positioning ability, and to propose a transplanting position quality assessment method based on image analysis and geometric modeling.

[0005] A method for evaluating the quality of transplanting position based on image analysis and geometric modeling. The specific process is as follows:

[0006] Step S1, the drone collects an RGB image dataset of unlabeled positions of farmland seedlings;

[0007] Step S2, preprocessing the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1, and labeling the preprocessed RGB image data of the unmarked positions of the farmland seedlings to obtain an RGB image data set of the marked positions of the farmland seedlings;

[0008] Step S3, based on the data set of RGB images of the unlabeled positions of the farmland seedlings collected by the drone in step S1, using contrastive learning to perform self-supervised pre-training on the encoder to obtain a pre-trained encoder;

[0009] Step S4, based on the RGB image data set with marked farmland rice seedling positions obtained in step S2 and the pre-trained encoder, training a farmland rice seedling target detection model to obtain a trained farmland rice seedling target detection model;

[0010] Step S5, inputting the RGB image data to be tested into the trained farmland rice seedling target detection model, and the trained farmland rice seedling target detection model outputs the farmland rice seedling position in the RGB image data to be tested;

[0011] Step S6, based on the farmland rice seedling position information in the RGB image data to be tested output by the farmland rice seedling target detection model trained in step S5, obtain the planting distance, and judge whether there is a lack of seedlings based on the planting distance. If there is no lack of seedlings, end; if there is a lack of seedlings, estimate the missing seedling position;

[0012] Step S7, based on the attitude information and GPS information of the drone during flight recorded in step S1, convert the missing seedling position estimated in step S6 into a geographic coordinate system;

[0013] Attitude information includes the roll, pitch, and yaw angles of the drone;

[0014] The GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining the GPS information.

[0015] The beneficial effects of the present invention are:

[0016] In view of the inherent limitations of current rice transplanting quality assessment technology in terms of accuracy, functional integration and automation level, the present invention is committed to breaking through the existing bottlenecks and building a set of efficient, accurate and intelligent rice transplanting quality assessment system, thereby providing a solid technical guarantee for improving agricultural production efficiency and resource utilization. The core goal of the present invention is to design and implement a comprehensive solution that integrates multiple key functions such as precise positioning of seedlings, intelligent identification and inference of missing seedlings, precise statistics of seedling numbers, scientific assessment of plant spacing rationality, and geographic spatial visualization of assessment results.

[0017] First of all, the technical problem that the present invention primarily solves is how to achieve high-precision and high-robustness detection and positioning of rice seedlings in a complex and changeable farmland environment. Factors such as weeds, soil texture, water surface reflection and light changes in the farmland environment lead to large differences in the apparent characteristics of rice seedlings in the image, resulting in a decrease in the accuracy of traditional detection algorithms and missed detection and false detection. The differences in rice seedling morphology at different growth stages and shooting angles also increase the difficulty of detection. Traditional detection methods rely on a large number of accurately labeled samples for training. However, in the case of limited labeled data, how to improve the model's adaptability to complex environmental factors and obtain high-precision and high-robustness rice seedling detection results is the basis and key to achieving subsequent high-quality evaluation. Therefore, the present invention focuses on how to improve the generalization ability and robustness of the rice seedling detection model in the absence of large-scale annotations. The core is to use a contrastive learning strategy to pre-train the encoder on large-scale unlabeled farmland image data, so that it learns feature expressions that are invariant to various environmental interference factors. Subsequently, the pre-trained encoder is migrated to the target detection model for fine-tuning, which can significantly improve the detection accuracy and generalization ability of the model under limited labeled data. This reduces the reliance on labeled data and improves detection performance in complex farmland scenarios.

[0018] Secondly, the present invention focuses on solving the problem of accurate identification and positioning of missing seedlings. It is difficult to accurately determine whether there is a missing seedling phenomenon and its specific location by relying solely on the detection of existing seedlings. The present invention innovatively introduces the Delaunay triangulation method, and constructs the spatial neighborhood relationship between seedlings based on the detected seedling distribution, and then infers the possible missing seedling area. Especially in the case of uneven local planting density, how to avoid misjudging the normal gaps in densely planted areas as missing seedlings, and how to accurately infer the potential missing seedling positions in sparsely planted areas are key technical problems that the present invention needs to solve. The present invention adaptively estimates the local expected plant spacing, and combines the geometric characteristics of Delaunay triangulation to identify missing seedlings. It can more accurately judge the missing seedling situation and accurately locate the missing seedling position, providing accurate spatial information for subsequent seedling replenishment operations.

[0019] In addition, the present invention is committed to achieving accurate statistics on the number of seedlings and scientific evaluation of the rationality of the spacing between plants. On the basis of precise detection and inference of seedling shortage, the present invention needs to be able to accurately count the total number of seedlings in the field and quantitatively analyze the spacing between each seedling and its neighborhood. Judging whether the spacing between plants is reasonable is crucial to evaluating the quality of transplanting operations. However, in the actual transplanting process, the spacing between plants is not completely uniform and there is a certain local variability. How to deal with the local variability of the spacing between plants in the field and set reasonable evaluation criteria are key technical issues that need to be solved in the present invention. By combining Delaunay triangulation to construct neighborhood relationships and adaptive local expected spacing estimation, the present invention can more accurately evaluate the rationality of the spacing between seedlings, overcome the deviation caused by the global unified spacing threshold, and provide more refined data support for optimizing planting density.

[0020] Compared with the existing rice transplanting quality evaluation method, the present invention is improved mainly in three aspects: comprehensiveness, professionalism and potential real-time performance.

[0021] From a comprehensive perspective, the present invention aims to build an integrated platform that integrates multiple evaluation functions, avoiding the limitations of single-function evaluation in traditional methods and enabling a more comprehensive and systematic evaluation of transplanting quality. This multifunctional integration not only improves evaluation efficiency, but also provides users with richer analysis dimensions and decision support information.

[0022] From a professional perspective, the present invention achieves in-depth analysis of rice transplanting quality through sophisticated strategies and scheme designs. For example, the application of comparative learning strategy improves the robustness of feature extraction of the model in complex environments, laying the foundation for subsequent high-precision seedling detection; the use of Delaunay triangulation and local expected plant spacing provides an effective solution for evaluating the rationality of seedling spacing in terms of spatial geometric modeling; and the geographic positioning based on the EXIF ​​information of drone images provides the necessary geographic spatial information for subsequent precision agricultural operations.

[0023] From the perspective of potential real-time performance, the algorithm framework designed by the present invention not only ensures accuracy, but also focuses on improving computational efficiency. For example, the backbone network of YOLOv11 is selected as the encoder, and efficient modules such as SPPF and C2PSA are used to help accelerate feature extraction and processing. Combined with the efficient data collection capabilities of the drone platform, the method of the present invention has potential real-time or near real-time evaluation capabilities, which can provide timely feedback information for agricultural producers to quickly adjust production strategies.

[0024] In summary, the present invention aims to break through the bottleneck of existing rice transplanting quality assessment technology and provide a high-precision, intelligent, and multifunctional comprehensive solution. By solving key technical problems such as robust detection and precise positioning of seedlings in complex environments (especially focusing on using contrastive learning to alleviate model generalization problems), precise identification and position inference of missing seedlings, rational evaluation of seedling quantity and spacing, and visual output based on geographic coordinates, the present invention is expected to provide strong technical support for the realization of large-scale intelligent precision agriculture, and help improve rice production efficiency and management level.

[0025] The present invention proposes a rice transplanting quality assessment method based on image analysis and geometric modeling. The method combines the target detection capability of deep learning with geometric modeling technology to achieve the integration of multiple functions such as seedling positioning, seedling missing detection, seedling number statistics, and plant spacing rationality analysis. In a complex field environment, the present invention can make full use of the geometric features and posture information of drone images, perform spatial alignment of the detection results, and complete the geographic positioning and visual annotation of the seedling missing area.

[0026] The present invention proposes a rice transplanting quality assessment method based on image analysis and geometric modeling. The method uses a contrastive learning strategy to improve the robustness of the seedling feature representation, and combines geometric modeling to achieve accurate assessment of the transplanting quality. Compared with traditional manual assessment methods, the present invention has achieved significant improvements in efficiency, objectivity and accuracy, and effectively reduced labor intensity and human errors.

[0027] The present invention effectively utilizes a large amount of unlabeled farmland image data through comparative learning, and pre-trains an encoder with stronger generalization ability. The encoder can effectively overcome the interference caused by factors such as complex farmland background, illumination changes, and differences in seedling growth stages, and can extract robust seedling features even under different viewing angles, illumination conditions, and imaging quality. The pre-trained encoder is applied to the training of the subsequent seedling target detection model, which significantly improves the model's ability to accurately identify and locate seedlings, and lays a solid foundation for subsequent quality analysis. Compared with directly training the target detection model on a small amount of labeled data, the method of the present invention can more effectively utilize the rich information contained in the unlabeled data and improve the detection performance of the model in a complex environment. In addition, the geometric modeling method based on Delaunay triangulation combined with adaptive local expected plant spacing proposed in the present invention can accurately identify the seedling-missing area and accurately locate the seedling-missing position. Even in the case of uneven local planting density (such as densely planted or sparsely planted areas), the method can still provide a reliable basis for judging the lack of seedlings, avoiding the misjudgment caused by improper global threshold setting in traditional methods. The present invention can also accurately count the number of seedlings in the field, and by quantitatively analyzing the deviation between the actual spacing and the local expected spacing, scientifically evaluate the rationality of the spacing between seedlings, and provide objective data support for optimizing the planting density. This spacing evaluation method based on local neighborhood relationships can more accurately reflect the actual planting quality and overcome the limitations of traditional methods that only consider the global average spacing. The present invention further utilizes the EXIF ​​information of drone images to accurately map the evaluation results to the geographic coordinate system to achieve geographic positioning of areas with missing seedlings and abnormal spacing. This function greatly facilitates subsequent precise seedling replenishment and field management operations, allowing agricultural producers to quickly locate problem areas and take corresponding measures, thereby improving management efficiency.

[0028] In summary, the present invention provides an automated, high-precision, and multifunctional rice transplanting quality assessment solution, which provides strong technical support for realizing intelligent and refined agricultural production management. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0030] Specific implementation method 1: This implementation method is a method for evaluating the quality of transplanting position based on image analysis and geometric modeling. The specific process is as follows:

[0031] A rice transplanting quality assessment method based on image analysis and geometric modeling. The overall steps of the method are shown in the figure below. Figure 1 As shown (divided into training phase and inference phase), it includes the following steps:

[0032] Step S1, the drone collects an RGB image dataset of unlabeled positions of farmland seedlings;

[0033] Step S2, preprocessing the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1, and labeling the preprocessed RGB image data of the unmarked positions of the farmland seedlings to obtain an RGB image data set of the marked positions of the farmland seedlings;

[0034] Step S3, based on the data set of RGB images of the unlabeled positions of the farmland seedlings collected by the drone in step S1, using contrastive learning to perform self-supervised pre-training on the encoder to obtain a pre-trained encoder;

[0035] Step S4, based on the RGB image data set with marked farmland rice seedling positions obtained in step S2 and the pre-trained encoder, training a farmland rice seedling target detection model to obtain a trained farmland rice seedling target detection model;

[0036] Step S5, inputting the RGB image data to be tested into the trained farmland rice seedling target detection model, and the trained farmland rice seedling target detection model outputs the farmland rice seedling position in the RGB image data to be tested;

[0037] Step S6, based on the farmland rice seedling position information in the RGB image data to be tested output by the farmland rice seedling target detection model trained in step S5, obtain the planting distance, and judge whether there is a lack of seedlings based on the planting distance. If there is no lack of seedlings, end; if there is a lack of seedlings, estimate the missing seedling position;

[0038] Step S7, based on the attitude information, GPS information, and camera parameters of the drone during flight recorded in step S1, convert the missing seedling position estimated in step S6 into a geographic coordinate system;

[0039] Attitude information includes the roll, pitch, and yaw angles of the drone;

[0040] The GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining the GPS information.

[0041] Specific implementation method 2: This implementation method is different from the specific implementation method 1 in that in step S1, the drone collects an RGB image data set without marking the positions of the farmland seedlings; and comprises the following steps:

[0042] Choose a multi-rotor drone, which has a positioning system RTK or PPK;

[0043] The multi-rotor drone is equipped with an RGB camera;

[0044] Set the flight altitude of the multirotor drone equipped with an RGB camera;

[0045] Set the heading overlap rate and sideways overlap rate of the multirotor drone equipped with RGB cameras;

[0046] Choose a multi-rotor drone with a high-precision positioning system (such as RTK or PPK) and stable flight performance to ensure the spatial accuracy and clarity of the image.

[0047] Equipped with an RGB camera with high resolution and good color reproduction capabilities, it ensures that the detailed features of the seedlings can be clearly captured. According to the camera's field of view and target accuracy requirements, set a suitable flight altitude, flying at an altitude of 10-30 meters above the ground to obtain centimeter-level ground resolution. At the same time, set a reasonable heading overlap rate and lateral overlap rate (not less than 80% and 60%) to ensure the quality of image stitching and the possibility of subsequent 3D reconstruction.

[0048] The key parameters of a camera include the size of the image sensor in the camera (internal photosensitive element), lens focal length, exposure time, ISO sensitivity, and aperture size;

[0049] Set the appropriate exposure time, ISO sensitivity and aperture size according to the lighting conditions to avoid overexposure or underexposure and ensure that the image has moderate brightness and clear details.

[0050] Fly along pre-planned routes to ensure coverage of the entire target area;

[0051] The RGB image dataset of the unlabeled positions of the seedlings in the farmland collected by drones;

[0052] The RGB image dataset of the unlabeled positions of the seedlings in the farmland collected by the drone is stored in lossless image formats such as RAW or TIFF, so as to retain the original information of the image and facilitate subsequent refined processing;

[0053] Keep the drone stable during flight, avoid shaking and tilting, and record the attitude information and GPS information during flight;

[0054] Attitude information includes the roll, pitch, and yaw angles of the drone;

[0055] The GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining the GPS information.

[0056] The other steps and parameters are the same as those in the first embodiment.

[0057] Specific implementation method three: This implementation method is different from specific implementation method one or two in that, in step S2, the RGB image data of the unlabeled farmland seedling position collected by the drone in step S1 is preprocessed, and the preprocessed RGB image data of the unlabeled farmland seedling position is labeled to obtain an RGB image data set of labeled farmland seedling position;

[0058] The specific process is:

[0059] S21, geometric correction and atmospheric correction are performed on the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1; the specific process is as follows:

[0060] (1) Perform geometric correction on the collected RGB images to eliminate the geometric deformation caused by sensor posture changes and lens distortion, and restore the true geometric shape of the image;

[0061] The geometric correction is implemented based on the camera calibration parameters and the UAV attitude data using the spatial resection method.

[0062] Perform atmospheric correction on the geometrically corrected RGB image to eliminate the influence of atmospheric absorption, scattering and other factors on the spectral information of the ground objects and obtain the real surface reflectance data; it is expressed as:

[0063]

[0064] Among them, L λ is the spectral radiance of the RGB image, in W / (m 2 ·sr·nm), W is watt (unit of power), m 2 is square meter (unit of area), sr is steradian (unit of solid angle), nm is nanometer (unit of wavelength), and · is the multiplication sign;

[0065] d is the distance between the sun and the earth, in astronomical units (AU), which is the standard unit for measuring the average distance between the sun and the earth in astronomy;

[0066] E sunλ is the average extraterrestrial irradiance of the sun in a given wavelength band, in W / (m 2 nm);

[0067] θ z is the solar zenith angle; ρ λ is the surface reflectivity;

[0068] S22. Mark the center point position of each seedling in the atmospherically corrected RGB image.

[0069] Use the image annotation tool to annotate the center point of each seedling in the atmospherically corrected RGB image.

[0070] The main target of the annotation is the center point position of a single seedling;

[0071] Use professional image annotation tools (LabelImg) for precise point annotation.

[0072] The other steps and parameters are the same as those in the first or second embodiment.

[0073] Specific implementation method 4: This implementation method is different from one of the specific implementation methods 1 to 3 in that, in S3, based on the dataset of unlabeled RGB images of farmland seedlings collected by the S1 drone, the encoder is self-supervised pre-trained using contrast learning to obtain a pre-trained encoder; it includes the following detailed steps:

[0074] S31, generate positive and negative sample pairs; the specific process is:

[0075] S311, randomly cropping a number of anchor image blocks from the dataset of unlabeled RGB images of farmland seedlings collected by the S1 drone, each anchor image block having the same size;

[0076] S312, performing data enhancement on each anchor image block to generate corresponding positive sample pairs; the specific process is as follows:

[0077] (1) Each anchor image block is randomly rotated (-10° to 10°), translated (±10% of the image size), scaled (0.8 to 1.2 times), and flipped (horizontally or vertically) to obtain each processed image block; simulating the morphology of rice seedlings under different viewing angles and shooting angles;

[0078] (2) Randomly adjust the brightness (±20%), randomly adjust the contrast (±20%), randomly adjust the saturation (±20%), and randomly adjust the hue (±10°) of each processed image block obtained in (1) to obtain each processed image block;

[0079] Simulate images under different lighting conditions and color deviations.

[0080] (3) adding different degrees of Gaussian noise, salt and pepper noise, and blur processing to each processed image block obtained in (2) to obtain each processed image block;

[0081] Simulates the image quality degradation that may occur during actual shooting.

[0082] (4) randomly adding weeds to each processed image block obtained in (3) to obtain each processed positive sample image block;

[0083] Each processed positive sample image block and the anchor image block randomly cropped by S311 generate a positive sample pair;

[0084] Improve the model's ability to resist weeds.

[0085] The present invention uses a series of random image transformations to simulate the variation of the same scene or the same rice seedling under different viewing angles, lighting conditions and imaging quality. Each anchor image block and its enhanced version constitute a positive sample pair.

[0086] S313, randomly selecting image blocks different from the anchor image blocks from the dataset of unlabeled RGB images of the seedling stage of farmland collected by the S1 drone to form negative sample image blocks, so as to ensure the irrelevance of the contents between the negative sample pairs;

[0087] The negative sample image block and the image block randomly cropped by S311 generate a negative sample pair;

[0088] By constructing a large number of positive and negative sample pairs, sufficient training data is provided for contrastive learning;

[0089] S32, select encoder; the specific process is:

[0090] Select the backbone network of YOLOv11 as the encoder;

[0091] The present invention selects the backbone network of YOLOv11 as the encoder for self-supervised pre-training. The backbone network of YOLOv11 is mainly composed of the input convolution layer, C3k2 module, SPPF module and C2PSA module, which has powerful feature extraction capabilities and efficient computing performance, and can effectively capture the detailed information and global context features in the image. The backbone network is separated from the complete YOLOv11 model, and the subsequent feature fusion network and prediction head are removed, and it is trained as an independent encoder;

[0092] S33, construct a contrast loss function; the specific process is:

[0093] The InfoNCE loss function is used as the contrast loss function;

[0094] The present invention adopts the InfoNCE loss function as the loss function of contrastive learning to maximize the consistency of feature representation between positive sample pairs and minimize the consistency of feature representation between negative sample pairs.

[0095] The InfoNCE loss function is defined as follows:

[0096]

[0097] in,

[0098] L i represents the InfoNCE loss function of the anchor image block i;

[0099] q i Represents the query vector output by the encoder after the anchor image block i is input into the encoder;

[0100] k + It means that the positive sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector;

[0101] k j It means that the negative sample corresponding to the anchor image block i is input into the encoder, and the key vector output by the encoder;

[0102] Represents vector dot product;

[0103] τ is the temperature coefficient, which is used to adjust the discrimination between different sample pairs and control the degree of separation between positive and negative sample pairs in the feature space;

[0104] j represents a negative sample;

[0105] N i It represents the total number of anchor image patches randomly cropped from the dataset of large-scale unlabeled farmland RGB images collected by drones;

[0106] S34, performing self-supervised pre-training based on the positive and negative sample pairs, the selected encoder, and the constructed contrast loss function to obtain a pre-trained encoder;

[0107] The specific process is:

[0108] The anchor image patch i is input into the encoder, and the encoder outputs the query vector q i ;

[0109] The positive sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector k + ;

[0110] The negative sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector k j ;

[0111] Based on the query vector q i , key vector k + , key vector k j Calculate InfoNCE loss;

[0112] Use the Adam optimizer to update the encoder parameters to minimize the contrast loss function;

[0113] Until the contrast loss function converges, a pre-trained encoder is obtained, which is used to initialize the backbone network of the downstream target detection model to achieve knowledge transfer.

[0114] By pre-training on large-scale unlabeled farmland image data, the encoder can learn more robust and discriminative feature representations for rice seedlings, improving its ability to adapt to various morphologies, scales, and lighting changes of seedlings.

[0115] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0116] Specific implementation mode 5: This implementation mode is different from any one of specific implementation modes 1 to 4 in that, in said S4, a farmland rice seedling target detection model is trained based on the farmland rice seedling stage RGB image dataset annotated in S2 and a pre-trained encoder to obtain a trained farmland rice seedling target detection model;

[0117] The specific process is:

[0118] S41. Build a model for detecting rice seedlings in farmland:

[0119] The target detection model for rice seedlings in farmland is the YOLOv11 model, which consists of three parts: backbone network, feature fusion network, and prediction head;

[0120] The backbone network is responsible for extracting features from the input image. The feature fusion network is used to further process the features extracted by the backbone network. The prediction head is the output part of YOLOv11 and is responsible for classification and positioning from the fused features.

[0121] S42, transferring the weights of the pre-trained encoder to the backbone network of the farmland rice seedling target detection model (YOLOv11 model);

[0122] The encoder weights obtained through large-scale unlabeled data self-supervised pre-training in step S3 are used as the weights for initializing the backbone network of the YOLOv11 target detection model. After knowledge transfer, the rich information contained in the unlabeled data can be fully utilized, so that the model has a strong feature extraction capability at the beginning of training, which accelerates the convergence process of the model and significantly improves the detection performance and generalization ability of the model under limited labeled data. After migrating the weights, freeze some shallow layers of the backbone network to prevent the destruction of the general features learned in pre-training at the beginning of training, and then gradually unfreeze all network layers in subsequent training for end-to-end fine-tuning optimization;

[0123] S43. Construct the loss function of the farmland rice seedling target detection model:

[0124] The improved Smooth L1 loss function was used to optimize the regression of the center coordinates of the seedlings and the number of seedlings, and the cross entropy loss function was used to optimize the prediction of confidence.

[0125] The loss function is as follows:

[0126]

[0127] In the formula,

[0128] represents the smooth L1 loss function;

[0129] represents the smooth L1 loss function;

[0130] is the center coordinate of the i-th rice seedling predicted by the farmland rice seedling target detection model;

[0131] is the true value of the center coordinate of the i-th seedling;

[0132] N gt represents the total number of real rice seedlings in the RGB image dataset in which the positions of the rice seedlings in the farmland are marked in step S2;

[0133] is the cross entropy loss;

[0134] is a binary label indicating whether there is a rice seedling in the jth grid cell. is 1, otherwise it is 0;

[0135] is the confidence of the existence of rice seedlings in the jth grid cell predicted by the farmland rice seedling target detection model;

[0136] H and W represent the height and width of the feature map, respectively;

[0137] The process of obtaining grid unit j is:

[0138] Set the height and width of one grid unit, and divide the RGB image data set for marking the positions of the farmland seedlings in step S2 into ζ grid units according to the size of one grid unit, where j = 1, 2, ..., ζ;

[0139] S44, optimizer selection and parameter setting;

[0140] The specific process is:

[0141] Adam is selected as the optimizer for the farmland rice seedling target detection model;

[0142] The cosine annealing learning rate decay strategy is adopted. A higher learning rate is used to accelerate convergence in the early stage of training, and the learning rate is reduced in the later stage to improve accuracy.

[0143] Use early stopping method to prevent overfitting of rice seedling target detection model in farmland;

[0144] S45, using the RGB image data set in S2 that marks the positions of the farmland rice seedlings as a training set, training the farmland rice seedling target detection model, and obtaining a trained farmland rice seedling target detection model;

[0145] The specific process is:

[0146] (1) The RGB image dataset of the positions of rice seedlings in the farmland marked by S2 is used as the training set;

[0147] (2) Inputting the training set into the farmland rice seedling target detection model, the farmland rice seedling target detection model outputs the predicted farmland rice seedling position result, and calculating the loss function according to the predicted farmland rice seedling position result;

[0148] The back propagation algorithm is used to calculate the gradient, and the optimizer is used to update the parameters of the farmland rice seedling target detection model until the loss function converges to obtain a trained farmland rice seedling target detection model.

[0149] Evaluate the model performance on the validation set and save the model parameters with the best performance.

[0150] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0151] Specific implementation method six: This implementation method is different from any one of specific implementation methods one to five in that, in said S6, the rice seedling position information in the RGB image data to be tested outputted by the rice seedling target detection model trained in step S5 is used to obtain the rice seedling spacing, and whether the rice seedling spacing is reasonable is judged, and if it is reasonable, the process ends; if it is unreasonable, the missing seedling position is estimated;

[0152] The specific process is:

[0153] Step S61: Obtain the seedling p based on the Delaunay triangulation method i The neighbor set N i ; The specific process is:

[0154] Step S611, Step S5 The farmland rice seedling position coordinate point set in the RGB image data to be tested output by the trained farmland rice seedling target detection model is

[0155] Among them, p i represents the i-th seedling, p i The coordinates (x i ,y i ), p i ∈R 2 , R represents a real number set, and N represents the total number of seedlings in the RGB image data to be tested;

[0156] The coordinate point set of the farmland seedling position Perform Delaunay triangulation to obtain a set of triangular meshes

[0157] Among them, T k =(v k1 ,v k2 ,v k3 ) represents the kth triangle mesh, (v k1 ,v k2 ,v k3 ) represents the kth triangle mesh T k The three vertex coordinates of the triangle mesh T k The three vertex positions of N are determined based on the rice seedling point information in the point set P; T Represents the number of triangles in a set of triangular meshes;

[0158] Step S612: In order to further optimize the modeling of neighborhood relations, the edges of the Delaunay triangulation are considered;

[0159] For each edge e of the triangle mesh ij , if edge e ij Connected to the i-th seedling p i and the jth seedling p j , and the edge e ij If the i-th seedling p is not “divided” by any other seedling point, then the i-th seedling p i and the jth seedling p j are neighbors; the i-th seedling p i The neighbor set of i ={p j |(p i ,p j )},(p i ,p j ) is an edge of a triangle mesh;

[0160] Otherwise, the i-th seedling p is considered i and the jth seedling p j They are not neighbors to each other;

[0161] Step S62: Using neighbor set N i , calculate the number of seedlings p i The planting distance between each adjacent seedling is used to obtain the local expected average spacing based on the planting distance. The specific process is as follows:

[0162] Step S621: Using neighbor set N i , calculate the number of seedlings p i The spacing between each adjacent seedling is d ij :

[0163]

[0164] Among them, (x i ,y i ) represents the i-th seedling p i The coordinates of (x j ,y j ) represents the jth seedling p j The coordinates of

[0165] p j Representative and seedlings i Adjacent seedlings, i.e. p j Belong to p i The neighbor set N i ;

[0166] Step S622: To improve robustness, use the median as the local expected plant spacing average value. Because it is insensitive to outliers:

[0167]

[0168] in, represents the i-th seedling p i The average value of the local expected plant spacing;

[0169] S63, based on the average planting distance and local expected plant spacing Determine whether the spacing is reasonable, and if so, end the process; if not, proceed to step S64;

[0170] The specific process is:

[0171] Considering the allowable error range in the planting process, the following conditions are defined to determine whether the spacing deviates significantly from the expectation:

[0172] If formula (6) is not satisfied, then the i-th seedling p i and the jth seedling p j The spacing between them is reasonable;

[0173] If equation (6) is satisfied, then the i-th seedling p i and the jth seedling p j The spacing between them is unreasonable;

[0174]

[0175] in,

[0176] d ij represents the i-th seedling p i With the jth adjacent seedling p j The spacing between transplanting rice seedlings;

[0177] represents the i-th seedling p i The average value of the local expected plant spacing;

[0178] represents the jth seedling p j The average value of the local expected plant spacing,

[0179] θ spacing represents a positive threshold set according to the expected row spacing and plant spacing error tolerance, θ spacing The value is 2, and the specific value may depend on the actual planting standard and tolerance range.

[0180] Step S64, estimating the missing seedling position based on the average value of the local expected plant spacing; the specific process is:

[0181] Each triangle T after Delaunay triangulation k The seedlings corresponding to the three vertices are the ath seedling p a , the bth seedling p b , the cth seedling p c ;

[0182] First calculate the lengths of the three sides of the triangle:

[0183] l ab =‖p a -p b || 2 (7)

[0184] l bc =‖p b -p c || 2 (8)

[0185] l ca =‖p c -p a || 2 (9)

[0186] Among them, l ab For vertex p a and p b The length of the side that makes up the edge; l bc For vertex p b and p c The length of the side that makes up the edge; l ca For vertex p c and p a The length of the sides that make up the edge; |||| 2 is the two-norm;

[0187] If the length of a side of the triangle is much larger than the sum of the local expected spacing between the seedlings at its two endpoints, it is considered that there may be a missing seedling between the two seedlings connected by the side.

[0188] If the following formula is not satisfied, there is no missing seedling between the two seedlings connected by the longest side;

[0189] If the following formula is satisfied, there may be a missing seedling between the two seedlings connected by the longest side, and the weighted average method based on the local expected plant spacing is used to estimate the missing seedling position p missing ;

[0190]

[0191] in, Indicates seedlings a The local expected plant spacing average, Indicates seedlings b The local expected plant spacing average, Indicates seedlings c The local expected plant spacing average value; θ missing_edge Indicates the set threshold value, the value is 1.8;

[0192] The weighted average method based on the local expected plant spacing is used to estimate the missing seedling position p missing ; expressed as:

[0193]

[0194] Among them, (x a ,y a ) represents the coordinates of the ath seedling, (x b ,y b ) represents the coordinates of the bth seedling;

[0195] The advantage of using the weighted average of the local expected plant spacing to estimate the missing seedling location is that it takes into account the non-uniformity of the local distribution of seedlings. If some areas of the field are densely planted and some are sparsely planted (for example, due to local unevenness caused by terrain, soil quality, and transplanting methods), the weighted average can better reflect the actual distribution of seedlings and place the missing seedling point in a place that is more consistent with the surrounding density. a Expected spacing around If it is smaller, it means that the area is planted more densely, and the location of missing seedlings is more likely to be close to p a ;vice versa.

[0196] S65. Generate a high-information seedling spacing quality evaluation diagram based on S63 and S64: visualize the evaluation results and generate a seedling spacing quality evaluation diagram containing rich information.

[0197] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.

[0198] Specific implementation method 7: This implementation method is different from any one of specific implementation methods 1 to 6 in that, in said S65, a high-information rice seedling spacing quality evaluation diagram is generated based on S63 and S64: the evaluation results are visualized to generate a rice seedling spacing quality evaluation diagram containing rich information;

[0199] The specific process is:

[0200] Normally spaced seedlings are marked with solid green dots;

[0201] The seedlings with unreasonable spacing are marked with yellow triangles;

[0202] The estimated missing seedling positions are marked with red crosses in the middle of the seedlings with unreasonable spacing.

[0203] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0204] Specific implementation eight: This implementation differs from any one of specific implementations one to seven in that, in step S7, based on the attitude information, GPS information, and camera parameters of the drone during flight recorded in step S1, the missing seedling position estimated in step S6 is converted into a geographic coordinate system;

[0205] Attitude information includes the roll, pitch, and yaw angles of the drone;

[0206] GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining GPS information;

[0207] The specific process is:

[0208] Step S71:

[0209] Extracting the attitude information, GPS information, and camera parameters of the drone during flight recorded in step S1;

[0210] GPS information includes the latitude, longitude, and altitude of the drone’s location when it was filmed;

[0211] Attitude information includes roll angle, pitch angle and yaw angle;

[0212] S72, establish the coordinates (u, v) in the image pixel coordinate system to the coordinates (X w ,Y w ,Z w )’s mapping relationship;

[0213] S73, the coordinates in the world coordinate system (X w ,Y w,0) is converted to the coordinates in the geographic coordinate system (Latitude, Longitude);

[0214] S74,

[0215] According to the coordinates (u, v) in the image pixel coordinate system established in S72 to the coordinates (X w ,Y w ,Z w ) and the missing seedling position p estimated by S6 missing Convert to the world coordinate system (X w ,Y w ,0);

[0216] According to S73, the coordinates (X w ,Y w ,0) is converted into the coordinates (Latitude, Longitude) in the geographic coordinate system to obtain the missing seedling position p missing Coordinates in geographic coordinate system.

[0217] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0218] Specific implementation method 9: This implementation method is different from any one of the specific implementation methods 1 to 8 in that the coordinates (u, v) in the image pixel coordinate system are converted to the coordinates (x, y) in the world coordinate system in S72. w ,Y w ,Z w )’s mapping relationship;

[0219] The specific process is:

[0220] Considering that the ground is relatively flat, it is assumed that the seedlings are located on the same plane (Z w =0 or a constant);

[0221] In the homogeneous image pixel coordinate system, a point on the image is represented by P img =[u,v,1] T , click P img The corresponding three-dimensional position in the homogeneous world coordinate system is represented by P world =[X w ,Y w ,Z w ,1] T (The homogeneous coordinate representation here is to facilitate the transformation and projection operations of three-dimensional space, adding a dimension 1, but it essentially still represents a three-dimensional point), connected by the following formula:

[0222]

[0223] Where s is a scale factor; the superscript T indicates transposition; K is the camera intrinsic matrix, [R|t] is the extrinsic matrix; R is the rotation matrix, t is the translation vector; u represents the horizontal coordinate in the image pixel coordinate system, v represents the vertical coordinate in the image pixel coordinate system, X w Indicates the X coordinate in the world coordinate system, Y w Indicates the Y coordinate in the world coordinate system, Z w Represents the Z coordinate in the world coordinate system;

[0224] Since the height of the drone is known and the ground height is assumed to be 0, the coordinates (X w ,Y w ,0).

[0225] The rotation matrix R is calculated from the roll angle φ, pitch angle ω and yaw angle κ of the drone.

[0226] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.

[0227] Specific implementation method 10: This implementation method is different from any one of the specific implementation methods 1 to 9 in that the coordinates (X) in the world coordinate system are converted into w ,Y w ,0) is converted to the coordinates in the geographic coordinate system (Latitude, Longitude);

[0228] The specific process is:

[0229] The geographic coordinates of the image center at the time of drone shooting are (Lat center ,Lon center )(known);

[0230] Among them, Lat drone is the latitude of the location when the drone took the photo, Lon drone The longitude of the location when the drone took the photo;

[0231] The seedling position in the world coordinate system (X w ,Y w ,0) in the local coordinate system. local ,Y local ) is expressed as:

[0232] X local =(X w -c x )×scale x (13)

[0233] Y local =(Y w -c y)×scale y (14)

[0234] in,

[0235] (c x ,c y ) are the coordinates of the center of the image in the world coordinate system (known);

[0236] scale x and scale y is the actual physical size represented by each pixel, which is calculated by the drone's altitude and camera parameters;

[0237] The coordinates in the local coordinate system (X local ,Y local ) is converted to the coordinates (Latitude, Longitude) in the geographic coordinate system through an affine transformation:

[0238]

[0239] Among them, a, b, c, and d represent coefficients; Latitude represents the latitude of the coordinate position in the geographic coordinate system, and Longitude represents the longitude of the coordinate position in the geographic coordinate system;

[0240] The least square method is used to solve the linear equation system (15) and obtain the optimal estimated values ​​of the coefficients a, b, c, and d.

[0241] The other steps and parameters are the same as those in Specific Embodiments 1 to 9.

[0242] Testing the rice seedling target detection model in farmland includes the following aspects:

[0243] (1) Use a test dataset that is independent of the training dataset to ensure the objectivity and reliability of the test results. The test dataset needs to cover images of rice seedlings in various scenes and conditions, such as different lighting, angles, and growth stages.

[0244] (2) Select appropriate model performance evaluation indicators to comprehensively evaluate the detection accuracy and positioning ability of the model. The evaluation indicators used for seedling density estimation include: precision, recall, F1-score, and mean average precision (mAP).

[0245] Use the test data set to test the trained model and calculate various performance evaluation indicators. Based on the test results, further optimize the model or adjust the training strategy.

[0246] Key points of the present invention

[0247] 1. Self-supervised pre-training scheme for rice seedling target detection. The present invention adopts a contrastive learning strategy and uses large-scale unlabeled farmland RGB image data to perform self-supervised pre-training on the encoder. By constructing positive and negative sample pairs and designing the InfoNCE loss function, the encoder can learn a feature representation that is more discriminative and robust for rice seedlings. Specifically, by applying a series of data enhancement strategies, such as geometric transformation, color perturbation, noise addition, and weed simulation, positive sample pairs of anchor image blocks are generated to simulate the variation of the same rice seedling under different viewing angles, lighting conditions, and imaging quality. This self-supervised pre-training method makes full use of the rich information contained in a large amount of unlabeled data, significantly improves the feature extraction ability and generalization performance of the encoder in the face of complex farmland environments (such as lighting changes, weed occlusion, viewing angle differences, etc.), and lays a solid foundation for subsequent accurate rice seedling target detection, rather than relying solely on training with labeled data. The key to the present invention lies in the important role played by the contrastive learning strategy in improving the robustness of the rice seedling detection model in dealing with complex and changeable farmland environments.

[0248] 2. Accurate identification and positioning of missing seedlings by combining Delaunay triangulation and adaptive local expected plant spacing. In response to the problem of missing seedling identification, the present invention proposes a neighborhood relationship modeling method based on Delaunay triangulation, and combines it with adaptive local expected plant spacing estimation to achieve accurate identification of missing seedling areas and precise positioning of missing seedling positions. Delaunay triangulation can effectively represent the true adjacency relationship between seedlings, while the introduction of adaptive local expected plant spacing can effectively deal with the situation of uneven local planting density, avoid misjudging normal gaps as missing seedlings, and accurately infer potential missing seedling positions.

[0249] 3. A seedling target detection model integrating a self-supervised pre-trained encoder and its application in the evaluation of the rationality of the number and spacing of seedlings. The present invention constructs a target detection model based on deep learning, which uses an encoder that has been pre-trained by contrastive learning self-supervision as the backbone network, thereby inheriting the powerful feature extraction ability of the pre-trained encoder. The model can accurately predict the center position of the seedlings and provide precise data support for subsequent seedling quantity statistics and spacing rationality evaluation. Based on the precise seedling positioning results, combined with the neighborhood relationship constructed by Delaunay triangulation and the adaptive local expected plant spacing, the present invention can quantitatively evaluate the rationality of the seedling spacing and identify abnormal spacing that significantly deviates from the expected value.

[0250] 4. Geographic positioning and visual output based on drone image EXIF ​​information. In order to achieve accurate spatial positioning and visual display of the evaluation results, the present invention uses the EXIF ​​metadata of drone images (such as GPS coordinates, attitude information, etc.) and combines the camera imaging model to establish a conversion relationship from image coordinates to geographic coordinates. This method can project the detected missing seedling positions and abnormal spacing areas to the geographic coordinate system, and generate a high-information seedling spacing quality evaluation map, providing intuitive and accurate guidance information for field workers.

[0251] In summary, the innovation of the present invention is mainly reflected in the design and application of the technical solution, especially in the use of contrastive learning strategies to improve the robustness of seedling detection in complex environments. First, the self-supervised pre-training method based on contrastive learning proposed in the present invention can effectively improve the detection accuracy and robustness of seedlings in complex environments, and overcome the limitations of traditional supervised learning methods. Secondly, combined with the Delaunay triangulation and adaptive local expected plant spacing methods, the precise identification and positioning of missing seedlings are achieved, effectively solving the problem of misjudgment of traditional methods under uneven planting density. In addition, the self-supervised pre-trained encoder is applied to the target detection model to improve the accuracy of seedling quantity statistics and spacing rationality assessment. Finally, the geo-positioning technology based on drone image EXIF ​​information realizes the geospatial visualization of the evaluation results. Combining the above innovations, the present invention can achieve accurate, comprehensive and reliable evaluation of rice transplanting quality, which has important application value for improving the level of agricultural production management.

[0252] Although the technical solution of the present invention can effectively achieve high-precision and robust transplanting quality assessment, there are some alternative solutions in certain specific application scenarios, such as when there are extreme restrictions on computing resources or the requirements for assessment accuracy can be appropriately reduced. However, these alternative solutions are usually insufficient in the robustness of seedling detection, especially in complex and changeable farmland environments, and it is difficult to achieve the technical effect of the present invention.

[0253] The core technical problem of the present invention is how to achieve high-precision and high-robust detection and positioning of rice seedlings in a complex and changeable farmland environment. The present invention effectively solves this problem by introducing a contrastive learning strategy in step S3 to perform self-supervised pre-training on the encoder. This strategy uses a large amount of unlabeled farmland image data to enable the encoder to learn a more discriminative and robust representation of rice seedling features, thereby significantly improving the generalization ability of the target detection model under different viewing angles, lighting conditions and imaging qualities.

[0254] If an alternative to step S3 is considered, one possible approach is not to use contrastive learning for self-supervised pre-training, but to directly rely on supervised learning methods to train a farmland rice seedling target detection model. However, the effectiveness of this scheme is heavily dependent on the quality and quantity of the labeled data. When the labeled data is limited, the model is prone to overfitting, resulting in a significant decrease in detection performance in complex farmland scenes that have never been seen. In addition, the labeling process itself is time-consuming and labor-intensive, and it is difficult to utilize the rich information contained in the massive amount of unlabeled farmland image data. In contrast, the contrastive learning method used in the present invention can make full use of a large amount of easily accessible unlabeled data to learn a more general feature representation, thereby improving the generalization ability and robustness of the model.

[0255] Another alternative is to use traditional image feature extraction methods, such as manually designed feature descriptors (such as SIFT, HOG, etc.) combined with machine learning classifiers for seedling detection. However, the features extracted by these traditional methods are sensitive to factors such as illumination changes, scale changes, and occlusion, and are difficult to adapt to the needs of seedling detection in complex farmland environments. Compared with deep learning methods, there is an essential gap in their feature expression capabilities, and it is difficult to capture the diverse characteristics of seedlings, resulting in detection accuracy and robustness that are difficult to meet the requirements of high-quality transplanting quality assessment.

[0256] In the link of missing seedling location and transplanting spacing quality assessment in step S6, although a simplified method based on point-by-point distance calculation can be considered, that is, calculating the nearest neighbor distance between each detected seedling point and other seedling points, and setting a fixed distance threshold to determine whether there are missing seedlings or spacing abnormalities. However, this method ignores the local differences in farmland planting. In the case of manual transplanting or uneven local planting density, it is easy to misjudge normal sparse areas as missing seedlings, or the assessment of spacing is not accurate enough. In contrast, the neighborhood relationship modeling method based on Delaunay triangulation and the adaptive local expected plant spacing estimation designed by the present invention can more accurately reflect the actual distribution of seedlings, and adaptively evaluate the missing seedlings and spacing quality according to the local density, with higher accuracy and reliability.

[0257] In summary, although there are some approaches that can replace some of the technical solutions of the present invention, these alternatives have obvious shortcomings in solving the core technical challenge of high-precision and high-robustness detection and positioning of seedlings in complex farmland environments. The self-supervised pre-training method based on contrastive learning adopted by the present invention can more effectively utilize unlabeled data to improve the generalization ability and robustness of the model, and is the key to achieving high-quality rice transplanting quality assessment. Other alternatives either rely on a large amount of labeled data, or have insufficient feature expression capabilities, or cannot adapt to the local differences in farmland planting, and it is difficult to achieve the technical effects and accuracy levels of the present invention.

[0258] What are the advantages of this invention compared with the closest prior art?

[0259] In view of the current rice transplanting quality assessment technology based on remote sensing images, the method based on image analysis and geometric modeling proposed in this invention has shown significant advantages in many aspects and effectively overcomes the limitations of the existing technology. The specific comparison is as follows:

[0260] 1. Significant improvement in the accuracy and robustness of rice seedling detection in complex environments: Existing rice transplanting quality assessment methods, some of which focus on simple target detection or traditional machine learning methods, have limited feature extraction capabilities and are difficult to effectively deal with factors such as illumination changes, shadow interference, weed occlusion, and differences in seedling growth stages in complex farmland environments, resulting in insufficient accuracy and robustness in seedling detection, and prone to missed detection and false detection. In contrast, the present invention innovatively uses a contrastive learning strategy to pre-train the encoder for self-supervision. The method uses a large amount of unlabeled farmland RGB image data to learn more robust and discriminative seedling feature representations by constructing positive and negative sample pairs. This pre-training method enables the encoder to capture more essential seedling features, significantly improving the adaptability and generalization performance of the target detection model in various complex environments. Thanks to the high-quality features extracted by the pre-trained encoder, the subsequent target detection model can more accurately identify and locate the seedlings, and can still maintain a high detection accuracy even under unfavorable conditions such as uneven illumination and weed interference, laying a more solid and reliable foundation for subsequent quality assessment. Compared with existing technologies that only rely on supervised learning or shallow feature extraction, the method of the present invention has significant advantages in detection performance in complex farmland scenes.

[0261] 2. Precision in identifying and locating missing seedlings: Some existing rice transplanting quality assessment methods mainly rely on simple density statistics, fixed threshold rule judgments, or analysis based on low-resolution remote sensing images in terms of missing seedling identification. It is difficult to accurately deal with situations where the seedlings are unevenly distributed and local planting density differences are large, and they can often only provide macroscopic estimates of the missing seedling area or quantity, and cannot accurately locate the specific location of the missing seedlings. The present invention innovatively introduces a neighborhood relationship modeling method based on Delaunay triangulation, and combines it with adaptive local expected plant spacing estimation. Delaunay triangulation can effectively capture the spatial proximity relationship between seedlings, while the adaptive local expected plant spacing takes into account the differences in local planting and can dynamically estimate the expected plant spacing based on the distribution of surrounding seedlings. Based on this, the present invention can accurately identify missing seedlings caused by missed planting or death, and can accurately locate the location of each missing seedling. Even in the case of local dense or sparse planting, it can still provide a reliable basis for judging missing seedlings and accurate location information. Compared with existing technologies that can only give macroscopic seedling shortage situations or rely on fixed threshold judgments but cannot accurately locate the location of each missing seedling, this has obvious advantages and can provide more effective guidance for precise seedling replenishment operations.

[0262] 3. Comprehensiveness and accuracy of evaluation indicators: Some existing technologies or methods may only provide evaluation indicators of a single dimension, such as seedling density and coverage, and cannot comprehensively and accurately reflect the quality of transplanting. For example, even if the seedling density meets the standard, uneven spacing between plants will seriously affect subsequent growth. The method proposed in the present invention can comprehensively evaluate the rationality of the number of seedlings and the spacing between plants. First, the number of seedlings is accurately counted through a high-precision target detection model; secondly, by using Delaunay triangulation and adaptive local expected spacing, the rationality of the spacing between adjacent seedlings can be quantitatively evaluated, and the spacing that is significantly deviated from the expected value can be identified. This comprehensive evaluation indicator can reflect the quality of transplanting more comprehensively and accurately, avoiding the one-sidedness that may be caused by a single indicator evaluation. Compared with the existing technology with a single evaluation indicator and limited accuracy, the present invention can provide more valuable and comprehensive reference information, and provide more reliable data support for refined management.

[0263] 4. Effective integration and application of geospatial information: Many existing rice transplanting quality assessment methods or systems lack effective integration with geospatial information, which makes it difficult to directly apply the assessment results to guide field management and precision operations. For example, even if missing seedlings are detected, it is difficult to quickly locate the specific location in the field. The present invention makes full use of the precise geographic coordinates and posture information contained in the EXIF ​​metadata of drone images, and establishes an accurate conversion relationship from image pixel coordinates to geographic coordinates. The method can accurately project each detected missing seedling position and unreasonable spacing of seedlings to the geographic coordinate system, and generate a high-information seedling spacing quality evaluation map with geographic coordinate information. These evaluation maps can provide intuitive and operational guidance information for precision agricultural operations such as precise seedling replacement and variable fertilization, greatly enhancing the application value of the assessment results. This is a significant advantage that many existing technologies are difficult to achieve due to the lack of effective geographic information fusion methods.

[0264] The present invention may also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for evaluating the quality of transplanting position based on image analysis and geometric modeling, characterized in that: The specific process of the method is: Step S1, the drone collects an RGB image dataset of unlabeled positions of farmland seedlings; Step S2, preprocessing the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1, and labeling the preprocessed RGB image data of the unmarked positions of the farmland seedlings to obtain an RGB image data set of the marked positions of the farmland seedlings; Step S3, based on the data set of RGB images of the unlabeled positions of the farmland seedlings collected by the drone in step S1, using contrastive learning to perform self-supervised pre-training on the encoder to obtain a pre-trained encoder; Step S4, based on the RGB image data set with marked farmland rice seedling positions obtained in step S2 and the pre-trained encoder, training a farmland rice seedling target detection model to obtain a trained farmland rice seedling target detection model; Step S5, inputting the RGB image data to be tested into the trained farmland rice seedling target detection model, and the trained farmland rice seedling target detection model outputs the farmland rice seedling position in the RGB image data to be tested; Step S6, based on the farmland rice seedling position information in the RGB image data to be tested output by the farmland rice seedling target detection model trained in step S5, obtain the planting distance, and judge whether there is a lack of seedlings based on the planting distance. If there is no lack of seedlings, end; if there is a lack of seedlings, estimate the missing seedling position; Step S7, based on the attitude information and GPS information of the drone during flight recorded in step S1, convert the missing seedling position estimated in step S6 into a geographic coordinate system; Attitude information includes the roll, pitch, and yaw angles of the drone; The GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining the GPS information.

2. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 1, characterized in that: In step S1, the drone collects an RGB image dataset without marking the positions of the seedlings in the farmland; the steps include: The drone is equipped with an RGB camera; Set the flight altitude of the drone equipped with an RGB camera; Flying on pre-planned routes; The RGB image dataset of the unlabeled positions of the seedlings in the farmland collected by drones; The RGB image dataset of unlabeled farmland seedling positions collected by UAVs is stored in RAW or TIFF lossless image format; Record attitude information and GPS information during flight; Attitude information includes the roll, pitch, and yaw angles of the drone; The GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining the GPS information.

3. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 2, characterized in that: In the step S2, the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1 is preprocessed, and the preprocessed RGB image data of the unmarked positions of the farmland seedlings are labeled to obtain an RGB image data set of marked positions of the farmland seedlings; the specific process is: S21, geometric correction and atmospheric correction are performed on the RGB image data of the unmarked positions of the farmland seedlings collected by the drone in step S1; the specific process is as follows: (1) Perform geometric correction on the collected RGB images; Perform atmospheric correction on the geometrically corrected RGB image to obtain the real surface reflectance data; it is expressed as: Where Lλ is the spectral radiance of the RGB image; d is the distance between the sun and the earth; E sunλ is the average extraterrestrial irradiance of the sun in a given band; θ z is the solar zenith angle; ρ λ is the surface reflectivity; S22. Mark the center point position of each seedling in the atmospherically corrected RGB image.

4. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 3, characterized in that: In S3, based on the dataset of unlabeled RGB images of farmland seedlings collected by the S1 drone, the encoder is self-supervised pre-trained using contrastive learning to obtain a pre-trained encoder; the following detailed steps are included: S31, generate positive and negative sample pairs; the specific process is: S311, randomly cropping anchor image blocks from the dataset of unlabeled RGB images of farmland seedlings collected by the S1 drone, each anchor image block has the same size; S312, performing data enhancement on each anchor image block to generate corresponding positive sample pairs; the specific process is as follows: (1) Randomly rotate, translate, scale, and flip each anchor image block in turn to obtain each processed image block; (2) For each processed image block obtained in (1), randomly adjust the brightness, randomly adjust the contrast, randomly adjust the saturation, and randomly adjust the hue in sequence to obtain each processed image block; (3) Adding Gaussian noise, salt and pepper noise, and blur processing to each processed image block obtained in (2) in turn to obtain each processed image block; (4) randomly adding weeds to each processed image block obtained in (3) to obtain each processed positive sample image block; Each processed positive sample image block and the anchor image block randomly cropped by S311 generate a positive sample pair; S313, randomly selecting image blocks different from the anchor image blocks from the dataset of unlabeled RGB images of the rice seedling stage of the farmland collected by the S1 drone to form negative sample image blocks, The negative sample image block and the image block randomly cropped by S311 generate a negative sample pair; S32, select encoder; the specific process is: Select the backbone network of YOLOv11 as the encoder; S33, construct a contrast loss function; the specific process is: The InfoNCE loss function is used as the contrast loss function; The InfoNCE loss function is defined as follows: in, L i represents the InfoNCE loss function of the anchor image block i; q i Represents the query vector output by the encoder after the anchor image block i is input into the encoder; k + It means that the positive sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector; k j It means that the negative sample corresponding to the anchor image block i is input into the encoder, and the key vector output by the encoder; Represents vector dot product; τ is the temperature coefficient; j represents a negative sample; N i It represents the total number of anchor image patches randomly cropped from the dataset of unlabeled farmland RGB images collected by UAV; S34, performing self-supervised pre-training based on the positive and negative sample pairs, the selected encoder, and the constructed contrast loss function to obtain a pre-trained encoder; the specific process is: The anchor image patch i is input into the encoder, and the encoder outputs the query vector q i ; The positive sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector k + ; The negative sample corresponding to the anchor image block i is input into the encoder, and the encoder outputs the key vector k j ; Based on the query vector q i , key vector k + , key vector k j Calculate InfoNCE loss; Use the Adam optimizer to update the encoder parameters to minimize the contrast loss function; Until the contrast loss function converges, the pre-trained encoder is obtained.

5. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 4, characterized in that: In the S4, based on the farmland rice seedling stage RGB image dataset annotated in S2 and the pre-trained encoder, a farmland rice seedling target detection model is trained to obtain a trained farmland rice seedling target detection model; The specific process is: S41. Build a model for detecting rice seedlings in farmland: The target detection model for rice seedlings in farmland is the YOLOv11 model; S42, transferring the weights of the pre-trained encoder to the backbone network of the farmland rice seedling target detection model; S43. Construct the loss function of the farmland rice seedling target detection model: The loss function is as follows: In the formula, represents the smooth L1 loss function; represents the smooth L1 loss function; is the center coordinate of the i-th rice seedling predicted by the farmland rice seedling target detection model; is the true value of the center coordinate of the i-th seedling; N gt represents the total number of real rice seedlings in the RGB image dataset in which the positions of the rice seedlings in the farmland are marked in step S2; is the cross entropy loss; is a binary label indicating whether there is a rice seedling in the jth grid cell. is 1, otherwise it is 0; is the confidence of the existence of rice seedlings in the jth grid cell predicted by the farmland rice seedling target detection model; H and W represent the height and width of the feature map, respectively; S44, optimizer selection; S45. Use the RGB image data set in which the positions of the farmland rice seedlings are marked in S2 as a training set to train a farmland rice seedling target detection model to obtain a trained farmland rice seedling target detection model.

6. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 5, characterized in that: In the step S6, the rice seedling position information in the RGB image data to be tested output by the rice seedling target detection model trained in the step S5 is used to obtain the rice seedling spacing, and whether the rice seedling spacing is reasonable is determined. If it is reasonable, the process ends; if it is unreasonable, the position of the missing rice seedlings is estimated; The specific process is: Step S61: Obtain the seedling p based on the Delaunay triangulation method i The neighbor set N i ; The specific process is: Step S611, Step S5 The farmland rice seedling position coordinate point set in the RGB image data to be tested output by the trained farmland rice seedling target detection model is Among them, p i represents the i-th seedling, p i The coordinates (x i ,y i ), p i ∈R 2 , R represents a real number set, and N represents the total number of seedlings in the RGB image data to be tested; The coordinate point set of the farmland seedling position Perform Delaunay triangulation to obtain a set of triangular meshes Among them, T k =(v k1 ,v k2 ,v k3 ) represents the kth triangle mesh, (v k1 ,v k2 ,v k3 ) represents the kth triangle mesh T k The three vertex coordinates of N T Represents the number of triangles in a set of triangular meshes; Step S612: for each edge e of the triangle mesh ij , if edge e ij Connected to the i-th seedling p i and the jth seedling p j , and the edge e ij If the i-th seedling p is not "divided" by any other seedling point, then it is considered that the i-th seedling p i and the jth seedling p j are neighbors; the i-th seedling p i The neighbor set of i ={p j |(p i ,p j )},(p i ,p j ) is an edge of a triangle mesh; Otherwise, the i-th seedling p is considered i and the jth seedling p j They are not neighbors to each other; Step S62: Using neighbor set N i , calculate the number of seedlings p i The planting distance between each adjacent seedling is used to obtain the local expected average spacing based on the planting distance. The specific process is as follows: Step S621: Using neighbor set N i , calculate the number of seedlings p i The spacing between each adjacent seedling is d ij : Among them, (x i ,y i ) represents the i-th seedling p i The coordinates of (x j ,y j ) represents the jth seedling p j The coordinates of p j Representative and seedlings i Adjacent seedlings, i.e. p j Belong to p i The neighbor set N i ; Step S622: Use the median as the local expected plant spacing average value in, represents the i-th seedling p i The average value of the local expected plant spacing; S63, based on the average planting distance and local expected plant spacing Determine whether the spacing is reasonable, and if so, end the process; if not, proceed to step S64; The specific process is: If formula (6) is not satisfied, then the i-th seedling p i and the jth seedling p j The spacing between them is reasonable; If equation (6) is satisfied, then the i-th seedling p i and the jth seedling p j The spacing between them is unreasonable; in, d ij represents the i-th seedling p i With the jth adjacent seedling p j The spacing between transplanting rice seedlings; represents the i-th seedling p i The average value of the local expected plant spacing; represents the jth seedling p j The average value of the local expected plant spacing, θ spacing Indicates the set positive threshold; Step S64, estimating the missing seedling position based on the average value of the local expected plant spacing; the specific process is: Each triangle T after Delaunay triangulation k The seedlings corresponding to the three vertices are the ath seedling p a , the bth seedling p b , the cth seedling p c ; First calculate the lengths of the three sides of the triangle: l ab =||p a -p b ||2 (7) l bc =||p b -p c ||2 (8) l ca =||p c -p a ||2 (9) Among them, l ab For vertex p a and p b The length of the side that makes up the edge; l bc For vertex p b and p c The length of the side that makes up the edge; l ca For vertex p c and p a The length of the side that makes up the edge; || ||2 is the two-norm; If the following formula is not satisfied, there is no missing seedling between the two seedlings connected by the longest side; If the following equation is satisfied, there may be a missing seedling between the two seedlings connected by the longest side, and the weighted average method based on the local expected plant spacing is used to estimate the missing seedling position p missing ; in, Indicates seedlings a The local expected plant spacing average, Indicates seedlings b The local expected plant spacing average, Indicates seedlings c The local expected plant spacing average value; θ missing_edge Indicates the set threshold; The weighted average method based on the local expected plant spacing is used to estimate the missing seedling position p missing ; expressed as: Among them, (x a ,y a ) represents the coordinates of the ath seedling, (x b ,y b ) represents the coordinates of the bth seedling; S65. Generate a seedling spacing quality evaluation diagram based on S63 and S64.

7. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 6, characterized in that: In S65, a rice seedling spacing quality evaluation diagram is generated based on S63 and S64; the specific process is as follows: Normally spaced seedlings are marked with solid green dots; The seedlings with unreasonable spacing are marked with yellow triangles; The estimated missing seedling positions are marked with red crosses in the middle of the seedlings with unreasonable spacing.

8. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 7, characterized in that: In the step S7, based on the attitude information and GPS information of the drone during flight recorded in step S1, the seedling shortage position estimated in step S6 is converted into a geographic coordinate system; Attitude information includes the roll, pitch, and yaw angles of the drone; GPS information includes the longitude, latitude, altitude of the drone, and the timestamp of obtaining GPS information; The specific process is: Step S71: Extracting the attitude information and GPS information of the UAV during flight recorded in step S1; GPS information includes the latitude, longitude, and altitude of the drone’s location when it was filmed; Attitude information includes roll angle, pitch angle and yaw angle; S72, establish the coordinates (u, v) in the image pixel coordinate system to the coordinates (X w ,Y w ,Z w )’s mapping relationship; S73, the coordinates in the world coordinate system (X w ,Y w ,0) is converted to the coordinates in the geographic coordinate system (Latitude, Longitude); S74, convert the coordinates (u, v) in the image pixel coordinate system established in S72 to the coordinates (X, V) in the world coordinate system. w ,Y w ,Z w ) and the missing seedling position p estimated by S6 missing Convert to the world coordinate system (X w ,Y w ,0); According to S73, the coordinates (X w ,Y w ,0) is converted into the coordinates (Latitude, Longitude) in the geographic coordinate system to obtain the missing seedling position p missing Coordinates in geographic coordinate system.

9. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 8, characterized in that: In step S72, the coordinates (u, v) in the image pixel coordinate system are converted to the coordinates (x, y) in the world coordinate system. w ,Y w ,Z w ) mapping relationship; the specific process is: Assume that the seedlings are located on the same plane; In the homogeneous image pixel coordinate system, a point on the image is represented by P img =[u,v,1] T , click P img The corresponding three-dimensional position in the homogeneous world coordinate system is represented by P world =[X w ,Y w ,Z w ,1] T ; The relationship is through the following formula: Where s is a scale factor; the superscript T indicates transposition; K is the camera intrinsic matrix, [R|t] is the extrinsic matrix; R is the rotation matrix, t is the translation vector; u represents the horizontal coordinate in the image pixel coordinate system, v represents the vertical coordinate in the image pixel coordinate system, X w Indicates the X coordinate in the world coordinate system, Y w Indicates the Y coordinate in the world coordinate system, Z w Represents the Z coordinate in the world coordinate system; Since the height of the drone is known and the ground height is assumed to be 0, the coordinates (X w ,Y w ,0).

10. The method for evaluating the quality of transplanting position based on image analysis and geometric modeling according to claim 9, characterized in that: In S73, the coordinates (X w ,Y w ,0) is converted to the coordinates in the geographic coordinate system (Latitude, Longitude); The specific process is: The geographic coordinates of the image center at the time of drone shooting are (Lat center ,Lon center ); Among them, Lat drone is the latitude of the location when the drone took the photo, Lon drone The longitude of the location when the drone took the photo; The seedling position in the world coordinate system (X w ,Y w ,0) in the local coordinate system. local ,Y local ) is expressed as: X local =(X w -c x )×scale x (13) Y local =(Y w -c y )×scale y (14) Among them, (c x ,c y ) is the coordinate of the center of the image in the world coordinate system; scale x and scale y is the actual physical size represented by each pixel; The coordinates in the local coordinate system (X local ,Y local ) is converted to the coordinates (Latitude, Longitude) in the geographic coordinate system through an affine transformation: in, a, b, c, d represent coefficients; Latitude represents the latitude of the coordinate position in the geographic coordinate system, and Longitude represents the longitude of the coordinate position in the geographic coordinate system; The least square method is used to solve the linear equation system (15) and obtain the optimal estimated values ​​of the coefficients a, b, c, and d.

Citation Information

Patent Citations

  • Seedling stage corn identification method based on unmanned aerial vehicle remote sensing image deep learning

    CN115578658A

  • Seedling missing detection method

    CN116584220A

  • Seedling missing identification method, device, equipment and medium

    CN117636314A

  • Corn seedling optimization method, medium and electronic device

    CN118863257A

  • Plant seedling stage seedling emergence quality evaluation method and device based on remote sensing image

    CN118865098A

Cited By

  • Method and system for testing seedling throwing effect of seedling throwing unmanned aerial vehicle based on image analysis

    CN120375244A

  • Image analysis-based testing method and system for rice seedling throwing effect of rice seedling throwing drone

    CN120375244B

  • Seedling dropping control method and control system of automatic vegetable transplanter

    CN120411914A

  • A seedling planting control method and control system for an automatic vegetable transplanter

    CN120411914B

  • Greenhouse environment yield and energy consumption joint simulation method based on hybrid model

    CN122390590A