A corn kernel breakage identification method based on multi-feature fusion

By introducing the edge gradient direction and local texture features of the kernel tip region into the identification of broken corn kernels, and performing nonlinear reweighted Mahalanobis distance calculation, the problem of misjudgment between natural wear and mechanical fracture is solved, thus improving the accuracy and stability of corn kernel sorting.

CN121564494BActive Publication Date: 2026-04-14JILIN ACAD OF AGRI SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JILIN ACAD OF AGRI SCI
Filing Date
2026-01-23
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing methods for identifying broken corn kernels based on Mahalanobis distance cannot effectively distinguish between natural wear and mechanical breakage, resulting in a high misjudgment rate and affecting sorting accuracy and production efficiency.

Method used

By using a multi-feature fusion method, the edge gradient direction distribution and local texture smoothness features of the grain tip region are introduced to obtain shape and texture correction factors, perform nonlinear reweighting, and calculate the corrected Mahalanobis distance to improve recognition accuracy.

Benefits of technology

It significantly reduces the proportion of naturally worn grains misclassified as broken grains, improves the consistency of sorting results and the robustness of identification, adapts to changes in different varieties and transportation wear, and enhances the stability and economic benefits of industrial sorting systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121564494B_ABST
    Figure CN121564494B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image detection, and more particularly to a corn kernel breakage identification method based on multi-feature fusion, which comprises: acquiring standardized sample feature vectors and Mahalanobis distance reference parameters by collecting and extracting features from multi-source image data; obtaining a shape correction factor by evaluating the distribution of the edge gradient direction distribution of the top region of the kernel; obtaining a texture correction factor by analyzing the smoothness of the local texture of the top region of the kernel; obtaining a weighted feature vector and calculating a corrected Mahalanobis distance by nonlinear reweighting the sample feature vectors under physical constraints; and obtaining the breakage identification result of the corn kernel by thresholding the corrected Mahalanobis distance, so as to solve the problem of high misjudgment rate caused by the inability to effectively distinguish between natural wear and mechanical rupture in the existing corn kernel breakage identification based on Mahalanobis distance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, and in particular to a method for identifying broken corn kernels based on multi-feature fusion. Background Technology

[0002] In grain procurement, seed processing, and food industry production, the integrity of corn kernels directly affects product quality assessment, processing efficiency, and economic value. In actual production, broken kernels not only lower the commodity grade but also easily lead to mold, pests, and other problems during storage, transportation, and processing. Therefore, rapid and accurate detection and sorting of broken corn kernels is of significant practical importance. With the widespread adoption of large-scale, automated grain processing equipment, traditional methods relying on manual visual inspection are no longer sufficient to meet the demands of high efficiency and consistency in industry. Machine vision-based automatic detection and sorting technology for corn kernels is gradually becoming the mainstream solution. Existing machine vision-based methods for identifying broken corn kernels typically include image acquisition, single-kernel segmentation, feature extraction, and classification. In the feature extraction stage, shape, color, and texture features are often extracted from single-kernel images. Based on the extracted multi-dimensional features, a feature vector is constructed, and distance metrics or classification models are used to determine whether the kernels are broken. Because corn kernels exhibit significant individual morphological differences and various characteristics are generally correlated, simple metrics such as Euclidean distance are insufficient to accurately reflect the true differences between samples and intact kernels. Therefore, Mahalanobis distance, which comprehensively considers differences in feature scale and feature correlation, is widely used in multi-feature fusion discrimination scenarios such as corn kernel breakage identification. However, in practical applications, traditional Mahalanobis distance-based identification methods still have significant limitations when processing certain corn varieties, especially those with a powdery cap structure, such as floury corn or dent corn. During transportation, loading, unloading, and storage, the tip of these corn kernels is prone to natural wear, resulting in a whitish surface and a flattened tip curvature, resembling powdery wear. Simultaneously, mechanical impact or cutting during processing often occurs in the tip region, creating a relatively flat fracture surface and exposing the white endosperm tissue. These two situations exhibit high similarity in macroscopic shape features, brightness distribution, and color features, leading to similar statistical deviations in the multidimensional feature space. Existing Mahalanobis distance discrimination mechanisms essentially measure the degree of feature deviation based on global statistical properties. Their focus is on the overall offset of feature values ​​relative to the center of intact grain distribution, making it difficult to distinguish the differences in the physical causes of these feature variations. For grains of natural wear and mechanical breakage, the key difference lies primarily in the microstructural characteristics of the grain tip region: naturally worn areas typically exhibit rough surfaces, complex textures, and divergent edge gradient directions, while mechanically broken areas often show relatively smooth surfaces, simplified textures, and a consistent, concentrated edge gradient direction. Because traditional methods fail to effectively incorporate these micro-geometric and surface material characteristics into the distance measurement process, naturally worn grains that still meet usage standards are misclassified as broken grains, thus affecting sorting accuracy and production efficiency.

[0003] Therefore, there is an urgent need for a corn kernel breakage identification method that can introduce the microstructural and surface texture characteristics of the kernel tip region into the discrimination process in a deterministic manner while retaining the advantages of multi-feature fusion. This would improve the ability to distinguish between naturally worn and mechanically broken kernels, reduce the false judgment rate, and enhance the stability and reliability of industrial sorting systems. Summary of the Invention

[0004] In view of this, the present invention aims to propose a corn kernel breakage identification method based on multi-feature fusion, so as to solve the problem that the existing corn kernel breakage identification based on Mahalanobis distance cannot effectively distinguish between natural wear and pulverization and mechanical fracture, resulting in a high misjudgment rate.

[0005] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0006] A method for identifying broken corn kernels based on multi-feature fusion, the method comprising:

[0007] Step S1: By collecting and extracting features from multi-source image data, obtain standardized feature vectors of the test samples and Mahalanobis distance benchmark parameters;

[0008] Step S2: Obtain the shape correction factor by evaluating the distribution of the gradient direction at the edge of the grain tip region;

[0009] Step S3: Obtain the texture correction factor by performing smoothness analysis on the local texture of the grain tip region;

