Soil crushing quality evaluation method of rotary cultivator
By performing multi-scale segmentation and feature fusion on soil images, the problem of low accuracy in crushed soil quality assessment in existing technologies is solved, and the comprehensive capture and precise quantification of soil particle characteristics are achieved, thereby improving the assessment accuracy.
Patent Information
- Application Number
- CN202511151783.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Existing technologies have the problem of low precision in soil crushing quality assessment, especially the image processing algorithm cannot fully capture the multi-scale characteristics of soil particles and the soil image feature extraction is not fine enough, resulting in inaccurate assessment.
A soil crushing quality assessment method using a rotary tiller is adopted. The soil image is divided into M×L blocks of equal size. The fine-grained, medium-grained, and coarse-grained contour maps are extracted, and local and global uniform value matrices are constructed. The multi-scale features are fused using a multi-grained convolutional assessment model to obtain the soil crushing quality score.
It achieves comprehensive capture and fine extraction of the multi-scale characteristics of soil particles, improves the accuracy of soil crushing quality assessment, and accurately quantifies the spatial distribution and uniformity of soil particles.
Smart Images

Figure CN120635615A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for evaluating soil crushing quality of a rotary tiller. Background Art
[0002] In modern agricultural production, soil tillage quality directly impacts crop growth and agricultural production efficiency. Traditional methods for assessing soil fragmentation quality rely primarily on empirical judgment, using manual visual inspection of soil particle size, distribution, and uniformity. This method suffers from numerous drawbacks, including strong subjectivity, low accuracy, and poor efficiency. In recent years, with the advancement of image processing technology, the agricultural machinery sector has begun to experiment with the use of machine vision and image analysis techniques to objectively assess soil tillage quality. However, existing technologies still face serious technical bottlenecks: First, image processing algorithms are typically limited to single-scale analysis and cannot fully capture the multi-scale characteristics of soil particles. Second, existing methods lack sufficient precision in feature extraction from soil images, making it difficult to accurately quantify the spatial distribution and uniformity of soil particles, resulting in low precision in soil fragmentation quality assessment. Summary of the Invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for evaluating the crushed soil quality of a rotary tiller, which solves the problem of low accuracy in the prior art in evaluating the crushed soil quality.
[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: a method for evaluating the crushed soil quality of a rotary tiller, comprising the following steps:
[0005] S1. Collect soil images after tillage with a rotary tiller, divide the soil images into M × L image blocks of equal size, and extract fine-grained contour maps, medium-grained contour maps, and coarse-grained contour maps for each image block, where M is the number of image blocks in the horizontal direction and L is the number of image blocks in the vertical direction.
[0006] S2. Constructing a fine-grained local uniform value matrix, a medium-grained local uniform value matrix, and a coarse-grained local uniform value matrix according to the distribution of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map, respectively;
[0007] S3, constructing a fine-grained global uniform value matrix, a medium-grained global uniform value matrix, and a coarse-grained global uniform value matrix according to the number of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map corresponding to each image block;
[0008] S4. Use the multi-grained convolution evaluation model of crushed soil quality to process the fine-grained local uniform value matrix, medium-grained local uniform value matrix, coarse-grained local uniform value matrix, fine-grained global uniform value matrix, medium-grained global uniform value matrix and coarse-grained global uniform value matrix to obtain the crushed soil quality score.
[0009] Furthermore, S1 includes the following sub-steps:
[0010] S11, extracting the maximum pixel value and the minimum pixel value in each image block, taking the average of the minimum pixel values of all image blocks to obtain the minimum pixel mean, and taking the average of the maximum pixel values of all image blocks to obtain the maximum pixel mean;
[0011] S12, taking 1 / 2 of the difference between the maximum pixel mean and the minimum pixel mean as the first segmentation threshold;
[0012] S13, taking 1 / 2 of the first segmentation threshold as the second segmentation threshold;
[0013] S14, taking 1 / 2 of the second segmentation threshold as the third segmentation threshold;
[0014] S15. In each image block, based on the first segmentation threshold, the second segmentation threshold, and the third segmentation threshold, non-contour points are marked to obtain a fine-grained contour map, a medium-grained contour map, and a coarse-grained contour map of the same image block.
[0015] Furthermore, S15 includes the following sub-steps:
[0016] S151. In each image block, taking each pixel as the center, calculate the difference between the pixel value of each pixel in the neighborhood and the pixel value of the central pixel;
[0017] S152, when the difference values of the neighborhood are all less than the first segmentation threshold, the central pixel is marked as a non-contour point, and other pixels not marked as non-contour points are marked as fine-medium-coarse-grained contour points;
[0018] S153, when the difference values of the neighborhood are all less than the second segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-medium granularity contour points;
[0019] S154, when the difference values of the neighborhood are all less than the third segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-grained contour points, to generate a fine-grained contour map;
[0020] S155, removing pixel points marked as fine-grained contour points from the fine-medium-grained contour points, obtaining medium-grained contour points, and generating a medium-grained contour map;
[0021] S156 , removing pixel points marked as fine-medium-grained contour points from among the fine-medium-coarse-grained contour points to obtain coarse-grained contour points and generate a coarse-grained contour map.
[0022] Furthermore, S2 includes the following sub-steps:
[0023] S21, taking each contour point in the contour map as the center, counting the number of contour points within a 7×7 neighborhood, and taking the number of contour points within the 7×7 neighborhood as the local aggregation degree of the contour point at the center;
[0024] S22. In a contour graph, average the local aggregation of each contour point to obtain a local mean;
[0025] S23, calculating the local mean value based on the difference between the local aggregation degree of each contour point and the local mean;
[0026] S24. Arrange the local uniform values of each image block in the order of the image blocks to construct an M×L local uniform value matrix, wherein, when the contour map in S21 is a fine-grained contour map, the local uniform value matrix in S23 is a fine-grained local uniform value matrix; when the contour map in S21 is a medium-grained contour map, the local uniform value matrix in S23 is a medium-grained local uniform value matrix; when the contour map in S21 is a coarse-grained contour map, the local uniform value matrix in S23 is a coarse-grained local uniform value matrix.
[0027] Furthermore, the formula for calculating the local uniform value in S23 is: , where γ Lo is the local uniform value, h Lo,i is the local aggregation degree of the i-th contour point, h Lo,avg is the local mean, K is the number of contour points in the contour map, i is a positive integer, and ε is a constant greater than 0.
[0028] Furthermore, S3 includes the following sub-steps:
[0029] S31, averaging the number of contour points in the contour map corresponding to each image block to obtain a global mean;
[0030] S32, calculating the global mean value of the image block according to the difference between the number of contour points in the contour map corresponding to each image block and the global mean;
[0031] S33. Arrange the global uniform values of each image block in the order of the image blocks to construct an M×L global uniform value matrix, wherein, when the contour map in S31 is a fine-grained contour map, the global uniform value matrix in S33 is a fine-grained global uniform value matrix; when the contour map in S31 is a medium-grained contour map, the global uniform value matrix in S33 is a medium-grained global uniform value matrix; when the contour map in S31 is a coarse-grained contour map, the global uniform value matrix in S33 is a coarse-grained global uniform value matrix.
[0032] Furthermore, the formula for calculating the global mean value of the image block in S32 is: , where θ Go,j is the global average value of the jth image block, hGo,j is the number of contour points in the contour map corresponding to the jth image block, h Go,avg is the global mean, j is a positive integer, and ε is a constant greater than 0.
[0033] Furthermore, the multi-grained convolutional assessment model for crushed soil quality in S4 includes: a fine-grained uniform feature fusion unit, a medium-grained uniform feature fusion unit, a coarse-grained uniform feature fusion unit, a first shallow uniform feature extraction unit, a second shallow uniform feature extraction unit, a third shallow uniform feature extraction unit, a first deep uniform feature extraction unit, a second deep uniform feature extraction unit, a third deep uniform feature extraction unit, a deep uniform feature fusion unit, a shallow uniform feature fusion unit, a first CNN network, a second CNN network, a Concat layer, and a fully connected layer;
[0034] The fine-grained uniform feature fusion unit is used to fuse the corresponding features of the fine-grained local uniform value matrix and the fine-grained global uniform value matrix to obtain fine-grained uniform features; the medium-grained uniform feature fusion unit is used to fuse the corresponding features of the medium-grained local uniform value matrix and the medium-grained global uniform value matrix to obtain medium-grained uniform features; the coarse-grained uniform feature fusion unit is used to fuse the corresponding features of the coarse-grained local uniform value matrix and the coarse-grained global uniform value matrix to obtain coarse-grained uniform features;
[0035] The first shallow uniform feature extraction unit is used to extract fine-grained shallow uniform features from fine-grained uniform features; the second shallow uniform feature extraction unit is used to extract medium-grained shallow uniform features from medium-grained uniform features; the third shallow uniform feature extraction unit is used to extract coarse-grained shallow uniform features from coarse-grained uniform features;
[0036] The first deep uniform feature extraction unit is used to extract fine-grained deep uniform features from fine-grained shallow uniform features; the second deep uniform feature extraction unit is used to extract medium-grained deep uniform features from medium-grained shallow uniform features; the third deep uniform feature extraction unit is used to extract coarse-grained deep uniform features from coarse-grained shallow uniform features;
[0037] The deep uniform feature fusion unit is used to fuse the fine-grained deep uniform features, the medium-grained deep uniform features and the coarse-grained deep uniform features to obtain the deep fusion features; the shallow uniform feature fusion unit is used to fuse the fine-grained shallow uniform features, the medium-grained shallow uniform features and the coarse-grained shallow uniform features to obtain the shallow fusion features;
[0038] The first CNN network is used to extract features from the deep fusion features to obtain the first features to be classified; the second CNN network is used to extract features from the shallow fusion features to obtain the second features to be classified; the Concat layer is used to splice the first features to be classified and the second features to be classified to obtain the spliced features;
[0039] The fully connected layer is used to output the crushed soil quality score based on the splicing features.
[0040] Furthermore, the expressions of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit, and the coarse-grained uniform feature fusion unit are all: , where G is the output of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit, or the coarse-grained uniform feature fusion unit, g1 is the matrix input to the first input terminal, and g2 is the matrix input to the second input terminal. is the Hadamard product, and Conv is the convolution operation.
[0041] Furthermore, deep fusion features = fine-grained deep uniform features ⊕ medium-grained deep uniform features ⊕ coarse-grained deep uniform features, where ⊕ represents element-wise addition;
[0042] Shallow fusion features = fine-grained shallow uniform features ⊕ medium-grained shallow uniform features ⊕ coarse-grained shallow uniform features.
[0043] The beneficial effects of the present invention are as follows: the present invention first divides the soil image into M×L image blocks of the same size, extracts fine-grained contour maps, medium-grained contour maps and coarse-grained contour maps for each image block, and obtains contours with different boundary clarity. The coarse-grained contour map reflects the large-scale and macroscopic soil block boundary information, the fine-grained contour map reflects the small-scale soil block boundary information, and the medium-grained contour map reflects the medium-scale soil block boundary information. According to the fine, medium and coarse-grained contours, the soil Figure 3 The distribution of contour points is obtained from three aspects, and local uniform value matrices of fine, medium and coarse grains are constructed to reflect the uniform distribution of fine, medium and coarse grained contour points in each image block. Then, based on the number of contour points in the fine, medium and coarse grained contour maps, global uniform value matrices of fine, medium and coarse grains are constructed to reflect the deviation of the number of the three contour points in each image block. The multi-granularity convolution evaluation model of crushed soil quality is adopted to integrate the three local uniform value matrices and the three global uniform value matrices to comprehensively capture the multi-scale characteristics of soil particles, finely extract soil image features, and accurately quantify the spatial distribution and uniformity of soil particles, thereby effectively improving the accuracy of crushed soil quality assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of a method for evaluating soil crushing quality of a rotary tiller;
[0045] Figure 2 It is a fine, medium and coarse grain contour map;
[0046] Figure 3 It is a contour map of fine and medium grain size;
[0047] Figure 4 is a fine-grained contour map;
[0048] Figure 5 This is a schematic diagram of the structure of the multi-granularity convolution assessment model for crushed soil quality;
[0049] Figure 6 Schematic diagram of the structures of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit and the coarse-grained uniform feature fusion unit;
[0050] Figure 7 Schematic diagram of the structures of the first shallow uniform feature extraction unit, the second shallow uniform feature extraction unit and the third shallow uniform feature extraction unit;
[0051] Figure 8 Schematic diagram of the structures of the first deep uniform feature extraction unit, the second deep uniform feature extraction unit and the third deep uniform feature extraction unit. DETAILED DESCRIPTION
[0052] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.
[0053] like Figure 1 As shown, a method for evaluating the soil crushing quality of a rotary tiller includes the following steps:
[0054] S1. Collect soil images after tillage with a rotary tiller, divide the soil images into M × L image blocks of equal size, and extract fine-grained contour maps, medium-grained contour maps, and coarse-grained contour maps for each image block, where M is the number of image blocks in the horizontal direction and L is the number of image blocks in the vertical direction.
[0055] S2. Constructing a fine-grained local uniform value matrix, a medium-grained local uniform value matrix, and a coarse-grained local uniform value matrix according to the distribution of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map, respectively;
[0056] S3, constructing a fine-grained global uniform value matrix, a medium-grained global uniform value matrix, and a coarse-grained global uniform value matrix according to the number of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map corresponding to each image block;
[0057] S4. Use the multi-grained convolution evaluation model of crushed soil quality to process the fine-grained local uniform value matrix, medium-grained local uniform value matrix, coarse-grained local uniform value matrix, fine-grained global uniform value matrix, medium-grained global uniform value matrix and coarse-grained global uniform value matrix to obtain the crushed soil quality score.
[0058] In this embodiment, the soil image has a horizontal length of 800 pixels and a vertical length of 600 pixels. The horizontal length is divided into 40 pixels per column and the vertical length is divided into 60 pixels per row. Then, M is 20 and L is 10.
[0059] In this embodiment, S1 includes the following sub-steps:
[0060] S11, extracting the maximum pixel value and the minimum pixel value in each image block, taking the average of the minimum pixel values of all image blocks to obtain the minimum pixel mean, and taking the average of the maximum pixel values of all image blocks to obtain the maximum pixel mean;
[0061] S12, taking 1 / 2 of the difference between the maximum pixel mean and the minimum pixel mean as the first segmentation threshold;
[0062] S13, taking 1 / 2 of the first segmentation threshold as the second segmentation threshold;
[0063] S14, taking 1 / 2 of the second segmentation threshold as the third segmentation threshold;
[0064] S15. In each image block, based on the first segmentation threshold, the second segmentation threshold, and the third segmentation threshold, non-contour points are marked to obtain a fine-grained contour map, a medium-grained contour map, and a coarse-grained contour map of the same image block.
[0065] The method uses statistical analysis of the pixel values of each image block to generate three threshold levels, from coarse to fine. Each threshold selects contour points corresponding to soil particle boundaries with varying degrees of disparity. The first segmentation threshold extracts the most significant contour points; subsequent segmentation gradually explores smaller, finer particle boundaries, comprehensively capturing soil particle characteristics at multiple scales.
[0066] Coarse-grained: Corresponding to the maximum threshold (first segmentation threshold), only the contour points with the most significant neighborhood differences are retained, reflecting strong boundary features (such as the clear edges of large soil blocks). Medium-grained: Corresponding to the medium threshold (second segmentation threshold), the contour points with moderate neighborhood differences are captured, reflecting moderately significant boundaries (such as the edges of medium-sized soil blocks). Fine-grained: Corresponding to the minimum threshold (third segmentation threshold), the contour points with the subtlest neighborhood differences are extracted, reflecting weak boundary features (such as the fuzzy edges of small soil blocks or broken soil particles).
[0067] In this embodiment, S15 includes the following sub-steps:
[0068] S151. In each image block, taking each pixel as the center, calculate the difference between the pixel value of each pixel in the neighborhood and the pixel value of the central pixel;
[0069] S152, when the difference values of the neighborhood are all less than the first segmentation threshold, the central pixel is marked as a non-contour point, and other pixels not marked as non-contour points are marked as fine-medium-coarse-grained contour points;
[0070] S153, when the difference values of the neighborhood are all less than the second segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-medium granularity contour points;
[0071] S154, when the difference values of the neighborhood are all less than the third segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-grained contour points, to generate a fine-grained contour map;
[0072] S155, removing pixel points marked as fine-grained contour points from the fine-medium-grained contour points, obtaining medium-grained contour points, and generating a medium-grained contour map;
[0073] S156 , removing pixel points marked as fine-medium-grained contour points from among the fine-medium-coarse-grained contour points to obtain coarse-grained contour points and generate a coarse-grained contour map.
[0074] In this embodiment, the neighborhood range in S151 can be set to 3×3 or 5×5.
[0075] In this embodiment, the specific process of S15 is described as follows:
[0076] A1. In each image block, with each pixel as the center, when the difference of the neighborhood is less than the first segmentation threshold, the center pixel is marked as a non-contour point, and the other pixels not marked as non-contour points are marked as fine-medium-coarse-grained contour points. The pixel values of non-contour points are set to 0, and the pixel values of fine-medium-coarse-grained contour points are set to 1. A fine-medium-coarse-grained contour map is obtained. The pixel value of 0 is rendered white, and the pixel value of 1 is rendered black, as shown in the following example. Figure 2 shown.
[0077] A2. In each image block, with each pixel as the center, when the difference of the neighborhood is less than the second segmentation threshold, the center pixel is marked as a non-contour point, and the other pixels not marked as non-contour points are marked as fine-medium granularity contour points. The pixel values of non-contour points are set to 0, and the pixel values of fine-medium granularity contour points are set to 1. A fine-medium granularity contour map is obtained. The pixel value of 0 is rendered white, and the pixel value of 1 is rendered black, as shown in FIG. Figure 3 shown.
[0078] A3. In each image block, with each pixel as the center, when the difference in the neighborhood is less than the third segmentation threshold, the central pixel is marked as a non-contour point, and the other pixels not marked as non-contour points are marked as fine-grained contour points. The pixel values of non-contour points are set to 0, and the pixel values of fine-grained contour points are set to 1 to obtain a fine-grained contour map. The pixel value of 0 is rendered white, and the pixel value of 1 is rendered black, as shown in the following example. Figure 4 shown.
[0079] A1 to A3 are performed independently.
[0080] In the fine-medium-coarse-grained contour map, the pixel points marked as fine-medium-grained contour points in A2 are removed (the remaining contour points are coarse-grained contour points), the pixel values of the coarse-grained contour points are set to 1, and the pixel values of other positions are set to 0 to obtain the coarse-grained contour map.
[0081] In the fine and medium-grained contour map, the pixel points marked as fine-grained contour points in A3 are removed (the remaining contour points are medium-grained contour points), the pixel values of the medium-grained contour points are set to 1, and the pixel values of other positions are set to 0 to obtain the medium-grained contour map.
[0082] Since the first segmentation threshold > the second segmentation threshold > the third segmentation threshold, the contour points marked in S152 include three scales of "fine, medium and coarse", and the number of marked contour points is the largest. The contour points marked in S153 include two scales of "fine and medium", and the contour points marked in S154 include one scale of "fine". In S155, the pixel points marked as fine-grained contour points are eliminated from the fine- and medium-grained contour points, and the contour points whose neighborhood difference is greater than the third segmentation threshold and less than the second segmentation threshold are obtained. In S156, the pixel points marked as fine- and medium-grained contour points are eliminated from the fine-, medium- and coarse-grained contour points, and the contour points whose neighborhood difference is greater than the second segmentation threshold and less than the first segmentation threshold are obtained.
[0083] In this embodiment, S2 includes the following sub-steps:
[0084] S21, taking each contour point in the contour map as the center, counting the number of contour points within a 7×7 neighborhood, and taking the number of contour points within the 7×7 neighborhood as the local aggregation degree of the contour point at the center;
[0085] S22, averaging the local aggregation of each contour point to obtain a local mean;
[0086] S23, calculating the local mean value based on the difference between the local aggregation degree of each contour point and the local mean;
[0087] S24. Arrange the local uniform values of each image block in the order of the image blocks to construct an M×L local uniform value matrix, wherein, when the contour map in S21 is a fine-grained contour map and the contour points are fine-grained contour points, the local uniform value matrix in S23 is a fine-grained local uniform value matrix; when the contour map in S21 is a medium-grained contour map and the contour points are medium-grained contour points, the local uniform value matrix in S23 is a medium-grained local uniform value matrix; when the contour map in S21 is a coarse-grained contour map and the contour points are coarse-grained contour points, the local uniform value matrix in S23 is a coarse-grained local uniform value matrix.
[0088] In this embodiment, the formula for calculating the local uniform value in S23 is: , where γ Lo is the local uniform value, h Lo,i is the local aggregation degree of the i-th contour point, h Lo,avg is the local mean, K is the number of contour points in the contour map, i is a positive integer, and ε is a constant greater than 0.
[0089] In this embodiment, the value of ε is 1 to avoid the denominator being 0.
[0090] The present invention counts the number of contour points within the 7×7 neighborhood of each contour point to determine the distribution of soil block contours of different scales. The uniformity of contour point distribution in the image block area is reflected according to the difference between the local aggregation degree of each contour point and the local mean.
[0091] In this embodiment, S3 includes the following sub-steps:
[0092] S31, averaging the number of contour points in the contour map corresponding to each image block to obtain a global mean;
[0093] S32, calculating the global mean value of the image block according to the difference between the number of contour points in the contour map corresponding to each image block and the global mean;
[0094] S33. Arrange the global mean values of the image blocks in the order of the image blocks to construct an M×L global mean value matrix.
[0095] The fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map are respectively executed according to steps S31 to S33 to obtain corresponding global uniform value matrices.
[0096] When the contour map in S31 is a fine-grained contour map and the contour points are fine-grained contour points, the global average value matrix in S33 is a fine-grained global average value matrix. When the contour map in S31 is a medium-grained contour map and the contour points are medium-grained contour points, the global average value matrix in S33 is a medium-grained global average value matrix. When the contour map in S31 is a coarse-grained contour map and the contour points are coarse-grained contour points, the global average value matrix in S33 is a coarse-grained global average value matrix. Taking the fine-grained contour map as an example: the number of fine-grained contour points in the fine-grained contour map corresponding to each image block is averaged to obtain the global average corresponding to the fine grain. Based on the difference between the number of fine-grained contour points in the fine-grained contour map corresponding to each image block and the global average corresponding to the fine grain, the global average value of the image block is calculated. The global average values of each image block are arranged in the order of the image blocks to construct an M×L fine-grained global average value matrix. The global average value matrices for the medium-grained contour map and the coarse-grained contour map are constructed in the same way.
[0097] In this embodiment, the formula for calculating the global mean value of the image block in S32 is: , where θ Go,j is the global average value of the jth image block, h Go,j is the number of contour points in the contour map corresponding to the jth image block, h Go,avg is the global mean, j is a positive integer, and ε is a constant greater than 0.
[0098] Since there are M×L image blocks in the soil image, one image block corresponds to the contour maps at three scales. Under the contour map of each scale, the number of contour points in the contour map of each image block is averaged to obtain the global mean, which reflects the level of the overall number of contour points. According to the gap between the number of contour points in the contour map of each image block and the global mean, the global uniform value of the image block is calculated. The smaller the gap between the number of contour points in the contour map of the image block and the global mean, the closer the number of contour points at the image block is to the average level, and the more uniform the distribution of the soil block contour is.
[0099] like Figure 5 As shown in Figure 4, the multi-grained convolutional assessment model for crushed soil quality in S4 includes: a fine-grained uniform feature fusion unit, a medium-grained uniform feature fusion unit, a coarse-grained uniform feature fusion unit, a first shallow uniform feature extraction unit, a second shallow uniform feature extraction unit, a third shallow uniform feature extraction unit, a first deep uniform feature extraction unit, a second deep uniform feature extraction unit, a third deep uniform feature extraction unit, a deep uniform feature fusion unit, a shallow uniform feature fusion unit, a first CNN network, a second CNN network, a Concat layer, and a fully connected layer.
[0100] The fine-grained uniform feature fusion unit is used to fuse the corresponding features of the fine-grained local uniform value matrix and the fine-grained global uniform value matrix to obtain fine-grained uniform features; the medium-grained uniform feature fusion unit is used to fuse the corresponding features of the medium-grained local uniform value matrix and the medium-grained global uniform value matrix to obtain medium-grained uniform features; the coarse-grained uniform feature fusion unit is used to fuse the corresponding features of the coarse-grained local uniform value matrix and the coarse-grained global uniform value matrix to obtain coarse-grained uniform features;
[0101] The first shallow uniform feature extraction unit is used to extract fine-grained shallow uniform features from fine-grained uniform features; the second shallow uniform feature extraction unit is used to extract medium-grained shallow uniform features from medium-grained uniform features; the third shallow uniform feature extraction unit is used to extract coarse-grained shallow uniform features from coarse-grained uniform features;
[0102] The first deep uniform feature extraction unit is used to extract fine-grained deep uniform features from fine-grained shallow uniform features; the second deep uniform feature extraction unit is used to extract medium-grained deep uniform features from medium-grained shallow uniform features; the third deep uniform feature extraction unit is used to extract coarse-grained deep uniform features from coarse-grained shallow uniform features;
[0103] The deep uniform feature fusion unit is used to fuse the fine-grained deep uniform features, the medium-grained deep uniform features and the coarse-grained deep uniform features to obtain the deep fusion features; the shallow uniform feature fusion unit is used to fuse the fine-grained shallow uniform features, the medium-grained shallow uniform features and the coarse-grained shallow uniform features to obtain the shallow fusion features;
[0104] The first CNN network is used to extract features from the deep fusion features to obtain the first features to be classified; the second CNN network is used to extract features from the shallow fusion features to obtain the second features to be classified; the Concat layer is used to splice the first features to be classified and the second features to be classified to obtain the spliced features;
[0105] The fully connected layer is used to output the crushed soil quality score based on the splicing features.
[0106] The present invention uses a local mean value matrix to reflect the local details of an image block, while a global mean value matrix reflects the overall features. Combining the two allows the model to simultaneously capture both the local fine information and the global structural information of an image block, avoiding focusing on the local while ignoring the overall layout, or focusing on the global while missing details, thereby making the features more complete.
[0107] The present invention extracts features at different depths through a shallow uniform feature extraction unit and a deep uniform feature extraction unit, fuses the shallow features through a shallow uniform feature fusion unit, and fuses the deep features through a deep uniform feature fusion unit, further extracts features through a first CNN network and a second CNN network, and integrates the features at two depths to improve the assessment accuracy of the crushed soil quality score.
[0108] like Figure 6 As shown, the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit and the coarse-grained uniform feature fusion unit all include: a first convolutional layer, a second convolutional layer and a Hadamard product , the convolution kernel size of the first convolution layer and the second convolution layer is 1×1, and the specific expressions are: , where G is the output of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit, or the coarse-grained uniform feature fusion unit, g1 is the matrix input to the first input terminal, and g2 is the matrix input to the second input terminal. is the Hadamard product, and Conv is the convolution operation.
[0109] In the fine-grained uniform feature fusion unit, g1 is the fine-grained local uniform value matrix, and g2 is the fine-grained global uniform value matrix; in the medium-grained uniform feature fusion unit, g1 is the medium-grained local uniform value matrix, and g2 is the medium-grained global uniform value matrix; in the coarse-grained uniform feature fusion unit, g1 is the coarse-grained local uniform value matrix, and g2 is the coarse-grained global uniform value matrix.
[0110] The uniform feature fusion unit processes the input matrices g1 and g2 using convolution (Conv). Convolution extracts local features and explores inter-feature correlations. The two convolution results are then fused using the Hadamard product, achieving element-by-element multiplication between features. This allows for deep interaction between features from different sources, generating a more discriminative feature representation.
[0111] In this embodiment, deep fusion feature = fine-grained deep uniform feature ⊕ medium-grained deep uniform feature ⊕ coarse-grained deep uniform feature, where ⊕ represents element-wise addition;
[0112] Shallow fusion features = fine-grained shallow uniform features ⊕ medium-grained shallow uniform features ⊕ coarse-grained shallow uniform features.
[0113] like Figure 7 As shown, the first shallow uniform feature extraction unit, the second shallow uniform feature extraction unit and the third shallow uniform feature extraction unit all include: a first Conv block and a second Conv block, the convolution kernel size of the first Conv block is: 3×3, and the convolution kernel size of the second Conv block is: 1×1.
[0114] like Figure 8As shown, the first deep uniform feature extraction unit, the second deep uniform feature extraction unit and the third deep uniform feature extraction unit all include: a third Conv block and a fourth Conv block, the convolution kernel size of the third Conv block is: 3×3, and the convolution kernel size of the fourth Conv block is: 5×5.
[0115] The Conv block includes: convolutional layer, ReLU layer and normalization layer.
[0116] The present invention first divides the soil image into M×L image blocks of uniform size. For each image block, fine-, medium-, and coarse-grained contour maps are extracted to obtain contour features of varying boundary significance. The coarse-grained contour map corresponds to the macroscopic boundary information of large-scale soil blocks (e.g., the edges of insufficiently fragmented soil blocks); the medium-grained contour map corresponds to the boundary characteristics of medium-scale soil blocks (e.g., the edges of moderately fragmented soil blocks); and the fine-grained contour map corresponds to the subtle boundary information of small-scale soil blocks or crushed soil particles (e.g., the edges of finely crushed soil particles). Based on the contour point distribution of the three types of contour maps, local uniformity matrices for fine, medium, and coarse grains are constructed to characterize the spatial distribution uniformity of contour points of each particle size within a single image block. Furthermore, based on the number of contour points in the three types of contour maps, global uniformity matrices for fine, medium, and coarse grains are constructed to reflect the global deviation in the number of contour points of the same particle size across image blocks. Finally, by integrating the above matrices (three local uniform value matrices + three global uniform value matrices) into the multi-granularity convolution assessment model of crushed soil quality, we can fully capture the multi-scale characteristics of soil particles, finely extract image features, and accurately quantify the uniformity of the spatial distribution of soil particles, thereby significantly improving the accuracy of crushed soil quality assessment.
[0117] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for evaluating soil crushing quality of a rotary tiller, characterized in that: The following steps are involved: S1. Collect soil images after tillage with a rotary tiller, divide the soil images into M × L image blocks of equal size, and extract fine-grained contour maps, medium-grained contour maps, and coarse-grained contour maps for each image block, where M is the number of image blocks in the horizontal direction and L is the number of image blocks in the vertical direction. S2. Constructing a fine-grained local uniform value matrix, a medium-grained local uniform value matrix, and a coarse-grained local uniform value matrix according to the distribution of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map, respectively; S3, constructing a fine-grained global uniform value matrix, a medium-grained global uniform value matrix, and a coarse-grained global uniform value matrix according to the number of contour points in the fine-grained contour map, the medium-grained contour map, and the coarse-grained contour map corresponding to each image block; S4. Use the multi-grained convolution evaluation model of crushed soil quality to process the fine-grained local uniform value matrix, medium-grained local uniform value matrix, coarse-grained local uniform value matrix, fine-grained global uniform value matrix, medium-grained global uniform value matrix and coarse-grained global uniform value matrix to obtain the crushed soil quality score.
2. The soil crushing quality assessment method of a rotary tiller according to claim 1, characterized in that: The S1 comprises the following sub-steps: S11, extracting the maximum pixel value and the minimum pixel value in each image block, taking the average of the minimum pixel values of all image blocks to obtain the minimum pixel mean, and taking the average of the maximum pixel values of all image blocks to obtain the maximum pixel mean; S12, taking 1 / 2 of the difference between the maximum pixel mean and the minimum pixel mean as the first segmentation threshold; S13, taking 1 / 2 of the first segmentation threshold as the second segmentation threshold; S14, taking 1 / 2 of the second segmentation threshold as the third segmentation threshold; S15. In each image block, based on the first segmentation threshold, the second segmentation threshold, and the third segmentation threshold, non-contour points are marked to obtain a fine-grained contour map, a medium-grained contour map, and a coarse-grained contour map of the same image block.
3. The soil crushing quality assessment method of a rotary tiller according to claim 2, characterized in that: The S15 comprises the following sub-steps: S151. In each image block, taking each pixel as the center, calculate the difference between the pixel value of each pixel in the neighborhood and the pixel value of the central pixel; S152: When the difference values of the neighborhood are all less than the first segmentation threshold, the central pixel is marked as a non-contour point, and other pixels not marked as non-contour points are marked as fine-medium-coarse-grained contour points; S153, when the difference values of the neighborhood are all less than the second segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-medium granularity contour points; S154, when the difference values of the neighborhood are all less than the third segmentation threshold, the central pixel is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-grained contour points, to generate a fine-grained contour map; S155, removing the pixel points marked as fine-grained contour points from the fine-medium-grained contour points, obtaining medium-grained contour points, and generating a medium-grained contour map; S156 , removing pixel points marked as fine-medium-grained contour points from among the fine-medium-coarse-grained contour points, obtaining coarse-grained contour points, and generating a coarse-grained contour map.
4. The soil crushing quality assessment method of a rotary tiller according to claim 1, characterized in that: The S2 comprises the following sub-steps: S21, taking each contour point in the contour map as the center, counting the number of contour points within a 7×7 neighborhood, and taking the number of contour points within the 7×7 neighborhood as the local aggregation degree of the contour point at the center; S22, averaging the local aggregation of each contour point to obtain a local mean; S23, calculating the local mean value based on the difference between the local aggregation degree of each contour point and the local mean; S24. Arrange the local uniform values of each image block in the order of the image blocks to construct an M×L local uniform value matrix, wherein, when the contour map in S21 is a fine-grained contour map, the local uniform value matrix in S23 is a fine-grained local uniform value matrix; when the contour map in S21 is a medium-grained contour map, the local uniform value matrix in S23 is a medium-grained local uniform value matrix; when the contour map in S21 is a coarse-grained contour map, the local uniform value matrix in S23 is a coarse-grained local uniform value matrix.
5. The soil crushing quality assessment method of a rotary tiller according to claim 4, characterized in that: The formula for calculating the local uniform value in S23 is: , where γ Lo is the local uniform value, h Lo,i is the local aggregation degree of the i-th contour point, h Lo,avg is the local mean, K is the number of contour points in the contour map, i is a positive integer, and ε is a constant greater than 0.
6. The soil crushing quality assessment method of a rotary tiller according to claim 1, characterized in that: The S3 includes the following sub-steps: S31, averaging the number of contour points in the contour map corresponding to each image block to obtain a global mean; S32, calculating the global mean value of the image block according to the difference between the number of contour points in the contour map corresponding to each image block and the global mean; S33. Arrange the global uniform values of each image block in the order of the image blocks to construct an M×L global uniform value matrix, wherein, when the contour map in S31 is a fine-grained contour map, the global uniform value matrix in S33 is a fine-grained global uniform value matrix; when the contour map in S31 is a medium-grained contour map, the global uniform value matrix in S33 is a medium-grained global uniform value matrix; when the contour map in S31 is a coarse-grained contour map, the global uniform value matrix in S33 is a coarse-grained global uniform value matrix.
7. The soil crushing quality assessment method of a rotary tiller according to claim 6, characterized in that: The formula for calculating the global average value of the image block in S32 is: , where θ Go,j is the global average value of the jth image block, h Go,j is the number of contour points in the contour map corresponding to the jth image block, h Go,avg is the global mean, j is a positive integer, and ε is a constant greater than 0.
8. The soil crushing quality assessment method of a rotary tiller according to claim 1, characterized in that: The S4 medium-sized convolutional assessment model for crushed soil quality includes: a fine-grained uniform feature fusion unit, a medium-grained uniform feature fusion unit, a coarse-grained uniform feature fusion unit, a first shallow uniform feature extraction unit, a second shallow uniform feature extraction unit, a third shallow uniform feature extraction unit, a first deep uniform feature extraction unit, a second deep uniform feature extraction unit, a third deep uniform feature extraction unit, a deep uniform feature fusion unit, a shallow uniform feature fusion unit, a first CNN network, a second CNN network, a Concat layer, and a fully connected layer; The fine-grained uniform feature fusion unit is used to fuse the corresponding features of the fine-grained local uniform value matrix and the fine-grained global uniform value matrix to obtain fine-grained uniform features; the medium-grained uniform feature fusion unit is used to fuse the corresponding features of the medium-grained local uniform value matrix and the medium-grained global uniform value matrix to obtain medium-grained uniform features; the coarse-grained uniform feature fusion unit is used to fuse the corresponding features of the coarse-grained local uniform value matrix and the coarse-grained global uniform value matrix to obtain coarse-grained uniform features; The first shallow uniform feature extraction unit is used to extract fine-grained shallow uniform features from fine-grained uniform features; the second shallow uniform feature extraction unit is used to extract medium-grained shallow uniform features from medium-grained uniform features; the third shallow uniform feature extraction unit is used to extract coarse-grained shallow uniform features from coarse-grained uniform features; The first deep uniform feature extraction unit is used to extract fine-grained deep uniform features from fine-grained shallow uniform features; the second deep uniform feature extraction unit is used to extract medium-grained deep uniform features from medium-grained shallow uniform features; the third deep uniform feature extraction unit is used to extract coarse-grained deep uniform features from coarse-grained shallow uniform features; The deep uniform feature fusion unit is used to fuse the fine-grained deep uniform feature, the medium-grained deep uniform feature and the coarse-grained deep uniform feature to obtain a deep fusion feature; the shallow uniform feature fusion unit is used to fuse the fine-grained shallow uniform feature, the medium-grained shallow uniform feature and the coarse-grained shallow uniform feature to obtain a shallow fusion feature; The first CNN network is used to extract features from the deep fusion features to obtain first features to be classified; the second CNN network is used to extract features from the shallow fusion features to obtain second features to be classified; the Concat layer is used to splice the first features to be classified and the second features to be classified to obtain spliced features; The fully connected layer is used to output a crushed soil quality score based on the splicing features.
9. The soil crushing quality assessment method of a rotary tiller according to claim 8, characterized in that: The expressions of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit, and the coarse-grained uniform feature fusion unit are all: , where G is the output of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit, or the coarse-grained uniform feature fusion unit, g1 is the matrix input to the first input terminal, and g2 is the matrix input to the second input terminal. is the Hadamard product, and Conv is the convolution operation.
10. The soil crushing quality assessment method of a rotary tiller according to claim 8, characterized in that: The deep fusion feature = fine-grained deep uniform feature ⊕ medium-grained deep uniform feature ⊕ coarse-grained deep uniform feature, where ⊕ represents element-wise addition; Shallow fusion features = fine-grained shallow uniform features ⊕ medium-grained shallow uniform features ⊕ coarse-grained shallow uniform features.
Citation Information
Patent Citations
Ore particle segmentation system and method and machine readable storage medium
CN113344912A
High-standard farmland big data intelligent management platform and method based on Internet of Things
CN118313800A
Concrete crack detection method based on optical scanning technology
CN118781096A
Rotary cultivator crushed soil quality detection system and method based on image technology
CN119359633A
Method for estimating particle size distribution of soil
JP2021117625A