Method and device for evaluating food grains

By collecting appearance features and near-infrared spectral data, and combining multi-stage sieving and air separation, a multi-feature fusion model was constructed, which solved the problems of feature identification and impurity separation in the assessment of raw grain impurities, and achieved the accuracy and reliability of grain quality detection.

CN121409906BActive Publication Date: 2026-03-17BEIJING SINO INSTR INTELLIGENT CONTROL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing methods for assessing impurities in raw grains are inadequate in terms of feature extraction and analysis, lack multi-stage screening mechanisms and air separation strategies, making it difficult to accurately identify different types of grains and separate impurities, thus affecting the reliability of the assessment.

Method used

By collecting appearance feature data and near-infrared spectral data, and combining multi-stage sieving and air separation, a multi-feature fusion model is constructed to identify grain varieties and separate impurities. Morphological and color features are used to identify imperfect grains and different types of grains, and quality calculations are performed to assess impurity content.

Benefits of technology

It has improved the accuracy of feature identification and impurity separation in grain quality testing, ensuring the reliability and precision of impurity assessment and providing technical support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121409906B_ABST
    Figure CN121409906B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for assessing impurities in raw grains. Through an innovative design of a multi-feature fusion model, and by using appearance analysis and spectral detection, accurate identification of grain varieties is achieved. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and through morphological analysis and mass calculation, the accuracy of impurity assessment is ensured. This method effectively addresses the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a method and apparatus for evaluating impurities in raw grains. Background Technology

[0002] Existing methods for assessing impurities in raw grains have significant shortcomings. Traditional systems perform poorly in feature extraction and analysis, failing to effectively integrate appearance features and spectral data, thus affecting identification accuracy.

[0003] Furthermore, existing technologies face bottlenecks in screening and impurity separation. Most systems lack sophisticated multi-stage screening mechanisms and air separation strategies, resulting in incomplete impurity separation.

[0004] Existing systems have technical shortcomings in impurity identification. The lack of in-depth analysis of imperfect grains makes accurate identification of different grain types based on morphological characteristics difficult, affecting the reliability of assessments. Solving these problems is of great significance for improving grain quality testing. Summary of the Invention

[0005] In view of the problems in the prior art, this application provides a method and apparatus for evaluating impurities in raw grains, which can effectively solve the shortcomings of traditional technologies in feature identification, impurity separation and content evaluation, and provide technical support for grain quality testing.

[0006] To solve at least one of the above problems, this application provides the following technical solution:

[0007] Firstly, this application provides a method for evaluating impurities in raw grains, comprising:

[0008] The appearance feature data and near-infrared spectral data of the grain sample to be tested are collected. The color feature, texture feature and shape feature in the appearance feature data are input into the variety identification model. The grain variety is identified by combining the near-infrared spectral data. Based on the identification result, the preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters are retrieved, and the grain sample to be tested is put into the multi-stage sieving system.

[0009] Based on the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters, the grain sample to be tested is subjected to multi-stage sieving. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. The grain particles separated by the middle sieve are separated by air separation to obtain light impurities. The remaining material is used as a semi-clean grain sample. After homogenization treatment, a representative sample is extracted from the semi-clean grain sample.

[0010] The representative sample is input into the impurity identification model. Based on morphological and color characteristics, imperfect grains and foreign grains are identified. The identified imperfect grains and foreign grains are classified and weighed. The mass ratio of foreign grains in the representative sample is calculated. The mass ratio is multiplied by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities. The mass of semi-clean grain impurities is added to the mass of material on the sieve, the mass of material under the sieve, and the mass of light impurities, and then divided by the total mass of the grain sample to be tested to obtain the total impurity content.

[0011] Furthermore, it also includes: constructing a machine vision acquisition device to acquire visible light images of the grain sample to be tested under standard light source illumination, performing image segmentation and edge extraction on the visible light images, calculating the perimeter, area, and aspect ratio parameters of the grain particles as shape features, extracting the brightness, chroma, and saturation components of the color space as color features, and using the gray-level co-occurrence matrix to calculate energy, contrast, correlation, and entropy as texture features.

[0012] Install a near-infrared spectral acquisition probe, set the wavelength range and sampling interval of the near-infrared light source, scan the grain sample to be tested to obtain reflectance spectral data, perform dark current correction and white board calibration on the reflectance spectral data to eliminate baseline drift and scattering effects, and preprocess the spectral data using the standard normal transformation method.

[0013] Furthermore, it also includes: inputting appearance feature data and near-infrared spectral data into a deep neural network, extracting local image features through convolutional layers, fusing the local features and spectral features through fully connected layers, establishing a mapping relationship between feature vectors and grain variety labels, inputting the mapping relationship into a classifier to calculate the probability score of each variety, and selecting the variety with the highest score as the recognition result;

[0014] Based on the identification results, the corresponding screening parameter group is retrieved from the parameter database. The upper screen aperture size, middle screen aperture size, lower screen aperture size, air separation speed, and screen surface inclination angle are read from the screening parameter group. The values ​​are then transmitted to the control unit of the multi-stage screening system, which drives the actuator to adjust the screen spacing, fan speed, and vibration table inclination angle to the target state.

[0015] Furthermore, it also includes: starting the vibration motor to drive the screen box to vibrate, putting the grain sample to be tested into the feed hopper, controlling the feeding rate through the quantitative feeder, separating impurities larger than the screen hole size through the upper screen, the impurities are introduced into the first receiving hopper through the chute to become the oversize material, the remaining material enters the middle screen, and adjusting the tilt angle of the middle screen according to the screen surface tilt angle parameter;

[0016] The material moves on the surface of the middle screen. Material with a particle size smaller than the size of the middle screen hole passes through the screen hole and enters the lower screen. Whole grain particles slide down to the second receiving hopper. The lower screen retains material with a particle size larger than the size of the lower screen hole. Fine impurities pass through the lower screen hole and are collected in the third receiving hopper to become undersize. The quality data of the oversize and undersize are collected respectively.

[0017] Furthermore, it also includes: conveying the grain particles separated by the middle layer screen to the air separation device, adjusting the speed of the centrifugal fan according to the air separation speed parameters, the material falling in the air separation channel, forming a horizontal airflow in the air separation channel, the light material deviating from the falling trajectory under the action of the airflow and entering the light material collection hopper to become light impurities, and the heavy material falling directly into the heavy material collection hopper to become a semi-clean grain sample.

[0018] The semi-clean grain sample is transported to the mixing device, and the mixing blades are started to stir at a preset speed to ensure that the material is fully mixed and homogenized. The rotating feed plate of the sampler is started to disperse the material into multiple sampling slots, and the material in the preset number of sampling slots is collected to form a representative sample.

[0019] Furthermore, it also includes: acquiring high-resolution images of representative samples under a standard light source, extracting single-grain images through an adaptive threshold segmentation algorithm, calculating the area, perimeter, roundness, aspect ratio, and eccentricity of each grain as morphological features, extracting the color histogram, hue distribution, and saturation distribution of the single-grain images as color features, inputting the morphological features and color features into a hybrid grain recognition model, and classifying grain particles into normal grains, imperfect grains, and heterogeneous grains according to a pre-trained classifier;

[0020] The automatic sorting device is activated to guide the identified imperfect grains and foreign grains into their respective receiving hoppers. The mass data of the imperfect grains and foreign grains are collected by a high-precision electronic balance. The mass ratio of foreign grains is obtained by dividing the mass of the foreign grains by the total mass of the representative sample.

[0021] Furthermore, it also includes: inputting the mass ratio of different types of grains and the mass value of the semi-clean grain sample into the calculation unit, performing a multiplication operation to obtain the total mass of different types of grains in the semi-clean grain, using the total mass of different types of grains as the mass of impurities in the semi-clean grain, reading the mass data of the material on the sieve, the mass data of the material under the sieve, and the mass data of light impurities from the data acquisition unit, and adding the mass data to the mass data of impurities in the semi-clean grain to obtain the total mass of impurities;

[0022] The total mass data of the grain sample to be tested is read from the feeding unit. The total mass of impurities is divided by the total mass of the grain sample to be tested to obtain an initial ratio. The initial ratio is multiplied by a reference coefficient to obtain the total impurity content. The total impurity content value is output to the display unit. Simultaneously, the mass data, ratio data, and calculation parameters during the detection process are recorded to the data storage unit.

[0023] Secondly, this application provides an apparatus for evaluating impurities in raw grains, comprising:

[0024] The sieving module is used to collect appearance feature data and near-infrared spectral data of the grain sample to be tested. The color features, texture features and shape features in the appearance feature data are input into the variety identification model. The grain variety is identified by combining the near-infrared spectral data. Based on the identification result, preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters are retrieved, and the grain sample to be tested is put into the multi-stage sieving system.

[0025] The sampling module is used to perform multi-stage sieving of the grain sample to be tested based on the sieve aperture size parameters, air separation wind speed parameters, and sieve surface inclination angle parameters. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. Light impurities are separated by air separation from the grain particles separated by the middle sieve. The remaining material is used as a semi-clean grain sample. After homogenization of the semi-clean grain sample, a representative sample is extracted.

[0026] The identification module is used to input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of oversize material, undersize material, and light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0027] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method for evaluating impurities in raw grain.

[0028] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for evaluating impurities in raw grains.

[0029] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method for evaluating impurities in raw grains.

[0030] As described above, this application provides a method and apparatus for assessing impurities in raw grains. Through an innovative design of a multi-feature fusion model, and by using appearance analysis and spectral detection, it achieves accurate identification of grain varieties. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and through morphological analysis and mass calculation, the accuracy of impurity assessment is ensured. This method effectively addresses the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart illustrating the method for evaluating impurities in raw grains according to embodiments of this application.

[0033] Figure 2 This is a structural diagram of the grain impurity assessment device in the embodiments of this application;

[0034] Figure 3 This is a schematic diagram of the structure of the electronic device in the embodiments of this application.

[0035] Figure label:

[0036] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0039] In view of the problems existing in the prior art, this application provides a method and apparatus for evaluating impurities in raw grains. Through the innovative design of a multi-feature fusion model, accurate identification of grain varieties is achieved through appearance analysis and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculation are used to ensure the accuracy of impurity evaluation. This method effectively solves the shortcomings of traditional technologies in feature identification, impurity separation, and content evaluation, providing technical support for grain quality testing.

[0040] To effectively address the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, and to provide technical support for grain quality testing, this application provides an embodiment of a method for assessing impurities in raw grains. (See attached example.) Figure 1 The method for assessing impurities in raw grain specifically includes the following:

[0041] Step S101: Collect appearance feature data and near-infrared spectral data of the grain sample to be tested, input the color features, texture features and shape features in the appearance feature data into the variety identification model, combine the near-infrared spectral data to identify the grain variety, retrieve the preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters according to the identification results, and put the grain sample to be tested into the multi-stage sieving system.

[0042] Optionally, this embodiment focuses on the execution of S101 at grassroots purchasing points, addressing the complex scenario of alternating mixed grains, old grains, and new season grains. We first deploy an integrated acquisition unit next to the weighing station, including a standard D65 light source box, a line array camera, and a near-infrared probe. The operator spreads a thin layer of the grain sample to be tested on a matte background tray. After starting the imaging, the camera acquires a visible light image and a striped near-infrared reflectance spectrum from a top-view perspective in a single operation. To reduce interference from dust and residual oil on the data, this embodiment records the black field and white field before each shift, locking the exposure time and gain range to avoid drift during subsequent spectral calibration and ensure comparability across batches.