[0010] Step S4: Obtain the weighted feature vector and calculate the corrected Mahalanobis distance by performing nonlinear reweighting under physical constraints on the feature vector of the sample to be tested;

[0011] Step S5: Obtain the corn kernel breakage identification result by thresholding the modified Mahalanobis distance.

[0012] Furthermore, the step of acquiring standardized feature vectors and Mahalanobis distance benchmark parameters for the test sample by collecting and extracting features from multi-source image data includes:

[0013] An industrial camera and a multi-angle light source system for continuous imaging are deployed on the corn kernel sorting production line. During the sorting process, real-time image acquisition is performed on the corn kernels that pass through the imaging field of view in sequence, and the original color image data and grayscale image data corresponding to each corn kernel are obtained.

[0014] By performing image segmentation processing on the original color image data and grayscale image data, the region of interest of a single corn kernel is extracted. Based on the contour information of the region of interest, the top region of the corn kernel is located and cropped to obtain image data of the kernel top region for feature calculation.

[0015] By extracting morphological features from the image data of the region of interest, shape feature data representing the overall morphology of corn kernels is obtained. The shape feature data includes at least the kernel projection area, kernel perimeter, kernel length-to-width ratio, kernel roundness, and kernel convexity.

[0016] By performing texture statistical analysis on the image data of the region of interest, texture feature data characterizing the surface texture of corn kernels is obtained. The texture feature data includes at least texture energy, texture entropy, texture contrast and texture correlation calculated based on the gray-level co-occurrence matrix.

[0017] By performing color space conversion and statistical analysis on the image data of the region of interest, color feature data characterizing the color distribution characteristics of corn kernels is obtained. The color feature data includes at least the statistical values ​​of the hue component, saturation component and lightness component in the HSV color space.

[0018] The acquired shape feature data, texture feature data and color feature data are concatenated to obtain the feature vector of the sample to be tested, and the feature vector of the sample to be tested is standardized to obtain the standardized feature vector of the sample to be tested.

[0019] The inverse matrix of the mean vector and covariance matrix obtained from the statistics of complete corn kernel samples is read from the pre-set complete corn kernel sample database and used as the benchmark parameter of Mahalanobis distance.

[0020] Furthermore, the step of evaluating the distribution of gradient direction at the edge of the grain tip region to obtain the shape correction factor includes:

[0021] By evaluating the distribution dispersion of statistical data on the edge gradient direction in the top region of the grain, peak dispersion data of the gradient direction is obtained.

[0022] By performing nonlinear modulation processing on the peak dispersion data of the gradient direction, a shape correction factor is obtained to correct the shape feature weights.

[0023] Furthermore, the step of evaluating the distribution dispersion of statistical data on the edge gradient direction of the grain tip region to obtain gradient direction peak dispersion data includes:

[0024] For any target corn kernel, extract the grayscale image data of the kernel tip region corresponding to the target corn kernel from the kernel tip region image data, perform edge detection processing on the kernel tip region grayscale image data to obtain the set of edge pixels of the kernel tip region; perform gradient direction calculation processing on each edge pixel in the edge pixel set to obtain the gradient direction data corresponding to each edge pixel, and use the gradient direction data corresponding to all edge pixels as the edge gradient direction statistics of the kernel tip region.

[0025] The edge gradient direction statistics are divided into direction intervals to obtain multiple gradient direction intervals; the number of gradient direction data falling into each gradient direction interval is counted to obtain the interval count data corresponding to each gradient direction interval; the interval count data corresponding to each gradient direction interval is divided by the total number of all gradient direction data to obtain the normalized probability data corresponding to each gradient direction interval.

[0026] Logarithmic operations are performed on the normalized probability data corresponding to each gradient direction interval, and the normalized probability data is multiplied by the corresponding logarithmic operation result to obtain the probability-weighted logarithmic evaluation value corresponding to each gradient direction interval. The probability-weighted logarithmic evaluation values ​​corresponding to each gradient direction interval are summed, and the summation result is reversed. The result is used as the peak dispersion data of the gradient direction.

[0027] Furthermore, the step of obtaining a shape correction factor for correcting shape feature weights by performing nonlinear modulation processing on the gradient direction peak dispersion data includes:

[0028] For any target corn kernel, set the reference gradient direction peak dispersion and the maximum dispersion benchmark of the gradient direction peak dispersion corresponding to the naturally worn intact kernel; use the reference gradient direction peak dispersion as the numerator, use the gradient direction peak dispersion data corresponding to the target corn kernel as the denominator, and use the resulting fraction as the inverse proportional driving quantity of the dispersion corresponding to the target corn kernel.

[0029] The maximum dispersion benchmark is used as the numerator, the peak dispersion data of the gradient direction corresponding to the target corn kernel is used as the denominator, the corresponding fraction is used as the dispersion normalization amplification ratio, and the result of adding the dispersion normalization amplification ratio to the positive bias constant is used as the logarithmic modulation true number; the logarithmic modulation true number is processed by logarithmic operation to obtain the corresponding logarithmic modulation amount;

[0030] The result of multiplying the discrete inverse proportional driving quantity by the logarithmic modulation quantity is used as the nonlinear modulation driving quantity. The bilinear modulation driving quantity is then subjected to exponential mapping to obtain the shape correction factor used to correct the shape feature weights.

[0031] Furthermore, the step of obtaining a texture correction factor by performing smoothness analysis on the local texture of the grain tip region includes:

[0032] By performing neighborhood statistical processing on the local gray-level difference data of the grain tip region, local texture smoothness evaluation data is obtained.

[0033] By applying threshold gating to the local texture smoothness evaluation data, texture deviation data representing the degree of abnormal smoothness is obtained.

[0034] By performing nonlinear enhancement modulation processing on the texture deviation data, a texture correction factor is obtained to correct the texture feature weights.

[0035] Furthermore, the step of obtaining local texture smoothness evaluation data by performing neighborhood statistical processing on the local gray-level difference data of the seed tip region includes:

