A method for evaluating soil breaking quality of a 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
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-17
- 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 image blocks, and the fine-grained, medium-grained, and coarse-grained contour maps are extracted. Local and global uniform value matrices are constructed, and a multi-grained convolutional soil crushing quality assessment model is used to fuse multi-scale features 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 CN120635615B_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] Further, S1 comprises the following sub-steps:
[0010] S11, extracting the maximum pixel value and the minimum pixel value in each image block, taking the average value of the minimum pixel value of all image blocks to obtain the minimum pixel mean value, and taking the average value of the maximum pixel value of all image blocks to obtain the maximum pixel mean value;
[0011] S12, taking 1 / 2 of the difference between the maximum pixel mean value and the minimum pixel mean value as the first segmentation threshold value;
[0012] S13, taking 1 / 2 of the first segmentation threshold value as the second segmentation threshold value;
[0013] S14, taking 1 / 2 of the second segmentation threshold value as the third segmentation threshold value;
[0014] S15, in each image block, based on the first segmentation threshold value, the second segmentation threshold value and the third segmentation threshold value, marking the non-contour points to obtain the fine-grained contour map, the medium-grained contour map and the coarse-grained contour map of the same image block.
[0015] Further, S15 comprises the following sub-steps:
[0016] S151, in each image block, calculating the difference between the pixel value of each pixel point in the neighborhood and the pixel value of the center pixel point;
[0017] S152, when the differences in the neighborhood are all less than the first segmentation threshold value, marking the center pixel point as a non-contour point, and marking the other pixel points not marked as non-contour points as fine-medium-coarse-grained contour points;
[0018] S153, when the differences in the neighborhood are all less than the second segmentation threshold value, marking the center pixel point as a non-contour point, and marking the other pixel points not marked as non-contour points as fine-medium-grained contour points;
[0019] S154, when the differences in the neighborhood are all less than the third segmentation threshold value, marking the center pixel point as a non-contour point, and marking the other pixel points not marked as non-contour points as fine-grained contour points to generate the fine-grained contour map;
[0020] S155, eliminating the pixel points marked as fine-grained contour points from the fine-medium-grained contour points to obtain the medium-grained contour points and generate the medium-grained contour map;
[0021] S156, eliminating the pixel points marked as fine-medium-grained contour points from the fine-medium-coarse-grained contour points to obtain the coarse-grained contour points and generate the coarse-grained contour map.
[0022] Further, S2 comprises the following sub-steps:
[0023] S21, counting the number of contour points in a 7x7 neighborhood centered on each contour point in the contour map, and taking the number of contour points in the 7x7 neighborhood as the local concentration of the contour point at the center;
[0024] S22, averaging the local concentrations of the contour points in a contour map to obtain a local mean value;
[0025] S23, calculating a local uniform value according to the difference between the local concentration of each contour point and the local mean value;
[0026] S24, arranging the local uniform values of each image block in the order of the image blocks to construct a local uniform value matrix of MxL, 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, and 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] Further, the formula for calculating the local uniform value in S23 is: wherein γ Lo is the local uniform value, h Lo,i is the local concentration of the i-th contour point, h Lo,avg is the local mean value, K is the number of contour points in the contour map, i is a positive integer, and ε is a constant greater than 0.
[0028] Further, 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 value;
[0030] S32, calculating the global uniform value of each 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 value;
[0031] S33, arranging the global uniform values of each image block in the order of the image blocks to construct a global uniform value matrix of MxL, 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, and 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] Further, the formula for calculating the global uniform value of each image block in S32 is: wherein θ Go,j is the global uniform value of the j-th 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 full connection layer is used to output the soil crushing quality score according to the spliced features.
[0040] Further, the expression of the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit and the coarse-grained uniform feature fusion unit is: Wherein, 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 by the first input end, g2 is the matrix input by the second input end, is Hadamard product, and Conv is convolution operation.
[0041] Further, the deep layer fusion feature = fine-grained deep layer uniform feature ⊕ medium-grained deep layer uniform feature ⊕ coarse-grained deep layer uniform feature, wherein ⊕ is element-wise addition.
[0042] The shallow layer fusion feature = fine-grained shallow layer uniform feature ⊕ medium-grained shallow layer uniform feature ⊕ coarse-grained shallow layer uniform feature.
[0043] The beneficial effects of the present application are: the present application first divides the soil image into MxL image blocks of the same size, extracts fine-grained contours, medium-grained contours and coarse-grained contours for each image block, obtains contours with different boundary clarity, the coarse-grained contour reflects large-scale and macroscopic soil block boundary information, the fine-grained contour reflects small-scale soil block boundary information, and the medium-grained contour reflects medium-scale soil block boundary information. Figure Three The aspect obtains contour point distribution, constructs fine, medium and coarse-grained local uniform value matrices, reflects the uniformity of fine, medium and coarse-grained contour point distribution in each image block, and based on the number of contour points in the fine, medium and coarse-grained contour maps, constructs fine, medium and coarse-grained global uniform value matrices, reflects the deviation of the number of three kinds of contour points at each image block, and comprehensively captures the multi-scale characteristics of soil particles, finely extracts soil image features, accurately quantifies the spatial distribution and uniformity of soil particles, and thus effectively improves the soil crushing quality evaluation precision. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 It is a flowchart of a soil crushing quality evaluation method of a rotary cultivator;
[0045] Figure 2 It is a fine, medium and coarse-grained contour map;
[0046] Figure 3 It is a fine and medium-grained contour map;
[0047] Figure 4 It is a fine-grained contour map;
[0048] Figure 5 a structure diagram of a soil crushing quality multi-granularity convolution evaluation model;
[0049] Figure 6 a structure diagram of a fine-granularity uniform feature fusion unit, a medium-granularity uniform feature fusion unit and a coarse-granularity uniform feature fusion unit;
[0050] Figure 7 a structure diagram of a first shallow uniform feature extraction unit, a second shallow uniform feature extraction unit and a third shallow uniform feature extraction unit;
[0051] Figure 8 a structure diagram of a first deep uniform feature extraction unit, a second deep uniform feature extraction unit and a third deep uniform feature extraction unit. DETAILED DESCRIPTION
[0052] The specific embodiments of the present application are described below to facilitate the understanding of the present application for those skilled in the art, but it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, any changes within the spirit and scope of the present application defined and determined by the appended claims are obvious, and all the inventions utilizing the concept of the present application are within the scope of protection.
[0053] As shown in Figure 1 a soil crushing quality evaluation method of a rotary cultivator, comprising the following steps:
[0054] S1, collecting soil images after the rotary cultivator is cultivated, dividing the soil images into MxL image blocks of the same size, extracting a fine-granularity contour map, a medium-granularity contour map and a coarse-granularity contour map for each image block, 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-granularity local uniform value matrix, a medium-granularity local uniform value matrix and a coarse-granularity local uniform value matrix according to the distribution of contour points in the fine-granularity contour map, the medium-granularity contour map and the coarse-granularity contour map, respectively;
[0056] S3, constructing a fine-granularity global uniform value matrix, a medium-granularity global uniform value matrix and a coarse-granularity global uniform value matrix according to the number of contour points in the fine-granularity contour map, the medium-granularity contour map and the coarse-granularity contour map corresponding to each image block, respectively;
[0057] S4, processing the fine-granularity local uniform value matrix, the medium-granularity local uniform value matrix, the coarse-granularity local uniform value matrix, the fine-granularity global uniform value matrix, the medium-granularity global uniform value matrix and the coarse-granularity global uniform value matrix by using a soil crushing quality multi-granularity convolution evaluation model to obtain a soil crushing quality score.
[0058] In the embodiment, the lateral length of the soil image is 800 pixels, the longitudinal length is 600 pixels, the lateral direction is divided into 40-pixel columns, and the longitudinal direction is divided into 60-pixel rows, so that M is 20 and L is 10.
[0059] In the embodiment, S1 comprises the following steps:
[0060] S11, extracting the maximum pixel value and the minimum pixel value in each image block, taking the average value of the minimum pixel values of all image blocks to obtain the minimum pixel mean value, and taking the average value of the maximum pixel values of all image blocks to obtain the maximum pixel mean value;
[0061] S12, taking 1 / 2 of the difference between the maximum pixel mean value and the minimum pixel mean value 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, marking non-contour points 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 present application generates three-level thresholds through statistical analysis of the pixel values of each image block, from coarse granularity to fine granularity, and each threshold screens out contour points corresponding to soil particle boundaries in different gap conditions. The first segmentation threshold is used to extract the most prominent contour points of the boundary; and subsequent small-scale and more detailed particle boundaries are gradually excavated to comprehensively capture the soil particle characteristics from multiple scales.
[0066] Coarse granularity: corresponding to the maximum threshold (the first segmentation threshold), only the most prominent contour points of the neighborhood difference are retained, and strong boundary features (such as the obvious edges of large soil blocks) are embodied. Medium granularity: corresponding to the medium threshold (the second segmentation threshold), contour points with medium neighborhood difference are captured, and medium prominent boundaries (such as the edges of medium soil blocks) are embodied. Fine granularity: corresponding to the minimum threshold (the third segmentation threshold), the most subtle contour points of the neighborhood difference are extracted, and weak boundary features (such as the blurred edges of small soil blocks or soil particles) are embodied.
[0067] In the embodiment, S15 comprises the following steps:
[0068] S151, in each image block, calculating the difference between the pixel value of each pixel point in the neighborhood and the pixel value of the center pixel point with the center pixel point as the center;
[0069] S152, when the difference values of the neighborhood are all less than the first segmentation threshold, the center pixel point is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-medium-coarse granularity contour points;
[0070] S153, when the difference values of the neighborhood are all less than the second segmentation threshold, the center pixel point 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 center pixel point is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine granularity contour points, to generate a fine granularity contour map;
[0072] S155, in the fine-medium-coarse granularity contour points, the pixel points marked as fine granularity contour points are removed to obtain medium granularity contour points, to generate a medium granularity contour map;
[0073] S156, in the fine-medium-coarse granularity contour points, the pixel points marked as fine-medium granularity contour points are removed to obtain coarse granularity contour points, to generate a coarse granularity contour map.
[0074] In the embodiment, the neighborhood range in S151 can be set to 3x3 or 5x5.
[0075] In the embodiment, the specific process of S15 is as follows:
[0076] A1, in each image block, taking each pixel point as the center, when the difference values of the neighborhood are all less than the first segmentation threshold, the center pixel point is marked as a non-contour point, and other pixel points not marked as non-contour points are marked as fine-medium-coarse granularity contour points, the pixel value of the non-contour point is set to 0, and the pixel value of the fine-medium-coarse granularity contour point is set to 1, to obtain a fine-medium-coarse granularity contour map, the pixel value of 0 is rendered to white, and the pixel value of 1 is rendered to black, as shown in Figure 2 .
[0077] A2, in each image block, taking each pixel point as the center, when the difference values of the neighborhood are all less than the second segmentation threshold, the center pixel point 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, the pixel value of the non-contour point is set to 0, and the pixel value of the fine-medium granularity contour point is set to 1, to obtain a fine-medium granularity contour map, the pixel value of 0 is rendered to white, and the pixel value of 1 is rendered to black, as shown in Figure 3 .
[0078] A3, in each image block, taking each pixel point as the center, when the difference values of the neighborhood are all less than the third segmentation threshold, marking the center pixel point as a non-contour point, marking other pixel points not marked as non-contour points as fine-grained contour points, setting the pixel value of the non-contour point to 0 and setting the pixel value of the fine-grained contour point to 1, obtaining a fine-grained contour map, rendering the pixel value of 0 as white and the pixel value of 1 as black, as shown in Figure 4
[0079] A1~A3 are independently performed.
[0080] In the fine-to-medium-to-coarse-grained contour map removal A2, the pixel points marked as fine-to-medium-grained contour points (the remaining contour points are coarse-grained contour points) are removed, the pixel value of the coarse-grained contour point is set to 1, and the pixel value of other positions is set to 0, obtaining a coarse-grained contour map.
[0081] In the fine-to-medium-grained contour map removal A3, the pixel points marked as fine-grained contour points (the remaining contour points are medium-grained contour points) are removed, the pixel value of the medium-grained contour point is set to 1, and the pixel value of other positions is set to 0, obtaining a medium-grained contour map.
[0082] Since the first segmentation threshold > the second segmentation threshold > the third segmentation threshold, the marked contour points in S152 contain "fine-to-medium-to-coarse" three scales, the most marked contour points, the marked contour points in S153 contain "fine-to-medium" two scales, and the marked contour points in S154 contain "fine" one scale; in S155, the pixel points marked as fine-grained contour points are removed from the fine-to-medium-grained contour points, obtaining the contour points in the range of the difference value of the neighborhood greater than the third segmentation threshold and less than the second segmentation threshold; in S156, the pixel points marked as fine-to-medium-grained contour points are removed from the fine-to-medium-to-coarse-grained contour points, obtaining the contour points in the range of the difference value of the neighborhood greater than the second segmentation threshold and less than the first segmentation threshold.
[0083] In the embodiment, S2 includes the following steps:
[0084] S21, taking each contour point in the contour map as the center, counting the number of contour points in the 7x7 neighborhood range, and taking the number of contour points in the 7x7 neighborhood range as the local aggregation degree of the contour point at the center;
[0085] S22, calculating the local mean value of the local aggregation degree of each contour point;
[0086] S23, calculating the local uniform value according to the difference between the local aggregation degree of each contour point and the local mean value;
[0087] S24, arrange the local uniform values of each image block in the order of the image blocks to construct a local uniform value matrix of MxL, wherein when the contour map is a fine-grained contour map and the contour points are fine-grained contour points in S21, the local uniform value matrix in S23 is a fine-grained local uniform value matrix, when the contour map is a medium-grained contour map and the contour points are medium-grained contour points in S21, the local uniform value matrix in S23 is a medium-grained local uniform value matrix, and when the contour map is a coarse-grained contour map and the contour points are coarse-grained contour points in S21, the local uniform value matrix in S23 is a coarse-grained local uniform value matrix.
[0088] In the embodiment, the formula for calculating the local uniform value in S23 is: wherein γ 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 value, 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 the embodiment, ε is 1, which is used to avoid a denominator of 0.
[0090] The application counts the number of contour points in the 7x7 neighborhood of each contour point to determine the distribution of the contours of soil blocks of different scales, and reflects the uniformity of the distribution of contour points in the image block region according to the difference between the local aggregation degree and the local mean value of each contour point.
[0091] In the embodiment, S3 includes the following steps:
[0092] S31, average the number of contour points in the contour map corresponding to each image block to obtain a global mean value;
[0093] S32, calculate the global uniform value of each 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 value;
[0094] S33, arrange the global uniform values of each image block in the order of the image blocks to construct a global uniform value matrix of MxL.
[0095] The fine-grained contour map, the medium-grained contour map and the coarse-grained contour map are respectively executed according to steps S31-S33 to obtain the corresponding global uniform value matrix.
[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 configured to fuse 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 configured to fuse corresponding features of the medium-grained local uniform value matrix and the medium-grained global uniform value matrix to obtain medium-grained uniform features; and the coarse-grained uniform feature fusion unit is configured to fuse 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 configured to extract fine-grained shallow uniform features from the fine-grained uniform features; the second shallow uniform feature extraction unit is configured to extract medium-grained shallow uniform features from the medium-grained uniform features; and the third shallow uniform feature extraction unit is configured to extract coarse-grained shallow uniform features from the coarse-grained uniform features.
[0102] The first deep uniform feature extraction unit is configured to extract fine-grained deep uniform features from the fine-grained shallow uniform features; the second deep uniform feature extraction unit is configured to extract medium-grained deep uniform features from the medium-grained shallow uniform features; and the third deep uniform feature extraction unit is configured to extract coarse-grained deep uniform features from the coarse-grained shallow uniform features.
[0103] The deep uniform feature fusion unit is configured to fuse the fine-grained deep uniform features, the medium-grained deep uniform features and the coarse-grained deep uniform features to obtain deep fusion features; and the shallow uniform feature fusion unit is configured to fuse the fine-grained shallow uniform features, the medium-grained shallow uniform features and the coarse-grained shallow uniform features to obtain shallow fusion features.
[0104] The first CNN network is configured to extract features from the deep fusion features to obtain first classification features; the second CNN network is configured to extract features from the shallow fusion features to obtain second classification features; and the Concat layer is configured to concatenate the first classification features and the second classification features to obtain a concatenated feature.
[0105] The fully connected layer is configured to output a soil quality score according to the concatenated feature.
[0106] The local uniform value matrix reflects local detailed features of the image block, and the global uniform value matrix reflects overall features. The fusion of the two can enable the model to simultaneously obtain local fine information and global structural information of the image block, avoid focusing on the local while ignoring the overall layout, or only considering the global while losing details, and make the features more complete.
[0107] The present application extracts features of different depths through the shallow uniform feature extraction unit and the deep uniform feature extraction unit, fuses the shallow features through the shallow uniform feature fusion unit, fuses the deep features through the deep uniform feature fusion unit, further extracts features through the first CNN network and the second CNN network, and comprehensively extracts features of two depths, thereby improving the evaluation accuracy of the soil crushing quality score.
[0108] As shown in Figure 6 , the fine-grained uniform feature fusion unit, the medium-grained uniform feature fusion unit and the coarse-grained uniform feature fusion unit each include a first convolution layer, a second convolution layer and a Hadamard product , the convolution kernel size of the first convolution layer and the second convolution layer is 1x1, and the specific expression is as follows: , wherein 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 by the first input end, g2 is the matrix input by the second input end, is the Hadamard product, and Conv is the convolution operation.
[0109] In the fine-grained uniform feature fusion unit, g1 is a fine-grained local uniform value matrix, and g2 is a fine-grained global uniform value matrix; in the medium-grained uniform feature fusion unit, g1 is a medium-grained local uniform value matrix, and g2 is a medium-grained global uniform value matrix; in the coarse-grained uniform feature fusion unit, g1 is a coarse-grained local uniform value matrix, and g2 is a coarse-grained global uniform value matrix.
[0110] The uniform feature fusion unit processes the input matrices g1 and g2 by using the convolution operation (Conv), and the convolution can extract local features and mine the correlation between features. Then, the two convolution results are fused by using the Hadamard product to realize element-by-element multiplication between features, so that different source features are interacted, and a feature representation with higher discrimination is generated.
[0111] In this embodiment, the deep fusion feature = fine-grained deep uniform feature ⊕ medium-grained deep uniform feature ⊕ coarse-grained deep uniform feature, wherein ⊕ is element-wise addition.
[0112] The shallow fusion feature = fine-grained shallow uniform feature ⊕ medium-grained shallow uniform feature ⊕ coarse-grained shallow uniform feature.
[0113] As shown in Figure 7 , the first shallow uniform feature extraction unit, the second shallow uniform feature extraction unit and the third shallow uniform feature extraction unit each include a first Conv block and a second Conv block, the convolution kernel size of the first Conv block is 3x3, and the convolution kernel size of the second Conv block is 1x1.
[0114] As shown in 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 each include a third Conv block and a fourth Conv block, the third Conv block has a convolution kernel size of 3x3, and the fourth Conv block has a convolution kernel size of 5x5.
[0115] The Conv block includes a convolution layer, a ReLU layer and a normalization layer.
[0116] The present application firstly divides the soil image into MxL image blocks with consistent size, and extracts fine-grained, medium-grained and coarse-grained contour maps for each image block respectively to obtain contour features with different boundary saliencies. Among them: the coarse-grained contour map corresponds to the macro boundary information of large-scale soil blocks (such as the edge of soil blocks not fully broken); the medium-grained contour map corresponds to the boundary features of medium-scale soil blocks (such as the edge of soil blocks with moderate degree of fragmentation); the fine-grained contour map corresponds to the subtle boundary information of small-scale soil blocks or soil particles (such as the edge of fine soil particles). Based on the contour point distribution of the three types of contour maps, fine, medium and coarse-grained local uniform value matrices are constructed to represent the spatial distribution uniformity of contour points of each granularity within a single image block; further, according to the number of contour points of the three types of contour maps, fine, medium and coarse-grained global uniform value matrices are constructed to reflect the global deviation degree of the number of contour points of the same granularity among image blocks. Finally, through the soil particle quality multi-granularity convolution evaluation model, the above matrices (three local uniform value matrices + three global uniform value matrices) are fused to realize comprehensive capture of soil particle multi-scale features, fine extraction of image features, and accurate quantification of soil particle spatial distribution uniformity, thereby significantly improving the accuracy of soil particle quality evaluation.
[0117] The above only for the preferred embodiments of the present application and not for limiting the present application, for those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
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 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 to obtain coarse-grained contour points and generate 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