[0043] This embodiment first segments and locates the appearance data at the granular level. Adaptive thresholding and morphological opening operations are used to obtain a particle mask. Furthermore, Canny edge and contour tracking is used to calculate the perimeter, area, aspect ratio, roundness, and eccentricity of individual particles, which are considered shape features. In color space, the linearized RGB is converted to HSV, and the mean and variance of lightness, chroma, and saturation are calculated. Dispersion is estimated in the ab plane to characterize the degree of yellowing and the inherent color difference of the variety. For texture, a gray-level co-occurrence matrix is ​​generated based on the particle neighborhood, and four indicators—energy, contrast, correlation, and entropy—are extracted. These features are sensitive to changes in illumination; therefore, a reference area is introduced as a brightness anchor point to normalize the entire image to the target reflectance percentage. This ensures that color and texture indicators obtained across devices and time periods fall on the same scale, preventing subsequent models from misinterpreting lighting differences as variety differences.

[0044] In this near-infrared acquisition embodiment, the probe scans stepwise within a preset wavelength band to obtain the reflectance spectrum of each pixel strip. The original spectrum is first subjected to dark current subtraction and whiteboard correction, and then the scattering changes caused by particle orientation are processed using a standard normal transformation. The reason for fixing the SNV at the acquisition end is that the dust concentration in the chamber often changes, and the scattering term fluctuates in a short period of time. If the correction is postponed to the model end, misalignment will occur between training and deployment. We also perform a gentle baseline drift removal on the spectrum to avoid slow shift caused by the temperature rise of the lamp source due to long-term continuous operation.

[0045] This embodiment feeds image and near-infrared information into the variety recognition model. The model structure is as follows: a convolutional module extracts local color-texture patterns, and a fully connected module fuses them with the compressed spectral vector. At the input end, the shape and color texture of each grain are concatenated into a one-dimensional vector. At the spectral end, principal component transformation is used to obtain several principal components. The two are then merged and mapped to the variety label space by a multilayer perceptron. During the training phase, we do not allow the model to blindly pursue classification boundaries. Instead, we incorporate interpretive regularization with "natural constraints": the loading near the near-infrared main absorption band of the same variety should be higher than that of the noise band, and the spectral principal components related to color and protein should show moderate correlation. This correlation stems from the consistency between the actual chemical composition and phenotype, preventing the network from remembering the camera model or background material. During inference, the model outputs the probability distribution of each variety, takes the highest probability as the recognition result, and caches the confidence level. When the confidence level is too low, a re-enhancing or additional sampling process is triggered to reduce the risk of misidentification and control parameters.

[0046] In this embodiment, the identification result is used as a key to search for a matching set of screening parameters in the parameter database. The database was calibrated by process engineers based on numerous prototype tests, maintaining combinations of "upper, middle, and lower layer screen aperture sizes, air separation velocity, and screen inclination angle" according to variety, moisture content range, and common particle size distribution. Considering seasonal moisture fluctuations, we reread the moisture meter's real-time reading on-site and made fine adjustments based on thresholds within the same variety. For example, for slightly moist japonica rice, the air velocity was lowered based on the same variety parameters to prevent wet grains from being mistakenly carried away. After the query is completed, the values ​​are sent to the actuators of the screening system via PLC. The motor gradually approaches the target by adjusting the screen spacing and vibrating table inclination angle, and the fan speed is kept in a closed loop at the set value until the sensor feedback stabilizes before feeding is allowed.

[0047] In this embodiment, before feeding the grain sample into the multi-stage sieving system, a small-batch pre-flow test is performed to read the instantaneous throughput of a small number of samples in the upper, middle, and lower layers. If the deviation from the empirical range mapped by the model is too large, we tend to assume that the sample contains a non-target variety or has abnormal moisture content. The system then suspends large-batch processing and requires reconfirmation of the variety. This may seem to slow down the process, but from a system-level perspective, it prevents the cascading losses caused by incorrect parameters from occurring at the outset. This ensures that the subsequent quality acquisition and impurity calculation in S102-S107 are not amplified layer by layer due to the starting point deviation.

[0048] This embodiment presents a clear chain of technical challenges and effectiveness: The original samples from the field exhibit strong heterogeneity and high noise levels, making it difficult to reliably identify varieties based solely on visual inspection or single-path sensing. By combining appearance phenotype with near-infrared chemical information, the model learns decision-making criteria that align with natural laws (color and texture correspond to outer structure, and spectrum corresponds to internal composition), thus outputting reliable variety labels. With these labels, sieve aperture, wind speed, and tilt angle can be accurately retrieved from the process database, ensuring that the flow boundaries of subsequent multi-stage sieving match the particle size and density distribution of the variety, reducing the occurrence of large particles entering the undersize or light impurities remaining in the middle layer. For ease of understanding, we also record a one-time formula:

[0049] I = (P_max × C_m),

[0050] Where I represents the variety confidence index used for process verification, P_max is the highest category probability output by the identification model, and C_m is the moisture correction coefficient (derived from real-time moisture readings and used to correct the sensitivity of parameter selection to moisture content). When I is lower than the threshold, supplementary sampling and manual confirmation are triggered. Through this closed loop, this embodiment connects identification, parameter calling, and equipment placement into a traceable link, providing a clean starting point for subsequent impurity assessment.

[0051] Step S102: Based on the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters, the grain sample to be tested is subjected to multi-stage sieving. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. The grain particles separated by the middle sieve are separated by air separation to obtain light impurities. The remaining material is used as a semi-clean grain sample. The semi-clean grain sample is homogenized and then a representative sample is extracted.

[0052] Optionally, this embodiment focuses on step S102, inputting the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters from S101. The goal is to orderly separate impurities of different sizes and densities without changing the natural particle size distribution of the grain, and ultimately obtain a statistically representative sample. Actual production lines experience fluctuations in humidity and feed particle size distribution. This embodiment combines mechanical separation with process monitoring to ensure that subsequent impurity content calculations are not skewed by front-end deviations.

[0053] This embodiment first prepares the physical state of the screening unit: the upper screen aperture size is designed for volumetric debris such as straw segments, stones, and hemp rope ends; the middle screen aperture matches the main particle size range of the target variety; and the lower screen aperture is used to remove sand, dust, and fragments. The quantitative feeder controls the instantaneous flow rate in a closed-loop manner, and the sensor reads the feed belt load in real time, maintaining it within the allowable range of the parameter library. The reason is simple—overload causes particles to form an accumulation layer on the screen surface, reducing the equivalent porosity. Lighter, smaller particles are carried away by this "bridging" effect, immediately increasing the misclassification rate. The vibration frequency and screen inclination angle are set by the control unit to the corresponding value in the parameter set. A larger inclination angle results in a shorter residence time and a lower probability of perforation; a smaller inclination angle leads to clogging on the screen and smooths out the stratification effect. We would rather let the sample pause for one more second than accept mixed samples entering the air separation stage.

[0054] In this embodiment, during the upper-layer screening, the particle group is coarsely divided into "oversized" and "can continue" based on the given upper-layer screen aperture size. To prevent long strips of straw from passing through the aperture at a certain angle, the screen surface uses short-amplitude high-frequency vibration, superimposed with the directional misalignment of the slit-shaped apertures. This detail is crucial for reducing "missed particles." The material on the screen falls into the first receiving hopper via a chute. The hopper opening is equipped with a weight sensor and a metal foreign object detection coil. The two work together to record the mass of large impurities and mark abnormal batches. For example, fields with high metal content may have originated from debris falling off mechanical harvesting equipment. The subsequent weighing should avoid magnetic adsorption errors.

[0055] In this embodiment, the middle-layer screening targets the flow within the target particle size band. The aperture and inclination angle of the middle-layer screen are transmitted from the variety identification module. Indica and Japonica rice have different aspect ratios and equivalent passing areas; if the same aperture is applied, qualified Japonica rice grains may be mistakenly retained. We have placed two layers with different surface roughness on the screen surface. The front layer increases friction to agitate thin, flaky particles, while the rear layer reduces friction to allow whole grains to slide off smoothly. With fine adjustment of the vibration direction, even in extreme cases, thin, flaky particles can be guided to the lower perforation layer rather than being mixed into the path of whole grains. The fine material entering the lower layer continues screening. Extremely small particles and powder perforations become undersize and fall into the third receiving hopper. Non-target fine particles remaining on the lower screen surface are discharged to prevent backflow. Those sliding off the middle-layer screen are identified as "quasi-whole grains." Instead of immediate judgment, they are sent to an air classifier for further separation based on density and shape differences.

[0056] In this embodiment, the air separation process employs horizontal directional airflow with an adjustable Venturi throat. The airflow velocity is calibrated according to the air separation wind speed parameters. Too fast an airflow will deflect even plump particles with slightly larger surface areas, while too slow an airflow will cause lightweight impurities to fall and mix into the semi-clean grain. We added an adjustable drop height at the discharge port. The simple physics principle is that the longer the drop distance, the greater the vertical velocity component, and the smaller the contribution of unit horizontal wind pressure to trajectory deflection, which is suitable for wheat with larger particle sizes. Conversely, for long rice grains, the drop height can be appropriately shortened to improve separation sensitivity. Lightweight impurities are intercepted and enter the lightweight material hopper, while heavy materials fall directly as semi-clean grain. To avoid blurring the boundaries between husk fragments and insect-damaged grains due to their different shapes, a light curtain is installed at the end of the air duct to detect the cross-sectional integral distribution of the two types of particles. If the threshold fluctuation exceeds the limit, the controller will briefly reduce the wind speed and prompt for resampling.

[0057] In this embodiment, after obtaining the semi-cleaned grain, it is not directly used for weighing, but rather undergoes homogenization. The mixing device is not a simple agitator; we use a combination of double spiral ribbons and blades to first tumble the entire mixture and then shear it locally, aiming to break up any possible stratification due to gravity. The mixing time is not fixed; an online particle size sensor collects the particle number distribution at multiple cross-sections until the variance falls within the empirical band. The sampler uses a rotating quartering method; the feeding disc randomly sprinkles particles into equidistant sampling slots at a fixed rate. The randomness relies on the slight perturbation of the incident angle and the micro-protrusions on the disc surface. A predetermined number of slots are collected to form a representative sample. We also considered that electrostatic adsorption is more pronounced in dry seasons; before sampling, an ion wind is used to gently brush the sample, reducing the probability of micropowder adhering to the slot walls. This step is to avoid complicating subsequent image recognition.

[0058] The reason this embodiment emphasizes representativeness is that the subsequent parallel impurity identification model needs to estimate the ratio of imperfect particles to heterogeneous particles on a small sample. If the sampling is skewed, the final total impurity content will be systematically skewed. In other words, S102 is not an isolated mechanical step; it is closely linked to the statistical inferences of S103 and S104. To verify that the boundary of physical separation and the wind separation criterion have not been "over-stripped," we randomly sampled a small portion of wind-separated lightweight material from each shift, photographed it, and performed a rough color-morphology classification to see if the proportion of heavy particles entering the system was outside the empirical range. If it deviated, we traced back the combination of wind speed and falling height to restore it to the previous stable setting.