[0036] For any target corn kernel, extract the grayscale image data of the kernel tip region corresponding to the target corn kernel from the kernel tip region image data, and use each pixel in the kernel tip region grayscale image data as a set of candidate center pixels.

[0037] Set the neighborhood window size, take any candidate center pixel as the target center pixel, obtain the neighborhood pixel set corresponding to the target center pixel, and perform difference between the gray values ​​of the target center pixel and each neighboring pixel in the neighborhood pixel set and take the absolute value to obtain the local gray-level difference data corresponding to the target center pixel.

[0038] The local grayscale difference data corresponding to all candidate center pixels in the candidate center pixel set are summed, and the summation result is divided by the total number of candidate center pixels in the candidate center pixel set to obtain the neighborhood difference mean evaluation data corresponding to the top region of the seed. The reciprocal of the neighborhood difference mean evaluation data is used as the local texture smoothness evaluation data corresponding to the top region of the seed.

[0039] Furthermore, the step of obtaining texture deviation data characterizing the degree of abnormal smoothness by performing threshold gating processing on the local texture smoothness evaluation data includes:

[0040] Set a safe threshold for local texture smoothness to characterize the texture state of naturally worn grains;

[0041] For any target corn kernel, the difference between the local texture smoothness evaluation data corresponding to the target corn kernel and the local texture smoothness safety is calculated to obtain the local texture smoothness deviation evaluation value.

[0042] When the local texture smoothness deviates from the evaluation value by less than or equal to 0, the corresponding texture deviation data is set to 0;

[0043] When the local texture smoothness deviation from the evaluation value is greater than 0, the local texture smoothness evaluation value is used as the texture deviation data corresponding to the target corn kernel.

[0044] Furthermore, the step of obtaining a texture correction factor for correcting texture feature weights by performing nonlinear enhancement modulation processing on the texture deviation data includes:

[0045] For any target corn kernel, a texture enhancement adjustment coefficient is set to adjust the texture correction intensity; the texture deviation data corresponding to the target corn kernel is multiplied by the texture enhancement adjustment coefficient, and the product result is normalized by the ratio of the local texture smoothness to obtain the texture deviation intensity evaluation value.

[0046] The logarithmic result of adding the texture deviation intensity evaluation value to a constant 1 is used to obtain the texture nonlinear enhancement modulation amount.

[0047] The result of adding constant 1 to the texture nonlinear enhancement modulation amount is used as the texture correction factor corresponding to the target corn kernel.

[0048] Furthermore, the step of obtaining a weighted feature vector and calculating the corrected Mahalanobis distance by performing nonlinear reweighting under physical constraints on the feature vector of the sample to be tested includes:

[0049] For any target corn kernel, the standardized test sample feature vector corresponding to the target corn kernel is divided into shape feature components, texture feature components, and color feature components;

[0050] Each shape feature data in the shape feature component is multiplicatively modulated with the shape correction factor corresponding to the target corn kernel to obtain the shape feature component after weighting by the shape correction factor.

[0051] Each texture feature data in the texture feature component is multiplicatively modulated with the texture correction factor corresponding to the target corn kernel to obtain the texture feature component weighted by the texture correction factor.

[0052] Keeping the color feature data in each color feature component unchanged, the weighted shape feature component, the weighted texture feature component, and the unweighted color feature component are combined to obtain the weighted feature vector corresponding to the target corn kernel.

[0053] The difference between the weighted feature vector and the mean vector in the Mahalanobis distance benchmark parameters is calculated, and the distance is processed by combining the inverse of the covariance matrix to obtain the corrected Mahalanobis distance corresponding to the target corn kernel.

[0054] Compared with the prior art, the present invention has the following advantages:

[0055] This invention discloses a multi-feature fusion-based method for identifying broken corn kernels. By introducing a constraint mechanism based on microscopic physical causes during the multi-feature fusion discrimination process, the distance metric no longer relies solely on macroscopic statistical deviation but can simultaneously reflect the geometric morphological features and surface material characteristics of the kernel tip region. In actual sorting scenarios such as floury corn and dent corn, which are prone to crown powdering, even if the kernel tip is highly similar to mechanically broken samples in shape and brightness, this invention can still utilize information such as edge gradient direction concentration and local texture smoothness to apply differentiated weight modulation to samples with genuine breakage risk. This significantly enhances the separability between naturally worn kernels and mechanically broken kernels in the feature space, effectively reducing the proportion of kernels misjudged as broken due to slight wear, and improving the consistency between sorting results and actual physical conditions.

[0056] On the other hand, this invention optimizes existing statistical distance models using a physically constrained feature reweighting method, without altering the original feature extraction system and distance calculation framework, thus exhibiting good engineering compatibility and deployment stability. Under the continuous high-speed operation conditions of industrial sorting lines, this technology can significantly improve the robustness and stability of broken product identification while maintaining controllable computational complexity, reducing fluctuations in identification performance caused by product differences, transportation wear, or lighting variations, thereby improving the detection accuracy, operational reliability, and economic benefits of the entire sorting system. Attached Figure Description

[0057] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0058] Figure 1 This is a flowchart illustrating a method for identifying broken corn kernels based on multi-feature fusion, as described in an embodiment of the present invention. Detailed Implementation

[0059] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0060] See Figure 1 This is a flowchart of a method for identifying broken corn kernels based on multi-feature fusion, as provided in Embodiment 1 of the present invention. Figure 1 As shown, a method for identifying broken corn kernels based on multi-feature fusion may include:

[0061] Step S1 involves acquiring and extracting features from multi-source image data to obtain standardized feature vectors of the test samples and Mahalanobis distance benchmark parameters.

[0062] An industrial camera and a multi-angle light source system for continuous imaging are deployed on the corn kernel sorting production line. During the sorting process, real-time image acquisition is performed on the corn kernels that pass through the imaging field of view in sequence, and the original color image data and grayscale image data corresponding to each corn kernel are obtained.

