Hole tray large seedling age grading detection method based on machine vision
By acquiring images of plug seedlings using machine vision, determining detection points, extracting morphological features, and establishing a correlation between growth differences and seedling age, the problem of low efficiency and insufficient accuracy in plug seedling grading is solved, and high-precision dynamic grading detection is achieved.
Patent Information
- Application Number
- CN202511946468.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2045-12-23
AI Technical Summary
Existing grading methods for plug seedlings are inefficient and inaccurate, especially in complex environments where it is difficult to distinguish specific growth defects such as weak stems or stunted growth, leading to reduced classification accuracy.
By using a multi-step machine vision-based method, images of plug seedlings are acquired, detection points are determined, morphological features of the target area are extracted, the correlation between growth differences and seedling age is established, and grading detection is performed in combination with morphological features to ensure that the grading results are consistent with the actual seedling age.
It enables dynamic grading and detection of seedlings of advanced age in plug trays, improving the accuracy and efficiency of grading, ensuring that the grading results are consistent with the actual growth status of the seedlings, avoiding problems such as unclear area segmentation edges and background interference, and enhancing the integrity and accuracy of the target area.
Smart Images

Figure CN121366360A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of crop seedling raising, in particular to a plug tray large seedling age grading detection method based on machine vision. BACKGROUND
[0002] Plug tray seedling raising is a common planting method. Due to the influence of factors such as seeds, soil substrates, and sowing, seedlings will exhibit different states. In order to ensure uniform management of large seedling seedlings after transplanting, it is necessary to grade and screen the seedlings. The current grading methods mainly have two kinds, one is a manual method, which is low in efficiency and high in labor intensity; the other is based on simple image processing, which lacks accuracy in the face of complex environments and is low in plug tray seedling grading efficiency.
[0003] For example, Chinese Patent Publication No. CN114998656A discloses a plug tray seedling classification method and system. The method includes acquiring plug tray images of plug tray seedlings at a fixed time period every day, and processing the plug tray images through an image processing method to establish a time series data set of the plug tray seedlings. A deep learning algorithm is used to train the time series data set to obtain growth information of the plug tray seedlings at the seedling stage, and a mapping relationship model between the growth information of the plug tray seedlings at the seedling stage and the good or bad labels of the plug tray seedlings is established. The mapping relationship model is used to classify the growth of the plug tray seedlings.
[0004] In the prior art, the growth process of the plug tray seedlings is explained by the extracted growth information through the visual time series of the images. However, the growth information is an abstract feature and cannot explain the specific growth defects of the bad seedlings, such as weak stems and growth stagnation, so that when the plug tray seedlings are divided, only the two-class division method of good seedlings or bad seedlings cannot adapt to the scene requirements of the plug tray seedlings, resulting in reduced classification accuracy. SUMMARY
[0005] To solve the above technical problems, the technical solution adopted by the present application is: a plug tray large seedling age grading detection method based on machine vision, comprising: S1, acquiring plug tray seedling images using a preset angle, and determining the detection points corresponding to each seedling in the plug tray.
[0006] S2, through the coordinates of the detection points in the image, the detection points are determined in the target area corresponding to the stems and leaves in the growth of the image.
[0007] S3, based on the segmented target area, the morphological features corresponding to the target area are extracted, and the growth difference features and classification labels of the target area are determined through the differences of the morphological features in the continuous time series.
[0008] S4, based on the growth difference features of the target area, the correlation between the morphological features and the seedling age is established, and the trend fitting of the growth difference features is performed in combination with the average morphological features of the seedlings to obtain the grading feature interval corresponding to the seedling age.
[0009] S5, hierarchical detection is performed on each seedling according to the hierarchical feature interval and the classification label, the hierarchical result in each hierarchical feature interval is determined, and when the hierarchical result belongs to the corresponding seedling age, the corresponding data is taken as an output plug tray grading report.
[0010] The beneficial effects of the present application are as follows: 1. The present application realizes dynamic grading detection of plug tray large seedling age through the multi-step cooperation of image acquisition and detection point determination, target region segmentation, growth difference feature extraction, seedling age correlation model establishment and grading detection output; solves the technical problem that the grading result is disconnected with the actual seedling age growth state in the traditional grading, ensures that the grading result is consistent with the actual growth stage of the seedling, and improves the accuracy and efficiency of seedling grading processing.
[0011] 2. The present application establishes image-physical coordinate mapping through chessboard calibration, delimits the rectangular area of the hole and sets the basic detection point; realizes accurate positioning and range test of the detection point by combining gray threshold preliminary selection and supplementary detection point; at the same time, based on the green channel component and YOLOv8 segmentation, the seedling candidate area is extracted, the leaf gray mean center is calculated as the supplementary detection point; finally, through the region growing method, the selection of the target region is completed, avoiding the problems of unclear region segmentation edge and background interference, and improving the integrity and accuracy of the target region.
[0012] 3. The present application extracts stem diameter, plant height and leaf area ratio as morphological features to construct time series vectors; calculates the difference features of adjacent seedling ages, sets classification labels by matching the healthy reference library through Euclidean distance; and calculates the average slope of plant height / stem diameter and the differential standard deviation of stem diameter as differential factors, and weights the static features to enhance the dynamics of the difference features; finally, through the connection relationship and distance threshold of the target region, the target region under the same difference dimension is determined, the dimension clustering of the difference features is realized; the growth difference of each seedling can be matched with the static features of stem diameter, plant height and leaf area ratio, and a clear label is provided for the growth of seedlings.
[0013] 4. The present application determines the optimal cluster number of each seedling age by clustering, constructs the mapping relationship between seedling age and average morphological feature; combines with the transplanting standard constraint, fits the grading feature interval that meets the standard; realizes the correlation relationship construction between seedling age and morphological feature in the way of average morphological feature, improves the scene adaptability of the grading feature interval and the corresponding seedling, and provides reliable basis for subsequent production decision. BRIEF DESCRIPTION OF DRAWINGS
[0014] The present application will be further described below in combination with the drawings and examples.
[0015] Figure 1 It is a flowchart of a plug tray large seedling grading detection method based on machine vision.
[0016] Figure 2 is a structural schematic diagram of a YOLOv8 segmentation model of a plug tray large seedling age grading detection method based on machine vision.
[0017] Figure 3 is a structural schematic diagram of an SConv module in a YOLOv8 segmentation model of a plug tray large seedling age grading detection method based on machine vision.
[0018] Figure 4 is a flowchart of step S1 of a plug tray large seedling age grading detection method based on machine vision.
[0019] Figure 5 is a flowchart of step S3 of a plug tray large seedling age grading detection method based on machine vision.
[0020] Figure 6 is a flowchart of step S4 of a plug tray large seedling age grading detection method based on machine vision. DETAILED DESCRIPTION
[0021] Embodiments of the present application will be described in detail below. The embodiments described below are exemplary and are intended to explain the present application, and should not be understood as limiting the present application. If a specific technique or condition is not mentioned in the embodiments, the technique or condition described in the literature in the art or according to the product manual is used.
[0022] Reference Figure 1 A plug tray large seedling age grading detection method based on machine vision, comprising: S1, using a preset angle to collect a plug tray seedling image, and determining detection points corresponding to each seedling in the plug tray.
[0023] S2, through the coordinates of the detection points in the image, determining target regions corresponding to stems and leaves in a growth manner of the image.
[0024] S3, based on the segmented target regions, extracting morphological features corresponding to the target regions, and determining growth difference features and classification labels of the target regions through differences in the morphological features under continuous time sequences.
[0025] S4, based on the growth difference features of the target regions, establishing a correlation between the morphological features and the seedling age, and combining the average morphological features of the seedlings to trend fit the growth difference features, to obtain a grading feature interval corresponding to the seedling age.
[0026] S5, performing grading detection using the grading feature interval and the classification label of each seedling to determine a grading result under each grading feature interval, and when the grading result belongs to the corresponding seedling age, using corresponding data as an output plug tray grading report.
[0027] When extracting the plug seedling image, a multi-convolution method is used to extract the features of the seedlings to obtain image features under multi-dimensional segmentation, and further identification is performed on these image features to obtain image features under multiple dimensions such as plant height, stem diameter, and leaf area, and these feature descriptions are used to describe the grading detection results under large seedling age.
[0028] When collecting data, the front view and top view are collected at a fixed position, and the height and area of the leaves of the seedlings are identified using an industrial camera, a ring LED light source, a fixed support, and a plug seedling conveying device. Based on the frame of the seedling segmentation and the area of the leaves, images of plug seedlings of different ages and different growth states (including healthy seedlings, weak seedlings, and empty holes) are collected, and these images are labeled to complete the subsequent model training process.
[0029] After that, the collected original image is preprocessed to eliminate noise and interference: Gaussian filtering is used to remove Gaussian noise in the image, and median filtering is used to eliminate salt and pepper noise; the color image is converted to a grayscale image through grayscale processing to reduce the amount of calculation; the image brightness is adjusted using gamma correction to ensure the consistency of image features under different lighting conditions, thereby completing the processing of the plug seedling image.
[0030] As shown in Figure 4 The implementation of step S1 includes: S11, using a chessboard calibration method to establish a mapping relationship between the plug seedling image and the physical coordinates; at this time, a standard calibration board is placed on the plane where the plug is located, and then the calibration board image is collected. The physical coordinates represented by each hole in the calibration board and the pixel position of each hole in the plug seedling image are mapped to determine the position of each hole in the plug seedling in image recognition.
[0031] S12, according to the physical structure of the plug, the rectangular area of each hole is demarcated, and the center pixel point of the hole is set as the basic detection point; at this time, the hole is selected as the basic detection point to record the seedling growth in the plug.
[0032] S13, according to the basic detection point, the gray threshold of the hole area is preliminarily selected, and the detection points corresponding to the leaves and stems in the hole area are output as supplementary detection points. Then all the detection points are stored as a txt file to associate the detection points with the corresponding image positions.
[0033] The implementation of step S13 includes: S131, based on the RGB format of the plug seedling image, the green channel component is extracted, and based on the distribution of the green channel pixel value output by the YOLOv8 segmentation model, the seedling candidate area is extracted.
[0034] In the initial selection of the gray threshold, first, the RGB format of the color plug seedling image is taken as the input, and the G value corresponding to the green channel is taken as the main processing part. Based on the training result of the YOLOv8 segmentation model, the pixel value distribution of the green channel corresponding to the leaf area is determined, such as the average G value of the leaf area is 180±20, the stem area is 120±15, and the background is 50±10. The green channel value (0-255) of the leaf area and the stem area is normalized to [0, 1], and then the part with the normalized G value greater than 0.3 is selected as the seedling candidate area.
[0035] In S132, the pixel gray mean center coordinates are calculated in the leaf mask of the seedling candidate area, and the corresponding supplementary detection points of the leaf are determined. In the seedling candidate area, the leaf mask and the stem mask output by the YOLOv8 segmentation model are used to calculate the gray mean center of the leaf pixels in the leaf mask, which is taken as the supplementary detection point of the leaf. In the stem mask, the continuous equal interval is divided along the vertical direction in the front view and along the horizontal direction in the top view, and the gray mean center coordinates of each equal interval are calculated to determine the supplementary detection points of the stem. The equal interval can be divided into 5 parts, and the gray mean centers of the middle 3 intervals are selected to complete the selection of the detection points of the stem. If the gray mean center of each equal interval is retained, the detection points are identified and need to be screened by the Euclidean distance to complete the processing of the detection points.
[0036] The initial selection method of the gray threshold value can effectively distinguish the pixel values of the black background and the green leaf based on the YOLOv8 segmentation model in multiple iterations to complete the setting of the gray initial selection and identify the corresponding supplementary detection points.
[0037] In S133, based on the perspective of the seedling candidate area, the feature points corresponding to the local texture are extracted, and the classification labels corresponding to the feature points are determined.
[0038] When setting the feature points of each seedling in the plug, in the top view, the SIFT, SURF or ORB algorithm is used to detect the corner points of the leaf edge, the tip points of the leaf and the bifurcation points of the leaf veins; in the front view, the stem edge points, the internode boundary points and the connection points of the leaf and the stem are detected, and the high-contrast feature points in the green region are preferentially selected by combining color information screening. These identified feature points are classified according to the local texture as the output detection points. The detection points will be further represented as the leaf feature points located on the arc edge with gentle texture direction change; the stem feature points located on the straight line edge with consistent texture direction; and the bifurcation point feature points at the intersection of multiple directions. The SIFT algorithm parameters can be set as the conventional parameters such as the number of Gaussian difference pyramid layers 6 and the feature point threshold 0.03 to complete the identification of the detection points at the positions such as the leaf edge and the stem edge.
[0039] In the processing of step S133, based on the detection content of SIFT, SURF or ORB algorithm, after identifying the supplementary detection point, the feature points about the texture description are found according to the texture of the position, and the feature points are set with the mark information about the position according to the perspective of the top view and the front view, so as to determine the semantic information of each detection point.
[0040] S134, integrate all the supplementary detection points, basic detection points and feature points, and take these points as the output detection points.
[0041] Each detection point includes pixel coordinates, a corresponding perspective, a feature descriptor, a detection point type and the like, and finally the processing of the detection point is completed.
[0042] S14, range inspection is performed on the acquired detection points, and the inspected detection points are stored in a standard way.
[0043] During the range inspection, it is required that the detection points must fall within the rectangular area corresponding to the hole, and the Euclidean distance between each detection point cannot be too small to avoid the repeated output of the detection points, for example, the distance < 3 pixels can be selected as the repeated point, and the point with a higher response value is reserved, so that the setting of the detection point is completed.
[0044] In an embodiment of the present application, the implementation mode of step S2 includes: S21, taking the detection point as a seed point, and gradually merging the adjacent pixels according to the similarity of the pixels.
[0045] In the current processing mode, the essence is to take the detection point as a seed point, and gradually merge the adjacent pixels according to the similarity of the pixels in color, gray scale and texture, so as to finally form the complete target area of the stem, the leaf and the hole.
[0046] S22, determining the growth criterion and the stop condition of the current detection point in different areas, and determining the target area of the stem and the leaf after the region growing.
[0047] Since the seedling has obvious characteristics in green, the Gaussian filter is first used to remove image noise, and the G value of the green channel and the gray value of the gray image are taken as the feature basis of the region growing. For example, the plug seedling image is divided into a generated green channel image and a gray image according to the color characteristics and the gray value.
[0048] As for the setting of the growth criterion representing the taking value of the G value of the green channel and the gray value, the merging of the adjacent pixels is completed according to the taking value of the two values.
[0049] For example, for the seed point corresponding to the leaf, the growth criterion is set as the absolute value difference of G value between the adjacent pixel and the seed point < 0.05 and the gray value difference ≤ 20; at this time, the 0.05 and the gray value difference are set based on the model after marking the leaf area multiple times, and the average difference of G value and the average difference of gray value between the adjacent pixels in the leaf area are used to set the growth criterion of the leaf area. The stop condition is represented as the absolute value difference of G value ≥ 0.05 and the gray value difference > 20, and the part greater than the two values or reaching the hole area boundary is stopped for the region growth at the corresponding position.
[0050] The seed point corresponding to the leaf is traversed through the 8-neighborhood pixels (up, down, left, right and diagonals), and it is judged whether the neighborhood pixels meet the growth criterion of the leaf; the pixels meeting the criterion are merged into the leaf area, and the pixels are used as new seed points to continue traversing the neighborhood; the above process is repeated until there is no pixel meeting the criterion, and the finally formed connected domain is the target area of the leaf.
[0051] For the detection point corresponding to the stem, the gray value difference is used as the judgment basis, and the gray value difference between the adjacent pixel and the seed point is required to be ≤ 15, and the gray gradient value of the edge position is < 30 during the region growth, and in the case of not meeting the two values or connecting to the leaf area, it is considered as the stop condition of the corresponding position to complete the region growth of the stem.
[0052] The seed point corresponding to the stem is traversed through the 4-neighborhood pixels (up, down, left and right), and since the stem is a vertical column, the 4-neighborhood traversal can more directly obtain the region of the stem growth, and then it is judged whether the neighborhood pixels meet the growth criterion of the stem; the pixels meeting the criterion are merged into the stem area and used as new seed points for continuous growth; when the growth reaches the boundary of the leaf area, the stop is performed, and the finally formed connected domain is the target area of the stem.
[0053] S23, morphological operation is performed on the grown region, and the processed region is regarded as the target region of output. For the target region after the region growth, the small holes in the region are filled by inflation, and the burrs on the edge of the region are eliminated by corrosion. The parameters of inflation kernel 3x3 and corrosion kernel 2x2 can be selected, and each iteration is performed once to complete the morphological operation, so that the contour of the target region is smoother; then the boundary coordinates of each target region are extracted to complete the setting of the target region.
[0054] In steps S1-S3, the image features of the stem, the leaf and the hole are quantified based on the processing mode of the image model.
[0055] At this time, the YOLOv8 segmentation model is used as the basic model, and the structure of the model is as follows Figures 2-3As shown, YOLOv8 is essentially a target detection algorithm, and its core function is to quickly locate the boundary box of the leaf, stem, cavity and other positions in the image, and to configure the semantic label and category description of the leaf, stem, cavity and other positions in the form of a boundary box.
[0056] In order to improve the accuracy of its recognition and the accuracy of its features, a region growing algorithm can be introduced to further summarize the contours of the leaf, stem, cavity and other positions, with the purpose of completely extracting the contours of the target, and reducing the target missegmentation and image feature loss caused by the boundary box recognition.
[0057] From Figure 2 It can be seen that the detection process of YOLOv8 follows the paradigm of feature extraction → feature fusion → prediction output, and its components are as follows.
[0058] Backbone (backbone network): input the original image, extract the feature map of the bottom layer (edge / texture) → high layer (semantic) layer by layer, and construct the basic feature representation.
[0059] Neck (neck feature fusion): fuse the multi-scale features (deep high semantic + shallow high space) output by Backbone, generate multi-scale enhanced features with balanced space and semantics through Upsample (up sampling), Concat (concatenation), C2f, etc.
[0060] Head (detection head): process the multi-scale features output by Neck respectively, enhance feature expression through Conv, Split, SConv, Concat, etc. operations, and finally output the position and category prediction of different scale targets by the Detect module.
[0061] In order to reduce the computational amount of the model, SConv is used to replace the Conv module in the C2f of the YOLOv8 model structure. Figure 3 As shown, SConv has a specific structure, which divides the feature vector into two parts according to 1:3, uses different size kernels for convolution respectively, and fuses the obtained features to output, to reduce the operation amount of directly using Conv module, and adds a CA module at the end of the backbone network to realize multi-scale enhancement of channel and spatial information, so that the model has stronger perception and positioning ability for the frame, leaf area and other parts in the image, to obtain the current hole tray seedling image to be processed.
[0062] For the front view of the hole tray seedling image, the area used to extract the seedling is recorded, and the ratio between the real plant height and the plant height in the image, as well as the ratio between the real stem diameter and the stem diameter in the image is recorded. These ratio relationships are used to inversely identify the values of plant height and stem diameter in the current image, so as to record the relative values of morphological characteristics.
[0063] As for the top view of the plug seedling image, it is used to record the leaf area and further identify the ratio between the leaf area and the plant height to determine the growth of the current seedling.
[0064] The measured morphological features will include the stem diameter, the plant height and the leaf area to plant height ratio (the ratio of the leaf area to the plant height) to reflect the growth and health of the seedling. The selected leaf area to plant height ratio can eliminate the influence of the size difference of the plants and retain the key growth trend information. In the subsequent processing, the value range in the continuous time period will be emphasized to quantify the growth difference features of the target region.
[0065] If the leaf area to plant height ratio of the seedlings in a certain region decreases significantly, it may indicate that the distribution of the leaves in the height direction is sparse, and the light management needs to be optimized, so as to quantify the difference of each target region.
[0066] In an embodiment of the present application, as shown in Figure 5 the implementation mode of step S3 includes: S31, extracting the stem diameter, the plant height and the leaf area of any target region in the plug seedling image, taking the stem diameter, the plant height and the leaf area to plant height ratio as the output morphological features, and constructing the feature subset corresponding to each target region. When constructing the feature subset, all the input data are standardized to set the feature subset in a normalized manner.
[0067] S32, constructing a time series vector according to the values of the feature subset at multiple seedling ages, and determining the difference feature corresponding to the time series vector according to the difference of the time series vector at adjacent seedling ages. Each time series vector will extract the value of the same plug seedling at multiple seedling ages according to the change of the stem diameter, the plant height and the leaf area to plant height ratio with time.
[0068] The output difference feature can record the dynamic difference of the same plug seedling in the form of growth rate and growth fluctuation. For example, the growth rate is expressed as the first-order difference and the average slope of the increase with time, reflecting the growth amount at adjacent seedling ages; the growth fluctuation is expressed in the form of difference standard deviation, reflecting the stability of the growth.
[0069] It can be seen that the first-order difference represents the difference value at adjacent time points, and the difference standard deviation represents the standard deviation of the difference value at adjacent time points, to explain the change trend of the growth rate; the average slope represents the average value of the ratio of the difference value of the stem diameter at adjacent time points to the time difference, and the value is used to explain the average growth rate of the single seedling at the corresponding time.
[0070] Preferably, the implementation mode of step S32 further includes: S321, calculating the plant height average slope, the stem diameter average slope and the stem diameter difference standard deviation of all seedlings in the target region at adjacent time points as the difference factors of the corresponding time series vector; these three values can directly reflect the growth speed, the stability and the dynamic change of the seedling growth.
[0071] S322, regarding the original value of each feature in the feature subset as a static feature, fusing the difference factor and the static feature by weighting, and regarding the fused feature value as an output difference feature.
[0072] When fusing and weighting, first, the difference factor and the static feature are spliced, the input features are normalized, then the spliced features are input into the random forest, the feature that reduces the node impurity the most is selected for splitting, then the sum of the impurity reduction values of each feature on all classification nodes is calculated, the sum of the impurity reduction values is normalized according to the current feature, thereby obtaining the weight corresponding to each feature, then the current dynamic feature and the static feature are weighted and summed according to the number, so as to highlight the influence of key features and weaken the interference of the current secondary features.
[0073] S33, matching and identifying the difference features of each time series vector to determine the target regions in the same difference dimension.
[0074] The implementation of step S33 includes: calling the target region corresponding to each difference feature value, connecting the target regions to form the connection relationship of the target regions.
[0075] After completing the connection relationship of the target regions, the types and connection conditions of any two target regions are determined, and when the connection condition meets the distance threshold, it is determined that they are in the same difference dimension.
[0076] At present, the target regions corresponding to the difference feature values are grouped and merged, and the target regions processed at this time represent the front view and top view of a group of plug seedling images; by identifying these images to the target regions of the corresponding seedlings, the connection is performed in a mapping relationship.
[0077] As for the type of the target region, it is the semantic interpretation of the difference feature in the corresponding target region, such as the semantic description of fast growth in height and slow growth in stem diameter, and selecting the target regions in the same type can clearly understand the distribution of the collected plug seedling images at a single seedling age; then the connection condition set will represent the value condition of the difference feature itself, and the Euclidean distance of the difference feature value is used as the main condition, and the value conditions of the static feature, the difference factor and the like are checked to prevent part of the seedlings with stagnant growth from being mixed into the subsequent analysis process.
[0078] Using the Euclidean distance of the difference feature value can explain the growth difference pattern between the seedlings in different target regions, and the smaller the distance value, the closer the growth difference, and the more the identified seedlings are in the same difference pattern; the Euclidean distance calculated by the value of the static feature, the difference factor and the like can check the specific value condition to find multiple target regions that are relatively similar.
[0079] The distance threshold value set later is set according to the median of the Euclidean distance, for example, the median is multiplied by 0.8, and the data less than the distance threshold value is regarded as the same difference dimension, and after the corresponding seedlings are identified, the setting of the difference dimension is completed, which can reduce the calculation amount when the seedling morphological characteristics are clustered subsequently.
[0080] In S34, the target region in the same difference dimension is set with the Euclidean distance between the difference feature and the growth feature reference library of the healthy seedlings, the classification label of the difference feature is set, and the classified data is regarded as the output growth difference feature.
[0081] The growth feature reference library of the healthy seedlings is set based on the values of the difference features in multiple batches, for example, the time series data of 1000 healthy seedlings of the same variety is collected, the difference factor and the static feature when splicing are established in the form of mean ± standard deviation, for example, in the form of mean ± 1.5 times standard deviation, and then the reference library is established according to the seedling age segmentation, for example, 7 days, 14 days, 21 days and 28 days, respectively, to complete the setting of the growth feature reference library of the healthy seedlings.
[0082] As for the subsequent Euclidean distance, the difference between the difference factor and the static feature corresponding to the current difference feature and the corresponding average value in the reference library is calculated to quantify the difference from the healthy seedling reference; the Euclidean distance can be used for preliminary growth difference classification, for example, the healthy seedling value is less than 0.3, the weak seedling value is between 0.3 and 0.6, and the abnormal seedling is greater than or equal to 0.6, to complete the quantification of the growth difference.
[0083] In the overall processing process of step S3, the seedlings in a single target region are preferentially analyzed, that is, the multi-time change quantification of a single seedling is performed, and then all seedlings should be analyzed according to the hole configuration to determine the change of the seedlings at the corresponding seedling age.
[0084] In an embodiment of the present application, step S4 combines the multi-time sequence growth difference features of the plug seedlings, takes the data corresponding to the growth difference features as input, takes the values of the difference factor, stem diameter, plant height and leaf area plant height ratio presented by the growth difference features, and the clustering of multiple seedlings, calculates the average feature value at the corresponding seedling age, establishes the correlation model of seedling age and morphological characteristics, and determines the grading feature interval of different seedling ages.
[0085] As shown in FIG. 4, the implementation of step S4 includes the following steps: Figure 6 S41, according to the data corresponding to the growth difference features, clustering all seedlings according to the classification label corresponding to the growth difference features, and determining the optimal clustering number at each seedling age.
[0086] When clustering is performed, the data with the same classification label is taken as a reference to identify the classification at the corresponding seedling age, and the stem diameter, plant height, and leaf area / plant height corresponding to the growth difference feature are taken as the clustering index. After being converted into a vector, the Euclidean distance between the vectors is used to complete the quantification of the data classification in each cluster.
[0087] The current processing process is based on the growth difference feature to perform clustering on the plug seedling images collected in each period, determine the optimal cluster number for a single period, and calculate the average morphological feature at the corresponding seedling age based on the optimal cluster number to complete the establishment of the correlation.
[0088] When the optimal cluster number is selected, the k-means algorithm is used as the current clustering algorithm, and the cluster number corresponding to the maximum silhouette coefficient is considered as the optimal cluster number.
[0089] S42, the mapping relationship between the cluster clusters at each seedling age and the classification label of the growth difference feature is constructed, the average morphological feature at the corresponding seedling age is calculated, and the mapping relationship between the average morphological feature value of each cluster cluster and the corresponding seedling age is determined.
[0090] The average morphological feature value of each cluster cluster represents the average value of the stem diameter, plant height, and leaf area / plant height in the corresponding cluster cluster, which illustrates the average value of the classification label corresponding to the healthy seedlings, abnormal seedlings, and weak seedlings, and determines the fitting value of the corresponding seedlings under the continuous seedling age distribution according to these average values, which illustrates the relative situation of the corresponding seedlings during growth, and assists in predicting the value of the corresponding part under the growth of seedling age.
[0091] S43, based on the mapping relationship between the average morphological feature value of each cluster cluster and the corresponding seedling age, the seedling age is taken as the independent variable, and the average morphological feature obtained by clustering is taken as the dependent variable, to establish a seedling age-morphological feature correlation model.
[0092] When setting up the seedling age-morphological feature correlation model, the XGBoost algorithm is mainly used to determine the predicted value at different seedling ages by regression calculation. XGBoost integrates multiple decision trees through additive models, and the predicted value of the model after the kth iteration is the sum of the predicted values of the first k trees.
[0093] The additive model is defined as follows: ; wherein, represents the predicted value of the ith sample after the kth iteration, and each sample represents a specific value at a specific time, such as the plant height value input at the 14th day seedling age; represents the predicted value after the k-1th iteration, and in the initial round, the predicted value is the average value of all input samples; represents the learning rate, which can be 0.1, and is used to control the contribution weight of the kth tree; represents the prediction output of the i-th sample by the k-th decision tree, and represents the weighted sum of the leaf weights of the corresponding decision tree. At this time, the input average morphological features are predicted by means of the decision tree to fill in the trend under the change of multiple time points, so that the curve corresponding to the average value of the stem diameter, plant height and the like changing with time is more complete and complete.
[0094] After the k-th decision tree The output corresponding to the seedling age t can be represented as: ; wherein, represents the number of leaf nodes of the k-th tree, and the number of leaf nodes is affected by the current decision tree setting depth. If the decision tree depth is set to 3, the number of leaf nodes is 8; represents the weight of the j-th leaf node of the k-th tree, and the value of j ranges from 1 to J. The value of the weight depends on the extraction of the input sample and the second derivative, such as ; wherein, represents the gradient of the sample i, represents the second derivative of the sample i, represents the L2 regularization parameter, which can be 0.1, used to punish the leaf weight for being too large; represents the sample interval of the j-th leaf node of the k-th tree, such as the value range corresponding to the plant height and the value range corresponding to the seedling age, to illustrate the interval corresponding to each sample; represents an indicator function, I=1, otherwise I=0. The essence of the decision tree is the mapping of the seedling standardization value to the leaf node weight. In a constantly iterative manner, the average value of the morphological features under different seedling ages is determined.
[0095] According to the prediction value obtained by multiple iterations, when the prediction value and the current input value reach the minimum mean square error, the iteration is stopped, and the corresponding prediction value is output, thereby completing the establishment of the seedling-morphological feature correlation model, and obtaining the correlation between the input morphological features and the seedling age under nonlinear analysis.
[0096] That is, the implementation of step S43 includes: taking the average morphological features of any seedling age as input samples, constructing a decision tree, and determining the gradient and second derivative of the input samples.
[0097] The second derivative and the gradient of the input sample are used to calculate the split gain, and the data with the maximum split gain is used as the root node split point of the decision tree.
[0098] The split point is recursively processed to complete the recursive processing of the leaf nodes, and the prediction value of the seedling-morphological feature correlation model is updated by the weight corresponding to each leaf node until the prediction value meets the minimum mean square error, the iteration is stopped, and the analysis and processing of the seedling-morphological feature correlation model are completed.
[0099] It should be noted that when the decision tree analysis is currently performed, 40 decision trees can be selected for iteration to prevent the accuracy of the output data from being reduced due to feature redundancy.
[0100] Through the above calculation process, the establishment of the seedling age-morphological feature correlation model can be completely realized, which not only ensures the nonlinear fitting capability of the model, but also adapts to the average law of seedling growth.
[0101] S44, calling the transplanting standard constraint corresponding to the seedling age from the database, trend fitting the predicted value output by the seedling age-morphological feature correlation model with the average morphological feature value, and setting the classification feature interval using the fitted value that meets the transplanting standard constraint.
[0102] When trend fitting is performed, the average morphological feature value of the seedling age cluster + the predicted value of the intermediate seedling age is combined into a complete time series, and the feature mean curve under the corresponding classification label is generated, such as the healthy seedling feature mean curve, using each classification label as a guide. At this time, the stem diameter, plant height and leaf area to plant height ratio are fitted using a quadratic polynomial or linear regression method, and the classification feature interval is set in the form of fitted value ± 2 times the standard deviation, which is calculated based on multiple input stem diameter, plant height and leaf area to plant height ratio values.
[0103] The fitted value obtained is essentially the expected mean value of a specific seedling age. Based on the fitted value and the standard deviation of the input stem diameter, plant height and leaf area to plant height ratio, the classification feature interval under the classification label of healthy seedlings / weak seedlings / abnormal seedlings, etc. can be set.
[0104] The transplanting standard constraint represents the stem diameter, plant height and leaf area to plant height ratio required at the time of transplanting extracted from the database. The seedlings that meet these values are considered as part of the current division process to determine the specific value range of healthy seedlings and weak seedlings, abnormal seedlings and other unhealthy seedlings.
[0105] In step S5, based on the classification label set for each seedling in steps S3 and S4, the fitting of the clustering process is summarized to form the final classification results of healthy seedlings, weak seedlings, abnormal seedlings and seedlings to be reviewed, and a mapping relationship between seedling age-hole ID-classification result is formed to explain the final result of each seedling under image recognition.
[0106] Therefore, the implementation of step S5 includes: sequentially extracting the data corresponding to the classification label and the classification feature interval, determining whether the data mapped by the classification label and the classification feature interval is the same group of data, and outputting the corresponding data as the plug tray classification report when it is the same group of data. The output plug tray classification report contains information such as seedling age distribution, healthy seedling proportion, classification label, and weak seedling classification feature interval.
[0107] When judging whether it is the same group of data, the essence is to identify whether the data corresponding to the health seedlings, weak seedlings, abnormal seedlings, etc. in the current classification label and the data divided by the grading feature interval are from the same source. The data from the same source is summarized. If it is not from the same source, it means that there is part of the abnormality when dividing the data, and the corresponding transaction needs to be checked and rolled back to complete the checking and analysis of all seedlings.
[0108] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application, which are still covered by the protection scope of the present application.
Claims
1. A machine vision-based plug tray large seedling age grading detection method, characterized in that, The method comprises the following steps: S1, acquiring a plug seedling image using a preset angle, and determining corresponding detection points of each seedling in the plug; S2, determining target regions corresponding to stems and leaves by coordinates of the detection points in the image, and growing the detection points in the image; S3, extracting morphological features corresponding to the target regions based on the segmented target regions, determining growth difference features and classification labels of the target regions by differences of the morphological features in a continuous time sequence; S4, establishing a correlation between the morphological features and the seedling age based on the growth difference features of the target regions, and combining the average morphological features of the seedlings to trend fit the growth difference features, thereby obtaining a grading feature interval corresponding to the age; S5, performing grading detection on the grading feature interval and the classification label of each seedling to determine a grading result in each grading feature interval, and when the grading result belongs to the corresponding age, corresponding data is taken as an output plug grading report.
2. The method according to claim 1, wherein, The implementation of step S1 comprises: S11, establishing a mapping relationship between the plug seedling image and the physical coordinates by using a chessboard calibration method; S12, demarcating a rectangular region of each hole according to the physical structure of the plug, and setting a hole center pixel point as a basic detection point; S13, performing initial selection of a gray threshold on the hole region based on the basic detection point, and outputting the detection points corresponding to the leaves and stems in the hole region as supplementary detection points; S14, performing range inspection on the obtained detection points, and storing the inspected detection points in a standardized manner.
3. The method according to claim 2, wherein, The implementation of step S13 comprises: S131, extracting a green channel component based on the RGB format of the plug seedling image, and extracting a seedling candidate region based on a green channel pixel value distribution output by a YOLOv8 segmentation model; S132, calculating a pixel gray mean center coordinate in a leaf mask of the seedling candidate region to determine a supplementary detection point corresponding to the leaf; S133, extracting feature points corresponding to local textures based on a perspective of the seedling candidate region to determine classification labels corresponding to the feature points; S134, integrating all the supplementary detection points, the basic detection points and the feature points, and taking these points as output detection points.
4. The method according to claim 1, wherein, The implementation of step S2 comprises: S21, regarding the detection points as seed points, and gradually merging adjacent pixels according to the similarity of the pixels; S22, determining growth criteria and stop conditions of the current detection points in different regions, and determining target regions of stems and leaves after region growth; S23, performing morphological operations on the grown regions, and regarding the processed regions as output target regions.
5. The machine vision-based plug tray seedling age grading method according to claim 1, wherein, The implementation of step S3 comprises: S31, extracting stem thickness, plant height and leaf area of any target region in the plug seedling image, taking the stem thickness, plant height and leaf area height ratio as output morphological features, and constructing a feature subset corresponding to each target region; S32, constructing a time sequence vector according to the values of the feature subset under multiple seedling ages, and determining a difference feature corresponding to the time sequence vector by the difference of the time sequence vector under adjacent seedling ages; S33, performing matching identification on the difference feature of each time sequence vector to determine target regions in the same difference dimension. S34, for the target region in the same difference dimension, setting a classification label for the difference feature according to the Euclidean distance between the difference feature and the growth feature benchmark library, and regarding the classified data as the output growth difference feature.
6. The machine vision-based plug tray seedling age grading method according to claim 5, wherein, The implementation of step S32 further includes: S321, calculating the average slope of the plant height, the average slope of the stem diameter, and the standard deviation of the stem diameter difference of all seedlings in the target region at adjacent time points as the difference factor of the corresponding time series vector; S322, regarding the original value of each feature in the feature subset as a static feature, weighting and fusing the difference factor and the static feature, and regarding the fused feature value as the output difference feature.
7. The method according to claim 5, wherein the method is characterized by, The implementation of step S33 includes: Accessing each target region corresponding to each difference feature value, connecting each target region to form a connection relationship of each target region; After completing the connection relationship of the target region, determining the type and connection condition of any two target regions, and determining that they are in the same difference dimension when the connection condition meets the distance threshold.
8. The machine vision-based plug tray seedling age grading method according to claim 1, wherein, The implementation of step S4 includes: S41, according to the data corresponding to the growth difference feature, clustering all seedlings according to the classification label corresponding to the growth difference feature, and determining the optimal cluster number at each seedling age; S42, constructing a mapping relationship between the cluster at each seedling age according to the classification label of the growth difference feature, calculating the average morphological feature at the corresponding seedling age, and determining the mapping relationship between the average morphological feature value of each cluster and the corresponding seedling age; S43, based on the mapping relationship between the average morphological feature value of each cluster and the corresponding seedling age, taking the seedling age as the independent variable and the average morphological feature obtained by clustering as the dependent variable, establishing a seedling age-morphological feature correlation model; S44, calling the transplanting standard constraint at the corresponding seedling age from the database, trend fitting the predicted value output by the seedling age-morphological feature correlation model with the average morphological feature value, and setting the fitting value that meets the transplanting standard constraint as the grading feature interval.
9. The machine vision-based plug tray seedling age grading method according to claim 8, wherein, The implementation of step S43 includes: Taking the average morphological feature at any seedling age as an input sample, constructing a decision tree, and determining the gradient and second derivative of the input sample; Taking the second derivative and gradient of the input sample, calculating the split gain, and taking the data with the maximum split gain as the root node split point of the decision tree; Recursively processing the split points to complete the recursive processing of the leaf nodes, updating the predicted value of the seedling age-morphological feature correlation model corresponding to the weight of each leaf node, and stopping iteration until the predicted value meets the minimum mean square error.
10. The machine vision-based plug tray seedling age grading method according to claim 1, wherein, The implementation of step S5 includes: Extracting the data corresponding to the classification label and the grading feature interval in turn, determining whether the data mapped by the classification label and the grading feature interval is the same group of data, and outputting the corresponding data as the plug tray grading report when it is the same group of data.
Citation Information
Patent Citations
Wheat seedling monitoring method based on unmanned aerial vehicle remote sensing and deep learning
CN114419439A
Plug seedling classification method and system
CN114998656A
Tomato plug seedling grading detection and data transmission method based on deep learning
CN116630707A
Melon seedling phenotypic characteristic measurement and digital grading system based on image processing
CN118823448A
Tobacco seedling growing period growth state discrimination and emergence rate detection method and related device
CN119418117A
Cited By
A navigation path generation method, system, electronic device and readable storage medium
CN122281939A