[0059] This embodiment adds a simple model at the engineering level for estimating the probability of passage from the upper to the lower layer, to guide the selection of tilt angle and amplitude:

[0060] p = exp(−k·L / (v·sinθ)),

[0061] Where p represents the probability of a unit particle passing through the target layer sieve aperture, k is an empirical constant related to the particle shape coefficient, L is the average travel distance of the particle on the sieve surface, v is the effective vibration velocity of the sieve surface, and θ is the sieve surface inclination angle. The physical meaning of this relationship is quite simple: a longer travel distance and stronger normal excitation result in a higher probability of penetration, while an increased inclination angle reduces the effective normal component. We do not use it for precise control, but only as an intuitive quantitative reference during on-site parameter adjustments to avoid large fluctuations caused by differences in team experience.

[0062] In terms of technical effectiveness, the initial grading stage effectively removes both volumetric and powdery impurities. Air separation further refines the separation in terms of density and morphology, ensuring homogenization and representative sampling so that subsequent identification and weighing deal with a "reduced version of the true total quantity." In practical scenarios, the moisture content of the grains is higher during harvest season, weakening the self-cleaning effect of the sieve surface. Therefore, we have included a bypass for heated air, allowing for slight drying before sieving. In areas with a high concentration of grass seeds, the air separation speed is lowered and the airflow channel length is extended to prevent small, heavy grass seeds from being mistakenly classified as lighter. Through this series of interconnected steps, S102 truly incorporates multi-source parameters into the physical separation process, providing a reliable foundation for subsequent impurity mass calculations.

[0063] Step S103: Input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of material on the sieve, the mass of material under the sieve, and the mass of light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0064] Optionally, in this embodiment, the semi-clean grain sample after S101 sieving and air separation is sent to the homogenization and sampling unit to obtain a representative sample R. In the operation, a high-resolution image of R is first acquired in a standard light source box, and single-particle images are cut out using a mechanical particle segmentation channel or software segmentation. To make the subsequent model's judgment closer to natural laws, we calculate the area, perimeter, aspect ratio, roundness, eccentricity, and tip bluntness of each grain as morphological features. For color, we extract the mean, variance, and skewness of brightness, chromaticity, saturation, and a* and b* distributions from both HSV and Lab spaces. The reason for the coexistence of dual spaces is that some heterogeneous grains (such as a small amount of rye mixed with wheat) are more clearly separated in Lab, while some imperfect grains (chaff grains, insect-damaged grains) are easier to distinguish in the combined saturation and brightness of HSV. Brightness shifts introduced by different batches are corrected using standard white film to prevent the model from mistaking illuminance differences for variety or defect clues.

[0065] This embodiment inputs single-grain features into a hybrid grain recognition model. The model consists of a two-branch feature encoder and an integrated classification head: the morphology branch uses a fusion of lightweight convolution and shape matrix statistics, while the color branch uses a binning histogram with an attention weight layer to highlight discoloration and moldy areas. The results are then concatenated in the fusion layer and fed into a fully connected classifier to output three label probabilities: normal grains, imperfect grains, and heterogeneous grains. The annotations during training come from previous years' sampling and manual review. We added prior constraints consistent with physical causality: when morphological abnormalities (such as extreme aspect ratios) and color abnormalities (such as significant brightness drops) coexist, imperfect grains are more likely to be identified; heterogeneous grains exhibit a systematic shift from the target variety in morphological scale and texture frequency, making it difficult to completely mask them even if the colors are similar. The model's input is the feature vector of each grain and its optional local patches; the output is the class distribution and confidence score of each grain. Particles with excessively low confidence are marked for review and are not directly included in the statistical process to avoid misleading weighing by boundary samples.

[0066] In this embodiment, the identification results are linked to an automatic picking device. Pneumatic nozzles and small solenoid valves guide imperfect grains and foreign grains into receiving hoppers A and B respectively, while normal grains fall into hopper C. The weighing process uses a calibrated electronic balance to record stable readings of the mass curves in hoppers A and B using timestamp matching, obtaining m_def (mass of imperfect grains) and m_mis (mass of foreign grains). Since the total mass m_R of the representative sample R is known during sampling, we calculate the proportion of foreign grains p_mis = m_mis / m_R. The mass of imperfect grains can also be archived separately for other clauses regarding mass deduction, but in the impurity calculation, foreign grains are included in the semi-clean grain impurity item.

[0067] In this embodiment, p_mis is multiplied by the semi-clean grain sample mass M_sg to obtain the semi-clean grain impurity mass M_sg_imp. The logic here is not a simple overcalculation, but rather based on the statistical premise of sample representativeness: R is sampled with equal probability using a quartering method or a rotating disk, and its proportion of dissimilar grains approximates the true proportion of the entire batch of semi-clean grain. Furthermore, the particle size distribution of the remaining semi-clean grain material has been stabilized within the target variety range by the parameters of S101. Therefore, extrapolating the proportion of R to M_sg is reasonable. In cases of extreme mixed incoming materials, we will trigger parallel retesting of two samples, calculate the consistency of the two p_mis measurements, and then decide whether to use the average value for subsequent summarization.

[0068] In this embodiment, when summing the impurity mass, the following data are read from S101: oversize (M_over), undersize (M_under), and light impurities from air separation (M_light). These three items quantify the non-target particles and dust directly removed by the sieving system, while M_sg_imp represents the "remaining foreign particles" in the semi-clean grain. The total impurity mass M_imp is obtained by summing the four data, and the total impurity content is normalized based on the total sample mass M_total. To avoid numerical misunderstandings, the calculation relationship is clearly defined as a single formula:

[0069] C = M_imp / M_total,

[0070] Where C represents the total impurity content (a dimensionless proportion), M_imp is the total mass of impurities (the mass obtained by adding M_over, M_under, M_light, and M_sg_imp), and M_total is the total mass of the grain sample to be tested (provided by the feeding unit). All parameters are derived from the corresponding sensors and weighing records, are traceable, and have clear physical meanings.

[0071] A common question encountered in application scenarios in this embodiment is whether healthy, dark-colored kernels might be misclassified as different varieties. We introduced a distribution alignment approach in model training: we performed a correction mapping on the color distribution of the same variety from different origins, ensuring that the threshold for color features was not fixed to samples from a particular region. Then, we combined morphological frequency features (such as the consistency between ventral groove density and grain size) for joint discrimination. The model only increases the probability of being a different variety when both types of evidence deviate from the typical range of the target variety. This evidence fusion follows natural laws: single color differences often stem from drying and moisture content, while systematic differences in morphology and microtexture usually indicate genuine varietal differences.

[0072] This embodiment also considers minor fluctuations on the equipment side. Occasional jamming of the automatic picking valve can lead to a small number of missortings. We compare the cumulative mass of the three bins (A, B, and C) with the particle count through closed-loop quality monitoring. If an abnormal segment with "few particles but large mass jumps" is found, the system reviews the visual records within that time window, removes the suspicious segment from the p_mis calculation, and prompts for maintenance. For corn samples full of broken kernels, single-kernel segmentation may result in adhesion. We temporarily switch to the "connected region area mean method" to estimate the particle count to avoid broken pieces lowering the roundness index and being mistakenly pushed into the imperfect class.

[0073] This embodiment achieves two technical effects. First, based on the identification of impurities by shape and color, it labels and weighs imperfect grains and grains of different varieties that are difficult to reliably judge with the naked eye in a verifiable manner, providing a quality item with a clear source. Second, it reliably projects the proportion of different varieties from representative samples back to the semi-clean grain quality, and then combines it with the direct weighing data from the over-sieve, under-sieve, and light impurities channels. The resulting total impurity content is consistent with the physical process of the on-site process, without incorporating variety deviations or light differences into the impurity definition. The final C value, along with all intermediate quantities, is stored in the data storage unit, facilitating post-processing tracking by the quality inspection department.

[0074] As described above, the grain impurity assessment method provided in this application can accurately identify grain varieties through innovative multi-feature fusion model design, appearance analysis, and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculation are used to ensure the accuracy of impurity assessment. This method effectively solves the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.

[0075] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0076] Step S201: Construct a machine vision acquisition device to acquire visible light images of the grain sample to be tested under standard light source illumination, perform image segmentation and edge extraction on the visible light image, calculate the perimeter, area, and aspect ratio parameters of the grain particles as shape features, extract the lightness, chroma, and saturation components of the color space as color features, and use the gray-level co-occurrence matrix to calculate energy, contrast, correlation, and entropy as texture features.

[0077] Step S202: Install the near-infrared spectral acquisition probe, set the wavelength range and sampling interval of the near-infrared light source, scan the grain sample to be tested to obtain reflectance spectral data, perform dark current correction and white plate calibration on the reflectance spectral data to eliminate baseline drift and scattering effects, and preprocess the spectral data using the standard normal transformation method.

[0078] Optionally, this embodiment addresses both the acquisition point and warehouse inspection scenarios, focusing on the entire process of establishing a data foundation around S201 and S202. The machine vision acquisition device consists of a standard D65 light source box, a polarizing diffuser, an industrial camera, and a matte background tray. The operator spreads the grain to be tested in a single layer, leaving small gaps between the grains. The light source illuminates with a 45° / 0° geometric configuration, and the polarizer suppresses specular reflection to avoid bright spots affecting texture statistics. Before acquisition, a black and white correction is performed to lock exposure and gain. The reflectivity curve of the calibration plate is written to the device for subsequent color quantization traceability. After the entire image is acquired, the system enters image preprocessing: Gaussian denoising suppresses salt grain noise, adaptive thresholding (based on local window mean) obtains a coarse segmentation mask, morphological opening operation removes adhesion, and connected component screening identifies single-grain candidate regions. Edge extraction uses Canny combined with subpixel fitting of ellipses to calculate perimeter, area, aspect ratio, roundness, and eccentricity. Among these, aspect ratio and eccentricity are more sensitive to distinguishing the shape differences between indica and japonica rice. For color features, the original linearized RGB values ​​were transformed to HSV and CIELab using matrix transformation. The lightness (V, L*), chroma (a*, b*, or H), and saturation (S) of each grain were sampled. To reduce the influence of local shadows, color statistics within the grain were represented by the median and interquartile range to indicate stability centers and dispersion. For texture features, a gray-level co-occurrence matrix was constructed on the intra-grain grayscale image, with orientations of 0°, 45°, 90°, and 135°, and step sizes of 1 and 2. Energy, contrast, correlation, and entropy values ​​were summarized. Considering the anisotropic nature of grain pericarp texture, the directional difference term was retained for subsequent model analysis to determine texture damage caused by dryness and insect infestation.

[0079] This embodiment emphasizes optical geometry and polarization because unprocessed specular reflections can increase high-frequency energy, artificially inflating contrast and entropy, resulting in "false roughness" in texture features. On the other hand, single-layer paving combined with connected component constraints is to make morphological features interpretable—if perimeter and area are affected by adhesion, the aspect ratio will converge towards 1, misleading variety identification. For batches where multi-grain occlusion is unavoidable, we calculate concave polygon metrics on candidate regions; regions exceeding a threshold are marked as unreliable and removed from the feature statistics set, reducing the infiltration of erroneous samples.