[0063] By performing image segmentation processing on the original color image data and grayscale image data, the region of interest of a single corn kernel is extracted. Based on the contour information of the region of interest, the top region of the corn kernel is located and cropped to obtain image data of the kernel top region for feature calculation.

[0064] By extracting morphological features from the image data of the region of interest, shape feature data representing the overall morphology of corn kernels is obtained. The shape feature data includes at least the kernel projection area, kernel perimeter, kernel length-to-width ratio, kernel roundness, and kernel convexity.

[0065] By performing texture statistical analysis on the image data of the region of interest, texture feature data characterizing the surface texture of corn kernels is obtained. The texture feature data includes at least texture energy, texture entropy, texture contrast and texture correlation calculated based on the gray-level co-occurrence matrix.

[0066] By performing color space conversion and statistical analysis on the image data of the region of interest, color feature data characterizing the color distribution characteristics of corn kernels is obtained. The color feature data includes at least the statistical values ​​of the hue component, saturation component and lightness component in the HSV color space.

[0067] The acquired shape feature data, texture feature data and color feature data are concatenated to obtain the feature vector of the sample to be tested, and the feature vector of the sample to be tested is standardized. In this embodiment of the invention, Z-Score standardization is used to obtain the standardized feature vector of the sample to be tested.

[0068] The inverse matrix of the mean vector and covariance matrix obtained from the statistics of complete corn kernel samples is read from the pre-set complete corn kernel sample database and used as the benchmark parameter of Mahalanobis distance.

[0069] This completes the acquisition of standardized feature vectors and Mahalanobis distance benchmark parameters for the test samples by collecting and extracting features from multi-source image data.

[0070] Step S2: Obtain the shape correction factor by evaluating the distribution of the gradient direction at the edge of the grain tip region.

[0071] This step aims to address the identification failure problem caused by the high degree of confusion in macroscopic shape parameters (such as aspect ratio and roundness) when traditional Mahalanobis distance algorithms handle two types of samples: crown pulverization caused by natural wear and crown planar fracture caused by mechanical damage. The root of this problem lies in the fact that existing statistical distance metrics only focus on numerical deviation, neglecting the indicative role of microscopic edge geometric features in physical causes. Specifically, mechanical fracture is an instantaneous stress separation of brittle materials, and its resulting cross-section geometrically appears as a highly straight line segment. The edge normal direction of this region exhibits a high degree of consistency, meaning the gradient vector mainly converges to the normal direction of the tangential plane. Conversely, natural wear is a gradual physical friction process, resulting in a surface with a rounded, granular texture and diffuse reflection at the edges. The edge normal direction of this region exhibits a randomly distributed divergent state. In actual detection, if only macroscopic shape features are relied upon, the algorithm may misclassify smooth-cut fractured particles as intact wear particles. Therefore, a distance metric that truly reflects the risk of breakage must incorporate statistical information on microscopic gradient directions. This step introduces the feature of gradient direction peak dispersion to quantify the straightness of the current grain tip edge in real time. Then, this dispersion is used to dynamically adjust the weight of the Mahalanobis distance: when a high concentration of edge gradient directions (high straightness) is detected, it is identified as a mechanical fracture feature, and its distance weight is significantly amplified; when a divergent edge gradient direction is detected (low straightness), it is identified as a natural wear feature, and the original distance weight is maintained. Through this coupling mechanism between microscopic geometric features and macroscopic statistical distance, the algorithm's criteria for judging breakage risk are consistent with the actual physical causes.

[0072] In summary, this invention first evaluates the distribution discreteness of the edge gradient direction statistics data of the kernel tip region to obtain gradient direction peak discreteness data. Specifically, for any target corn kernel, grayscale image data of the kernel tip region corresponding to the target corn kernel is extracted from the kernel tip region image data. Edge detection processing is performed on the grayscale image data of the kernel tip region to obtain the set of edge pixels of the kernel tip region. Gradient direction calculation processing is performed on each edge pixel in the edge pixel set to obtain the gradient direction data corresponding to each edge pixel. The gradient direction data corresponding to all edge pixels is used as the edge gradient direction statistics data of the kernel tip region. The edge gradient direction statistics data are then divided into direction intervals to obtain multiple gradient direction regions. In this embodiment of the invention, the number of direction intervals is set to 36; the number of gradient direction data falling within each gradient direction interval is counted to obtain the interval count data corresponding to each gradient direction interval; the interval count data corresponding to each gradient direction interval is divided by the total number of all gradient direction data to obtain the normalized probability data corresponding to each gradient direction interval; logarithmic operations are performed on the normalized probability data corresponding to each gradient direction interval, and the normalized probability data is multiplied by its corresponding logarithmic operation result to obtain the probability-weighted logarithmic evaluation value corresponding to each gradient direction interval; the probability-weighted logarithmic evaluation values ​​corresponding to each gradient direction interval are summed, and the negative of the summation result is taken as the gradient direction peak dispersion data.

[0073] After obtaining the gradient direction peak dispersion data, nonlinear modulation processing is performed on the gradient direction peak dispersion data to obtain a shape correction factor for correcting the shape feature weights. Specifically, for any target corn kernel, a reference gradient direction peak dispersion and a maximum dispersion benchmark for the gradient direction peak dispersion are set for naturally worn intact kernels. In this embodiment of the invention, the reference gradient direction peak dispersion is determined by selecting no less than 100 intact kernels that have been manually confirmed to have natural wear characteristics to form a reference set. The gradient direction dispersion of the top region of each kernel is calculated, and the arithmetic mean is taken as the reference gradient direction peak dispersion. This value represents the average gradient divergence of the naturally worn surface under the current imaging resolution and illumination conditions. The maximum dispersion benchmark for the gradient direction peak dispersion is determined by the theoretical maximum entropy of the histogram for 36 directions. The maximum discreteness benchmark for the peak discreteness of the gradient direction in the interval is 3.58. Using the reference gradient direction peak discreteness as the numerator and the peak discreteness data corresponding to the target corn kernel as the denominator, the resulting fraction is used as the inverse proportional driving quantity for the discreteness of the target corn kernel. Using the maximum discreteness benchmark as the numerator and the peak discreteness data corresponding to the target corn kernel as the denominator, the resulting fraction is used as the discreteness normalization amplification ratio. The result of adding the discreteness normalization amplification ratio to the positive bias constant is used as the logarithmic modulation argument. The logarithmic modulation argument is then processed logarithmically to obtain the corresponding logarithmic modulation amount. The result of multiplying the discreteness inverse proportional driving quantity by the logarithmic modulation amount is used as the nonlinear modulation driving quantity. The logarithmic linear modulation driving quantity is then subjected to exponential mapping to obtain the shape correction factor used to correct the shape feature weights.

