Peanut mouldy kernel screening method and system based on image analysis
Patent Information
- Application Number
- CN202611390020.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-10-13
AI Technical Summary
[0006]本发明的目的是提供基于图像分析的花生霉变粒筛选方法及系统,以解决现有纯可见光方法漏检外观正常污染粒、而朴素紫外荧光方法因露仁假荧光误检正常粒的问题
[0030]本发明采用可见光与紫外激发荧光双模态成像,利用紫外荧光揭示可见光无法反映的隐性污染信息,从而能够检出外观正常但已污染的花生籽粒,克服了纯可见光方法在原理上的漏检;针对花生特有的露仁假荧光问题,本发明以局部荧光对比度并按组织类型施加不同对比度阈值(露仁处阈值更高)进行真伪判别,将裸露子叶产生的弥散假荧光有效抑制、同时保留霉菌产生的局部亮斑,从而克服了朴素紫外荧光方法在花生上的误检;本发明仅需普通可见相机与紫外光源即可实现,无需昂贵的高光谱设备,成本低、判别过程物理意义明确、可解释性强,便于在生产线上对逐粒花生进行在线筛选。
Smart Images

Figure CN122906064A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural product image detection and sorting technology, and in particular to a method and system for screening moldy peanut kernels based on image analysis. Background Technology
[0002] Peanuts are susceptible to Aspergillus infection and mold growth during storage and transportation, which can lead to the production of aflatoxin. However, there is a unique problem that existing technologies cannot solve in screening moldy peanut kernels: the determination of whether a peanut should be rejected is essentially based on the degree of aflatoxin contamination, and the degree of contamination cannot be accurately judged based solely on the visible light appearance of the peanut.
[0003] On the one hand, aflatoxin contamination is often concentrated in a very small number of grains, and these grains may appear normal with no obvious mold spots, yet have already produced high concentrations of toxins. On the other hand, grains that are discolored or defective due to mechanical damage, immaturity, or natural color differences in the seed coat may have very low toxin content. This means that existing machine vision methods, which classify grains based solely on visual features such as color, texture, and morphology extracted from visible light images, are in principle unable to detect grains that appear normal but are contaminated, leading to dangerous missed detections. At the same time, they will also mistakenly reject a large number of grains that have visual defects but are actually safe, resulting in false detections and losses in yield.
[0004] To reveal contamination information beyond its appearance, it is known in the art that the bright yellow-green fluorescence produced by Aspergillus flavus under ultraviolet light excitation can be used for auxiliary discrimination. This method has been applied to materials such as dried figs and corn. However, it fails when directly applied to peanuts: once the red seed coat of peanuts is detached or damaged, the exposed light-colored cotyledons will also exhibit similar fluorescence under ultraviolet excitation due to surface reflection, thus being misjudged as contamination fluorescence, generating a large number of false positives and causing normal kernels to be mistakenly rejected. In addition, although detection methods based on hyperspectral imaging combined with machine learning have been reported, the required equipment is expensive and the detection speed is limited, making it difficult to perform low-cost online screening of peanuts one by one on the production line.
[0005] In summary, how to detect peanut kernels that appear normal but are contaminated, and how to suppress false fluorescence caused by exposed kernel reflection to avoid false detection, without relying on expensive hyperspectral equipment, is an urgent problem to be solved in the screening of moldy peanut kernels. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for screening moldy peanut kernels based on image analysis, in order to solve the problems of existing pure visible light methods failing to detect moldy kernels with normal appearance, and the naive ultraviolet fluorescence method misdetecting normal kernels due to false fluorescence of exposed kernels.
[0007] To achieve the above objectives, in a first aspect, the present invention provides a method for screening moldy peanut kernels based on image analysis, comprising the following steps:
[0008] Step S1: Collect visible light images and ultraviolet-excited fluorescence images of multiple peanut kernels on the bearing surface, and spatially register the visible light images and ultraviolet-excited fluorescence images.
[0009] Step S2: Preprocess the visible light image and segment the image region corresponding to each peanut kernel;
[0010] Step S3: For each peanut kernel image area, the seed coat area and exposed kernel area are identified by visible light image and visible mold features are extracted; the bright yellow-green fluorescent area is identified by ultraviolet excitation fluorescence image.
[0011] Step S4: The identified bright yellow-green fluorescent areas are distinguished as genuine or false, suppressing false fluorescence generated by exposed kernel reflection and retaining genuine moldy fluorescence generated by mold; the exposed kernel refers to the cotyledons of peanut kernels that are exposed due to seed coat shedding or damage;
[0012] Step S5: Based on the retained true mold fluorescence and the visible mold characteristics, determine whether the peanut kernel is moldy.
[0013] Step S6: Output the discrimination results of each peanut kernel, and drive the sorting mechanism to remove peanuts that are judged to be moldy from the main material flow based on the discrimination results.
[0014] Furthermore, in step S1, peanut kernels are laid out in a single layer and separated from each other on the support surface. When acquiring visible light images, a visible diffuse light source is used for uniform illumination. When acquiring ultraviolet excitation fluorescence images, an ultraviolet light source with a center wavelength of 365 nanometers is used for excitation and visible fluorescence is acquired through a filter.
[0015] Furthermore, the image region of a single peanut kernel is denoted as... Based on the color difference between the reddish-brown seed coat and the light yellow exposed cotyledons, The region is divided into a seed coat region and an exposed kernel region. The pixel set of the exposed kernel region is denoted as... , and according to Calculate the ratio of exposed kernel to unexposed kernel.
[0016] Furthermore, the fluorescence image is converted to a hue-saturation-brightness color space, with the hue positioned in the yellow-green range. , And the brightness is not lower than the fluorescence brightness threshold. The pixels are identified as fluorescent pixels and aggregated into fluorescent spots, among which... Take 60 degrees Take 120 degrees. Set the normalized brightness to 0.5.
[0017] Furthermore, for each fluorescent spot, according to Calculate the local fluorescence contrast, where is the average lightness within the spot, is the average lightness of the annular neighborhood in the same kernel region around the spot; determine the tissue type according to the proportion of the spot falling into the exposed kernel region and apply a contrast threshold: the seed coat takes , the exposed kernel takes , and is greater than ; spots with a contrast not less than the corresponding threshold are judged as true mildew fluorescence spots and retained, otherwise they are judged as false fluorescence from exposed kernels and suppressed; where takes 1.5, takes 2.5.
[0018] Further, the sum of the areas of the retained true mildew fluorescence spots is denoted as , and the effective fluorescence proportion is calculated according to ; the visible mildew coverage is calculated according to , where is the set of pixels whose CIELab color difference from the reference color of normal peanuts is not less than the color difference threshold , takes 6.
[0019] Further, step S5 performs discrimination according to a cascading discrimination rule: when the effective fluorescence proportion is not less than the fluorescence risk threshold , the kernel is judged as a mildewed kernel; otherwise, when the visible mildew coverage is not less than the visible mildew threshold , the kernel is judged as a mildewed kernel; otherwise, the kernel is judged as a normal kernel; where takes 0.02, takes 0.10.
[0020] Further, the reference color and reference fluorescence lightness of normal peanuts are obtained by statistics of pre-collected normal peanuts, and are slidingly updated according to the kernels judged as normal during the screening process, so as to adapt to the differences of different varieties and batches.
[0021] Further, in step S6, the mildewed kernels are graded according to the effective fluorescence proportion, the mildew rate of the current batch is counted, and the mildewed kernels are blown away from the main material flow by the pneumatic nozzle array arranged downstream of the image acquisition position.
[0022] In a second aspect, based on the same inventive concept, the present invention provides a peanut mildewed kernel screening system based on image analysis, the system comprising an image acquisition module, an image preprocessing and segmentation module, a feature extraction module, a fluorescence false positive suppression module, a mildew discrimination module and a sorting execution module.
[0023] The image acquisition module includes a visible diffuse light source, an ultraviolet light source with a center wavelength of 365 nanometers, an image sensor, and a conveying device for carrying peanut kernels, used to acquire spatially registered visible light images and ultraviolet-excited fluorescence images.
[0024] The image preprocessing and segmentation module is connected to the image acquisition module and is used to preprocess the image and segment the image region corresponding to each peanut seed.
[0025] The feature extraction module is connected to the image preprocessing and segmentation module, and is used to identify the seed coat area and exposed kernel area of each peanut kernel from the visible light image and extract the visible mold coverage, and to identify bright yellow-green fluorescent spots from the ultraviolet-excited fluorescence image.
[0026] The fluorescence false positive suppression module is connected to the feature extraction module and is used to calculate the local fluorescence contrast of each fluorescent spot and apply a corresponding contrast threshold according to the tissue type where the fluorescent spot is located, so as to suppress false fluorescence of lenticels and retain true fungal fluorescent spots.
[0027] The mold discrimination module is connected to the fluorescence false positive suppression module. It is used to calculate the effective fluorescence ratio based on the retained true mold fluorescent spots, and combined with the visible mold coverage, to determine whether each peanut kernel is a moldy kernel according to the cascade discrimination rules.
[0028] The sorting execution module is connected to the mold discrimination module and is used to drive the sorting mechanism to remove peanuts that are determined to be moldy from the main material flow based on the discrimination result.
[0029] Compared with the prior art, the beneficial effects of the present invention are:
[0030] This invention employs dual-modal imaging using visible light and ultraviolet-excited fluorescence. Ultraviolet fluorescence reveals latent contamination information that visible light cannot detect, enabling the detection of peanut kernels that appear normal but are contaminated, overcoming the inherent limitations of pure visible light methods. Addressing the issue of false fluorescence in peanuts with exposed kernels, this invention uses local fluorescence contrast and applies different contrast thresholds based on tissue type (higher thresholds for exposed kernels) to distinguish between genuine and fake kernels. This effectively suppresses diffuse false fluorescence from exposed cotyledons while preserving local bright spots produced by mold, thus overcoming the false detections of simple ultraviolet fluorescence methods on peanuts. This invention requires only a common visible light camera and an ultraviolet light source, eliminating the need for expensive hyperspectral equipment. It is low-cost, has a clear physical meaning in the discrimination process, and is highly interpretable, facilitating online screening of peanuts on production lines. Attached Figure Description
[0031] Figure 1 This is a flowchart of the peanut moldy grain screening method based on image analysis according to the present invention;
[0032] Figure 2 This is a schematic diagram of the composition of the peanut moldy grain screening system based on image analysis of the present invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0034] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0035] Example 1
[0036] This embodiment provides a method for screening moldy peanut kernels based on image analysis, such as... Figure 1 As shown, the method includes steps S1 to S6. The following descriptions of each step, along with their corresponding subordinate technical features, specific parameter values, and practical examples, are provided. A comparison is also made with existing pure visible light machine vision methods, naive ultraviolet fluorescence methods, and hyperspectral imaging methods. In the example, a peanut kernel image region to be evaluated is provided. The number of pixels is 8000.
[0037] Step S1: Collect visible light images and ultraviolet-excited fluorescence images of multiple peanut kernels on the bearing surface, and spatially register the visible light images and ultraviolet-excited fluorescence images.
[0038] Multiple peanut kernels were laid out in a single layer on a support surface, separated from each other. When acquiring visible light images, a visible diffuse light source was used to uniformly illuminate the peanuts to eliminate highlights and shadows, and a background with a significant color difference from the peanut seed coat was used. When acquiring ultraviolet-excited fluorescence images, an ultraviolet light source with a center wavelength of 365 nm was used for excitation, and the visible fluorescence images were acquired through a filter that cut off the ultraviolet band.
[0039] The visible light image and the ultraviolet-excited fluorescence image are acquired by the same image sensor in a time-division manner, or by two spatially registered image sensors simultaneously, so that the two images correspond pixel by pixel.
[0040] The 365 nm ultraviolet excitation was chosen because substances associated with Aspergillus infection and Aspergillus flavus contamination produce characteristic bright yellow-green fluorescence under this wavelength, which is a commonly used excitation wavelength for contamination screening in this field.
[0041] Unlike existing machine vision methods that only acquire visible light images, this step simultaneously acquires fluorescence modalities, providing a basis for subsequent detection of latent contamination that cannot be detected by visible light.
[0042] Step S2: Preprocess the visible light image and segment the image region corresponding to each peanut kernel.
[0043] White balance correction and noise reduction were performed on the acquired visible light and fluorescence images. Then, based on the color difference between the foreground and background, the peanut kernel region was separated from the background. Morphological processing and watershed transform were then used to separate interconnected peanut kernels, and small connected regions were removed as impurities. This yielded the image region corresponding to each peanut kernel, and the image region of a single peanut kernel was denoted as […]. Because the visible light image and the fluorescence image are spatially registered, the regions of the same grain in the two modes correspond one-to-one.
[0044] Step S3: For each peanut kernel image area, the seed coat area and exposed kernel area are identified by visible light image and visible mold features are extracted, and the bright yellow-green fluorescent area is identified by ultraviolet excitation fluorescence image.
[0045] For each peanut kernel region The characteristics of mold growth were extracted in the visible light mode and the fluorescence mode, respectively, including the following four aspects.
[0046] Seed coat and exposed kernel identification and ratio: In visible light images, based on the color difference between the reddish-brown of the peanut seed coat and the light yellow of the exposed cotyledons, the seed coat and exposed kernel ratio are identified. The region is divided into a seed coat region and a kernel exposed region. The pixel set of the kernel exposed region is denoted as... And calculate the kernel ratio according to the following formula. : .
[0047] The exposed kernel ratio indicates the degree of seed coat loss or damage in the seed, and the exposed kernel area is precisely the region that may produce false fluorescence. For example, if a certain type of seed coat has partially fallen off, and its exposed kernel area is 3000 pixels, then... .
[0048] Visible mold characteristics: Calculate on visible light images The CIELab color difference between each pixel and the normal peanut reference color is set to be no less than the color difference threshold. The pixels are categorized into the visible mold pixel set. Color difference threshold We set it to 6 because when the CIELab color difference is about 6, the color deviation is already clearly distinguishable, and it can reliably distinguish between real color change and normal color difference fluctuation.
[0049] Bright yellow-green fluorescence identification: On a UV-excited fluorescence image, convert the fluorescence image to a hue-saturation-brightness color space, and place the hue within the yellow-green hue range. , And the brightness is not lower than the fluorescence brightness threshold. The pixels are identified as fluorescent pixels, forming a fluorescent pixel set. Then, the interconnected fluorescent pixels are aggregated into several fluorescent spots; among them Take 60 degrees 120 degrees (corresponding to the yellow-green range between yellow and green, excluding other autofluorescent colors such as blue and red). A normalized brightness of 0.5 is used (to distinguish fluorescent pixels from the non-fluorescent dark background). A relatively wide detection condition is employed here to ensure that both true and false fluorescence are detected first, and then differentiated in step S4.
[0050] Reference value adaptation: The reference color of normal peanuts and the reference brightness of normal peanuts under ultraviolet excitation are obtained by statistical analysis of multiple peanut kernels that have been collected in advance and confirmed to be normal. During the screening process, the reference values are updated by sliding based on the kernels judged to be normal, so as to adapt to the differences in seed coat color and fluorescence background of different varieties and batches of peanuts.
[0051] Step S4: The identified bright yellow-green fluorescent areas are distinguished as genuine or false, suppressing the false fluorescence generated by the reflection of the exposed kernel and retaining the true fluorescence generated by mold; the exposed kernel refers to the cotyledons of peanut kernels that are exposed due to the shedding or damage of the seed coat.
[0052] Calculate the local fluorescence contrast for each fluorescent spot. : In the formula The average brightness of the pixels within the fluorescent spot. This represents the average brightness of the annular neighboring pixels surrounding the fluorescent spot, located within the same peanut kernel image area.
[0053] The false fluorescence produced by the reflection of naked cotyledons is approximately uniformly distributed in the kernel area, with the brightness of the spots similar to that of their neighboring tissues, and the local fluorescence contrast is close to 1; while the true fluorescence produced by mold is a local bright spot, with its brightness significantly higher than that of the surrounding tissues, and the local fluorescence contrast is significantly greater than 1.
[0054] Therefore, based on the fluorescent spots falling into the exposed kernel area The pixel ratio determines the tissue type in which the fluorescent spot is located, and a corresponding contrast threshold is applied: for fluorescent spots located in the seed coat region, the threshold is set to... Fluorescent spots located in the exposed kernel region, with a threshold value of [value missing]. ,and Greater than Fluorescent spots with a contrast ratio not less than the corresponding threshold are considered genuine moldy spots and retained; otherwise, they are considered false fluorescence spots and suppressed. Take 1.5, Take 2.5.
[0055] The seed coat is reddish-brown, strongly absorbs excitation light, and has low and uniform background fluorescence, with a low risk of false fluorescence, so a lower threshold can be used; there is bright and diffuse false fluorescence at the kernel, which needs to be filtered out with a higher threshold, while true mold spots will not be falsely suppressed because the brightness is high enough (the contrast is still greater than 2.5).
[0056] The process of distinguishing genuine from counterfeit products is illustrated using three typical fluorescent spots:
[0057] Firstly, a fluorescent spot appeared on the intact seed coat area of a seemingly normal seed. =0.72 =0.30, If the value is located on the seed coat and the threshold is 1.5, and 2.40≥1.5, it is judged as a true moldy fluorescent spot and retained.
[0058] Secondly, the exposed kernel area of a certain type of seed with its husk detached exhibits diffuse fluorescence. =0.55 =0.52, The value is located in the kernel, the threshold is 2.5, and 1.06 < 2.5, so it is judged as false fluorescence of the kernel and suppressed.
[0059] Thirdly, there were actual mold spots on a certain kernel. =0.88 =0.30, Although it is located in the exposed kernel and the threshold is 2.5, 2.93≥2.5, it is judged as a true moldy fluorescent spot and retained.
[0060] It is evident that this step can both suppress diffuse false fluorescence on the kernel (secondly) and not miss real mold spots with sufficiently high brightness on the kernel (thirdly).
[0061] The naive ultraviolet fluorescence method does not distinguish between true and false fluorescence. Any bright yellow-green fluorescence detected is judged as contamination. Therefore, the diffuse fluorescence of exposed kernels mentioned in the second point above will be counted as contamination, leading to the false rejection (false detection) of normal kernels. This method correctly suppresses the fluorescence by applying different thresholds according to the tissue type through local fluorescence contrast, thereby overcoming the false detection problem of the naive ultraviolet fluorescence method on peanuts.
[0062] Step S5: Based on the retained true mold fluorescence and the visible mold characteristics, determine whether the peanut kernel is moldy.
[0063] The sum of the areas of all retained true fungal fluorescent spots is denoted as Calculate the effective fluorescence percentage using the following formula. : ; Calculate the visible mold coverage using the following formula : .
[0064] Then, a cascaded discrimination rule was adopted: when the effective fluorescence percentage... Not less than the fluorescence risk threshold If the mold is visible, it is considered moldy; otherwise, it is considered moldy when the mold coverage is visible. Not less than the visible mold threshold Grains that are moldy are classified as such; otherwise, they are classified as normal. Take 0.02, Take 0.10.
[0065] Prioritizing the effective fluorescence percentage and its low threshold is because the fluorescent spots retained after authenticity verification indicate real mold infection. Even a small percentage indicates a risk of contamination, which can detect grains that appear normal but are contaminated. The visible mold threshold is higher because minor visible defects caused by mechanical damage, immaturity, and varietal color differences are common and mostly benign. A large coverage is required to identify visible evidence as moldy grains, thus avoiding false rejection.
[0066] The cascade discrimination rule of this invention will be further illustrated using three typical fluorescent spots:
[0067] The first type has normal-looking kernels, with a fluorescent spot area of 200. ≥0.02, judged as moldy grain; however, only 40 pixels of this grain show visible mold. The pure visible light method may misjudge the presence of mold due to the almost absence of visible mold growth, resulting in missed detection. This method, however, successfully detects mold based on fluorescence.
[0068] Secondly, the seed coat falls off the kernel, and fluorescence is suppressed. =0、 =0, its visible mold coverage A value <0.10 was considered a normal particle, thus avoiding false detection.
[0069] Thirdly, the kernels with genuine mold spots retained fluorescent spots covering an area of 200 mm. ≥0.02, judged as moldy grains. Another grain shows obvious mold and discoloration on its surface, with visible mold pixels of 1040. Even if the fluorescence signal is weak, the second stage of the cascade discrimination still classifies it as a moldy particle based on the visible mold coverage if the value is ≥0.10.
[0070] Pure visible light machine vision methods rely solely on apparent color, texture, and shape for identification. In principle, they cannot detect contaminated kernels that appear normal, leading to dangerous missed detections. Furthermore, they may mistakenly reject normal kernels with only minor apparent defects. While hyperspectral imaging methods can detect some hidden contamination, the equipment is expensive and the detection speed is limited, making it difficult to perform online screening of peanuts one by one on the production line.
[0071] Step S6: Output the discrimination results of each peanut kernel, and drive the sorting mechanism to remove peanuts that are judged to be moldy from the main material flow based on the discrimination results.
[0072] Output the discrimination results for each peanut kernel, and based on the effective fluorescence ratio... The size of the moldy grains is used to classify them into different mold risk levels; the proportion of moldy grains in the current batch to the total number of peanut kernels is calculated to obtain the mold rate of the batch. The sorting mechanism includes an array of pneumatic nozzles located downstream of the image acquisition position. Based on the discrimination result, the pneumatic nozzles corresponding to the positions of the moldy grains are controlled to blow the moldy grains away from the main material flow.
[0073] The processing flow of the above method is summarized in pseudocode as follows:
[0074] Input: Spatially registered visible light image and ultraviolet-excited fluorescence image; preset parameters =60° =120° =0.5、 =6、 =1.5、 =2.5、 =0.02、 =0.10.
[0075] Output: Quality label for each peanut kernel and the mold rate for that batch.
[0076] 1) Perform white balance correction and noise reduction on the two modal images;
[0077] 2) Based on the color difference between the foreground and background, morphological processing, and watershed transformation, segmentation is performed to obtain the peanut kernel region set { };
[0078] 3) For each peanut kernel region Perform steps 3.1 to 3.7:
[0079] 3.1) From visible light images Divided into seed coat region and kernel exposed region, kernel exposed mask ;
[0080] 3.2) Calculation The CIELab color difference between each pixel and the reference color is used to obtain the set of visible moldy pixels. ,make ;
[0081] 3.3) On the fluorescence image, take the hue located in [ , [Range and brightness not lower than] The pixels And aggregated into a fluorescent spot set { };make ;
[0082] 3.4) For each fluorescent spot Perform steps 3.4.1 to 3.4.3:
[0083] 3.4.1) Calculate the average lightness within the spot. Average brightness of the ring neighborhood ,make ;
[0084] 3.4.2) If fall into If the pixel ratio is greater than 0.5, then let Otherwise ;
[0085] 3.4.3) If Not less than If it is, then it is judged as a true moldy fluorescent spot, and... Otherwise, it will be judged as false fluorescence and suppressed;
[0086] 3.5) Order ;
[0087] 3.6) Cascade discrimination: If Not less than ,but = moldy grains; otherwise if Not less than ,but =Moldy grains; otherwise =Normal grains;
[0088] 3.7) If =Moldy grains, then according to Classify the mold risk level and trigger the corresponding pneumatic nozzle to remove it; otherwise, update the reference color and reference brightness according to the normal particle sliding.
[0089] 4) Statistics { The percentage of moldy grains in a batch is used to determine the batch mold rate; output the percentage of moldy grains in each batch. And batch mold rate.
[0090] In an exemplary application of a batch of peanuts, this method is compared with existing methods.
[0091] The pure visible light machine vision method has a false detection rate of about 15% for invisible contaminant particles with normal appearance, and some normal particles are mistakenly rejected due to appearance defects; the naive ultraviolet fluorescence method has a false detection rate of about 20% for normal particles due to false fluorescence of exposed kernels; although the hyperspectral imaging method has a higher detection rate, the cost of a single device is high and the processing speed is low, which is not conducive to online particle-by-particle screening.
[0092] After adopting this method, the false detection rate of hidden contaminated grains was reduced to about 3%, and the false detection rate of normal grains with exposed kernels was reduced to about 4%. After removing peanuts that were judged to be moldy, the aflatoxin B1 content of this batch was reduced from about 22 micrograms per kilogram to about 2 micrograms per kilogram, and the workload of manual verification was significantly reduced.
[0093] Example 2
[0094] This embodiment provides an image analysis-based peanut moldy grain screening system to implement the method of Embodiment 1. For example... Figure 2 As shown, the system includes an image acquisition module, an image preprocessing and segmentation module, a feature extraction module, a fluorescence false positive suppression module, a mold discrimination module, and a sorting execution module, which are connected in sequence.
[0095] The image acquisition module includes a visible diffuse light source, an ultraviolet light source with a center wavelength of 365 nm, an image sensor, and a conveying device for carrying peanut kernels. The conveying device delivers a single layer of flat and separated peanut kernels to the acquisition station. The visible diffuse light source and the ultraviolet light source are lit in a time-sharing manner. The image sensor acquires spatially registered visible light images and ultraviolet-excited fluorescence images in a time-sharing manner, or the images are acquired synchronously by two spatially registered image sensors. The acquired dual-modal images are output to the image preprocessing and segmentation module.
[0096] The image preprocessing and segmentation module is connected to the image acquisition module and is used to perform white balance correction and noise reduction on the image, and to segment the image region corresponding to each peanut kernel based on the foreground and background color differences, morphological processing and watershed transformation. The output is sent to the feature extraction module.
[0097] The feature extraction module is connected to the image preprocessing and segmentation module, and is used to: extract features from the visible light image based on the color difference between the reddish-brown seed coat and the light yellow cotyledon. Divide the region into seed coat region and kernel exposed region, and obtain the pixel set of kernel exposed region. , and according to Extract visible mold coverage; extract the UV-excited fluorescence image by hue-saturation-brightness space according to hue range [ , [and fluorescence brightness threshold] The system identifies bright yellow-green fluorescent pixels and aggregates them into fluorescent spots; the extracted features are then output to the fluorescence false positive suppression module.
[0098] The fluorescence false positive suppression module is connected to the feature extraction module and is used to perform fluorescence spot suppression according to the feature extraction module. Calculate the local fluorescence contrast and determine the location of the fluorescent spot within the exposed kernel area. The proportion determines the tissue type, and a contrast threshold is applied to those located in the seed coat region. Apply a higher contrast threshold to those located in the exposed area. Spots with a contrast not less than the corresponding threshold are identified as true mold fluorescent spots and retained, while the rest are identified as false fluorescence spots and suppressed; the retention results are output to the mold discrimination module.
[0099] The mold detection module is connected to the fluorescence false positive suppression module, and is used to calculate the sum of the areas of the retained true mold fluorescent spots according to... Calculate the effective fluorescence percentage and combine it with the visible mold coverage. According to the cascading discrimination rule—discriminate first. Is it not less than the fluorescence risk threshold? Retrial Is it not less than the visible mold threshold? — Determine whether each peanut kernel is moldy, and classify the moldy kernels according to the effective fluorescence ratio; output the determination results to the sorting execution module.
[0100] The sorting execution module is connected to the mold detection module and includes a pneumatic nozzle array located downstream of the image acquisition position. This array controls the movement of the pneumatic nozzles corresponding to the location of the moldy particles based on the detection result, blowing the peanuts identified as moldy particles away from the main feed stream. Each of these modules can be implemented using an industrial camera, an ultraviolet light source, an image processor, a programmable logic controller, and corresponding software modules.
[0101] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for screening moldy peanut kernels based on image analysis, characterized in that, Includes the following steps: Step S1: Collect visible light images and ultraviolet-excited fluorescence images of multiple peanut kernels on the bearing surface, and spatially register the visible light images and ultraviolet-excited fluorescence images. Step S2: Preprocess the visible light image and segment the image region corresponding to each peanut kernel; Step S3: For each peanut kernel image area, the seed coat area and exposed kernel area are identified by visible light image and visible mold features are extracted; the bright yellow-green fluorescent area is identified by ultraviolet excitation fluorescence image. Step S4: The identified bright yellow-green fluorescent areas are distinguished as genuine or false, suppressing false fluorescence generated by the reflection of exposed kernels and retaining genuine moldy fluorescence generated by mold; the exposed kernels refer to the cotyledons of peanut kernels that are exposed due to the shedding or damage of the seed coat; Step S5: Based on the retained true mold fluorescence and the visible mold characteristics, determine whether the peanut kernel is moldy. Step S6: Output the discrimination results of each peanut kernel, and drive the sorting mechanism to remove peanuts that are judged to be moldy from the main material flow based on the discrimination results.
2. The method according to claim 1, characterized in that, In step S1, multiple peanut kernels are laid out in a single layer and separated from each other on the support surface; when acquiring visible light images, a visible diffuse light source is used for uniform illumination, and when acquiring ultraviolet-excited fluorescence images, an ultraviolet light source with a center wavelength of 365 nanometers is used for excitation, and a visible fluorescence image is acquired through a filter that cuts off the ultraviolet band. The visible light image and the ultraviolet-excited fluorescence image are acquired synchronously by two spatially registered image sensors.
3. The method according to claim 2, characterized in that, In step S2, the segmentation includes: separating the peanut kernel region from the background based on the color difference between the foreground and the background, and then separating the peanut kernels that are stuck together through morphological processing and watershed transformation.
4. The method according to claim 3, characterized in that, In step S3, the image region of a single peanut kernel is denoted as... Based on the color difference between the reddish-brown peanut seed coat and the light yellow of the exposed cotyledons, The region is divided into a seed coat region and a kernel exposed region, where the pixel set of the kernel exposed region is denoted as... Calculate the kernel ratio : In the formula and These represent the number of pixels in the exposed kernel area and the entire peanut kernel image area, respectively.
5. The method according to claim 4, characterized in that, In step S3, identifying bright yellow-green fluorescent regions from the ultraviolet-excited fluorescence image includes: converting the fluorescence image to a hue-saturation-brightness color space, and selecting regions with hues in the yellow-green hue range. , And the brightness is not lower than the fluorescence brightness threshold. The pixels are identified as fluorescent pixels, forming a fluorescent pixel set. Then Interconnected fluorescent pixels aggregate into several fluorescent spots; the lower limit of the hue range Take 60 degrees, upper limit Set the fluorescence brightness threshold to 120 degrees. Set the normalized brightness to 0.
5.
6. The method according to claim 5, characterized in that, In step S4, the local fluorescence contrast is calculated for each fluorescent spot. : In the formula The average brightness of the pixels within the fluorescent spot. The area surrounding the fluorescent spot, located within the same peanut kernel image region. The average brightness of the pixels in the ring-shaped neighborhood within the area; Based on the fluorescent spots falling into the Lu Ren area The pixel ratio determines the tissue type to which it belongs, and an appropriate contrast threshold is applied: Fluorescent spots located in the seed coat region have a contrast threshold of 1.5; fluorescent spots located in the kernel region have a contrast threshold of 2.
5. When the local fluorescence contrast of a fluorescent spot is not less than its corresponding contrast threshold, it is judged as a true moldy fluorescent spot and is retained; otherwise, it is judged as a false fluorescence of the kernel and is suppressed and not included in subsequent discrimination.
7. The method according to claim 6, characterized in that, In step S5, the sum of the areas of all retained true fungal fluorescent spots is recorded as... Calculate the effective fluorescence percentage : ; The visible mold characteristics include the degree of visible mold coverage. : In the formula The peanut kernel image region The set of pixels whose CIELab color difference from the normal peanut reference color is not less than the color difference threshold of 6.
8. The method according to claim 7, characterized in that, In step S5, when the effective fluorescence percentage Not less than the fluorescence risk threshold If the mold growth is visible, it is considered moldy grain; otherwise, if the visible mold coverage is... Not less than the visible mold threshold If the condition is met, the grain is classified as moldy; otherwise, it is classified as normal. The fluorescence risk threshold is... Taking 0.02, the mold growth threshold can be seen. A value of 0.10 is used, meaning that the determination is based primarily on the effective fluorescence ratio, in order to detect peanut kernels that appear normal but are contaminated.
9. The method according to claim 8, characterized in that, In step S6, the sorting mechanism includes a pneumatic nozzle array located downstream of the image acquisition position. Based on the discrimination result, the pneumatic nozzles corresponding to the positions of the moldy particles are controlled to blow the moldy particles away from the main material flow.
10. A peanut moldy grain screening system based on image analysis, used to implement the method according to any one of claims 1 to 9, characterized in that, The system includes an image acquisition module, an image preprocessing and segmentation module, a feature extraction module, a fluorescence false positive suppression module, a mold detection module, and a sorting execution module; The image acquisition module includes a visible diffuse light source, an ultraviolet light source with a center wavelength of 365 nanometers, an image sensor, and a conveying device that carries peanut kernels, used to acquire spatially registered visible light images and ultraviolet-excited fluorescence images. The image preprocessing and segmentation module is connected to the image acquisition module and is used to preprocess the image and segment the image region corresponding to each peanut kernel. The feature extraction module is connected to the image preprocessing and segmentation module, and is used to identify the seed coat area and exposed kernel area of each peanut kernel from the visible light image and extract the visible mold coverage, and to identify bright yellow-green fluorescent spots from the ultraviolet-excited fluorescence image. The fluorescence false positive suppression module is connected to the feature extraction module and is used to calculate the local fluorescence contrast of each fluorescent spot and apply a corresponding contrast threshold according to the tissue type where the fluorescent spot is located, so as to suppress false fluorescence of lenticels and retain true fungal fluorescent spots. The mold discrimination module is connected to the fluorescence false positive suppression module. It is used to calculate the effective fluorescence ratio based on the retained true mold fluorescent spots, and combined with the visible mold coverage, to determine whether each peanut kernel is a moldy kernel according to the cascade discrimination rules. The sorting execution module is connected to the mold discrimination module and is used to drive the sorting mechanism to remove peanuts that are determined to be moldy from the main material flow based on the discrimination result.