[0080] In this embodiment, a near-infrared spectroscopy acquisition probe is installed in S202, selecting a wavelength range of 900–1700 nm or wider. The sampling interval is set according to the main absorption bands of the target variety (e.g., moisture around 1450 nm, protein / starch composite band around 1200–1500 nm), balancing resolution and scanning time. The fiber optic probe maintains a fixed working distance from the sample, and the integration time is extended as much as possible without saturation to improve the signal-to-noise ratio. Before scanning, the dark current D(λ) is recorded, and then calibration is performed using a white plate W(λ). The reflectance is calculated (using a common white reference correction method for near-infrared reflectance spectroscopy, used to calculate the relative reflectance / normalized reflectance signal):

[0081] R(λ)=(I(λ)−D(λ)) / (W(λ)−D(λ)),

[0082] Where R(λ) represents the unitless relative reflectance or relative spectral reflectance after correction for dark current and white plate reference, I(λ) is the original sample signal, D(λ) represents detector dark noise, and W(λ) is the white plate response. This ratio has a clear physical meaning, subtracting the device background and normalizing to the reference reflectance, facilitating cross-device comparison. To suppress baseline drift, a first- or second-order polynomial is first used for baseline fitting and subtraction, followed by standard normal transformation (SNV) to center and normalize the variance of each spectrum. The mean and standard deviation in SNV are calculated within a single spectrum, primarily targeting amplitude variations caused by scattering rather than differences in chemical absorption.

[0083] This embodiment addresses the coupling issue between spectral preprocessing and image features. Dust, particle orientation, and surface roughness within the storage area alter the scattering field. Relying solely on image texture can easily lead to misinterpreting scattering-induced bright and dark bands as cortical streaks. After SNV (Spectral Vector Reflection), the spectral amplitude, affected by scattering, is brought back to a uniform scale, appearing in tandem with polarization suppression at the image end. Both causally remove "spurious signals introduced by equipment and placement." To verify this, we recorded placement angle, stack thickness, and humidity on a small sample set. We found that morphological and color features have low direct sensitivity to humidity, but their absorption deepens at 1450nm, consistent with actual moisture levels. The model will subsequently utilize this complementarity to separate product types from moisture-containing scenarios.

[0084] This embodiment employs a two-level strategy for feature aggregation: granular aggregation and batch weighting. At the granular level, shape vectors, color vectors, and texture vectors are output. The spectrum is smoothed by Savitzky-Golay and then fed into principal component analysis, with the peak shape parameters of the first few principal components and chemical band positions used as spectral features. At the batch level, we use area distribution-based weights to perform a weighted average of the granular features. This is because samples with a high proportion of fine particles commonly found at the acquisition site can amplify the texture entropy value, and a simple mean would overestimate the roughness. The weights are positively correlated with the area, but an upper limit is set to avoid individual large particles hijacking the statistics. This entire set of outputs can be directly fed into the variety identification model in S101, and can also be used for backtracking diagnosis when equipment parameters in S102 are abnormal.

[0085] This embodiment considers two extended scenarios to align with real-world business scenarios. First, corn varieties have a high wax content in their outer layer, resulting in stronger specular reflection. In S201, cross-polarization and a higher diffusion optical path are enabled, and Retinex enhancement is performed before texture calculation to stabilize shadows. Second, when late-season rice has high moisture content, the spectrum in S202 easily saturates near the water absorption band. We automatically shorten the integration time and increase the number of averaging iterations, using time multiplexing to improve the signal-to-noise ratio. If it still approaches saturation, we suggest using a standard whiteboard with lower reflectivity for calibration to avoid excessive saturation.

[0086] This embodiment connects the technical problem with the effect. The goal of the two front-end data sources is not complexity but mutual verification: the image provides the phenotype—grain shape, color, and cortex texture; the near-infrared provides the intrinsic characteristics—water content, protein and starch composition. Subsequent variety identification and screening parameter retrieval rely on a "stable and interpretable" data base. S201 and S202, through geometric optical path control, segmentation and feature engineering, dark current and whiteboard calibration, and the combination of baseline and SNV, peel away an unavoidable layer of changes in placement, dust, and humidity from the signal, retaining changes that are closer to the grain itself. The features transmitted in this way not only allow the model to make common-sense boundaries in the label space, but also allow the process parameter retrieval to avoid detours, reduce the probability of misadjusting sieve aperture and wind speed, and make the subsequent statistical inference of representative samples more stable.

[0087] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0088] Step S301: Input appearance feature data and near-infrared spectral data into a deep neural network, extract local features of the image through a convolutional layer, fuse the local features and spectral features through a fully connected layer, establish a mapping relationship between feature vectors and grain variety labels, input the mapping relationship into a classifier to calculate the probability score of each variety, and select the variety with the highest score as the recognition result.

[0089] Step S302: Based on the identification result, retrieve the corresponding screening parameter group in the parameter database, read the upper screen aperture size, middle screen aperture size, lower screen aperture size, air separation speed, and screen surface inclination angle values ​​from the screening parameter group, and transmit the values ​​to the control unit of the multi-stage screening system to drive the actuator to adjust the screen spacing, fan speed, and vibration table inclination angle to the target state.

[0090] Optionally, this embodiment inherits the appearance features and near-infrared spectral features already generated in S201 and S202, and performs fusion recognition and parameter distribution around S301 and S302. We perform sample alignment between the particle-level shape, color, and texture vectors from machine vision and the spectral vectors processed by SNV and denoised, ensuring that the two data streams of the same batch of samples match in terms of timestamp and batch number, and then perform missing item processing: if the spectrum of individual particles is missing, it is gently interpolated at the batch level using the spectral center value of similar particle clusters, avoiding the network learning the false rule "missing = specific variety" due to inconsistent samples. The input is constructed into a two-branch deep network: the image branch uses lightweight convolutional blocks to extract local texture blocks and shape-sensitive features, with convolutional kernels alternating between 3×3 and 5×5, and channel attention is added between layers to suppress invalid high frequencies caused by shadow residue; the spectral branch uses one-dimensional convolution to capture local peaks and valleys and slopes of absorption bands, and then connects to bidirectional gating units to model cross-band correlations, avoiding treating adjacent peaks as independent evidence. The two branches are spliced ​​together in the fusion layer and then enter the fully connected layer to learn nonlinear combinations, with the output being a feature map of the variety label space.

[0091] In this embodiment, a loss structure consistent with the physical scene is set during the training phase. The main loss is cross-entropy, supplemented by feature consistency constraints: the spectral similarity of samples of the same variety near the 1450 nm water absorption band should be higher than that of cross-varietal samples, while the aspect ratio and ventral groove texture density of the image have directional contributions to the classification of japonica / indica rice, and the network is encouraged to "negotiate consistency" in these two dimensions. We also introduce intra-batch color drift enhancement and spectral micro-noise perturbation, intending to make the network regard "lighting changes and scattering fluctuations" as irrelevant factors, and "cortical texture and chemical absorption differences" as core evidence. This intrinsic relationship conforms to natural rules: color and texture are surface representations, while the spectrum reflects internal components; the two exhibit stable coupling for the same variety, but shift as a whole for different varieties.

[0092] In the inference phase of this embodiment, the network outputs a probability score vector p for each variety. The classifier takes the label corresponding to the largest component in p as the recognition result and retains the confidence level p_max. We do not mechanically accept labels with low confidence levels, but introduce a safety net on the business side: if p_max is lower than an empirical threshold, and the spectral branch gives close scores to two adjacent varieties, while the image branch strongly favors one in aspect ratio, the system requires re-shooting or small-batch re-collection to reduce the risk of misadjusting screening parameters. For mixed grain scenarios (such as wheat mixed with a small amount of rye), the network will give a wider distribution of p at the particle level within the sample. After batch aggregation, it presents a "main variety + secondary peak" form. In S302, we use the "main peak variety" to issue parameters, but take a conservative range for the wind separation speed to avoid excessive removal of a small amount of secondary varieties.

[0093] This embodiment connects the identification results to a parameter database. The database maintains parameter groups according to variety × moisture content range × regional particle size distribution. The key values ​​include the mesh size of the upper, middle, and lower sieve layers, the air separation velocity, and the sieve inclination angle. During retrieval, the identified variety is first used as the primary key, and then the moisture content range of the online moisture meter is read. If the moisture content falls within the critical zone, the rule engine selects two adjacent sets of parameters for linear interpolation to provide a "mild" combination. This is because the mechanism by which moisture content changes particle adhesion and passage probability is continuously changing, and hard switching can easily cause abrupt flow splitting. After the retrieval is completed, the parameters are written to the multi-level screening system control unit via industrial Ethernet. The controller executes the following sequentially: adjusting the sieve spacing to the target aperture calibration position; setting the vibration table inclination angle, first approaching it in small steps, and then waiting for the posture sensor to stabilize; and adjusting the fan speed in a closed loop, finely adjusting it near the set value based on the real-time flow rate to prevent misjudgment during no-load moments.

[0094] This embodiment incorporates a "dry run verification" during the actuator positioning process. The control unit instructs the vibration and fan to run according to target parameters for 20–30 seconds. The system reads the micro-sampling throughput and particle shape statistics of the three receiving hoppers. If the upper layer throughput is abnormally low and the aspect ratio distribution of the middle layer particles is unbalanced, we tend to judge that the sieve openings or tilt angle are not fully in place, and automatically revert to a small step before trying again. This verification is based on physical intuition: when the sieve angle is too small, particles remain for too long, and thin flakes and fragments are more likely to slide off with the laminar flow rather than perforate; if it is too large, the probability of perforation of intact particles decreases. Dry run can identify deviations in advance under conditions of no or small amount of material, avoiding the incorrect diversion of large batches of samples.

[0095] This embodiment considers the boundary issues of parameter extrapolation. For some newly introduced local varieties that lack explicit entries in the database, we employ a "similar variety neighborhood" strategy: we calculate the cosine similarity between the fusion features of the current sample and the prototype vectors of each variety in the database. If the highest similarity exceeds a threshold, we inherit the parameter set for that variety and reduce the wind speed and tilt angle by one level; if it falls below the threshold, the system prompts manual selection of similar varieties and records this manual selection for later inclusion in the database. This implementation logic balances model uncertainty with process safety, avoiding blindly applying parameters.

[0096] This embodiment forms a traceable chain after deployment. Each identification records the p-vector, image, and feature summary of the spectral branch (excluding the original image to reduce storage), as well as the final issued screening parameter group number. Subsequently, if "abnormal increase in oversize material" or "abnormal change in the proportion of different species" occurs in S102 or S103, the quality inspector can trace back the p_max and water segment at that time to determine whether it is due to unstable identification or incompatible process parameters. Field experience shows that when the moisture content is high, the water absorption band of the spectral branch becomes more dominant, and p becomes more dependent on spectral features; while on days with large deviations in lighting conditions, the color feature drift of the image branch will be pulled back by white film calibration, and the overall stability of the network remains acceptable.

[0097] From a technical perspective, this embodiment provides multimodal variety identification consistent with natural mechanisms in S301, avoiding misleading appearances. S302 reliably maps the identification results to executable screening and air-separation parameters, and tightens errors through dry running and online small-scale verification. These two steps combined create a closed loop between "data, model, and process," preventing the model from being treated as a black box and ensuring the process is not based on guesswork. Ultimately, this allows subsequent physical separation and impurity assessment to be based on interpretable and verifiable premises.