[0074] In one implementation, assume the first The peak dispersion data of the gradient direction of each corn kernel is as follows: The maximum dispersion benchmark is The peak dispersion of the reference gradient direction is Then the first The expression for calculating the shape correction factor of each corn kernel is:

[0075]

[0076] in, Indicates the first A shape correction factor for each corn kernel; Indicates the peak dispersion of the reference gradient direction; Indicates the maximum dispersion benchmark; Indicates the first Peak dispersion data of gradient direction for individual corn kernels.

[0077] It should be noted that the present invention constructs a shape correction factor. The statistical distribution differences of micro gradients are used to amplify the distance between macroscopically similar samples. Firstly, the inverse proportional driving term is designed in the formula. It is the fundamental criterion for achieving binary classification of fracture or wear. The higher the orderliness of the system, the lower the entropy value. When the sample to be tested is mechanically fractured, because the cut edge is straight, its gradient direction is highly ordered and consistent, and the calculated entropy value is... It will be significantly lower than the baseline value under natural wear conditions. At this point, the denominator is much smaller than the numerator, causing the value of the fraction to be significantly greater than 1. This provides a significant scaling basis for distance correction. Conversely, if the sample is naturally worn, the rough surface causes the gradient direction to exhibit a disordered random distribution. The values ​​are relatively large and close to This makes the value of the fraction approach the value of the fraction. Even smaller values ​​suppress the correction amplitude and avoid accidental damage to normally worn grains. Secondly, to further enhance the algorithm's sensitivity to minute crack features and ensure the robustness of numerical calculations, a logarithmic adjustment term is introduced into the formula. This design serves a dual purpose: on the one hand, it introduces a non-linear sensitivity gain. When At the minimum (i.e., when the fracture characteristics are very significant, approaching the ultimate ordered state), The ratio will increase dramatically. At this point, the logarithmic term provides an additional positive gain, which, when multiplied by the aforementioned inverse proportional term and passed through the external exponential function, results in... The mapping implements a penalty for the distance value of suspected broken samples. This forces broken samples to rapidly move away from the distribution center of intact particles in the feature space, improving inter-class separation and ensuring that the algorithm can accurately identify them even if the macroscopic shape changes are small, as long as there is a clear straight cutting edge. On the other hand, the introduction of the natural constant e ensures that the argument of the logarithmic function is always greater than e, that is, regardless of... Regardless of fluctuations, the value of the logarithmic adjustment term is always greater than... To prevent the adjustment term from becoming invalid or negative due to data anomalies, the correction factor is structurally ensured. Always greater than The exponent (i.e.) This ensures that the factor always plays a positive weighting amplification role, maintaining the consistency of the distance metric in a physical sense.

[0078] Thus, the shape correction factor was obtained by evaluating the distribution of gradient direction at the edge of the grain tip region.

[0079] Step S3: Obtain the texture correction factor by performing smoothness analysis on the local texture of the grain tip region.

[0080] This step aims to address the limitations of step S2 in handling irregular damage, particularly for samples with indistinct edge straightness but undeniably mechanical damage (such as irregular fractures or deep cuts). In real-world scenarios, the corn kernel's crown (composed of loose, starchy endosperm) is highly susceptible to friction during natural transport, resulting in a rough wear surface. Mechanical breakage, on the other hand, often involves deeper, more dense or keratinous endosperm layers, and its fracture surface (even if not straight) is relatively smooth and dense due to the material's compact structure. From an imaging texture perspective, the two differ significantly: on naturally worn surfaces, the loose and porous arrangement of the starchy endosperm particles causes strong diffuse reflection and random scattering of light, resulting in high-frequency, disordered jumps in pixel grayscale values ​​within small local areas of the image, exhibiting a high-texture complexity characteristic similar to Gaussian noise. Mechanically fractured surfaces, whether smooth cuts or brittle fractures, typically expose a dense starch-protein matrix with a relatively smooth and continuous surface. Within local regions of an image, the grayscale transitions between adjacent pixels are smooth, lacking high-frequency texture details, exhibiting low texture complexity. Existing Mahalanobis distance algorithms typically use global statistics of the Gray-Level Co-occurrence Matrix (GLCM) for texture features, which are easily affected by the overall grain pattern and struggle to capture such local microscopic material differences. Therefore, this step introduces a local texture smoothness index to construct a photometric correction factor: when a smooth texture (low complexity) is detected in a local region, it is identified as a dense fracture surface and penalized; when a rough texture (high complexity) is detected in a local region, it is identified as powdery wear and exempted.

[0081] In summary, this invention first obtains local texture smoothness evaluation data by performing neighborhood statistical processing on the local gray-level difference data of the kernel tip region. Specifically, for any target corn kernel, the gray-level image data of the kernel tip region corresponding to the target corn kernel is extracted from the kernel tip region image data, and each pixel in the kernel tip region gray-level image data is used as a set of candidate center pixels. A neighborhood window size is then set; in this embodiment of the invention, the neighborhood window size is set to [size missing]. Taking any candidate center pixel as the target center pixel, obtain the set of neighboring pixels corresponding to the target center pixel, and perform difference calculation on the gray values ​​of the target center pixel and each neighboring pixel in the set, taking the absolute value to obtain the local gray-level difference data corresponding to the target center pixel; sum the local gray-level difference data corresponding to all candidate center pixels in the candidate center pixel set, and divide the summation result by the total number of candidate center pixels in the candidate center pixel set to obtain the neighborhood difference mean evaluation data corresponding to the top region of the seed; use the reciprocal of the neighborhood difference mean evaluation data as the local texture smoothness evaluation data corresponding to the top region of the seed.

