Grain detection device and detection method
The grain detection device and method, which combines pneumatic conveying and data acquisition components, solves the problem of local high-risk grains being masked in a whole batch of grains, and achieves efficient and accurate mold detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG CAIJU ELECTRONICS TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies struggle to accurately identify high-risk particles in whole batches of grain when detecting mold, leading to missed detections, especially in cases of low concentration, localized aggregation, and uneven distribution within the batch, where the overall average signal masks local anomalies.
The grains are spread out using a pneumatic conveying device, combined with impurity, moisture, bulk density and moldy particle detection devices. Images and spectral data are collected through a data acquisition component, and particle segmentation and feature extraction are performed to establish initial features, screen candidate risk particles, construct risk distribution results, and generate mold detection results.
It improves the accuracy and stability of whole-batch grain testing, reduces the risk of missed detection under conditions of local aggregation and uneven distribution within the batch, and maintains testing efficiency.
Smart Images

Figure CN121995016A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grain detection, and more particularly to a grain detection device and detection method. Background Technology
[0002] During the grain storage process, the incoming grains need to undergo pre-screening to detect mold and ensure food safety. Since mold contamination in a batch of grains is usually characterized by low concentration, local aggregation, and uneven distribution within the batch, and different grain particles have significant fluctuations in moisture content, surface integrity, variety, degree of mold, and on-site lighting conditions, existing detection methods, without large-scale crushing and mixing of samples, cannot simultaneously ensure the efficiency of whole-batch screening, the ability to identify low-concentration local contamination, and the stability of detection results. This can easily lead to situations where the average signal of the whole batch is normal, but local high-risk particles are masked by the overall signal.
[0003] Currently, existing technologies typically employ methods such as chromatography-mass spectrometry, near-infrared spectroscopy, hyperspectral imaging, or Raman spectroscopy to conduct laboratory testing or rapid on-site screening of grain samples. In the artificial intelligence processing path, the collected spectral data, image data, or spectral and image fusion data are generally preprocessed, feature extracted, feature selected, and model trained. Then, classification models or regression models are used to determine whether mold exceeds the standard or to estimate the content of mycotoxins, so as to achieve rapid identification and risk assessment of grain samples.
[0004] However, in practical applications, most existing technologies still primarily analyze single-sample average spectra, single-field average features, or homogenized overall signals. While this approach facilitates model training and rapid discrimination, the detection results mainly reflect overall average differences, failing to accurately capture the localized, sparse, and spatially uneven distribution characteristics of toxin contamination in a batch of grains. For example, when the overall signal of a batch of grains is generally normal, but contains a small number of high-risk particles, these localized abnormal signals that truly determine the safety level of the entire batch are easily masked by the overall average result, leading to insufficient ability to identify localized high-risk contamination and a risk of missed detection. Summary of the Invention
[0005] The purpose of this invention is to address the problem that mold contamination in a batch of grain often presents as a low concentration, localized aggregation, and uneven distribution within the batch. Existing technologies rely primarily on the overall average signal for judgment, which can easily mask a small number of localized high-risk particles, leading to the risk of missed detection. Therefore, this invention proposes a grain detection device and a grain detection method.
[0006] To achieve the above objectives, in one aspect, the present invention proposes a grain detection device, comprising a pneumatic conveying device, an impurity detection device, a moisture detection device, a bulk density detection device, and a moldy particle detection device, wherein the bulk density detection device is disposed below the moisture detection device, and the pneumatic conveying device conveys the grain to the impurity detection device, the moisture detection device, and the moldy particle detection device respectively; characterized in that the moldy particle detection device comprises a grain conveying mechanism and a data acquisition component, the pneumatic conveying device conveys the grain onto the grain conveying mechanism, the grain is conveyed flat on the grain conveying mechanism, the data acquisition component is disposed on the upper side of the grain conveying mechanism, or the data acquisition component is disposed on both sides of the grain falling after being conveyed by the grain conveying mechanism, and the data acquisition component acquires image data and spectral data.
[0007] On the other hand, the present invention proposes a grain detection method for the above-mentioned grain detection device, which utilizes an impurity detection device, a moisture detection device, a bulk density detection device, and a moldy particle detection device to detect impurity content, moisture content, bulk density, and moldy particle content in the grain, respectively. The method for detecting moldy particles is as follows: The data acquisition component acquires raw detection data and performs correlation processing on the raw detection data to obtain correlated detection data, which includes correlated image data and correlated spectral data. Perform particle segmentation and invalid particle removal on the associated image data to determine the valid particle set; Based on the associated image data and associated spectral data, image features and spectral features are extracted from each effective particle in the effective particle set, and a corresponding relationship is established to form the initial features of each effective particle. Based on the initial features, an initial risk candidate screening is performed to obtain a set of candidate risk particles, and the initial risk information corresponding to each candidate risk particle is determined. Based on the initial risk information, a risk distribution result is constructed for the candidate risk particle set, and a mold detection result is generated based on the risk distribution result.
[0008] Preferably, the specific steps of acquiring the raw detection data and performing correlation processing on the raw detection data to obtain correlated detection data include: The raw detection data is obtained by continuously collecting single-layer transported grain batches in the target area by the data acquisition component. The raw detection data includes raw image data and raw spectral data. The original image data and original spectral data are processed using a unified time reference to obtain an image dataset and a spectral dataset. The image dataset and the spectral dataset are respectively cached and sorted to form an image cache queue and a spectral cache queue. The image cache queue and the spectral cache queue are matched and merged to obtain the associated detection data.
[0009] Preferably, the specific steps of performing particle segmentation and invalid particle removal on the associated image data to determine the valid particle set include: Preprocessing and foreground extraction of associated image data yields particle-connected regions; The region category is determined based on the regional characteristics of the particle connected region, and the region category is screened out to obtain normal candidate regions and adhered regions. The normal candidate region is retained as the first effective particle, and the adhesion region is split and its effectiveness is determined to obtain the second effective particle. Cross-frame deduplication and anomaly removal are performed on the first and second effective particles to obtain the effective particle set.
[0010] Preferably, the specific steps for forming the initial features of each effective particle include: A particle feature extraction queue is established based on the effective particle set and associated detection data, and a pre-established mapping table from image column coordinates to spectral sampling columns is called. Based on the mapping table and particle feature extraction queue, the spectral sampling column corresponding to each effective particle is retrieved to form a set of spectral sampling columns; Determine whether each effective particle has a corresponding relationship with the spectral sampling column set. Perform back-matching and anomaly removal on effective particles that have not established a corresponding relationship. Extract image features and spectral features from effective particles that have established a corresponding relationship. Then merge the extraction results to form the initial features of each effective particle.
[0011] Preferably, the specific steps of performing initial risk candidate screening based on the initial features to obtain a candidate risk particle set, and determining the initial risk information corresponding to each candidate risk particle include: Based on the initial characteristics of each effective particle, the image features and spectral features of each effective particle in the same batch of samples are normalized to determine the number of abnormal features and the joint anomaly of the spectrum and image, and the initial risk score is determined based on the joint anomaly of the spectrum and image. Based on the initial risk score and the number of abnormal features, each effective particle is initially screened for risk candidates to obtain a set of candidate risk particles. Initial risk information is generated based on the candidate risk particle set.
[0012] Preferably, the specific steps of constructing a risk distribution result for the candidate risk particle set based on the initial risk information, and generating a mold detection result based on the risk distribution result, include: A risk statistical grid is constructed based on the candidate risk particle set, initial risk information, and effective particle set. The grid risk density is calculated and adjacent risk statistical grids are merged to form local risk regions. Based on the statistical risk distribution characteristics of local risk areas, a threshold is determined according to the risk distribution characteristics, and the risk distribution result is constructed after the determination is passed. Mold detection results are generated based on the risk distribution results.
[0013] Grain testing methods also include: Non-toxic perturbation characterization is constructed for particles in the candidate risk particle set; Extract the toxin-related abnormal features from the candidate risk particle set and decouple them from the non-toxin perturbation characterization to obtain the toxin risk representation corresponding to each candidate risk particle. The risk distribution results are corrected based on the toxin risk representation to form a corrected distribution result, and a corrected detection result is generated based on the corrected distribution result.
[0014] Preferably, the specific steps for constructing non-toxic perturbation characterizations for particles in the candidate risk particle set include: Based on the initial features corresponding to the candidate risk particle set, regional normalization is performed and non-toxic perturbation sub-characteristics are extracted. The non-toxic perturbation sub-characteristics include moisture content perturbation, particle type perturbation, particle size perturbation, surface damage perturbation, and background illumination perturbation. The non-toxin perturbation sub-characteristics are weighted and merged to obtain the non-toxin perturbation characteristics corresponding to each candidate risk particle. The perturbation state of each candidate risk particle is calibrated based on the non-toxic perturbation characterization.
[0015] Preferably, the specific steps of extracting toxin-related abnormal features from the candidate risk particle set and decoupling them with the non-toxin perturbation characterization to obtain the toxin risk representation corresponding to each candidate risk particle include: Extract toxin-related abnormal features from the candidate risk particle set, and weight the toxin-related abnormal features to obtain the original toxin anomaly value; Candidate risk particles are divided into perturbation states based on non-toxin perturbation characterization, and non-toxin deduction coefficients are assigned based on perturbation states. The original toxin outliers are decoupled from the non-toxin perturbation characterization to obtain a toxin risk representation. Based on the toxin risk representation, the particle state of candidate risk particles is formed, and the risk distribution results are corrected based on the particle state. The particle state includes toxin-dominant particles, toxin particles to be verified, and non-toxin-dominant particles.
[0016] Preferably, the specific steps for correcting the risk distribution result based on the toxin risk representation to form a corrected distribution result, and generating a corrected detection result based on the corrected distribution result include: Based on the risk statistics grid, the grid risk density of the toxin-dominant particles and the toxin particles to be verified in each risk statistics grid is recalculated, and the toxin-dominant particles and the toxin particles to be verified constitute the modified risk particles. Risk statistical grids that are vertically or horizontally adjacent are merged to form a modified risk area; A corrected distribution result is constructed based on the corrected risk particles and the corrected risk regions, and a corrected detection result is generated based on the corrected distribution result.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention lays out and transports grains using a grain conveying device, forming a target area on the grain conveying mechanism or at the location where the grains fall. It uses a data acquisition component to collect image and spectral data, and by refining the average signal of the entire batch to the particle level for risk identification, it retains local abnormal information without relying on large-scale crushing and mixing of samples. This helps improve the accuracy of batch screening, effectively reduces the risk of mold abnormalities under conditions such as local aggregation and uneven distribution within the batch being masked by the overall average signal, and at the same time ensures detection efficiency and result stability.
[0018] 2. This invention uses the local area corresponding to the same data acquisition component number and the same target area number as the environmental benchmark to locally recalibrate the relevant characteristics of candidate risk particles. This allows the normalized deviation calculated subsequently to reflect the true degree of deviation of candidate risk particles from the local environmental benchmark, rather than the overall degree of deviation from the average level of the whole batch. This provides a basis for distinguishing between non-toxic fluctuations caused by normal physical differences and risk changes caused by abnormal mold growth.
[0019] 3. This invention uses five independently characterizable non-toxic wavelet characteristics—moisture content disturbance, particle variety disturbance, particle size disturbance, surface damage disturbance, and background illumination change—and merges them into a non-toxic disturbance characterization. This allows non-toxic disturbances from different sources to enter the subsequent decoupling process in a classified characterization manner, thereby avoiding the misjudgment problem caused by mixing normal physical disturbances with abnormal mold growth signals in existing technologies. This is beneficial to improving the pertinence and reliability of mold risk identification, thereby further improving the accuracy and stability of mold detection results for the entire batch of grains while maintaining rapid screening efficiency. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the structure of Embodiment 1 of the grain detection device of the present invention.
[0021] Figure 2 for Figure 1 A magnified view of a portion of point A in the middle.
[0022] Figure 3 This is a flowchart of the grain detection method of the present invention.
[0023] Figure 4 This is a comparison diagram of the effects of the present invention and the prior art.
[0024] Figure 5 This is a schematic diagram of the structure of the moldy grain detection device in Embodiment 3 of the grain detection device of the present invention.
[0025] The components include: 1. Fan; 2. Main negative pressure extraction pipe; 3. Anti-breakage unloader; 4. Vibrating screen; 5. Light impurity suction separator; 6. Parallel impurity separation device; 7. Moisture detection device; 8. Bulk density detection device; 9. Moldy particle detection device; 10. Silo; 11. Impurity hopper; 12. Grain hopper; 13. Data acquisition component; 14. Brush; 15. Conveyor belt. Detailed Implementation
[0026] To make the technical means, creative features, objectives, and effects of this invention easier to understand, the invention is further described below with reference to specific embodiments. However, the following embodiments are merely preferred embodiments of this invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention.
[0027] Example 1: To achieve the above objectives, please refer to Figure 1-2 The grain detection device of the present invention includes a pneumatic conveying device, an impurity detection device, a moisture detection device 7, a bulk density detection device 8, and a moldy particle detection device 9. The bulk density detection device 8 is located below the moisture detection device 7. The pneumatic conveying device conveys the grain to the impurity detection device, the moisture detection device 7, and the moldy particle detection device 9 respectively, and performs impurity content detection, moisture detection, bulk density detection, and moldy particle detection on the grain.
[0028] The pneumatic conveying device includes a negative pressure main pipe 2, a blower 1, and an anti-breakage unloader 3. Multiple anti-breakage unloaders 3 are connected to the negative pressure main pipe 2. The blower 1 is connected to one end of the negative pressure main pipe 2. The anti-breakage unloader 3 is connected to the hopper 10 through a suction pipe. The lower end of the anti-breakage unloader 3 conveys the grain to the impurity detection device, the moisture detection device 7, and the moldy particle detection device 9 through a pipeline.
[0029] The impurity detection device includes a vibrating screen 4, a light impurity suction separator 5, and a parallel impurity separation device 6. The vibrating screen 4 separates heavier impurities from the grain through vibration. The separated grain enters the light impurity suction separator 5. Impurities larger and smaller than the grain are directly conveyed to the impurity hopper 11. The light impurity suction separator 5 uses negative pressure to draw the light impurities contained in the grain into the impurity hopper 11. The heavier grains in the light impurity suction separator 5 enter the grain hopper 12. Finally, the impurities and grains are weighed separately to obtain the impurity content in the grain. The parallel impurity separation device 6 uses a camera to identify the grains and impurities, and weighs them separately to obtain the parallel mass content.
[0030] Moisture detection device 7 detects the moisture content of the grain using infrared technology. Bulk density detection measures the bulk density of the grain using a container of fixed capacity.
[0031] The anti-breakage unloading device 3 in this embodiment can adopt the structure of the unmanned intelligent conveying device for grain inspection and anti-breakage disclosed in CN222808916U, which will not be described in detail here. The vibrating screen 4, the light impurity suction separator 5, and the side impurity separation device 6 can adopt the corresponding structure in the unmanned grain sampling and quality inspection device and process disclosed in CN120275658A. For example, the light impurity suction separator 5 can use the impurity air separator therein, which will not be described in detail here.
[0032] The moldy grain detection device 9 includes a conveyor belt 15 and data acquisition components 13. Grains are spread flat on the conveyor belt 15 for conveying. Multiple sets of data acquisition components 13 are arranged sequentially along the conveying direction of the conveyor belt 15. A leveling mechanism is provided on the upper side of the input end of the conveyor belt 15. The leveling mechanism flattens the grains falling onto the conveyor belt 15, making the grains spread flat on the conveyor belt 15. The data acquisition components 13 collect image data and spectral data.
[0033] Specifically, the leveling mechanism can use a brush 14 to level the grain. The data acquisition component 13 can be an industrial area array camera, a hyperspectral imaging camera, a line scan near-infrared spectral camera, etc.
[0034] The method for detecting grain using the above-mentioned grain detection device includes the following steps: The impurity detection device detects the impurity content in the grain, the moisture detection device 7 detects the moisture content of the grain, the bulk density detection device 8 detects the bulk density of the grain, and the moldy particle detection device 9 detects the content of moldy particles in the grain.
[0035] Please see Figure 3 The moldy grain detection device 9 specifically detects the content of moldy grains in grains, including: S1. The data acquisition component acquires the raw detection data and performs correlation processing on the raw detection data to obtain correlated detection data, which includes correlated image data and correlated spectral data. S2. Perform particle segmentation and invalid particle removal on the associated image data to determine the valid particle set; S3. Based on the associated image data and associated spectral data, perform image feature extraction and spectral feature extraction on each effective particle in the effective particle set, establish a corresponding relationship, and form the initial features of each effective particle; S4. Based on the initial features, perform initial risk candidate screening to obtain a set of candidate risk particles, and determine the initial risk information corresponding to each candidate risk particle. S5. Based on the initial risk information, construct a risk distribution result for the candidate risk particle set, and generate a mold detection result based on the risk distribution result.
[0036] It should be noted that the grain batch sample is spread out and transported to the target area in a single layer. The grain batch sample is spread out in a single layer on the conveyor belt 15 by the brush 14 and transported by the conveyor belt 15. The data acquisition component is set above the conveyor belt 15 to continuously collect data on the grain on the conveyor belt 15.
[0037] As one implementation method: The target area can be set to a length of 220 mm and a width of 150 mm. The average grain size is 4 mm to 8 mm. The field of view of a single acquisition corresponding to this target area can stably cover 400 to 900 grain particles. This ensures that high-risk particles in some areas are fully exposed, and does not increase the difficulty of subsequent particle segmentation due to the large number of particles in a single frame.
[0038] Multiple data acquisition components are arranged sequentially along the length of the conveyor belt 15. The target areas of adjacent data acquisition components 13 are spaced 100 mm to 300 mm apart in the conveying direction. The grain batch sample conveyed in a single layer passes through the target area at a speed of 0.22 m / s. Image data is continuously acquired at 100 frames per second, and spectral data is continuously acquired at 300 lines per second. The above frequency settings ensure that the particle displacement corresponding to two adjacent image data acquisitions is no higher than 2.2 mm, and the particle displacement corresponding to two adjacent spectral data acquisitions is no higher than 0.73 mm, thereby ensuring that the same grain particle remains trackable during continuous acquisition. Therefore, one frame of image data can be output every 10 milliseconds, and one line of spectral data can be output every 3.33 milliseconds. Within a 10-millisecond matching window, there is usually one frame of image data and two to four lines of spectral data.
[0039] Considering that multiple target areas are detected simultaneously or multiple acquisition channels in the same target area output data simultaneously, after the processing terminal receives the raw detection data, it first timestamps the raw image data and raw spectral data to form an image dataset and a spectral dataset with a unified time reference. Simultaneously, it acquires displacement pulse information and conveying direction position number. The displacement pulse information is used to characterize the displacement change of the grain batch sample in the conveying direction. The displacement pulse information is output by the encoder of conveyor belt 15. The encoder of conveyor belt 15 generates the conveying direction position number according to the rule of generating one position count for every 0.5 mm of forward movement.
[0040] Based on the image dataset and the spectral dataset, the processing terminal writes the acquired raw image data into the image cache queue and the raw spectral data into the spectral cache queue. Each cache record is written with fields such as batch sample number, acquisition time, transport direction position number, data type, data acquisition component number, acquisition sequence number, target area number, and integrity flag.
[0041] Within the corresponding buffer queue, data is first sorted by acquisition time, then by position number in the direction of transport. When multiple data of the same type exist at the same acquisition time, they are further distinguished by the data acquisition component 13 number and the acquisition sequence number corresponding to the data acquisition component 13. For example, image data is the frame sequence number, and spectral data is the row sequence number.
[0042] After the arrangement is completed, matching and merging are performed with a matching window of 10 milliseconds. The specific steps of matching and merging include: first, coarse matching is performed. One frame of original image data is retrieved from the image buffer queue. Then, original spectral data with the same data acquisition component 13 number, the same target region number, and whose acquisition time falls within the matching window are selected from the spectral buffer queue as candidate spectral data. Then, fine matching is performed based on the position number of the transport direction. When the difference between the position number of the candidate spectral data and the original image data of the frame is not greater than 2, it is determined that the match is successful. The difference of 2 is the allowable difference calculated by the transport speed, acquisition cycle, and position counting resolution. Then, the median value of the 2 to 4 rows of spectral data corresponding to the same transport position segment in the matching window is taken point by point according to the band to form associated spectral data. Then, the associated spectral data is combined with the corresponding original image data to form one associated detection data, so that the associated detection data contains mutually corresponding associated image data and associated spectral data.
[0043] When there are fewer than 2 rows of original spectral data that meet the position number difference requirement, the corresponding transmission position segment will remain in a pending sampling state; when there are more than 4 rows of original spectral data that meet the position number difference requirement, the 4 rows of candidate spectral data with the closest position numbers will be selected for merging.
[0044] When there is no original spectral data in the matching window that satisfies the position number difference of no more than 2, the transmission position segment corresponding to the original image data of that frame is marked as pending acquisition. When the transmission position segments corresponding to two consecutive frames of original image data are both in the pending acquisition state, the integrity mark of the transmission position segment is updated to abnormal, triggering abnormal handling. Abnormal handling includes freezing the current matching window, retaining the cache record of the most recent second, and sending a acquisition instruction for the abnormal transmission position segment to the downstream data acquisition component 13.
[0045] The specific steps for supplementary sampling include: the processing terminal determines the time when the corresponding grain conveying position segment reaches the target area of the downstream data acquisition component 13 based on the position number of the conveying direction corresponding to the abnormal marker, combined with the conveying speed and the spacing of the data acquisition components 13, and sends a supplementary sampling instruction to the downstream data acquisition component 13 to perform supplementary sampling at that time.
[0046] When the original image data and the original spectral data are matched after the re-collection, the integrity mark is updated to normal and the associated detection data continues to be output. If the matching is not completed within 0.5 seconds after the re-collection, the transport position segment corresponding to the abnormal window is marked as an invalid segment and removed from the subsequent analysis of the current batch of samples. At the same time, the invalid segment number is retained for re-inspection.
[0047] Finally, the output of the associated detection data marked as normal includes batch sample number, acquisition time, transport direction position number, data acquisition component 13 number, target area number, associated image data, and associated spectral data.
[0048] In this embodiment, step S2 specifically includes: The processing terminal reads the associated image data from the associated detection data output in the previous step, and then performs particle segmentation and invalid particle removal. The specific steps are as follows: First, the background reference image acquired by the empty conveyor belt 15 under the same data acquisition component 13, the same target area, and the same lighting conditions is called. Preprocessing is performed on the associated image data. The preprocessing includes background subtraction, three-by-three median filtering, and local brightness normalization.
[0049] The window side length for local brightness normalization is set to 31 pixels because a single grain corresponds to a width of approximately 40 to 80 pixels under the current imaging resolution of 0.10 mm per pixel. A 31-pixel window can eliminate slow brightness fluctuations without smoothing out the grain edges.
[0050] Subsequently, foreground extraction is performed on the normalized associated image data, and regional features are extracted from the connected regions of the foreground. Specifically, with the background reference image as the background benchmark, pixels in the current associated image data with a grayscale difference greater than 12 relative to the background reference image are marked as foreground pixels, and the contour, area, major axis length, minor axis length, boundary contact rate, and sharpness value are extracted from the connected regions formed by the foreground pixels.
[0051] 180 pixels corresponds to approximately 1.8 square millimeters. After manual labeling of grains in the same batch, the projected area of a complete single grain is usually significantly larger than this value. Therefore, connected regions with an area less than 180 pixels are marked as debris regions.
[0052] 2500 pixels roughly corresponds to 25 square millimeters. Considering grain particles with a diameter of 4 to 8 millimeters, under single-layer conveying conditions, the projected area of a single intact grain usually does not exceed this upper limit. If it significantly exceeds this limit, it often indicates that two or more grains are in contact with each other, overlapping, partially stacked, or large clumps are adhering together. Therefore, connected regions with an area greater than 2500 pixels are marked as stacked regions.
[0053] Although normal grain grains have different long and short axes, their length-to-width ratio usually falls within a relatively stable range. When this ratio is significantly larger, it often corresponds to narrow and elongated regions that have not been properly split after being stretched, stretched, or adhered together by broken husks, awns, trailing shadows, etc. Therefore, connected regions with a ratio of long axis length to short axis length greater than 3.2 are marked as elongated and abnormal regions.
[0054] To identify particles located at the image edge that are not fully captured in the field of view, the boundary contact rate can be expressed as the proportion of boundary pixels whose contours contact the image boundary to the total perimeter of the contour. Intact particles generally fall entirely within the field of view, resulting in a very low proportion of contours contacting the image boundary. However, truncated particles inevitably have a longer section of their contour attached to the image boundary, significantly increasing this proportion. Therefore, connected regions with a boundary contact rate greater than 0.12 are marked as truncated regions. The specific threshold is usually determined by observing the intersection of the boundary contact rate distributions of the two types of samples after labeling both intact and truncated particles.
[0055] Connected regions with a sharpness value less than 45 are marked as blurry regions. The sharpness value is usually taken as the Laplacian response variance. The larger the value, the clearer the edge, and the smaller the value, the blurrier the image. After dividing a large number of particle samples into two categories, sharp particles and trailing particles, the sharpness value distribution of each category is calculated, and the area near the intersection of the two distributions is taken as the discrimination threshold.
[0056] Subsequently, for connected regions with an area between 180 and 2500 pixels that are not marked as truncated regions, blurred regions, or elongated abnormal regions, the processing terminal further detects whether their contours are adhered. When the narrowest neck width is less than 3 pixels and the area of the connected region is greater than 1.6 times the median area of a single grain, the connected region is marked as an adhered region.
[0057] It should be noted that 3 pixels corresponds to an actual width of approximately 0.3 mm. The outline of a complete single grain is generally continuously expanding outwards, and its local contraction will not remain stably narrowed to such a small size for a long period of time. However, when two grains in contact form an adhesive area, the connecting part in the middle often shows a significant waist-like contraction. This waist-like contraction is manifested in the binary outline as a significant decrease in the narrowest neck width. Therefore, a minimum neck width of less than 3 pixels is used as an adhesion criterion to identify the morphological features of a narrow connecting bridge between two grains. The specific threshold calibration method is as follows: under the same data acquisition component 13, the same target area, and the same lighting conditions, the distribution of the narrowest neck width is first statistically analyzed for no less than 3,000 manually labeled single grain outlines and no less than 1,000 manually labeled double grain adhesive outlines. Then, the boundary position of the two distributions is taken as the judgment threshold. At the current resolution, the boundary position usually falls between 2.6 pixels and 3.4 pixels, so 3 pixels is taken as the judgment value.
[0058] It should be noted that the median area of a single grain refers to the statistical median value of the area obtained after manual annotation of a complete single grain under the same imaging conditions. The fold calibration method is to statistically analyze the area distribution of complete single grains and the area distribution of double-grain adhesion regions, find the overlapping interval of the two types of distributions, and then select a balance point between mistakenly deleted single grains and missed adhesion regions. According to the current particle size range and resolution, the balance point usually falls between 1.5 and 1.7 times, so 1.6 times is selected.
[0059] Adhesive regions, debris regions, stacked regions, elongated abnormal regions, truncated regions, and blurred regions are all abnormal region categories obtained based on region feature recognition. Among them, debris regions, stacked regions, elongated abnormal regions, truncated regions, and blurred regions are directly eliminated, while adhesive regions are regions to be split. The remaining connected regions are considered normal candidate regions. Normal candidate regions are connected regions with an area between 180 and 2500 pixels that have not been marked as truncated regions, blurred regions, elongated abnormal regions, or adhesive regions. The connected regions corresponding to normal candidate regions are directly retained as the first effective particles.
[0060] Then, a distance-transform-based splitting process is used to divide the adhesion region into multiple candidate particles. For each candidate particle after splitting, the area, major axis length, minor axis length, boundary contact rate, and sharpness value are recalculated, and condition judgment is performed. Only candidate particles that simultaneously meet the following conditions are retained as the second effective particles: area between 180 and 2500 pixels, ratio of major axis length to minor axis length not greater than 3.2, boundary contact rate not greater than 0.12, and sharpness value not less than 45.
[0061] Both the first and second effective particles are effective particles in the current frame.
[0062] It's important to note that while the adhered regions appear as a single entity in a binary image, each particle contains a relatively independent central elevation. The distance transformation explicitly calculates this central elevation and low boundary structure, then uses these central locations to segment the adhered regions. For example, a foreground mask is first generated for the connected regions marked as adhered, and a Euclidean distance transformation is performed on this mask to obtain a distance map D(x,y), where D(x,y) represents the shortest distance from the foreground pixel (x,y) to the nearest boundary pixel. Since the center of each individual particle is furthest from the boundary, local peaks will form on the distance map. Next, local maxima detection is performed on the distance map, and local peaks with a height greater than 2.5 pixels and a center-to-center distance greater than 8 pixels are used as splitting seeds. Here, 2.5 pixels corresponds to the lower bound of the minimum inscribed radius of a single grain at the current resolution, avoiding mistaking edge noise for the particle center. 8 pixels corresponds to the range of one-fifth to one-quarter of the minimum minor axis length of a single grain, used to avoid multiple overly dense false peaks within the same particle. Then, using these splitting seeds as markers, watershed segmentation is performed on the negative distance map, causing each local peak to expand outwards until it meets the expansion boundary of the adjacent peak, thus obtaining multiple sub-regions. Finally, the area, major axis length, minor axis length, boundary contact rate, and sharpness value of each sub-region are recalculated, and only sub-regions that meet the single-particle determination criteria are retained as candidate particles.
[0063] Considering that the same grain particle may appear in two adjacent frames of related image data under continuous acquisition conditions, after the processing terminal completes the particle segmentation of the current frame, it performs cross-frame matching between the effective particles of the current frame and the effective particles of the previous frame. Under the conditions of current imaging resolution of 0.10 mm per pixel, conveying speed of 0.22 m / s, and associated image data acquisition frequency of 100 frames per second, the theoretical displacement between two adjacent frames is 22 pixels. Therefore, when the displacement of the centroid of two particles in the conveying direction is between 18 and 26 pixels, the displacement in the vertical conveying direction is no more than 6 pixels, and the area difference is no more than 0.15 of the area of the particle in the previous frame, it is determined that the two are duplicate observations of the same grain particle. The particle record with lower boundary contact rate and higher sharpness value is retained as the unique particle record, and the other particle record is marked as a duplicate record and merged and deleted.
[0064] When the proportion of connected regions marked as invalid particles in a frame of associated image data exceeds 0.65 of the total number of connected regions, the frame's status is updated to a segmentation anomaly frame, and particle output for that frame is frozen. Particle verification is then performed again, incorporating particle regions in the next frame of associated image data that overlap with the current frame. If two consecutive frames are segmentation anomaly frames, the corresponding location segment is marked as an image anomaly and removed from subsequent analysis of the current batch. The specific threshold is determined statistically based on the distribution of invalid particle proportions in normally segmentable frames and segmentation anomaly frames.
[0065] The final output of the valid particle set includes at least the batch sample number, data acquisition component 13 number, target area number, acquisition time, conveying direction position number, particle number, particle outline, particle centroid, particle image fragment, and valid particle marker.
[0066] In this embodiment, step S3 specifically includes: Before the system goes online, the processing terminal collects images of a 1mm dot matrix calibration board and corresponding spectral calibration data from the same data acquisition component 13 and the same target area. It extracts the column coordinates of the dot matrix center in the image data and the sampling column position in the spectral calibration data, and generates a mapping table from image column coordinates to spectral sampling columns based on their correspondence. Then, it projects the image column coordinates of the dot matrix center onto the corresponding spectral sampling column in the mapping table, calculates the pixel deviation between the projected position and the actual spectral sampling column position, and uses the average deviation of all dot matrix centers as the average projection error. When the average projection error does not exceed 1.5 pixels, the mapping table calibration is considered complete; otherwise, recalibration is required. The dot matrix calibration board image refers to the image data acquired by the data acquisition component 13 from the 1mm dot matrix calibration board set within the target area. The corresponding spectral calibration data refers to the spectral data synchronously acquired from the 1mm dot matrix calibration board under the same acquisition conditions.
[0067] The processing terminal acquires the valid particle set and associated detection data output from the previous step, and establishes a particle feature extraction queue according to the batch sample number, data acquisition component 13 number, target area number, acquisition time, and conveying direction position number.
[0068] During operation, the processing terminal sorts the particle feature extraction queues by acquisition time under the same batch sample number, data acquisition component 13 number, and target area number. When the acquisition time is the same, it sorts them by position number in the conveying direction, and then reads each valid particle one by one. Using a mapping table, it retrieves the spectral sampling column set corresponding to the valid particle from the associated spectral data corresponding to the associated image data. When the number of corresponding spectral sampling columns is not less than 5 and the coverage rate after the particle contour is projected onto the spectral sampling columns is not less than 0.60, it is determined that the valid particle has successfully established a correspondence with the spectral sampling column set. Specifically, the minimum and maximum column coordinates are determined based on the column coordinates of each contour pixel in the particle contour, and the column interval between the minimum and maximum column coordinates is taken as the lateral coverage range of the valid particle in the image data. The lower limit of the number of spectral sampling columns can be determined statistically based on the lateral spectral sampling density of the current data acquisition component 13 in the target area and the minimum lateral projection width of a single grain. The coverage threshold can be determined by statistically analyzing the image contour projection results of manually verified particles and taking the boundary value of the coverage distribution between correctly matched and incorrectly matched particles.
[0069] When the number of corresponding spectral sampling columns is less than 5 and the coverage is less than 0.60, the corresponding relationship status is updated to pending replenishment status, and the corresponding spectral sampling columns are searched again in the detection data within the range of the same data acquisition component 13 number, the same target area number, the position sequence number of the previous and next transport directions, and the acquisition time difference is not greater than 10 milliseconds.
[0070] If the above conditions are still not met after replenishment, the feature extraction status of the effective particle is updated to abnormal and removed from the initial feature output of the current batch, while the particle number is retained for re-inspection.
[0071] For valid particles that have successfully established a correspondence, the processing terminal first extracts image features based on the associated image data corresponding to the valid particles. The image features include at least area, major axis length, minor axis length, ratio of major axis length to minor axis length, boundary contact rate, sharpness value, average gray level, gray level standard deviation, texture contrast, and texture entropy.
[0072] The texture contrast and texture entropy are calculated using a gray-level co-occurrence matrix with a window size of 15 pixels. At the current resolution, this window covers an area of approximately 1.5 millimeters, which is sufficient to cover the local texture units on the surface of a single grain without introducing the texture of adjacent particles.
[0073] Subsequently, the processing terminal performs 9.2-order Savitzky-Golay smoothing, standard normal variable correction, and band denoising on the spectral sampling array corresponding to the effective particles, retaining the effective bands with a signal-to-noise ratio of not less than 20 dB in the range of 930 nm to 1680 nm, and extracting the reflectance values of 970 nm, 1200 nm, 1450 nm, and 1650 nm, the slope of the band from 930 nm to 1000 nm, the absorption depth from 1380 nm to 1480 nm, and the area of the band from 1600 nm to 1680 nm as spectral features.
[0074] The 930 nm to 1680 nm range is the stable output range of the current data acquisition component 13. The 970 nm, 1200 nm, 1450 nm and 1650 nm ranges correspond to the main response positions of water content change, hydrocarbon group absorption, hydroxyl absorption and lipid protein absorption, respectively. This can simultaneously retain information on component changes related to abnormal mold growth as well as physical differences related to non-toxic disturbances.
[0075] Subsequently, the processing terminal writes the spectral features and image features into the initial feature cache table with the particle number as the primary key, and writes the batch sample number, data acquisition component 13 number, target area number, acquisition time, conveying direction position number and corresponding relationship status, and completes sorting, matching, merging and status update to obtain the initial features of each effective particle. The initial features include at least the particle number, image features, spectral features and corresponding relationship status.
[0076] In this embodiment, step S4 specifically includes: The processing terminal establishes an initial risk screening queue based on the initial feature cache table. The processing terminal first merges and groups the particle records according to the batch sample number, the data acquisition component 13 number, and the target area number, and then arranges them sequentially within each group according to the acquisition time, the position number of the conveying direction, and the particle number.
[0077] Subsequently, within the same batch of sample numbers, the median and interquartile range were calculated for the following parameters: 970 nm reflectance, 1200 nm reflectance, 1450 nm reflectance, 1650 nm reflectance, slope of the 930 nm to 1000 nm band, absorption depth of the 1380 nm to 1480 nm band, area of the 1600 nm to 1680 nm band, average gray level, gray level standard deviation, texture contrast, texture entropy, and the ratio of major axis length to minor axis length. Normalization was then performed using the median as the center and the interquartile range as the scale. Specifically, when the interquartile range of a certain feature was less than one percent of the feature's range, one percent of the feature's range was used to replace the interquartile range, preventing the amplification of abnormal deviations due to excessively small fluctuations in a single batch of samples.
[0078] Considering that spectral anomalies in some particles may be caused by changes in moisture content and do not directly correspond to mold growth anomalies, and that surface texture anomalies in some particles may be caused by damage and dirt and do not directly correspond to mold growth anomalies, this implementation combines spectral features and image features. After normalization, the processing terminal converts each feature into a deviation from the overall level of the current batch of samples. Then, it selects spectral and image features that can characterize changes in composition and surface texture, converts the normalization deviation into single-feature anomalies, and sums the single-feature anomalies according to their weights to obtain the combined spectral and image anomalies of each effective particle, which are used for subsequent initial risk candidate screening. In the spectral part, the reflectance value at 1450 nm, the reflectance value at 1650 nm, the absorption depth from 1380 nm to 1480 nm, the area of the band from 1600 nm to 1680 nm, and the slope of the band from 930 nm to 1000 nm are selected. In the image part, the grayscale standard deviation, texture contrast, texture entropy, and the ratio of the major axis length to the minor axis length are selected.
[0079] It should be noted that the above features can simultaneously retain information on absorption changes related to mold abnormalities as well as information on abnormal particle surface textures.
[0080] Subsequently, the processing terminal generates an initial risk score with a spectral weight of 0.65 and an image weight of 0.35. Among them, the absolute normalization deviation of a single feature is not less than 1.2 and is recorded as an abnormal feature. Particles with an initial risk score of not less than 0.55 are directly marked as target risk particles. Particles with an initial risk score between 0.45 and 0.55 and no less than 2 abnormal features are marked as boundary risk particles. The remaining particles are marked as ordinary particles.
[0081] It should be noted that the values of 0.55 and 0.45 mentioned above are taken from the high recall cutoff point and the buffer cutoff point of the particle score distribution of positive and negative batches in 50 batches of labeled grain samples, respectively.
[0082] For particle records with more than two missing features, the processing terminal updates its screening status to abnormal and removes it from the candidate risk particle output of the current batch, while retaining the particle number, collection time, and transport direction position number for re-inspection.
[0083] The final output is a candidate risk particle set, which consists of target risk particles and boundary risk particles. The initial risk information output includes at least the batch sample number, data acquisition component 13 number, target area number, acquisition time, transport direction position number, particle number, initial risk score, risk category, number of abnormal features, and key feature identifier that triggers screening.
[0084] As one implementation method: On the grain depot's inbound conveyor line, the processing terminal reads the initial feature cache table output from the previous step. First, it groups the particle records by batch sample number. Then, under the same batch sample number, it establishes an initial risk screening queue based on the data acquisition component 13 number, target area number, acquisition time, conveying direction position number, and particle number. The image features and spectral features of each valid particle are then sequentially retrieved and normalized using the following formula: ; Among them, Z k,j Let f be the normalization bias of the k-th particle on the j-th feature; k,j Corresponding eigenvalues, M j I is the median value of the j-th feature in the same batch of samples. j δ represents the interquartile range of the j-th feature in the same batch of samples. j It is the lower limit of 100% of the j-th characteristic range.
[0085] Subsequently, the normalization bias was truncated to the range of 0 to 3 to obtain the single feature anomaly μ. k,j Quantity μ k,j The formula is: μ k,j =min(3,|Z k,j |) .
[0086] Then, the anomalies corresponding to these spectral and image features are weighted according to their respective weights to obtain an initial risk score, as shown in the formula: Among them, R K For the initial risk score of the k-th particle, w j The corresponding feature weights are as follows: reflectance at 1450 nm, reflectance at 1650 nm, absorption depth from 1380 nm to 1480 nm, area in the band from 1600 nm to 1680 nm, slope in the band from 930 nm to 1000 nm, grayscale standard deviation, texture contrast, texture entropy, and the ratio of major axis length to minor axis length. The corresponding weights are 0.18, 0.16, 0.14, 0.12, 0.10, 0.08, 0.08, 0.07, and 0.07, respectively. The weights were statistically determined by screening positive and negative batches of grain samples from 50 batches of labeled grain samples. The determination objective was to minimize the proportion of ordinary particles entering the sample while maintaining a recall rate of at least 0.95 for candidate risk particles.
[0087] Next, the terminal processes the number N of abnormal features. k The candidate risk particle state is determined by the following formula: .
[0088] Among them, C kThis represents the status of candidate risk particles. A value of 1 indicates that the particle enters the target risk particle output, while a value of 0 indicates that the particle only retains the ordinary particle label.
[0089] After all particles have been processed, the processing terminal outputs candidate risk particles and their initial risk information, and synchronously writes particles with abnormal screening status into the re-inspection cache table.
[0090] In this embodiment, step S5 specifically includes: The processing terminal establishes a risk distribution cache table based on the candidate risk particle set, initial risk information, and effective particle set, and uses the batch sample number. The input fields include at least the batch sample number, data acquisition component 13 number, target area number, acquisition time, conveying direction position number, particle number, particle centroid, initial risk score, risk category, number of abnormal features, and key feature identifier that triggers screening.
[0091] The processing terminal first groups the samples by batch number, data acquisition component 13 number, and target area number, and then arranges them in each group according to the acquisition time, conveying direction, position number, and particle number.
[0092] Subsequently, a risk statistical grid was constructed with 10 counts of the position number in the conveying direction as a vertical statistical unit and 40 pixels of the transverse coordinate of the particle centroid as a transverse statistical unit. The 10 counts correspond to a 5 mm conveying distance and the 40 pixels correspond to a 4 mm transverse width. These two values are equivalent to the typical length and width range of a single grain at the current conveying resolution, respectively. This can suppress random fluctuations of single particles while preserving local aggregation information.
[0093] Within each risk statistics grid, the processing terminal counts the number of valid particles and the number of candidate risk particles in the same grid, and assigns a risk category coefficient to each candidate risk particle based on the initial risk information. Particles with an initial risk score of not less than 0.55 are assigned a coefficient of 1, and particles with an initial risk score between 0.45 and 0.55 and at least 2 abnormal features are assigned a coefficient of 0.75.
[0094] Subsequently, the processing terminal calculates the grid risk density based on the initial risk score, risk category coefficient, and number of effective particles in the same grid for candidate risk particles. Risk grids with a grid risk density of not less than 0.18 and a number of candidate risk particles of not less than 2 are marked as risk grids. Then, risk grids that are vertically adjacent or horizontally adjacent under the same data acquisition component 13 number and the same target area number are merged to form local risk areas.
[0095] For each local risk area, the risk distribution characteristics are further calculated. The risk distribution characteristics include the intensity of the local risk area, the number of particles in the local risk area, and the coverage of the local risk area. Within the batch sample number range, the proportion of candidate risk particles to all effective particles, the number of local risk areas, the intensity of the maximum local risk area, and the number of target areas where local risk areas occur are statistically analyzed to construct the risk distribution results.
[0096] Specifically, when the number of valid particles in a target area is less than 50, the target area is updated to an invalid target area and removed from the risk distribution results to avoid local density distortion caused by insufficient sampled particles. When the number of valid target areas in the same batch of samples is less than 3, the mold detection status is updated to a low confidence status and supplementary sampling is triggered.
[0097] With at least three valid target areas, the processing terminal generates mold detection results based on the risk distribution. When the proportion of candidate risk particles to all valid particles is less than 0.03 and the maximum local risk area intensity is less than 0.35, the output is "No obvious risk observed," indicating that the proportion of candidate risk particles in the current batch is low, and no obvious local high-intensity risk areas have formed, showing no significant mold abnormalities overall. When the proportion of candidate risk particles to all valid particles is less than 0.08, the maximum local risk area intensity is not less than 0.35, and the number of target areas with local risk areas is equal to one, the output is "Local clustered risk," indicating that the overall proportion of candidate risk particles in the current batch is not high, but obvious concentrated local risk areas have formed in a few target areas, suggesting the possibility of localized clustered mold contamination in this batch. When the proportion of candidate risk particles to all valid particles is not less than 0.08, the number of local risk areas is not less than 3, and the number of target areas with local risk areas is not less than 2, the output is "dispersed and expanding risk," indicating that the proportion of candidate risk particles in the current batch sample has reached a high level, and local risk areas have appeared in multiple target areas, indicating that the mold abnormality in this batch sample is dispersed and expanding. When at least one of the following conditions is met: the proportion of candidate risk particles to all valid particles is not less than 0.12, and the intensity of the maximum local risk area is not less than 0.50, the output is "high-risk batch sample," indicating that the proportion of candidate risk particles in the current batch sample has increased significantly, or the intensity of local risk areas has increased significantly, indicating that this batch sample has a high level of mold contamination risk.
[0098] The final output of the risk distribution results should include at least the batch sample number, the number of candidate risk particles, the number of effective particles, the proportion of candidate risk particles, the number of local risk areas, the intensity of the largest local risk area, the coverage of the target area, and the distribution type. The final output of the mold detection results should include at least the batch sample number, the detection conclusion, the detection status, and the re-inspection recommendation.
[0099] As one implementation method: Each particle is written into its corresponding risk statistics grid based on its centroid's lateral coordinate and its position number in the transport direction. For the m-th risk statistics grid, the processing terminal calculates the grid risk density using the following formula: Among them, G m Let G be the grid risk density of the m-th risk statistical grid. m The set of candidate risk particles falling into the m-th risk statistical grid, b k R is the risk category coefficient of the k-th candidate risk particle. k For the initial risk score of the k-th candidate risk particle, E m This represents the number of effective particles within the m-th risk statistics grid.
[0100] Subsequently, for the q-th local risk region, the intensity of the local risk region is calculated using the following formula: Among them, H q Let Q be the intensity of the local risk region for the q-th local risk region. q Let n be the set of risk statistics grids for the q-th local risk region. m Let m be the number of candidate risk particles in the m-th risk statistics grid.
[0101] Finally, the proportion of candidate risk particles is calculated using the formula: P=N c / N e Where P represents the proportion of candidate risk particles to all effective particles, and N... c N represents the number of candidate risk particles in the current batch. e This represents the effective particle count in the current batch. It should be noted that the risk density threshold of the risk statistical grid (0.18), the maximum local risk area intensity threshold corresponding to local aggregation risk (0.35), the candidate risk particle proportion threshold corresponding to dispersed expansion risk (0.08), the candidate risk particle proportion threshold corresponding to high-risk batches (0.12), and the maximum local risk area intensity threshold corresponding to high-risk batches (0.50) were all obtained through statistical calibration of the local contamination distribution of 60 manually verified grain batches. After processing all target areas, the processing terminal outputs the risk distribution results and mold detection results, and synchronously writes low-confidence batches into the re-inspection cache table.
[0102] Example 1 refines the batch average signal to the granular level for risk identification, retaining local anomaly information without relying on large-scale fragmentation and mixing. This helps improve the accuracy of batch screening, effectively reduces the risk of mold abnormalities being masked by the overall average signal under conditions such as local aggregation and uneven distribution within the batch, and also ensures detection efficiency and result stability.
[0103] Example 2: This embodiment 2 further provides an improved solution based on embodiment 1. Embodiment 1 solved the problem of batch average signal masking local high-risk particles, enabling low-concentration, locally aggregated, and unevenly distributed mold abnormalities to be effectively preserved through particle-level screening and risk distribution construction. However, in practical applications, such as different batches, different seasons, and different equipment conditions, grain particles still exhibit significant fluctuations in moisture content, variety differences, particle size, surface damage, and background lighting. Existing judgment methods easily mix these normal physical differences with mold abnormality signals, leading to insufficient stability of initial risk screening, misjudgment, and the masking of true low-concentration contamination signals by background fluctuations. This embodiment introduces a decoupling mechanism between non-toxin perturbation characterization and toxin-related anomalies based on embodiment 1, achieving the effect of further distinguishing between normal physical differences and mold abnormality signals while preserving local high-risk particles. It further solves the defect of insufficient stability of screening results across batches, seasons, and equipment conditions. The specific steps are as follows: Non-toxic perturbation characterization was constructed for particles in the candidate risk particle set.
[0104] Toxin-related abnormal features are extracted from the candidate risk particle set and decoupled by combining them with non-toxin perturbation characterization to obtain the toxin risk representation corresponding to each candidate risk particle.
[0105] The risk distribution results are corrected based on the toxin risk representation to form a corrected distribution result, and a corrected detection result is generated based on the corrected distribution result.
[0106] Specifically, the processing terminal establishes a decoupled processing cache table based on the candidate risk particle set, initial risk information, initial features, and risk distribution results, and then merges and groups the particles according to the batch sample number, data acquisition component 13 number, and target area number. After grouping, the particles are arranged in order of acquisition time, transport direction position number, and particle number within each group.
[0107] The input fields include at least the batch sample number, data acquisition component 13 number, target area number, acquisition time, transport direction position number, particle number, initial risk score, risk category, 970 nm reflectance value, 1200 nm reflectance value, 1450 nm reflectance value, 1650 nm reflectance value, 930 nm to 1000 nm band slope, 1380 nm to 1480 nm absorption depth, 1600 nm to 1680 nm band area, average gray level, gray level standard deviation, texture contrast, texture entropy, area, major axis length, minor axis length, and the ratio of major axis length to minor axis length.
[0108] Subsequently, within the same data acquisition component 13 number and the same target area number, the reflectance values at 970 nm, 1200 nm, 1450 nm, and 1650 nm, the slope of the 930 nm to 1000 nm band, the absorption depth of the 1380 nm to 1480 nm band, the area of the 1600 nm to 1680 nm band, the average gray level, the standard deviation of gray level, the texture contrast, the texture entropy, the area, the length of the major axis, the length of the minor axis, and the median and interquartile range of the ratio of the length of the major axis to the length of the minor axis were calculated. The median value was used as the center and the interquartile range was used as the scale to complete the normalization within the region to obtain the normalized deviation of each candidate risk particle under the local environmental benchmark.
[0109] The aforementioned feature set covers all the features required for subsequent construction of non-toxin perturbation characterization and extraction of toxin-related abnormal features, ensuring that all subsequent sub-characterization values, original toxin anomaly values, and toxin risk representations are calculated based on the same local benchmark. When the number of candidate risk particles in the same target area is less than 20, the processing terminal merges adjacent target areas under the same data acquisition component number 13 to calculate the benchmark, avoiding benchmark shift caused by small samples.
[0110] As one implementation method, the normalization formula is: Among them, z r k,j f represents the regional normalization bias of the k-th candidate risk particle on the j-th feature within the r-th local region. k,j M represents the original feature value of the k-th candidate risk particle on the j-th feature. r,j Let I be the median value of the j-th feature within the r-th local region. r,j To represent the interquartile range of the j-th feature within the r-th local region, δ j Let r be the lower limit of the j-th characteristic range, and r be the local region number.
[0111] It should be noted that the regional normalization in this embodiment is different from the normalization processing for batch screening in Embodiment 1. In this embodiment, the local area corresponding to the same data acquisition component 13 number and the same target area number is used as the environmental benchmark. The relevant characteristics of the candidate risk particles are locally recalibrated so that the normalization deviation calculated subsequently reflects the true degree of deviation of the candidate risk particles from the local environmental benchmark, rather than the overall degree of deviation from the average level of the whole batch. This provides a basis for distinguishing between non-toxic fluctuations caused by normal physical differences and risk changes caused by abnormal mold growth.
[0112] After normalization, the processing terminal first constructs a non-toxic perturbation characterization. Among them, the water content perturbation is jointly characterized by the normalized deviation of the 970 nm reflectance value, the 1450 nm reflectance value, and the slope of the 930 nm to 1000 nm band; the particle type perturbation is jointly characterized by the normalized deviation of the 1200 nm reflectance value, the 1650 nm reflectance value, and the texture entropy; the particle size perturbation is jointly characterized by the normalized deviation of the area, the major axis length, and the minor axis length; the surface damage perturbation is jointly characterized by the normalized deviation of the grayscale standard deviation and the texture contrast; and the background illumination change is characterized by the normalized deviation of the average grayscale relative to the median value of the same target area.
[0113] Subsequently, the processing terminal calculates sub-characterization values for the above five types of non-toxin perturbations, and generates non-toxin perturbation characters with weights of 0.26, 0.18, 0.20, 0.18 and 0.18 respectively.
[0114] As one implementation method, the non-toxic perturbation characterization formula is D. k =0.26H k +0.18V k +0.2S k +0.18F k +0.18L k Among them, D k The non-toxic perturbation characterization for the k-th candidate risk particle. H k V is the characterization value of the water content perturbation. k S represents the perturbation factor characterization value for particle varieties. k F represents the particle size perturbation characterization value. k L is the characterization value of the surface damage perturbation sub-value. k The weights are used as the sub-characteristic values for background illumination changes. These weights were obtained through statistical calibration of non-toxic fluctuations in 60 batches of manually verified grain samples under cross-batch and cross-equipment conditions.
[0115] It should be noted that in this embodiment, moisture content disturbance, particle type disturbance, particle size disturbance, surface damage disturbance, and background illumination change are regarded as five types of non-toxic wavelet characteristics that can be independently characterized. On this basis, they are merged into non-toxic disturbance characteristics, so that non-toxic disturbances from different sources can enter the subsequent decoupling process in a classified characterization manner, thereby avoiding the misjudgment problem caused by mixing normal physical disturbances with abnormal mold growth signals in the prior art.
[0116] When the non-toxin perturbation characterization is not less than 0.60, the corresponding particle status is updated to a strongly perturbed particle, indicating that the anomaly of the candidate risk particle is mainly affected by the significant non-toxin perturbation. When the non-toxin perturbation characterization is between 0.40 and 0.60, the corresponding particle status is updated to a moderately perturbed particle, indicating that the candidate risk particle is affected by non-toxin fluctuations to a certain extent, but the source of its anomaly cannot be completely determined to be non-toxin-dominated. The rest are updated to weakly perturbed particles, indicating that the candidate risk particle is less affected by non-toxin fluctuations.
[0117] After distinguishing the disturbance states, the disturbance states are written into the non-toxic disturbance cache table, and each candidate risk particle is assigned a corresponding non-toxic deduction coefficient, where strong disturbance particles are assigned 0.85, medium disturbance particles are assigned 0.70, and weak disturbance particles are assigned 0.50. The non-toxic deduction coefficient is used as the basis for subsequent decoupling processing.
[0118] After constructing the non-toxic perturbation characterization, the processing terminal extracts toxin-related abnormal features from the candidate risk particle set. The toxin-related abnormal features include the absorption depth from 1380 nm to 1480 nm, the area of the band from 1600 nm to 1680 nm, the residual value of the 1450 nm reflectance after subtracting the moisture content benchmark in the region, the residual value of the texture contrast after subtracting the surface damage benchmark in the region, and the residual value of the texture entropy after subtracting the particle type benchmark in the region. The above five features are weighted by 0.28, 0.24, 0.18, 0.15, and 0.15 to obtain the original toxin abnormal value.
[0119] Subsequently, the processing terminal decouples the original toxin anomalies from the non-toxin perturbation characterization. The decoupling process refers to using the non-toxin perturbation characterization to correct the original toxin anomalies, separating out the risk components that are closer to the actual mold abnormalities, and obtaining a particulate-level toxin risk representation.
[0120] As an optional implementation method, the decoupling formula is: T k =max(0,A k -λ k D k ), where T k Let A represent the toxin risk of the k-th candidate risk particle. k Let λ be the original toxin anomaly value of the k-th candidate risk particle. k For the non-toxic perturbation characterization of the k-th candidate risk particle, D k This represents the non-toxic perturbation characterization of the k-th candidate risk particle. When the k-th candidate risk particle is a strongly perturbating particle, λ k =0.85. When the k-th candidate risk particle is a medium-perturbation particle, λ k =0.7. When the k-th candidate risk particle is a weakly perturbed particle, λ k =0.5.
[0121] It should be noted that in this embodiment, different non-toxin deduction coefficients are assigned to particles with strong, medium, and weak disturbances, respectively. This allows the degree to which non-toxin fluctuations weaken the original toxin anomaly value to be adaptively adjusted according to the disturbance intensity. In this way, under strong disturbance conditions, non-toxin dominant particles are prevented from entering the subsequent batch-level risk reconstruction process, and under weak disturbance conditions, excessive deduction of real toxin anomalies is avoided, thereby further improving the accuracy of toxin risk representation.
[0122] After obtaining the toxin risk representation, if the toxin risk representation is not less than 0.50, the particle is marked as a toxin-dominant particle; if the toxin risk representation is between 0.35 and 0.50, the particle is marked as a toxin particle to be reviewed; if the toxin risk representation is less than 0.35 and the non-toxin perturbation characterization is not less than 0.60, the particle is marked as a non-toxin-dominant particle and removed from subsequent batch-level risk reconstruction. For candidate risk particles with more than two missing toxin-related abnormal features, the processing terminal marks their decoupling status as abnormal and moves them to the re-examination cache table, excluding them from the risk construction of the current batch.
[0123] After completing the toxin risk representation calculation, the processing terminal calls the risk statistics grid formed in Example 1, recalculates the grid risk density for the toxin-dominant particles and toxin particles to be verified retained in each risk statistics grid, and merges vertically adjacent or horizontally adjacent risk statistics grids into a corrected risk region. The toxin-dominant particles and toxin particles to be verified together constitute the corrected risk particles. Furthermore, it does not directly merge diagonally adjacent risk statistics grids that only touch at corners, which can avoid mistakenly merging risk statistics grids that are only accidentally close in space into the same corrected risk region.
[0124] Subsequently, within the batch sample number range, the proportion of corrected risk particles to all valid particles, the number of corrected risk areas, the intensity of the maximum corrected risk area, and the number of target areas where corrected risk areas appear are statistically analyzed to form the corrected risk distribution result, i.e., the corrected distribution result.
[0125] When the number of candidate risk particles remaining in a target area is less than 2 and the number of valid particles is less than 50, the target area is updated as an invalid target area and removed from the corrected risk distribution results. When the number of valid target areas is less than 3, the current batch sample detection status is updated to a low-confidence state, and supplementary sampling is triggered. When the number of valid target areas is not less than 3, the processing terminal generates mold detection results based on the corrected risk distribution results.
[0126] Specifically, when the proportion of corrected risk particles is less than 0.03 and the intensity of the maximum corrected risk area is less than 0.30, no obvious risk is output; when the proportion of corrected risk particles is less than 0.08, the intensity of the maximum corrected risk area is not less than 0.30, and the number of target areas with corrected risk areas is equal to 1, local clustering risk is output; when the proportion of corrected risk particles is not less than 0.08, the number of corrected risk areas is not less than 3, and the number of target areas with corrected risk areas is not less than 2, dispersed expansion risk is output; and when at least one of the following conditions is met—the proportion of corrected risk particles is not less than 0.12 and the intensity of the maximum corrected risk area is not less than 0.45—a high-risk batch sample is output.
[0127] The final output of the corrected distribution results includes batch sample number, number of corrected risk particles, number of effective particles, percentage of corrected risk particles, number of corrected risk areas, intensity of the maximum corrected risk area, number of target areas covered, and distribution type.
[0128] Output corrected test results, including batch number, test conclusion, test status, and retest recommendations.
[0129] This embodiment corrects the risk distribution results formed in Example 1 by rewriting the decoupled toxin-dominant particles and toxin particles to be verified back into the risk statistics grid. This allows the particle-level decoupling results to further influence the identification of local risk areas and the generation of batch mold detection results, forming a closed-loop processing mechanism from particle-level decoupling to batch-level risk correction and then to the output of batch sample detection conclusions.
[0130] Depend on Figure 4 As can be seen, compared with existing technologies, this invention demonstrates superior performance in terms of local high-risk particle identification capability, batch-level risk distribution characterization capability, non-toxin fluctuation differentiation capability, and cross-batch and cross-device detection stability. Specifically, this invention improves the identification capability of local high-risk particles under low-concentration, locally aggregated contamination conditions through particle-level sieving and risk distribution construction. Furthermore, by decoupling non-toxin perturbation characterization from toxin-related anomalies, it further reduces the interference of moisture content differences, particle type differences, particle size differences, surface damage differences, and background lighting variations on the detection results. This results in more stable and accurate batch-level risk distribution and mold detection results.
[0131] Example 3 See Figure 5 In this embodiment, in order to obtain complete data on the grain and make the detection results more accurate, multiple sets of data acquisition components 13 are set on the lower side of the output end of the conveyor belt 15 to collect data from both sides of the grain.
[0132] After being conveyed by the conveyor belt 15, the data acquisition components 13 on both sides of the falling grain are alternately arranged, which can better collect data and avoid the data acquisition components 13 facing each other affecting the data quality.
[0133] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A grain detection device, comprising a pneumatic conveying device, an impurity detection device, a moisture detection device, a bulk density detection device, and a moldy grain detection device, wherein the bulk density detection device is disposed below the moisture detection device, and the pneumatic conveying device conveys the grain to the impurity detection device, the moisture detection device, and the moldy grain detection device respectively; characterized in that, The moldy grain detection device includes a grain conveying mechanism and a data acquisition component. The pneumatic conveying device transports the grain to the grain conveying mechanism, where the grain is laid flat and conveyed. The data acquisition component is located on the upper side of the grain conveying mechanism, or on both sides of the grain falling after being conveyed by the grain conveying mechanism. The data acquisition component collects image data and spectral data.
2. The grain detection method of the grain detection device according to claim 1, characterized in that, The impurity content, moisture content, bulk density, and moldy grains were detected in the grain using an impurity detection device, a moisture content detection device, a bulk density detection device, and a moldy grains detection device, respectively. The method for detecting moldy grains is as follows: The data acquisition component acquires raw detection data and performs correlation processing on the raw detection data to obtain correlated detection data, which includes correlated image data and correlated spectral data. Perform particle segmentation and invalid particle removal on the associated image data to determine the valid particle set; Based on the associated image data and associated spectral data, image features and spectral features are extracted from each effective particle in the effective particle set, and a corresponding relationship is established to form the initial features of each effective particle. Based on the initial features, an initial risk candidate screening is performed to obtain a set of candidate risk particles, and the initial risk information corresponding to each candidate risk particle is determined. Based on the initial risk information, a risk distribution result is constructed for the candidate risk particle set, and a mold detection result is generated based on the risk distribution result.
3. The grain detection method according to claim 2, characterized in that: The specific steps for obtaining raw detection data and performing correlation processing on the raw detection data to obtain correlated detection data include: The raw detection data is obtained by continuously collecting single-layer transported grain batches in the target area by the data acquisition component. The raw detection data includes raw image data and raw spectral data. The original image data and original spectral data are processed using a unified time reference to obtain an image dataset and a spectral dataset. The image dataset and the spectral dataset are respectively cached and sorted to form an image cache queue and a spectral cache queue. The image cache queue and the spectral cache queue are matched and merged to obtain the associated detection data.
4. The grain detection method according to claim 2, characterized in that: The specific steps for performing particle segmentation and invalid particle removal on the associated image data to determine the valid particle set include: Preprocessing and foreground extraction of associated image data yields particle-connected regions; The region category is determined based on the regional characteristics of the particle connected region, and the region category is screened out to obtain normal candidate regions and adhered regions. The normal candidate region is retained as the first effective particle, and the adhesion region is split and its effectiveness is determined to obtain the second effective particle. Cross-frame deduplication and anomaly removal are performed on the first and second effective particles to obtain the effective particle set.
5. The grain detection method according to claim 2, characterized in that: The specific steps for forming the initial features of each effective particle include: A particle feature extraction queue is established based on the effective particle set and associated detection data, and a pre-established mapping table from image column coordinates to spectral sampling columns is called. Based on the mapping table and particle feature extraction queue, the spectral sampling column corresponding to each effective particle is retrieved to form a set of spectral sampling columns; Determine whether each effective particle has a corresponding relationship with the spectral sampling column set. Perform back-matching and anomaly removal on effective particles that have not established a corresponding relationship. Extract image features and spectral features from effective particles that have established a corresponding relationship. Then merge the extraction results to form the initial features of each effective particle.
6. The grain detection method according to claim 2, characterized in that: The specific steps for performing initial risk candidate screening based on the initial features to obtain a set of candidate risk particles and determining the initial risk information corresponding to each candidate risk particle include: Based on the initial characteristics of each effective particle, the image features and spectral features of each effective particle in the same batch of samples are normalized to determine the number of abnormal features and the joint anomaly of the spectrum and image, and the initial risk score is determined based on the joint anomaly of the spectrum and image. Based on the initial risk score and the number of abnormal features, each effective particle is initially screened for risk candidates to obtain a set of candidate risk particles. Initial risk information is generated based on the candidate risk particle set.
7. The grain detection method according to claim 2, characterized in that: The specific steps for constructing a risk distribution result based on the initial risk information for the candidate risk particle set, and generating a mold detection result based on the risk distribution result, include: A risk statistical grid is constructed based on the candidate risk particle set, initial risk information, and effective particle set. The grid risk density is calculated and adjacent risk statistical grids are merged to form local risk regions. Based on the statistical risk distribution characteristics of local risk areas, a threshold is determined according to the risk distribution characteristics, and the risk distribution result is constructed after the determination is passed. Mold detection results are generated based on the risk distribution results.
8. The grain detection method according to claim 7, characterized in that: Also includes: Non-toxic perturbation characterization is constructed for particles in the candidate risk particle set; Extract the toxin-related abnormal features from the candidate risk particle set and decouple them from the non-toxin perturbation characterization to obtain the toxin risk representation corresponding to each candidate risk particle. The risk distribution results are corrected based on the toxin risk representation to form a corrected distribution result, and a corrected detection result is generated based on the corrected distribution result.
9. The grain detection method according to claim 8, characterized in that, in, The specific steps for constructing non-toxic perturbation characterizations for particles in the candidate risk particle set include: Based on the initial features corresponding to the candidate risk particle set, regional normalization is performed and non-toxic perturbation sub-characteristics are extracted. The non-toxic perturbation sub-characteristics include moisture content perturbation, particle type perturbation, particle size perturbation, surface damage perturbation, and background illumination perturbation. The non-toxin perturbation sub-characteristics are weighted and merged to obtain the non-toxin perturbation characteristics corresponding to each candidate risk particle. The perturbation state of each candidate risk particle is calibrated based on the non-toxic perturbation characterization. The specific steps for extracting toxin-related abnormal features from the candidate risk particle set and decoupling them with the non-toxin perturbation characterization to obtain the toxin risk representation corresponding to each candidate risk particle include: Extract toxin-related abnormal features from the candidate risk particle set, and weight the toxin-related abnormal features to obtain the original toxin anomaly value; Candidate risk particles are divided into perturbation states based on non-toxin perturbation characterization, and non-toxin deduction coefficients are assigned based on perturbation states. The original toxin outliers are decoupled from the non-toxin perturbation characterization to obtain a toxin risk representation. Based on the toxin risk representation, the particle state of candidate risk particles is formed, and the risk distribution results are corrected based on the particle state. The particle state includes toxin-dominant particles, toxin particles to be verified, and non-toxin-dominant particles.
10. The grain detection method according to claim 9, characterized in that: The specific steps for correcting the risk distribution results based on the toxin risk representation to form a corrected distribution result, and generating a corrected detection result based on the corrected distribution result include: Based on the risk statistics grid, the grid risk density of the toxin-dominant particles and the toxin particles to be verified in each risk statistics grid is recalculated, and the toxin-dominant particles and the toxin particles to be verified constitute the modified risk particles. Risk statistical grids that are vertically or horizontally adjacent are merged to form a modified risk area; A corrected distribution result is constructed based on the corrected risk particles and the corrected risk regions, and a corrected detection result is generated based on the corrected distribution result.
Citation Information
Patent Citations
Grain unmanned sampling quality inspection device and process
CN120275658A
Grain inspection anti-breaking unmanned intelligent conveying device
CN222808916U
Pneumatic conveying device of unmanned intelligent inspection system for grain quality
CN118759134A
Grain quality detection device and method, control device and storage medium
CN119827494A
Grain mildew degree image intelligent grading method and system
CN121767983A