[0098] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0099] Step S401: Start the vibration motor to drive the screen box to vibrate, put the grain sample to be tested into the feed hopper, control the feeding rate through the quantitative feeder, the material is separated by the upper screen to separate impurities larger than the screen hole size, the impurities are introduced into the first receiving hopper through the chute to become the oversize material, the remaining material enters the middle screen, and the tilt angle of the middle screen is adjusted according to the screen surface tilt angle parameter.

[0100] Step S402: The material moves on the surface of the middle screen. Material with a particle size smaller than the size of the middle screen hole passes through the screen hole and enters the lower screen. Whole grain particles slide down to the second receiving hopper. The lower screen retains material with a particle size larger than the size of the lower screen hole. Fine impurities pass through the lower screen hole and are collected in the third receiving hopper to become undersize. The quality data of the oversize and undersize are collected respectively.

[0101] Optionally, this embodiment continues with the parameters of screen aperture size, air separation velocity, and screen inclination angle issued in S301 / S302, and proceeds to the physical separation at the equipment level. The team first checks the temperature rise of the vibration motor and bearings under no-load conditions to confirm that the screen box fasteners are not loose. Then, the vibration motor is started to the target frequency, and the difference between the real-time reading of the acceleration sensor and the historical baseline is observed to avoid resonance drift caused by spring fatigue. The grain sample to be tested is poured into the feed hopper, and the quantitative feeder stabilizes the feeding rate according to closed-loop control. The control logic is mainly based on belt weighing feedback and supplemented by bucket level, to suppress instantaneous large peak flow. The reason is straightforward: if the thickness of the material layer increases out of control, it will cause the upper screen surface to form a "bridge arch", reducing the equivalent porosity. Large impurities that should be intercepted in the upper layer may slide with the thin layer and contaminate the subsequent middle layer identification.

[0102] In this embodiment, the upper screen is modified with corresponding hole types and opening ratios according to the variety parameters. The upper layer is responsible for quickly removing volumetric impurities such as straw fragments, gravel, and clumps of mud. The electronic control sets the vibration direction angle slightly off-center from the screen surface normal, causing long debris to frequently change its tumbling posture, reducing the chance of it passing through narrow edges. The material on the screen falls into the first receiving hopper via an anti-splash chute. A metal detection ring and a quality sensor are installed at the hopper opening. The former marks abnormal batches for quality inspection and traceability, while the latter continuously outputs the M_over curve for S103 summary. The remaining material flows into the middle screen. The control unit adjusts the inclination angle of the middle screen surface to the target angle θ according to the parameters in S302. The combined effective velocity v of the middle screen amplitude and frequency affects the particle residence time and local looseness. In engineering, we prefer a slightly longer residence time to allow for more thorough rearrangement and perforation of the broken particles.

[0103] This embodiment focuses on the micro-kinematics of the middle sieve surface in stage S402. Particles undergo alternating sliding-jumping motion in a field combining vibration and gravity. Particles smaller than the sieve aperture size are more likely to encounter and perforate after micro-jumping, entering the lower sieve. Whole grain particles, due to their larger size and shape (aspect ratio, roundness), have a lower probability of perforation and slide directionally along the sieve surface to the second receiving hopper, becoming the target flow. A detail often overlooked here is that flaky and strip-shaped particles behave differently. The former can perforate by tumbling to expose their short axis, while the latter requires stronger normal excitation. Therefore, we cover the front section of the sieve with a high-friction coating to increase the tumbling frequency, and then switch to a low-friction coating in the rear section to reduce the "braking" on whole particles. The lower sieve is responsible for intercepting the still relatively large fine particles; only powder and fine sand smaller than the lower sieve aperture size perforate and are collected as undersize in the third receiving hopper.

[0104] This embodiment converts the physical actions of S401 and S402 into measurable quantities at the data level. The load sensors of the first and third receiving hoppers each take stable readings within a fixed time window, outputting the quantities of material over and under the screen. These two signals are then de-jittered and averaged over a short window to eliminate high-frequency noise caused by vibration coupling. To ensure the quality curve has an interpretable process correlation, we include the acceleration of the middle screen surface and the feed rate as accompanying variables on the same time axis. Subsequently, if a segment of "stable feed but a sudden increase in under-screen material" occurs, quality control can quickly pinpoint it as a process event of "removal of middle screen pore blockage" or "increased amplitude," rather than misinterpreting it as an increase in sample fragments.

[0105] This embodiment takes into account scenarios with high seasonal moisture content. Wet particle adhesion increases the equivalent thickness of thin, fragmented particles, making perforation more difficult and causing non-target particles in the middle layer to slide into the second receiving hopper. We incorporate moisture compensation into our tilt angle θ control strategy: when the online moisture meter exceeds the threshold, the controller fine-tunes θ by one level, extending the residence time in the high-friction zone at the front and increasing the chance of tumbling and perforation; if this still does not meet expectations, the vibration frequency is slightly increased without changing the aperture, enhancing the normal component. The order of these two optimization steps is based on physical intuition: prioritizing changing the residence time, and only then increasing the excitation intensity, to avoid excessive disturbance to intact particles.

[0106] In this embodiment, the trade-off between misclassification and omission is addressed by using a simple empirical relationship to guide the work team's observation: when the feed rate F, the effective screen speed v, and the inclination angle θ are fixed, the perforation count N per unit time approximately decreases monotonically relative to the particle size d. If N jumps abruptly with respect to time while F remains unchanged, it is likely that the pore blockage has been cleared or the material has become drier; if N declines slowly, it may indicate the accumulation of contaminants on the screen surface. Instead of using formulas for closed-loop control, we map this empirical relationship into alarm logic to remind the team to clean or briefly stop the machine for inspection, reducing system errors caused by "operating with defects."

[0107] This embodiment also provides extended examples for two special types of incoming materials. First, when corn contains a large amount of small, heavy, heterogeneous grains such as thistle seeds, the air duct will further differentiate them in S102 after the lower sieve aperture size is set according to the database. In S401 / S402, we do not deliberately aim to lower all of them under the sieve, to avoid letting small, intact grains of the target variety pass through due to enlarging the lower sieve aperture. Second, when there is a high amount of rice husk powder, the dust under the upper sieve will form a film in the middle layer, reducing effective pore penetration. We configure periodic backflushing air pulses to perform short cleaning of the sieve surface, triggered intermittently without affecting the particle trajectory, maintaining stable grading boundaries.

[0108] This embodiment focuses on technical effectiveness. S401 uses stable excitation and controlled feeding to cut out large volumetric impurities in the upper layer, creating a clean inlet for the middle layer. S402, through the synergy of tilt angle, amplitude, and surface friction, separates "perforable fine fragments" from "intact particles that should slide off" according to size and morphology. Quality data from both the over- and under-screen ends are collected in real time, providing solid evidence for impurity assessment in S103. The entire process is parameter-linked to the types identified in S302, preventing distortion due to differences in shift experience. Even when encountering external disturbances such as humidity or dust, small, interpretable adjustments can bring the separation effect back to the ideal range.

[0109] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0110] Step S501: The grain particles separated by the middle layer screen are conveyed to the air separation device. The speed of the centrifugal fan is adjusted according to the air separation speed parameters. The material falls in the air separation channel. A horizontal airflow is formed in the air separation channel. Light materials deviate from the falling trajectory under the action of the airflow and enter the light material collection hopper to become light impurities. Heavy materials fall directly into the heavy material collection hopper to become semi-clean grain samples.

[0111] Step S502: The semi-clean grain sample is transported to the mixing device, the mixing blades are started to stir at a preset speed to make the material fully mixed and homogenized, the rotating feed plate of the sampler is started to disperse the material into multiple sampling slots, and the material in the preset number of sampling slots is collected to form a representative sample.

[0112] Optionally, in this embodiment, the intermediate sieve separation material output from S401 / S402 enters the air classification and uniform sampling stage. The conveying mechanism uses a combination of a gently sloping belt and a small drop chute to reduce the kinetic energy of intact particles before they enter the air duct inlet, minimizing secondary changes in density and morphology caused by impact and breakage. The arrival detection light curtain provides the batch number and timestamp, and the air classification controller reads the air classification wind speed parameters issued by S302, converts them into the target speed of the centrifugal fan and the angle of the guide louvers, and first runs it under no-load for several seconds to measure static pressure to confirm that the air duct leakage does not exceed the limit before switching to the feeding mode. Since different varieties and moisture content will change the equivalent density and force-bearing area of ​​the particles, we use the fall height h, air duct width b, and horizontal airflow center zone position as an adjustable triplet. The initial values ​​are obtained from the parameter library, and fine-tuning is performed during operation based on online trajectory deviation statistics.

[0113] This embodiment emphasizes the balance of "gravity-resistance-inertia" in the air separation mechanism. Grain particles fall freely from the inlet, and the horizontal airflow forms an approximately laminar flow profile within the channel. Lighter flakes or shell fragments have higher resistance coefficients and larger projected areas, and are subject to greater airflow acceleration than heavier, fuller particles, resulting in a larger trajectory deflection angle. We arrange two light curtains in the middle of the channel to measure the x-direction displacement of particles as they pass through. If the displacement distribution of the lighter particles is squeezed outside the set threshold area, the controller first reduces the falling height h to reduce the vertical velocity component, and then slightly increases the wind speed level to gradually pull the boundary line back. Lighter particles are introduced into the light material collection hopper through the boundary plate, while heavier particles fall directly into the heavy material collection hopper. The mass curves of the two are recorded as M_light and M_heavy, and the upstream feed uniformity is checked in response to abnormal fluctuations (such as a sudden increase in light particles).

[0114] This embodiment considers two examples of complex incoming materials that are closer to real-world applications. One type is wheat mixed with lighter, longer grains like rye. The shape of these mixed grains increases the surface area exposed to the airflow, resulting in more pronounced deflection at the same wind speed. We fine-tune the angle of the guide vanes to bring the main flow center slightly closer to the lighter grain outlet, improving the capture of lighter grains without touching the boundaries of heavier grains. The other type is high-moisture rice. Increased surface adhesion results in limited upward movement of the equivalent density, but a more stable descent, reducing deflection. We shorten the flow path (h) and add a section of guide grid to induce tumbling of the lighter, sheet-like grains, exposing the maximum projected surface before being deflected by the flow, thus achieving clearer separation.

[0115] In this embodiment, the heavy flow after air separation is defined as a semi-clean grain sample, which then enters the mixing and sorting process. The drop height during transport to the mixing device is controlled as much as possible to avoid secondary crushing that could alter subsequent image characteristics. The mixing chamber employs a composite structure of double helical ribbons and paddles. The outer ribbon drives the circumferential flow, while the inner ribbon and paddles create axial circulation. The preset rotational speed is not a fixed value but rather oscillates slightly around a target value, using speed disturbance to break any potential "density-based stratification." We read capacitive level and particle count data at three locations online, calculate the differences in local particle size distribution, and determine that homogenization has been achieved before proceeding to sorting when the deviations at the three points converge to an empirical threshold.

[0116] The sampler in this embodiment uses a combination of a rotating feed tray and equidistant sampling slots. The tray surface has micro-embossed textures to create random incident angles, preventing particles from repeatedly falling into the same slot along a fixed trajectory. The feed tray rotation speed is coordinated with the feed microflow to keep the particle count fluctuating within a narrow range per revolution, reducing the occurrence of "empty slots". The system pre-sets the number of sampling slots n to be collected, which is determined based on the total sample volume and subsequent image-spectral processing capabilities. After collection, a representative sample R is sealed in a sample cup with a QR code. The QR code contains metadata such as batch number, wind speed setting, final values ​​of h and b, and mixing time, facilitating S103's backtracking of abnormal samples.