[0082] After obtaining the local texture smoothness evaluation data, threshold gating processing is further performed on the local texture smoothness evaluation data to obtain texture deviation data representing the degree of abnormal smoothness. Specifically, a local texture smoothness safety threshold is set to represent the texture state of naturally worn grains. In this embodiment of the invention, the local texture smoothness safety threshold is obtained by calculating the smoothness of at least 100 whole grains that have been manually confirmed to have typical rough wear characteristics, taking the arithmetic mean, and adding 2 times the standard deviation as the local texture smoothness safety threshold. For any target corn grain, the difference between the local texture smoothness evaluation data corresponding to the target corn grain and the local texture smoothness safety threshold is calculated to obtain the corresponding local texture smoothness deviation evaluation value. When the local texture smoothness deviation evaluation value is less than or equal to 0, the corresponding texture deviation data is set to 0; when the local texture smoothness deviation evaluation value is greater than 0, the local texture smoothness evaluation value is used as the texture deviation data corresponding to the target corn grain.

[0083] After obtaining the texture deviation data corresponding to the target corn kernel, the texture deviation data is then subjected to nonlinear enhancement modulation processing to obtain a texture correction factor for correcting the texture feature weights. Specifically, for any target corn kernel, a texture enhancement adjustment coefficient is set to adjust the texture correction intensity. In this embodiment of the invention, the texture enhancement adjustment coefficient is set to 5. The texture deviation data corresponding to the target corn kernel is multiplied by the texture enhancement adjustment coefficient, and the product result is normalized by the ratio of the local texture smoothness to obtain the texture deviation intensity evaluation value. The result of adding the texture deviation intensity evaluation value to a constant 1 is logarithmically calculated to obtain the nonlinear enhancement modulation amount of the texture. The result of adding the constant 1 to the nonlinear enhancement modulation amount of the texture is used as the texture correction factor corresponding to the target corn kernel.

[0084] In one implementation, assume the first The local texture smoothness data corresponding to each corn kernel is: The local texture smoothness safety threshold is... The texture enhancement adjustment coefficient used to adjust the texture correction intensity is: Then the first The formula for calculating the texture correction factor of each corn kernel is:

[0085]

[0086] in, Indicates the first Texture correction factor for each corn kernel; Indicates the first Local texture smoothness data corresponding to each corn kernel; This represents the safe threshold for local texture smoothness. This represents the texture enhancement adjustment coefficient.

[0087] It should be noted that, firstly, in the formula The definition utilizes the reciprocal of the neighborhood difference. For naturally worn surfaces, due to surface roughness and large differences between adjacent pixels, the denominator is large, leading to... The numerical value is small; for dense fracture surfaces, the surface is smooth, the difference between adjacent pixels is small, and the denominator approaches 0, resulting in... The numerical value is significantly increased. This design provides a highly sensitive numerical basis for distinguishing between the two materials. Secondly, the core discriminant structure of the formula lies in... This is a one-way gating mechanism. When the sample under test is naturally worn (rough), its smoothness... Below the threshold The difference is negative, after After truncation At this point, for several terms , making This ensures that for all rough samples conforming to natural wear characteristics, the algorithm makes no intervention, completely preserving the original judgment and avoiding misclassifying wear as breakage. When the sample under test is mechanically fractured (smooth), It will significantly exceed the threshold. At this point, the difference is positive, and the gate opens. The ratio term in the formula quantifies the relative degree of this excess, and is expressed via a coefficient. Zoom in. Finally, through... The function is mapped to generate a correction coefficient greater than 1. This logarithmic growth property can effectively penalize obvious smooth fracture surfaces (significantly increasing the distance) while avoiding numerical explosion caused by individual abnormally smooth points.

[0088] This completes the process of obtaining the texture correction factor by analyzing the smoothness of the local texture at the tip of the grain.

[0089] Step S4: Obtain the weighted feature vector and calculate the corrected Mahalanobis distance by performing nonlinear reweighting under physical constraints on the feature vector of the sample to be tested.

[0090] After constructing shape correction factors for the linearity of shape edges and texture correction factors for surface material texture, this step aims to integrate these two independent physical constraints into the distance calculation of multi-dimensional feature fusion. Traditional Mahalanobis distance calculation methods are based on a fixed covariance matrix, assuming that the feature confidence of all samples is equal. However, this invention establishes the physical meaning of the correction factors through the aforementioned analysis: when the shape correction factor value increases significantly, it indicates that the sample has strong mechanical cutting characteristics at the micro-geometric level; when the texture correction factor value increases, it indicates that the sample has obvious dense fracture characteristics at the micro-material level. This means that the probability of the sample deviating from a complete grain in the corresponding shape or texture feature dimension is extremely high. Therefore, this step uses a feature reweighting strategy to optimize the existing Mahalanobis distance algorithm. Unlike directly modifying the complex matrix operation kernel, this invention chooses to reconstruct the physical constraints of the feature vector at the input end. That is, based on the physical properties of the features, the calculated shape correction factor and texture correction factor are used to nonlinearly stretch the shape and texture components in the feature vector of the test sample, respectively. This forces wear and fracture samples that were confused due to their similar macroscopic values ​​in the original space to be separated in the reconstructed weighted feature space, thereby correcting the data measurement without breaking the existing algorithm framework.

[0091] Specifically, for any target corn kernel, the standardized test sample feature vector corresponding to the target corn kernel is divided into shape feature components, texture feature components, and color feature components. Each shape feature data in the shape feature component is multiplicatively modulated with the shape correction factor corresponding to the target corn kernel to obtain the shape feature component weighted by the shape correction factor. Each texture feature data in the texture feature component is multiplicatively modulated with the texture correction factor corresponding to the target corn kernel to obtain the texture feature component weighted by the texture correction factor. Keeping the color feature data in the color feature component unchanged, the weighted shape feature component, the weighted texture feature component, and the unweighted color feature component are combined to obtain the weighted feature vector corresponding to the target corn kernel. The difference between the weighted feature vector and the mean vector in the Mahalanobis distance benchmark parameters is calculated, and distance operations are performed using the inverse of the covariance matrix to obtain the corrected Mahalanobis distance corresponding to the target corn kernel.