[0117] The reason this embodiment emphasizes homogenization is that the identification of side-by-side hybrid grains in S103 relies on small-sample statistical estimation of the ratio of imperfect grains to heterogeneous grains. If spatial density and particle size stratification still exists within the semi-clean grain, even with a rigorous sampling method, a skewed subset will still be drawn. We use two types of observation indicators to corroborate the "natural rationality" of homogenization: one is the Kolmogorov–Smirnov distance of particle size distribution before and after sampling, and the other is a measure of the consistency of the color histogram. The former captures structural stratification, while the latter reflects the spatial deviation of husk powder and pale yellowness. Only when both are close to the historical stable range are R allowed to enter the identification stage.

[0118] This embodiment includes anomaly handling procedures for engineering assurance. Dust accumulation in the air duct or atomization of wet material will alter laminar flow, increasing vibration at the boundary of lightweight tracks. The light curtain will report a signal of increased variance. The controller will first trigger a short-term high-speed cleaning, then return to the target speed; if the variance remains high, it will prompt a shutdown for cleaning. If torque fluctuations occur in the mixing gearbox, it indicates material agglomeration or foreign objects. We do not forcibly extend the mixing time, but instead reduce the speed and briefly reverse the direction to break up the agglomerates before continuing as planned. This is to avoid prolonged high shearing that could wear down intact particles into fine fragments, interfering with subsequent statistics.

[0119] This embodiment ultimately delivers a representative sample usable in S103, along with a closed loop of three types of quality records and process parameters. Air separation removes light impurities based on density and morphology, while semi-clean grains are uniformly sampled after homogenization, avoiding systematic bias from both statistical and physical perspectives. When the incoming material properties deviate from the database assumptions (high moisture content, higher proportion of heterogeneous grains), the coordinated adjustment of wind speed, drop height, and guide angle remains explainable, and the process log provides evidence for future verification. The entire S501-S502 system is embedded after S401-S402; the former addresses density differences beyond morphology, while the latter "cleans" the sample to a state reliably representative of the small sample, providing a solid starting point for downstream identification and total impurity calculation.

[0120] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0121] Step S601: Acquire high-resolution images of representative samples under a standard light source, extract single-grain images using an adaptive threshold segmentation algorithm, calculate the area, perimeter, roundness, aspect ratio, and eccentricity of each grain as morphological features, extract the color histogram, hue distribution, and saturation distribution of the single-grain images as color features, input the morphological features and color features into a hybrid grain recognition model, and classify grain particles into normal grains, imperfect grains, and heterogeneous grains according to a pre-trained classifier;

[0122] Step S602: Start the actuator of the automatic picking device, and feed the identified imperfect grains and foreign grains into the corresponding receiving hoppers. Collect the mass data of imperfect grains and foreign grains using a high-precision electronic balance. Divide the mass of foreign grains by the total mass of the representative sample to obtain the mass ratio of foreign grains.

[0123] Optionally, in this embodiment, S601 and S602 are executed starting with a representative sample output from S501 / S502, with the execution taking place in the quality inspection room at the acquisition point. The sample cup is placed in a D65 standard light source box, and an industrial camera is used to image the sample at a fixed focal length and in a vertical, top-down view. The resolution is set to a scale sufficient to distinguish the abdominal groove and insect spots. Before shooting, a two-point calibration is performed using a white board and a black board to lock the exposure and gain to constant values ​​for this shift, avoiding color drift between subsequent batches. The sample is laid in a single layer on an anti-reflective tray and gently shaken a few times to allow the particles to disperse naturally, aiming to reduce the impact of adhesion and occlusion on morphological measurements. The original image enters the preprocessing pipeline, where an adaptive threshold based on local mean is used to obtain a coarse segmentation mask. For regions with large and elongated connected components, the skeleton is first refined, and then breakpoints are repaired to prevent the "tailing" of thin stems or shells from damaging the circumscribed contour. The boundary is refined by Canny and subpixel ellipse fitting. The area, perimeter, roundness, aspect ratio, and eccentricity are calculated for each grain. The combination of roundness and eccentricity can well describe the morphological deviation of shriveled and flat grains, while the aspect ratio is more sensitive to dissimilar long grains.

[0124] In this embodiment, instead of directly using the original RGB for color feature extraction, the color is converted to two spaces: HSV and Lab. For each particle, histograms of brightness, hue, and saturation are calculated in HSV, and the peak position and dispersion of the hue distribution are extracted. In Lab, the mean and variance of a* and b* are extracted to reflect trends of yellowing or reddish tint. Considering that backlighting and shadows may cause local darkening, median filtering is used to construct color representations for each particle, reducing the stretching of the histogram tail by isolated dark pixels. Texture has already been globally measured in S201, so it is not collected again here; instead, color and shape are used as the main inputs for parallel particle recognition. Particles with uncertain segmentation (concave polygon measurement exceeding the threshold) are marked with low confidence and are not directly used for classification. Instead, they are reserved for manual review or a secondary sampling queue to avoid putting pressure on the trained decision boundary.

[0125] This embodiment inputs morphological and color feature vectors into a parallel hybrid grain recognition model. The model structure consists of a dual-tower encoder and a shared classification head: one side is the morphological tower, which receives area, perimeter, roundness, aspect ratio, eccentricity, and the principal axis direction obtained from ellipse fitting, forming a shape embedding after several layers of fully connected layers and batch normalization; the other side is the color tower, which receives HSV and Lab statistics and histogram features, and adds channel attention to emphasize the contribution of color spots and mold to the discrimination. The two towers are concatenated and fed into a pre-trained classifier, which outputs three probabilities: normal grains, imperfect grains, and heterogeneous grains. The model is intentionally constructed to follow natural laws: imperfect grains are often accompanied by decreased brightness, reduced saturation, and roundness deviation, while heterogeneous grains are shifted in aspect ratio and a*, b* center points, and even if the color is similar to the target variety, the morphological statistics are still difficult to completely overlap. During inference, we perform mild suppression on low-confidence samples, excluding them from subsequent weighing statistics to reduce the noise impact of boundary samples.

[0126] In this embodiment, the identification results are transferred to the automatic picking function of S602. A multi-nozzle array is installed below the conveyor belt. The opening and closing of the nozzles are driven by a trigger table aligned with the camera's coordinates and time axis. Identified imperfect and foreign grain particles are deflected by the airflow within their respective time windows and fall into two independent receiving hoppers, while normal particles proceed straight to the third hopper. To avoid secondary acceleration in the air duct causing particle breakage, we limit the jet pulse width and add a buffer curtain at the drop point to ensure particle integrity. Two weighing hoppers are equipped with high-precision electronic balances. The balance output is low-pass filtered and steady-state discriminated to obtain stable readings, denoted as m_def and m_mis, respectively. We simultaneously record the particle count and mass growth curve. If a segment is found where "the particle count is low but the mass suddenly increases," it is judged as foreign object entry or valve lag. The system reviews the image of that period and removes it from the statistics to maintain the physical consistency of the mass data.

[0127] In this embodiment, the mass of the heterologous grains, m_mis, is divided by the total mass of the representative sample, m_R, to obtain the heterologous mass ratio, p_mis. A mass ratio is used instead of a quantity ratio because the mass difference between the heterologous grains and the target variety may be significant, and the quantity ratio does not reflect the true impurity burden. The mass percentage is more consistent with the subsequent definition of total impurities. m_R is already provided by a weighbridge or analytical balance during sample dispensing and cupping, and is accompanied by a timestamp and sample cup code upon warehousing to prevent sample cross-contamination. To control statistical uncertainty, we introduce parallel measurements of two samples when the sample size is small. If the deviation between the two p_mis values ​​exceeds an empirical threshold, the system prompts for additional sampling or an extended picking time to obtain a more stable estimate.

[0128] This embodiment also considers boundary situations where identification and sorting are linked. When rye is mixed with wheat, some rye has a color and morphology similar to wheat with higher maturity. The model gives a neutral score on the color tower but a different score on the morphology tower. The final label of such samples comes from the weights after the fusion of the two towers and will not be biased by a single color anomaly. Unripe grains and insect-damaged grains deviate synchronously in roundness, eccentricity, and local color saturation, and the classification head naturally tends to "imperfect grains". These intrinsic relationships are not arbitrary assumptions, but are consistent with the physical processes of insufficient grain filling and pigment degradation caused by mold. To prove that the model does not account for equipment bias, we randomly sample a batch of normal grains in each shift and calculate the drift of the color histogram and morphology distribution. If the drift is large but the spectral side (involving step S202) does not show changes in chemical composition, we review the light source and camera calibration to avoid mistaking equipment problems for grain differences.

[0129] This embodiment seamlessly integrates the results of S601 / S602 into the subsequent impurity summary. p_mis, as an estimate of the proportion of foreign species within the semi-clean grain, is included in the calculation of S103 along with the over- and under-sieve samples collected in S401 / S402 and the light impurity count from S501. To reduce human error, a clear calculation chain is attached to the record: Sample number → Identification report (quantity and confidence level statistics for each category) → Picking quality curve → Stable reading → p_mis → Corresponding m_R. During visual review, quality inspectors can randomly examine image slices and color-morphological feature vectors identified as foreign species to verify whether the model falls within the common-sense range of "aspect ratio imbalance + color shift."

[0130] This embodiment presents processing strategies for two types of field extensions. First, in corn samples, endosperm exposure causes bright spots. The combined HSV saturation and brightness can misinterpret these as imperfect grains. We add top-cap / bottom-cap filters before the color features to suppress highlights, and then use the a* and b* changes in Lab space to confirm whether they represent genuine pigment changes. Second, during dry seasons, static electricity causes fine powder to adhere to the shell surface, resulting in a redshift in the color histogram but normal morphology. We lower the weighting coefficient of the color tower in the fusion layer for these batches to prevent false color signals from overshadowing morphological evidence. Both approaches align with natural phenomena and avoid introducing arbitrary rules.

[0131] The technical advantages of this embodiment are reflected in three aspects: First, it transforms the single-particle information of representative samples into interpretable category labels, with the underlying evidence consistent with the natural coupling of morphology and color; second, it closes the classification and automatic picking loop to the quality caliber, using mass ratios to describe the heterogeneous burden, which is closer to the subsequent impurity definition; third, it retains verification paths and redundant measurements in anomaly and uncertainty management, ensuring that every parameter entering the total impurity calculation can be traced back to its source. The entire process is consistent with the physical separation logic of the preceding screening and air separation, and will not mix external factors such as equipment status and lighting conditions into the quality statistics.

[0132] In one embodiment of the method for evaluating impurities in raw grains according to this application, it may further include the following:

[0133] Step S701: Input the mass ratio of different grains and the mass value of the semi-clean grain sample into the calculation unit, perform multiplication to obtain the total mass of different grains in the semi-clean grain, use the total mass of different grains as the mass of impurities in the semi-clean grain, read the mass data of the material on the sieve, the mass data of the material under the sieve, and the mass data of light impurities from the data acquisition unit, and add the mass data to the mass data of impurities in the semi-clean grain to obtain the total mass of impurities;