[0092] Thus, the process of obtaining weighted feature vectors and calculating corrected Mahalanobis distance by nonlinearly reweighting the feature vectors of the test samples under physical constraints is completed.

[0093] Step S5: By applying a threshold to the modified Mahalanobis distance, the broken corn kernel identification result is obtained.

[0094] This step, based on the modified Mahalanobis distance with physical constraints calculated in step S4, performs broken corn kernel identification and classification output, aiming to solve the identification failure problem caused by the algorithm masking the differences in microscopic physical characteristics.

[0095] The system first obtains the corrected Mahalanobis distance output in step S4. Compare it with the preset judgment threshold. A comparison is performed, and in this embodiment of the invention, a judgment threshold is set as follows: .

[0096] When the sample to be tested is a naturally worn powder cap, due to its microscopic roughness at the edges and complex surface texture, the calculated shape correction factor... With texture correction factor All approach (That is, the penalty mechanism was not triggered). At this time, the weighted feature vector The calculated Mahalanobis distance is basically the same as the original feature vector. It only reflects macroeconomic statistical bias, and the value remains low and less than The system correctly identifies it as an intact particle based on this. When the sample to be tested is mechanically cut or densely fractured, the high straightness of its edges leads to... The exponential surge may be due to the smoothness of the surface material. The magnification increases significantly. At this point, the corresponding shape or texture feature components are forcibly stretched by the physical factor, leading to a significant increase in the final calculated Mahalanobis distance. Far exceeding the original value and breaking the threshold Based on this, the system decisively identifies it as broken grains. Through the above process, this invention successfully amplifies the separability of wear and fracture in the feature space by utilizing physical constraint factors, effectively solving the problem of misjudgment of macroscopically similar samples, and achieving high-precision identification of broken corn kernels.

[0097] Thus, the process of obtaining the broken corn kernel identification result by thresholding the modified Mahalanobis distance is complete.