[0134] Step S702: Read the total mass data of the grain sample to be tested from the feeding unit, divide the total mass of impurities by the total mass of the grain sample to be tested to obtain an initial ratio, multiply the initial ratio by the benchmark coefficient to obtain the total impurity content, output the total impurity content value to the display unit, and simultaneously record the mass data, ratio data, and calculation parameters during the detection process to the data storage unit.

[0135] Optionally, this embodiment connects the representative sample statistical results generated in S501 / S502 with the weighing data of each receiving hopper, and completes the closed-loop calculation of impurity mass and total impurity content within the calculation unit. We first subscribe to four types of sources on the data bus: the mass ratio of different grains p_mis (derived from S103 and with confidence interval) output by the side-by-side impurity identification model, the mass of semi-clean grain samples M_sg (stable reading of the heavy hopper), the mass of material over the sieve M_over, the mass of material under the sieve M_under, and the mass of light impurities M_light (reported by the load sensors of each hopper during S401-S502). Before the calculation task is triggered, the system will perform time alignment and batch verification to prevent data from different batch numbers from being spliced ​​into the same link; if there are missing measurements or abnormal fluctuations, the calculation unit calls a robust estimation strategy to replace the instantaneous abnormal peak with the median within the window to avoid treating mechanical vibration or hopper impact as a real mass jump.

[0136] In this embodiment, the core of step S701 is to correctly project the proportional quantity into a mass quantity. p_mis and M_sg are input into the calculation module to obtain the total mass of heterogeneous grains in the semi-clean grain, M_sg_imp = p_mis × M_sg.

[0137] The logic here is based on the assumption of unbiased sampling of representative samples: the homogenization of S502 and the rotating disk sampling ensure that the proportion of different grains remains similar between the sample and the parent material, thus the proportion extrapolation is statistically valid. M_sg_imp is included as the "semi-clean grain impurity mass" in the summary, and then M_over, M_under, and M_light are read from the data acquisition unit. The sum of these four items yields the total impurity mass M_imp. After the calculation, a physical consistency check is performed: if M_imp is less than any of the sub-items within a short period, it is clearly due to sensor zero-point drift or unit mismatch. The system will then backtrack the calibration record for that time window and pause the result output to prevent erroneous figures from being included in the settlement.

[0138] This embodiment addresses the uncertainty of p_mis with a more robust business-oriented approach. Each batch of R samples provided by the parallel particle identification model has a granular label and a total mass m_R. We remove particles with model confidence below a threshold and recalculate the proportion to obtain p_mis,eff, and record the removal rate for auditing. On the other hand, to address the possibility of "extremely uneven sample distribution," we use the consistency index of the three-point granularity distribution of S502 and the distance from the color histogram as weights to make minor adjustments to p_mis. The more the weights deviate from the stable region, the more conservative the estimate of p_mis becomes, preventing a single poor sampling from skewing the entire batch M_sg_imp. This correction is not arbitrary; it follows a natural rule: when sample uniformity deteriorates, the reliability of extrapolating proportions based on smaller samples decreases, and providing a more conservative estimate is more in line with risk control.

[0139] In this embodiment, the total mass M_total of the grain sample to be tested, recorded by the feeding unit in S702, is read. This value is calibrated with weights at startup and automatically corrected during the shift according to the zero-point drift curve. The calculation unit divides M_imp by M_total to obtain the initial ratio r0 = r0(M_imp, M_total), where r0 represents the original impurity ratio of this batch under the current operating conditions. Considering the slight systematic influence of on-site operating conditions on weighing and separation (such as residual adhesion caused by humidity, and light weight reduction caused by dust load), we introduce a reference coefficient K_b, read from the parameter library. It is calibrated on standard samples during the process acceptance phase and mapped to "the overall deviation correction of impurity measurement under the current operating conditions". The final total impurity content C is given by C = r0 × K_b, where C is a dimensionless ratio; r0 is the ratio of the total impurity mass to the total sample mass; and K_b is the reference coefficient (a scalar used for minor correction based on equipment and environmental conditions). After the calculation is completed, C, along with the sub-item quality, ratio, K_b, timestamp, and batch number, is written into the data storage unit. At the same time, C and the key sub-items are displayed on the display unit to facilitate immediate decision-making by quality inspectors.

[0140] To avoid "good-looking but unrealistic" figures, this embodiment includes two post-verification checks. The first is a mass conservation approximation check: in continuous batches and with stable equipment conditions, the moving averages of M_over, M_under, and M_light should not show unexplained jumps. If they become decoupled from changes in the upstream feed rate F, it indicates a need to check for screen blockage or duct leakage. The second is a model-physical consistency check: when p_mis increases but M_light does not increase accordingly, we check if the color and morphology distribution of the R sample shows a sharp increase in dispersion. If so, it tends to indicate sample skew; if not, it considers an increase in actual foreign particle contamination and prompts S302 to set the wind speed strategy to a more conservative level in the next batch to reduce miscarriage.

[0141] This embodiment provides extended examples for two types of edge cases. First, for batches of corn with high breakage rates, the undersize material M_under will increase, but p_mis may not necessarily increase. We keep the calculation path of C unchanged, but add a "high breakage rate" process label next to the result to remind subsequent storage to arrange ventilation and drying in advance. Second, the high moisture content of late-season rice causes M_light to decrease temporarily due to husk powder adhesion, and C may be dominated by M_sg_imp. We enable the "high humidity curve" in the selection of K_b. This curve is derived from standard sample verification data to correct the systematic bias of light weight statistics and avoid underestimating total impurities.

[0142] From a technical perspective, this embodiment seamlessly integrates the proportional information from visual and spectral models with the physical quality information from the screening-air separation-weighing chain. S701's weighted summarization provides a clearly sourced total impurity mass, and S702 uses a controlled benchmark coefficient to convert the initial ratio into a reconciliation-friendly total impurity content, accompanied by a full-process log and verification mechanism. The final output, C, not only provides a number but also saves and displays the evidence chain behind that number (item quality, proportion, and operating condition corrections), facilitating quality inspection and settlement personnel to quickly reconstruct the original physical process and data state in case of disputes.

[0143] To effectively address the shortcomings of traditional technologies in feature recognition, impurity separation, and content assessment, and to provide technical support for grain quality testing, this application provides an embodiment of a grain impurity assessment device for implementing all or part of the aforementioned grain impurity assessment method. See [link to embodiment]. Figure 2 The grain impurity assessment device specifically includes the following components:

[0144] The sieving module 10 is used to collect appearance feature data and near-infrared spectral data of the grain sample to be tested, input the color features, texture features and shape features in the appearance feature data into the variety identification model, combine the near-infrared spectral data to identify the grain variety, and retrieve preset sieve hole size parameters, air separation wind speed parameters and sieve surface tilt angle parameters according to the identification results, and put the grain sample to be tested into the multi-stage sieving system.

[0145] The sampling module 20 is used to perform multi-stage sieving of the grain sample to be tested based on the sieve aperture size parameters, air separation wind speed parameters, and sieve surface inclination angle parameters. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. Light impurities are separated by air separation of the grain particles separated by the middle sieve. The remaining material is used as a semi-clean grain sample. After homogenization of the semi-clean grain sample, a representative sample is extracted.

[0146] The identification module 30 is used to input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of oversize material, undersize material, and light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0147] As described above, the grain impurity assessment device provided in this application can accurately identify grain varieties through innovative multi-feature fusion model design, appearance analysis, and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculation are used to ensure the accuracy of impurity assessment. This method effectively solves the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.

[0148] From a hardware perspective, in order to effectively address the shortcomings of traditional technologies in feature recognition, impurity separation, and content assessment, and to provide technical support for grain quality testing, this application provides an embodiment of an electronic device for implementing all or part of the aforementioned method for assessing impurities in raw grains. The electronic device specifically includes the following components:

[0149] The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to transmit information between the grain impurity assessment device and core business systems, user terminals, and related databases; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the grain impurity assessment method and the grain impurity assessment device described in the embodiments, the contents of which are incorporated herein by reference, and repeated details will not be described again.

[0150] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.

[0151] In practical applications, the evaluation method for grain impurities can be partially executed on the electronic device side as described above, or all operations can be completed in the client device. The choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed in the client device, the client device may further include a processor.

[0152] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.

[0153] Figure 3 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 3 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 3 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.

[0154] In one embodiment, the function of evaluating impurities in raw grain can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:

[0155] Step S101: Collect appearance feature data and near-infrared spectral data of the grain sample to be tested, input the color features, texture features and shape features in the appearance feature data into the variety identification model, combine the near-infrared spectral data to identify the grain variety, retrieve the preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters according to the identification results, and put the grain sample to be tested into the multi-stage sieving system.

[0156] Step S102: Based on the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters, the grain sample to be tested is subjected to multi-stage sieving. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. The grain particles separated by the middle sieve are separated by air separation to obtain light impurities. The remaining material is used as a semi-clean grain sample. The semi-clean grain sample is homogenized and then a representative sample is extracted.

[0157] Step S103: Input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of material on the sieve, the mass of material under the sieve, and the mass of light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0158] As described above, the electronic device provided in this application, through an innovative design of a multi-feature fusion model, achieves accurate identification of grain varieties via appearance analysis and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculations ensure the accuracy of impurity assessment. This method effectively addresses the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.

[0159] In another embodiment, the grain impurity assessment device can be configured separately from the central processing unit 9100. For example, the grain impurity assessment device can be configured as a chip connected to the central processing unit 9100, and the grain impurity assessment method function can be realized through the control of the central processing unit.

[0160] like Figure 3As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 3 All components shown; in addition, the electronic device 9600 may also include Figure 3 For components not shown, please refer to existing technologies.

[0161] like Figure 3 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.

[0162] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.

[0163] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0164] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.

[0165] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0166] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processing unit 9100 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.

[0167] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored audio via the speaker 9131.

[0168] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the grain impurity assessment method with a server or client as the execution subject in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the grain impurity assessment method with a server or client as the execution subject in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0169] Step S101: Collect appearance feature data and near-infrared spectral data of the grain sample to be tested, input the color features, texture features and shape features in the appearance feature data into the variety identification model, combine the near-infrared spectral data to identify the grain variety, retrieve the preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters according to the identification results, and put the grain sample to be tested into the multi-stage sieving system.

[0170] Step S102: Based on the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters, the grain sample to be tested is subjected to multi-stage sieving. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. The grain particles separated by the middle sieve are separated by air separation to obtain light impurities. The remaining material is used as a semi-clean grain sample. The semi-clean grain sample is homogenized and then a representative sample is extracted.

[0171] Step S103: Input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of material on the sieve, the mass of material under the sieve, and the mass of light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0172] As described above, the computer-readable storage medium provided in this application, through an innovative design of a multi-feature fusion model, achieves accurate identification of grain varieties via appearance analysis and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculations ensure the accuracy of impurity assessment. This method effectively addresses the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.

[0173] Embodiments of this application also provide a computer program product capable of implementing all steps in the grain impurity assessment method described above, where the execution subject is a server or client. When executed by a processor, this computer program / instruction implements the steps of the grain impurity assessment method. For example, the computer program / instruction implements the following steps:

[0174] Step S101: Collect appearance feature data and near-infrared spectral data of the grain sample to be tested, input the color features, texture features and shape features in the appearance feature data into the variety identification model, combine the near-infrared spectral data to identify the grain variety, retrieve the preset sieve aperture size parameters, air separation wind speed parameters and sieve surface tilt angle parameters according to the identification results, and put the grain sample to be tested into the multi-stage sieving system.