[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for identifying broken corn kernels based on multi-feature fusion, characterized in that, The method includes: Step S1: By collecting and extracting features from multi-source image data, obtain standardized feature vectors of the test samples and Mahalanobis distance benchmark parameters; Step S2: Obtain the shape correction factor by evaluating the distribution of the gradient direction at the edge of the grain tip region; Step S3: Obtain the texture correction factor by performing smoothness analysis on the local texture of the grain tip region; Step S4: Obtain the weighted feature vector and calculate the corrected Mahalanobis distance by performing nonlinear reweighting under physical constraints on the feature vector of the sample to be tested; Step S5: Obtain the corn kernel breakage identification result by thresholding the modified Mahalanobis distance; The step of evaluating the distribution of the gradient direction at the edge of the grain tip region to obtain the shape correction factor includes: evaluating the distribution discreteness of the statistical data of the gradient direction at the edge of the grain tip region to obtain the peak discreteness data of the gradient direction; and obtaining the shape correction factor for correcting the shape feature weights by performing nonlinear modulation processing on the peak discreteness data of the gradient direction. The step of obtaining a texture correction factor by performing smoothness analysis on the local texture of the grain tip region includes: obtaining local texture smoothness evaluation data by performing neighborhood statistical processing on the local gray-level difference data of the grain tip region; obtaining texture deviation data characterizing the degree of abnormal smoothness by performing threshold gating processing on the local texture smoothness evaluation data; and obtaining a texture correction factor used to correct the texture feature weights by performing nonlinear enhancement modulation processing on the texture deviation data.

2. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The process of acquiring and extracting features from multi-source image data to obtain standardized feature vectors and Mahalanobis distance benchmark parameters for the test samples includes: An industrial camera and a multi-angle light source system for continuous imaging are deployed on the corn kernel sorting production line. During the sorting process, real-time image acquisition is performed on the corn kernels that pass through the imaging field of view in sequence, and the original color image data and grayscale image data corresponding to each corn kernel are obtained. By performing image segmentation processing on the original color image data and grayscale image data, the region of interest of a single corn kernel is extracted. Based on the contour information of the region of interest, the top region of the corn kernel is located and cropped to obtain image data of the kernel top region for feature calculation. By extracting morphological features from the image data of the region of interest, shape feature data representing the overall morphology of corn kernels is obtained. The shape feature data includes at least the kernel projection area, kernel perimeter, kernel length-to-width ratio, kernel roundness, and kernel convexity. By performing texture statistical analysis on the image data of the region of interest, texture feature data characterizing the surface texture of corn kernels is obtained. The texture feature data includes at least texture energy, texture entropy, texture contrast and texture correlation calculated based on the gray-level co-occurrence matrix. By performing color space conversion and statistical analysis on the image data of the region of interest, color feature data characterizing the color distribution characteristics of corn kernels is obtained. The color feature data includes at least the statistical values ​​of the hue component, saturation component and lightness component in the HSV color space. The acquired shape feature data, texture feature data and color feature data are concatenated to obtain the feature vector of the sample to be tested, and the feature vector of the sample to be tested is standardized to obtain the standardized feature vector of the sample to be tested. The inverse matrix of the mean vector and covariance matrix obtained from the statistics of complete corn kernel samples is read from the pre-set complete corn kernel sample database and used as the benchmark parameter of Mahalanobis distance.

3. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The step involves evaluating the distribution dispersion of statistical data on the edge gradient direction in the kernel tip region to obtain gradient direction peak dispersion data, including: For any target corn kernel, extract the grayscale image data of the kernel tip region corresponding to the target corn kernel from the kernel tip region image data, perform edge detection processing on the kernel tip region grayscale image data to obtain the set of edge pixels of the kernel tip region; perform gradient direction calculation processing on each edge pixel in the edge pixel set to obtain the gradient direction data corresponding to each edge pixel, and use the gradient direction data corresponding to all edge pixels as the edge gradient direction statistics of the kernel tip region. The edge gradient direction statistics are divided into direction intervals to obtain multiple gradient direction intervals; the number of gradient direction data falling into each gradient direction interval is counted to obtain the interval count data corresponding to each gradient direction interval; the interval count data corresponding to each gradient direction interval is divided by the total number of all gradient direction data to obtain the normalized probability data corresponding to each gradient direction interval. Logarithmic operations are performed on the normalized probability data corresponding to each gradient direction interval, and the normalized probability data is multiplied by the corresponding logarithmic operation result to obtain the probability-weighted logarithmic evaluation value corresponding to each gradient direction interval. The probability-weighted logarithmic evaluation values ​​corresponding to each gradient direction interval are summed, and the summation result is reversed. The result is used as the peak dispersion data of the gradient direction.

4. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The step of obtaining a shape correction factor for correcting shape feature weights by performing nonlinear modulation processing on the gradient direction peak dispersion data includes: For any target corn kernel, set the reference gradient direction peak dispersion and the maximum dispersion benchmark of the gradient direction peak dispersion corresponding to the naturally worn intact kernel; use the reference gradient direction peak dispersion as the numerator, use the gradient direction peak dispersion data corresponding to the target corn kernel as the denominator, and use the resulting fraction as the inverse proportional driving quantity of the dispersion corresponding to the target corn kernel. The maximum dispersion benchmark is used as the numerator, the peak dispersion data of the gradient direction corresponding to the target corn kernel is used as the denominator, the corresponding fraction is used as the dispersion normalization amplification ratio, and the result of adding the dispersion normalization amplification ratio to the positive bias constant is used as the logarithmic modulation true number; the logarithmic modulation true number is processed by logarithmic operation to obtain the corresponding logarithmic modulation amount; The result of multiplying the discrete inverse proportional driving quantity by the logarithmic modulation quantity is used as the nonlinear modulation driving quantity. The bilinear modulation driving quantity is then subjected to exponential mapping to obtain the shape correction factor used to correct the shape feature weights.

5. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The process of obtaining local texture smoothness evaluation data by performing neighborhood statistical processing on the local gray-level difference data of the seed tip region includes: For any target corn kernel, extract the grayscale image data of the kernel tip region corresponding to the target corn kernel from the kernel tip region image data, and use each pixel in the kernel tip region grayscale image data as a set of candidate center pixels. Set the neighborhood window size, take any candidate center pixel as the target center pixel, obtain the neighborhood pixel set corresponding to the target center pixel, and perform difference between the gray values ​​of the target center pixel and each neighboring pixel in the neighborhood pixel set and take the absolute value to obtain the local gray-level difference data corresponding to the target center pixel. The local grayscale difference data corresponding to all candidate center pixels in the candidate center pixel set are summed, and the summation result is divided by the total number of candidate center pixels in the candidate center pixel set to obtain the neighborhood difference mean evaluation data corresponding to the top region of the seed. The reciprocal of the neighborhood difference mean evaluation data is used as the local texture smoothness evaluation data corresponding to the top region of the seed.

6. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The step of obtaining texture deviation data characterizing the degree of abnormal smoothness by performing threshold gating processing on local texture smoothness evaluation data includes: Set a safe threshold for local texture smoothness to characterize the texture state of naturally worn grains; For any target corn kernel, the difference between the local texture smoothness evaluation data corresponding to the target corn kernel and the local texture smoothness safety is calculated to obtain the local texture smoothness deviation evaluation value. When the local texture smoothness deviates from the evaluation value by less than or equal to 0, the corresponding texture deviation data is set to 0; When the local texture smoothness deviation from the evaluation value is greater than 0, the local texture smoothness evaluation value is used as the texture deviation data corresponding to the target corn kernel.

7. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The process of obtaining a texture correction factor for correcting texture feature weights by performing nonlinear enhancement modulation processing on texture deviation data includes: For any target corn kernel, a texture enhancement adjustment coefficient is set to adjust the texture correction intensity; the texture deviation data corresponding to the target corn kernel is multiplied by the texture enhancement adjustment coefficient, and the product result is normalized by the ratio of the local texture smoothness to obtain the texture deviation intensity evaluation value. The logarithmic result of adding the texture deviation intensity evaluation value to a constant 1 is used to obtain the texture nonlinear enhancement modulation amount. The result of adding constant 1 to the texture nonlinear enhancement modulation amount is used as the texture correction factor corresponding to the target corn kernel.

8. The method for identifying broken corn kernels based on multi-feature fusion according to claim 1, characterized in that, The process of obtaining a weighted feature vector and calculating the corrected Mahalanobis distance by performing nonlinear reweighting under physical constraints on the feature vector of the sample to be tested includes: For any target corn kernel, the standardized test sample feature vector corresponding to the target corn kernel is divided into shape feature components, texture feature components, and color feature components; Each shape feature data in the shape feature component is multiplicatively modulated with the shape correction factor corresponding to the target corn kernel to obtain the shape feature component after weighting by the shape correction factor. Each texture feature data in the texture feature component is multiplicatively modulated with the texture correction factor corresponding to the target corn kernel to obtain the texture feature component weighted by the texture correction factor. Keeping the color feature data in each color feature component unchanged, the weighted shape feature component, the weighted texture feature component, and the unweighted color feature component are combined to obtain the weighted feature vector corresponding to the target corn kernel. The difference between the weighted feature vector and the mean vector in the Mahalanobis distance benchmark parameters is calculated, and the distance is processed by combining the inverse of the covariance matrix to obtain the corrected Mahalanobis distance corresponding to the target corn kernel.

Citation Information

Patent Citations

  • Method and system for detecting metal abrasive particle defects in lubricating oil

    CN121027110A

  • Salient contour matching-based method for target measurement in severe imaging environment

    WO2025200565A1