[0175] Step S102: Based on the sieve aperture size parameters, air separation velocity parameters, and sieve surface inclination angle parameters, the grain sample to be tested is subjected to multi-stage sieving. Large impurities are separated by the upper sieve to obtain the oversize material, normal grain particles are separated by the middle sieve, and fine impurities are separated by the lower sieve to obtain the undersize material. The grain particles separated by the middle sieve are separated by air separation to obtain light impurities. The remaining material is used as a semi-clean grain sample. The semi-clean grain sample is homogenized and then a representative sample is extracted.

[0176] Step S103: Input the representative sample into the impurity identification model, identify imperfect grains and foreign grains based on morphological and color features, classify and weigh the identified imperfect grains and foreign grains, calculate the mass ratio of foreign grains in the representative sample, multiply the mass ratio by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, add the mass of semi-clean grain impurities to the mass of material on the sieve, the mass of material under the sieve, and the mass of light impurities, and divide by the total mass of the grain sample to be tested to obtain the total impurity content.

[0177] As described above, the computer program product provided in this application, through the innovative design of a multi-feature fusion model, achieves accurate identification of grain varieties via appearance analysis and spectral detection. A multi-stage screening system is constructed, combined with air separation, to establish a reliable impurity separation mechanism. Representative sampling is introduced, and morphological analysis and mass calculations ensure the accuracy of impurity assessment. This method effectively addresses the shortcomings of traditional technologies in feature identification, impurity separation, and content assessment, providing technical support for grain quality testing.

[0178] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0179] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.

[0180] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0181] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0182] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method of assessing the cleanliness of grain, characterised by, The method comprises: Collecting appearance feature data and near-infrared spectrum data of a to-be-tested grain sample, inputting color features, texture features and shape features in the appearance feature data into a variety identification model, combining the near-infrared spectrum data to identify the grain variety, and according to the identification result, calling preset screen size parameters, air separation wind speed parameters and screen surface inclination angle parameters, and putting the to-be-tested grain sample into a multi-stage screening system; Based on the screen size parameters, the air separation wind speed parameters and the screen surface inclination angle parameters, the to-be-tested grain sample is subjected to multi-stage screening, large impurities are separated by upper layer screening to obtain oversize material, normal grain particles are separated by middle layer screening, and small impurities are separated by lower layer screening to obtain undersize material, the grain particles separated by the middle layer screening are subjected to air separation to obtain light impurities, and the remaining material is used as a semi-clean grain sample, the representative sample is extracted after the semi-clean grain sample is subjected to homogenization treatment; The representative sample is input into a shoulder impurity identification model, imperfect grains and foreign grains are identified based on morphological features and color features, the identified imperfect grains and foreign grains are classified and weighed, the mass proportion of the foreign grains in the representative sample is calculated, the mass proportion is multiplied by the mass of the semi-clean grain sample to obtain the mass of semi-clean grain impurities, and the mass of the semi-clean grain impurities is added to the mass of the oversize material, the mass of the undersize material and the mass of the light impurities, and then divided by the total mass of the to-be-tested grain sample to obtain the total impurity content.

2. The method of evaluating grain purity according to claim 1, wherein, The collecting appearance feature data and near-infrared spectrum data of a to-be-tested grain sample, inputting color features, texture features and shape features in the appearance feature data into a variety identification model, comprises: A machine vision acquisition device is constructed, a visible light image of the to-be-tested grain sample is acquired under illumination of a standard light source, image segmentation and edge extraction are performed on the visible light image, the perimeter, area and aspect ratio parameters of the grain particles are calculated as shape features, the brightness, chrominance and saturation components of the color space are extracted as color features, and the energy, contrast, correlation and entropy values are calculated as texture features by using a gray level co-occurrence matrix; A near-infrared spectrum acquisition probe is installed, a near-infrared light source wavelength range and a sampling interval are set, the to-be-tested grain sample is scanned to obtain reflectance spectrum data, the reflectance spectrum data is corrected for dark current and calibrated by a white plate, baseline drift and scattering effects are eliminated, and the spectrum data is preprocessed by using a standard normal variate method.

3. The method of evaluating grain purity according to claim 1, wherein, The combining the near-infrared spectrum data to identify the grain variety, and according to the identification result, calling preset screen size parameters, air separation wind speed parameters and screen surface inclination angle parameters, and putting the to-be-tested grain sample into a multi-stage screening system, comprises: The appearance feature data and the near-infrared spectrum data are input into a deep neural network, local features of an image are extracted by a convolution layer, the local features and spectrum features are fused by a full connection layer, a mapping relationship between a feature vector and a grain variety label is established, the mapping relationship is input into a classifier to calculate probability scores of each variety, and a variety with the highest score is selected as the identification result; Retrieving corresponding screening parameter group from a parameter database based on the identification result, reading upper layer screen hole size, middle layer screen hole size, lower layer screen hole size, winnowing air speed and screen surface inclination value from the screening parameter group, and transmitting the values to a control unit of the multi-stage screening system to drive an execution mechanism to adjust screen mesh distance, fan speed and vibration table inclination to a target state.

4. The method of evaluating grain purity according to claim 1, wherein, The multi-stage screening of the grain sample to be tested based on the screen hole size parameter, the winnowing air speed parameter and the screen surface inclination parameter separates large impurities through upper layer screening to obtain oversize, normal grain particles through middle layer screening, and small impurities through lower layer screening to obtain undersize, including: Starting a vibration motor to drive the screen box to vibrate, and feeding the grain sample to be tested into a feed hopper, controlling the discharging rate through a quantitative feeder, separating impurities larger than the screen hole size through the upper layer screen, guiding the impurities into a first receiving hopper through a chute to become oversize, and the remaining material entering the middle layer screen, adjusting the inclination angle of the middle layer screen according to the screen surface inclination parameter; The material moves on the surface of the middle layer screen, the material with a particle size smaller than the middle layer screen hole size passes through the screen hole to enter the lower layer screen, the complete grain particles slide into a second receiving hopper, the material with a particle size larger than the lower layer screen hole size is intercepted by the lower layer screen, and the small impurities pass through the lower layer screen hole to be collected in a third receiving hopper to become undersize, and the mass data of the oversize and undersize is collected respectively.

5. The method of evaluating grain purity according to claim 1, wherein, The grain particles separated by the middle layer screening are subjected to air separation to obtain light impurities, and the remaining material is used as a semi-clean grain sample, and a representative sample is extracted after uniform treatment of the semi-clean grain sample, including: The grain particles separated by the middle layer screening are fed into an air separation device, the speed of a centrifugal fan is adjusted according to the winnowing air speed parameter, the material falls in an air flow separation channel, a horizontal air flow is formed in the air flow separation channel, the light material deviates from the falling track under the action of the air flow to enter a light material collection hopper to become light impurities, and the heavy material falls directly into a heavy material collection hopper to become a semi-clean grain sample; The semi-clean grain sample is fed into a mixing device, a mixing blade is started to stir at a preset speed to fully mix and uniformize the material, and a rotating discharging disc of a sample divider is started to disperse and fall the material into a plurality of sampling grooves, and the material in a preset number of sampling grooves is collected to form a representative sample.

6. The method of evaluating grain purity according to claim 1, wherein, The representative sample is input into a shoulder impurity identification model, imperfect grains and foreign grains are identified based on morphological features and color features, the identified imperfect grains and foreign grains are classified and weighed, and the mass proportion of the foreign grains in the representative sample is calculated, including: A high-resolution image of the representative sample is collected under a standard light source, a single grain image is extracted through an adaptive threshold segmentation algorithm, the area, perimeter, circularity, aspect ratio and eccentricity of each grain are calculated as morphological features, the color histogram, hue distribution and saturation distribution of the single grain image are extracted as color features, the morphological features and color features are input into the shoulder impurity identification model, and the grain particles are divided into normal grains, imperfect grains and foreign grains according to a pre-trained classifier. An actuator of the automatic picking device is started to guide the identified imperfect grains and foreign grains into corresponding receiving hoppers, respectively, high-precision electronic scales are used to collect the mass data of the imperfect grains and the foreign grains, respectively, and the mass of the foreign grains is divided by the total mass of the representative sample to obtain the mass proportion of the foreign grains.

7. The method of evaluating grain purity according to claim 1, wherein, The mass proportion is multiplied by the mass of the semi-clean grain sample to obtain the mass of the impurities in the semi-clean grain sample, and the mass of the impurities in the semi-clean grain sample, the mass of the oversize material, the mass of the undersize material, and the mass of the light impurities are added and then divided by the total mass of the grain sample to be tested to obtain the total impurity content, including: The mass proportion of the foreign grains and the mass of the semi-clean grain sample are input into a calculation unit, a multiplication operation is performed to obtain the total mass of the foreign grains in the semi-clean grain sample, the total mass of the foreign grains is taken as the mass of the impurities in the semi-clean grain sample, the mass data of the oversize material, the mass data of the undersize material, and the mass data of the light impurities are read from the data collection unit, the mass data is added to the mass data of the impurities in the semi-clean grain sample to obtain the total mass of the impurities; The total mass of the impurities is divided by the total mass of the grain sample to be tested to obtain an initial ratio, the initial ratio is multiplied by a reference coefficient to obtain the total impurity content, and the total impurity content is output to a display unit, and the mass data, the proportion data, and the calculation parameters in the detection process are recorded to a data storage unit at the same time.

8. A device for evaluating the quality of grain, characterized in that, The device comprises: The screening module is configured to collect appearance feature data and near-infrared spectrum data of the grain sample to be tested, input color features, texture features, and shape features in the appearance feature data into a variety identification model, perform grain variety identification in combination with the near-infrared spectrum data, and according to an identification result, retrieve preset screen hole size parameters, air separation wind speed parameters, and screen surface inclination angle parameters, and put the grain sample to be tested into a multi-stage screening system. The sampling module is configured to perform multi-stage screening on the grain sample to be tested based on the screen hole size parameters, the air separation wind speed parameters, and the screen surface inclination angle parameters, separate large impurities through upper layer screening to obtain oversize material, separate normal grain particles through middle layer screening, separate small impurities through lower layer screening to obtain undersize material, separate light impurities through air separation of the grain particles separated by the middle layer screening, and take the remaining material as a semi-clean grain sample, and extract a representative sample after uniform treatment of the semi-clean grain sample. The identification module is configured to input the representative sample into a shoulder impurity identification model, identify imperfect grains and foreign grains based on morphological features and color features, classify and weigh the identified imperfect grains and foreign grains, calculate a mass proportion of the foreign grains in the representative sample, multiply the mass proportion by the mass of the semi-clean grain sample to obtain the mass of the impurities in the semi-clean grain sample, and add the mass of the impurities in the semi-clean grain sample, the mass of the oversize material, the mass of the undersize material, and the mass of the light impurities and then divide by the total mass of the grain sample to be tested to obtain the total impurity content.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the evaluation method of the impurities in the grain and the raw grain according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the evaluation method of the impurities in the grain and the raw grain according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Grain quality monitoring and inspection method and system based on data analysis

    CN118566149A

  • Grain quality dynamic grading and stone removing cooperative control method based on multi-modal sensor fusion

    CN120429658A