Seed lesion grain identification method and seed screening system

By combining foreground perception fusion and channel differentiation enhancement technology with dual-stream feature coupling, the problems of uneven illumination and background interference in seed lesion identification are solved, enabling precise localization of lesion areas and scientific judgment of health status, thus improving identification accuracy and screening efficiency.

CN121962785AInactive Publication Date: 2026-05-01SHAANXI LONGFENG SEED CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHAANXI LONGFENG SEED CO LTD
Filing Date
2026-04-03
Publication Date
2026-05-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing seed lesion identification methods suffer from uneven illumination and background clutter interference in the image preprocessing stage, resulting in incomplete separation of the foreground and background, insufficient consistency and clarity of standardized images, affecting the effectiveness of feature extraction, and failing to fully integrate microscopic and macroscopic visual features, leading to blurred lesion area positioning, inaccurate boundary delineation, and large errors in health status judgment.

Method used

By employing foreground-aware fusion technology for binarization and homomorphic filtering, combined with channel differentiation enhancement and dual-stream feature coupling, the co-occurrence anomalies of texture and spectral features are accurately captured, lesion areas are located and morphological closure is performed, and the health status of seeds is scientifically determined.

Benefits of technology

It significantly improves the accuracy and efficiency of seed disease identification, ensures the reliability of screening results, and provides an efficient and feasible seed screening solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962785A_ABST
    Figure CN121962785A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses a seed lesion grain recognition method and a seed screening system.The method comprises the steps that foreground perception fusion is carried out on seed sample images to obtain standardized images, and channel differentiation enhancement is carried out to obtain enhanced images; analyzing microcosmic and macroscopic visual features and carrying out double-flow coupling to obtain comprehensive feature expression; positioning a lesion area of the seed according to collaborative abnormal performance of texture features and spectral features in the comprehensive feature expression, and performing morphological closing on the lesion area to obtain a lesion area boundary; according to the morphological characteristics and the coverage range of the lesion area boundary, visual mode discrimination is carried out on the health state of the seeds to obtain a recognition conclusion; sending a state identifier in the identification conclusion to a sorting execution terminal to complete seed screening; according to the invention, the seed lesion particle identification efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Seed disease identification method and seed screening system Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method for identifying diseased seeds and a seed screening system. Background Technology

[0002] Existing seed lesion identification methods have significant shortcomings in the image preprocessing stage. They are unable to effectively overcome interference factors such as uneven illumination and background clutter, resulting in incomplete separation of the foreground and background. The consistency and clarity of standardized images are insufficient, which directly affects the effectiveness of subsequent feature extraction. This makes lesion-related features easily masked by redundant information, leading to poor stability of the identification results.

[0003] In terms of feature processing and lesion identification, existing technologies mostly rely on single-dimensional feature analysis, failing to fully integrate the complementary information of microscopic and macroscopic visual features. They are not accurate enough in capturing the synergistic abnormal manifestations of texture and spectral features, resulting in fuzzy lesion area localization, inaccurate boundary delineation, and a lack of scientific and systematic basis for assessing lesion morphology and coverage. Ultimately, this leads to large errors in health status identification and screening efficiency that cannot meet the needs of practical applications. Therefore, how to improve the efficiency of seed lesion identification and screening has become an urgent problem to be solved. Summary of the Invention

[0004] This invention provides a method for identifying diseased seeds and a seed screening system to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides a method for identifying diseased seeds, comprising:

[0006] S1. Obtain a sample image of the seed and perform foreground-aware fusion on the sample image to obtain a standardized image of the seed;

[0007] S2. Perform channel differentiation enhancement on the standardized image to obtain the enhanced image of the seed;

[0008] S3. Extract microscopic and macroscopic visual features from the enhanced image, and couple the microscopic and macroscopic visual features in a dual-stream manner to obtain the comprehensive feature representation of the seed.

[0009] S4. Based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, locate the lesion area of ​​the seed, and morphologically close the lesion area to obtain the boundary of the lesion area of ​​the seed.

[0010] S5. Based on the morphological characteristics and coverage of the lesion area boundary, the health status of the seed is visually pattern-based to obtain the seed identification conclusion.

[0011] S6. Send the status identifier in the identification conclusion to the sorting execution terminal to complete the seed screening.

[0012] In a preferred embodiment, acquiring a sample image of the seed and performing foreground-aware fusion on the sample image to obtain a standardized image of the seed includes:

[0013] A sample image of the seed is obtained, and the sample image is binarized to obtain the foreground region mask and background region mask of the seed.

[0014] Based on the foreground region mask, the foreground pixel set in the sample image is extracted, and the foreground pixel set is homomorphically filtered to obtain the uniformly illuminated foreground image of the seed.

[0015] The uniformly illuminated foreground image is fused with the background pixels indicated by the background region mask at the pixel level to obtain the intermediate fused image of the seed.

[0016] An affine transformation is performed on the intermediate fused image to obtain the standardized image of the seed.

[0017] In a preferred embodiment, the step of performing channel differential enhancement on the standardized image to obtain the enhanced image of the seed includes:

[0018] Multi-scale edge detection is performed on the standardized image to obtain the edge density map of the standardized image;

[0019] Based on the density values ​​of the regions in the edge density map, the color channels of the standardized image are dynamically weighted to obtain the differential weight coefficients of the color channels.

[0020] Based on the differential weighting coefficient, the pixel values ​​of the color channel are subjected to contrast stretching;

[0021] Visual perception optimization is performed on the stretched color channels to obtain an enhanced image of the seed.

[0022] In a preferred embodiment, the differential weighting coefficient is calculated using the following formula:

[0023] ;

[0024] In the formula, For color channels Differential weighting coefficients, The total number of color channels in the standardized image. For summation index variables, Edge density map At pixel position Density value at that location, For color channels pixel matrix At pixel position The gradient vector at that point, For color channels pixel matrix At pixel position The gradient vector at that point, It is a very small positive number. This is the absolute value operator.

[0025] In a preferred embodiment, the step of parsing microscopic and macroscopic visual features from the enhanced image, and coupling the microscopic and macroscopic visual features in a two-stream configuration to obtain the comprehensive feature representation of the seed, includes:

[0026] Gaussian pyramids are constructed on the enhanced image to obtain the image pyramid of the enhanced image;

[0027] Global geometric features are extracted from the image pyramid and used as the macroscopic visual feature stream of the enhanced image;

[0028] High-frequency emphasis filtering is applied to the enhanced image to obtain a detail enhancement map of the enhanced image;

[0029] Texture spectrum analysis is performed on the enhanced detail map to obtain the microscopic visual feature flow of the enhanced image;

[0030] The macroscopic visual feature stream and the microscopic visual feature stream are subjected to cross-scale feature interaction to obtain the intermediate feature pair of the enhanced image;

[0031] Gated fusion is performed on the intermediate feature pairs to obtain the comprehensive feature representation of the seed.

[0032] In a preferred embodiment, the step of performing cross-scale feature interaction between the macroscopic visual feature stream and the microscopic visual feature stream to obtain intermediate feature pairs of the enhanced image includes:

[0033] Based on the spatial resolution of the microscopic visual feature stream, super-resolution reconstruction is performed on the macroscopic visual feature stream to obtain the macroscopic upsampled feature stream of the enhanced image;

[0034] The macroscopic upsampled feature stream and the microscopic visual feature stream are multiplied element-wise to obtain the feature interaction weight map of the enhanced image;

[0035] Based on the feature interaction weight map, feature modulation is performed on the macroscopic upsampled feature stream and the microscopic visual feature stream to obtain the modulated macroscopic feature stream and the modulated microscopic feature stream of the enhanced image;

[0036] The modulated macroscopic feature stream and the modulated microscopic feature stream are aggregated into an intermediate feature pair for the enhanced image.

[0037] In a preferred embodiment, the step of locating the lesion region of the seed based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and morphologically closing the lesion region to obtain the boundary of the lesion region of the seed, includes:

[0038] The texture features and spectral features in the comprehensive feature representation are subjected to spectral residual analysis to construct the texture anomaly response map and spectral anomaly response map of the seed.

[0039] The texture anomaly response map and the spectral anomaly response map are fused in a multi-dimensional anomaly response to obtain the lesion region probability map of the seed.

[0040] Adaptive threshold segmentation is performed on the probability map of the lesion region to obtain the lesion region label of the seed;

[0041] Using the lesion area as a seed point, region growth iteration is performed under the guidance of the texture anomaly response map and the spectral anomaly response map to obtain a fine lesion area mask of the seed.

[0042] The edges of the fine lesion area mask are refined to obtain the lesion area boundary of the seed.

[0043] In a preferred embodiment, the step of fusing the texture anomaly response map and the spectral anomaly response map into a multi-dimensional anomaly response to obtain the lesion region probability map of the seed includes:

[0044] The texture anomaly response map and the spectral anomaly response map are affine registered to obtain the registered anomaly response map pair of the seed.

[0045] The texture and spectral anomaly response on the pixels in the registered anomaly response map are correlated and mapped to obtain the spatial consistency weight map of the seed.

[0046] Based on the spatial consistency weight map, attention-weighted aggregation is performed on the registered abnormal response map pairs to obtain the fused response map of the seed;

[0047] A nonlinear transformation is performed on the fusion response map to obtain the lesion region probability map of the seed.

[0048] In a preferred embodiment, the step of visually pattern-based identification of the seed's health status based on the morphological characteristics and coverage of the lesion region boundary to obtain the seed identification conclusion includes:

[0049] The curvature scale space of the lesion region boundary is analyzed to obtain the curvature change spectrum and geometric complexity information of the lesion region boundary.

[0050] The relative coverage description of the seed is obtained by extracting the regional topological relationship between the coverage area of ​​the lesion region boundary and the overall contour of the standardized image.

[0051] The curvature variation spectrum, the geometric complexity information, and the relative coverage description are integrated into the visual pattern discrimination criteria for the seed;

[0052] Based on the aforementioned visual pattern discrimination criteria, the typical morphological pattern and coverage level of the lesion area boundary are simultaneously evaluated;

[0053] The membership degree of the synchronous evaluation results is determined to obtain the health status category of the seed.

[0054] The seed identification conclusion is generated based on the spatial distribution of the health status category and the boundary of the lesion area in the standardized image.

[0055] To address the above problems, the present invention also provides a seed screening system, the system comprising:

[0056] The image normalization module is used to acquire sample images of the seed and perform foreground-aware fusion on the sample images to obtain a standardized image of the seed.

[0057] The feature enhancement module is used to perform channel differentiation enhancement on the standardized image to obtain the enhanced image of the seed;

[0058] The feature fusion module is used to parse microscopic visual features and macroscopic visual features from the enhanced image, and to couple the microscopic visual features and macroscopic visual features in a two-stream manner to obtain the comprehensive feature expression of the seed.

[0059] The lesion localization module is used to locate the lesion region of the seed based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and to perform morphological closure on the lesion region to obtain the boundary of the lesion region of the seed.

[0060] The health assessment module is used to visually assess the health status of the seed based on the morphological features and coverage of the lesion area boundary, and to obtain the seed identification conclusion.

[0061] The decision execution module is used to send the status identifier in the identification conclusion to the sorting execution terminal to complete the screening of the seeds.

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] 1. This invention utilizes foreground-aware fusion technology to binarize, homomorphically filter, and affine transform seed sample images, effectively eliminating uneven illumination and background interference to obtain standardized images with strong consistency and high clarity, providing reliable data support for subsequent feature extraction. Simultaneously, based on the edge density map, color channel weights are dynamically allocated, combined with a channel differentiation enhancement strategy that combines contrast stretching and visual perception optimization to strengthen the identification of lesion-related features, making subtle lesion information easier to capture.

[0064] 2. This invention deeply integrates microscopic and macroscopic visual features through dual-stream feature coupling technology to construct a comprehensive feature representation, accurately capturing the synergistic anomalies of texture and spectral features. Combining spectral residual analysis and region growth iteration, it achieves precise localization and boundary refinement of diseased areas. Furthermore, curvature-scale spatial analysis and relative coverage analysis scientifically determine the seed health status. The entire technical process is highly efficient, significantly improving the accuracy and efficiency of seed disease identification, ensuring the reliability of screening results, and providing an efficient and feasible technical solution for seed screening. Attached Figure Description

[0065] Figure 1 is a schematic flowchart of a seed lesion identification method provided in an embodiment of the present invention;

[0066] Figure 2 is a functional block diagram of a seed screening system provided in an embodiment of the present invention;

[0067] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0068] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0069] This application provides a method for identifying seed lesions. The execution subject of the seed lesion identification method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the seed lesion identification method can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0070] Referring to Figure 1, a flowchart illustrating a seed lesion identification method according to an embodiment of the present invention is shown. In this embodiment, the seed lesion identification method includes:

[0071] S1. Obtain a sample image of the seed and perform foreground-aware fusion on the sample image to obtain a standardized image of the seed;

[0072] In this embodiment of the invention, acquiring a sample image of the seed and performing foreground-aware fusion on the sample image to obtain a standardized image of the seed includes:

[0073] A sample image of the seed is obtained, and the sample image is binarized to obtain the foreground region mask and background region mask of the seed.

[0074] Based on the foreground region mask, the foreground pixel set in the sample image is extracted, and the foreground pixel set is homomorphically filtered to obtain the uniformly illuminated foreground image of the seed.

[0075] The uniformly illuminated foreground image is fused with the background pixels indicated by the background region mask at the pixel level to obtain the intermediate fused image of the seed.

[0076] An affine transformation is performed on the intermediate fused image to obtain the standardized image of the seed.

[0077] After converting the seed sample image to grayscale, a grayscale threshold of 128 is set. The grayscale value of each pixel in the sample image is compared with this threshold one by one. Pixels with a grayscale value greater than 128 are identified as seed-related foreground pixels, and the value of the corresponding pixel in the generated foreground region mask is set to 255. Pixels with a grayscale value less than or equal to 128 are identified as irrelevant background pixels, and the value of the corresponding pixel in the generated background region mask is set to 0. Finally, the foreground region mask and background region mask of the seed are obtained.

[0078] Based on the pixel position with a value of 255 in the foreground region mask, all corresponding pixels are extracted from the sample image to form a complete foreground pixel set. For the image presented by this foreground pixel set, the illumination component and reflection component of the image are separated, the low-frequency part representing the illumination change is suppressed, and the high-frequency part representing the texture details of the seed itself is preserved, thereby offsetting the influence of the difference in illumination intensity in different regions, and finally obtaining a uniformly illuminated foreground image with consistent brightness distribution.

[0079] Using the pixel positions with a value of 0 in the background region mask as a guide, the specific positions of all background pixels in the sample image are determined. The color and texture information of each foreground pixel in the uniformly illuminated foreground image are matched and combined pixel by pixel with the information of the background pixels at the corresponding positions indicated by the background region mask. That is, the foreground region retains the pixel information of the uniformly illuminated foreground image, and the background region retains the background pixel information of the original sample image. Through this pixel-level precise combination, the intermediate fused image of the seed is obtained.

[0080] Fixed parameters for the standardized image are preset, including an image resolution of 640×480 pixels, seed center coordinates of (320,240), seed major axis parallel to the horizontal direction of the image, and seed size uniformly 100×100 pixels. The intermediate fused image is translated to move the seed center to the preset coordinates, scaled to adjust the seed size to a fixed size, rotated to correct the seed major axis direction, and cropped to remove excess parts of the image edges, finally obtaining a standardized image that conforms to the unified standard.

[0081] The beneficial effects are that by setting clear thresholds and using precise pixel processing, the seed foreground and background can be effectively separated, eliminating interference caused by uneven lighting. At the same time, the seed images are unified into a standardized format with fixed pose, size and center position, ensuring that the standardized images have clear and consistent image quality. This provides a reliable and unified data foundation for subsequent steps such as channel differentiation enhancement and feature extraction, ensuring the stability and accuracy of the entire recognition process.

[0082] S2. Perform channel differentiation enhancement on the standardized image to obtain the enhanced image of the seed;

[0083] In this embodiment of the invention, the step of performing channel differential enhancement on the standardized image to obtain the enhanced image of the seed includes:

[0084] Multi-scale edge detection is performed on the standardized image to obtain the edge density map of the standardized image;

[0085] Based on the density values ​​of the regions in the edge density map, the color channels of the standardized image are dynamically weighted to obtain the differential weight coefficients of the color channels.

[0086] Based on the differential weighting coefficient, the pixel values ​​of the color channel are subjected to contrast stretching;

[0087] Visual perception optimization is performed on the stretched color channels to obtain an enhanced image of the seed.

[0088] The formula for calculating the differential weighting coefficient is as follows:

[0089] ;

[0090] In the formula, For color channels Differential weighting coefficients, The total number of color channels in the standardized image. For summation index variables, Edge density map At pixel position Density value at that location, For color channels pixel matrix At pixel position The gradient vector at that point, For color channels pixel matrix At pixel position The gradient vector at that point, It is a very small positive number. This is the absolute value operator.

[0091] Multi-scale edge detection is performed on the standardized image. Three fixed detection scales are set with window sizes of 3×3, 5×5, and 7×7. Starting from the top left corner pixel of the image, the detection is moved sequentially to the right and down. The image is completely scanned pixel by pixel using the three windows. Within each window, the gray values ​​of the center pixel are compared with those of its eight neighboring pixels. The absolute difference between the gray values ​​of the center pixel and each neighboring pixel is calculated. If the absolute difference between the gray values ​​of any neighboring pixel and the center pixel is greater than a preset gray value threshold of 15, the center pixel is determined to be an edge pixel. The number of times each pixel is determined to be an edge pixel in the 3×3, 5×5, and 7×7 windows is counted. This number is the density value of the pixel position. The density values ​​of all pixels are arranged in order according to their corresponding pixel positions to form the edge density map of the standardized image. A three-scale window of 3×3, 5×5, and 7×7 is used. The logic is to cover full-scale features of fine lesion edges, medium lesion contours, and overall seed edges, so as to avoid missing lesion edges of different sizes. A grayscale threshold of 15 is used to distinguish lesion edges from normal texture noise to prevent misjudgment. The density value is directly adopted from the number of edge judgments, which can intuitively quantify the richness of pixel edges. The higher the edge density, the more likely the area is to be a seed lesion detail area, providing an accurate edge feature basis for subsequent channel weight allocation.

[0092] For the R, G, and B color channels of a standardized image, first iterate through all pixels in the edge density map, summing the density values ​​of each pixel to obtain the total density value of all pixels. Then, process each color channel one by one. For each pixel in the current processing channel, compare the gray values ​​of the pixel with the pixel directly above it and calculate the absolute difference; compare the gray values ​​of the pixel with the pixel directly below it and calculate the absolute difference; compare the gray values ​​of the pixel with the pixel directly to its left and calculate the absolute difference; compare the gray values ​​of the pixel with the pixel directly to its right and calculate the absolute difference. Then, sum these four values... The gradient intensity of a pixel is obtained by summing the absolute differences in its grayscale values. Then, all pixel positions within the channel are traversed, and the density value of each pixel position is multiplied by its corresponding gradient intensity. All these products are then summed to obtain the sum of the products for that channel. The sums of the products for the R, G, and B channels are calculated separately, and then summed again with a 0.0001 increment to avoid a zero result, resulting in a total denominator. The sum of the products for each channel is then divided by this total denominator to obtain the differential weight coefficient for each color channel. The total weight coefficients for the three channels are 1. This step uses the logic of accumulating "edge density × gradient intensity" to quantify the total contribution of a single channel's lesion features. Edge density focuses on the lesion region, and gradient intensity characterizes the grayscale abrupt changes in the lesion; multiplying the two strengthens the weight of lesion features. The denominator is normalized across all channels to ensure that the total weight of each channel is 1, achieving fairness and standardization in weight allocation, allowing channels with prominent lesion features to receive higher weights.

[0093] The differential weighting coefficient can be calculated using the corresponding formula. The value of B is 3. This value is determined by the color mode of the standardized image. The standardized image is obtained by foreground-aware fusion. The sample image acquired using the RGB color mode will form three color channels, R, G, and B, after foreground-aware fusion. Therefore, B is determined to be 3.

[0094] That is, the pixel position in the edge density map The density value is obtained by counting the number of times the pixel is identified as an edge pixel in three windows (3×3, 5×5, and 7×7) during multi-scale edge detection. This count is directly used as the density value at that location. Parameters The edge density of a pixel location is represented by the edge detection count as the density value setting logic, which directly quantifies the edge richness of the region. The more edge counts, the more significant the lesion details. This item is used to focus on high-frequency edge regions of lesions, filter out invalid information in flat background regions, and improve the sensitivity of weight allocation to lesion regions.

[0095] It is a color channel Pixel matrix at pixel position The gradient vector is formed by combining the absolute differences in grayscale values ​​between the pixel at that position and its four adjacent pixels (directly above, below, to the left, and to the right) in the order of above, below, left, and right. The acquisition method and Completely identical, k is the summation index variable used to iterate through the three color channels R, G, and B in turn, obtaining the pixel position of each channel. The gradient vector. , The setting logic of constructing a vector using the gray-level difference of four neighboring pixels represents the intensity of gray-level change of the corresponding channel pixels. This logic accurately extracts the gray-level mutation features caused by lesions. The greater the gray-level change, the more significant the lesion abnormality. k is used as the traversal index. The setting logic is to achieve unified accumulation of gradient features across all channels to ensure standardized calculation. The absolute value operation is used to eliminate gradient direction interference and retain only the core feature information of the lesion.

[0096] The value is 0.0001. This value is set based on the conventional engineering experience in the field of image processing to avoid the denominator calculation result being zero. Its value is much smaller than the possible range of the sum of the products of the three channels, so it will not have a substantial impact on the calculation result of the weight coefficient. At the same time, it can ensure that the denominator is always positive and avoid calculation abnormalities.

[0097] The core function of this formula is to dynamically assign differentiated weight coefficients to the three color channels. During the calculation, it combines the image edge distribution reflected by the edge density map with the intensity of grayscale changes in each color channel. Pixels in areas with high edge density contribute more to the weight allocation, and channels with strong grayscale changes have a greater advantage in weight allocation. Ultimately, channels with high edge density and significant grayscale changes receive higher weights, while channels with low edge density and gradual grayscale changes receive lower weights. This provides a scientifically reasonable weighting basis for subsequent contrast stretching of color channel pixel values. The formula uses the ratio of "single-channel feature contribution / total feature contribution of all channels," and its logic is to directly convert the contribution of lesion features into channel weights. In principle, this achieves "the more prominent the lesion feature, the higher the channel weight," specifically strengthening the identification of lesion features and solving the problem that traditional uniform channel weighting cannot focus on lesions.

[0098] Contrast stretching is performed on the R, G, and B color channels respectively. For the current processing channel, all pixels in the channel are traversed and the minimum and maximum pixel values ​​are recorded. The range of stretched pixel values ​​is set to 0 to 255. For the original value of each pixel in the channel, the minimum pixel value of the channel is subtracted from the original value to obtain the difference. The stretching coefficient is obtained by dividing 255 by the difference between the maximum and minimum pixel values ​​of the channel. The aforementioned difference is multiplied by the stretching coefficient to obtain the stretching base value. Then, the stretching base value is multiplied by the differential weight coefficient of the channel to obtain the final stretched pixel value of the pixel. After processing all pixels of the channel in the above manner, the stretched image of the color channel is obtained. The processing of the R, G, and B channels is performed in sequence to obtain the stretched images of the three color channels respectively.

[0099] Visual perception optimization is performed on the stretched R, G, and B color channels. First, for each channel, all pixels in that channel are traversed, and the brightness values ​​of all pixels are summed. This sum is then divided by the total number of pixels in that channel to obtain the average brightness value for that channel. A target average brightness of 128 is set. When the average brightness value of a channel is higher than 128, the ratio of 128 to the average brightness value of that channel is calculated. The brightness values ​​of all pixels in that channel are then multiplied by this ratio to proportionally reduce the brightness values ​​of all pixels in that channel. Conversely, when the average brightness value of a channel is lower than 128, the ratio of 128 to the average brightness value of that channel is also calculated. The brightness values ​​of all pixels in that channel are then multiplied by this ratio to proportionally increase the brightness values ​​of all pixels in that channel. The brightness value of each pixel is calculated. Simultaneously, for each pixel in the image, the stretched values ​​of its R, G, and B channels are extracted. The differences between the R and G channel values, the R and B channel values, and the G and B channel values ​​are calculated respectively. If the absolute value of any set of differences exceeds 80, the proportion of the excess value to the total difference is calculated. The value of the larger or smaller channel among the two channels with the larger difference is adjusted according to this proportion, so that the absolute value of the difference between the two sets of values ​​is controlled within 80. After adjusting all pixels, the optimized pixel information of the R, G, and B color channels is recombine according to the corresponding pixel positions to obtain the seed enhanced image.

[0100] The beneficial effects are as follows: by using three clearly defined fixed-scale detection windows, a grayscale threshold of 15, and a clear logic of pixel-by-pixel scanning and difference calculation, the density information of each pixel is accurately obtained to form an edge density map. Combined with formulas, the color channel weights are scientifically allocated, allowing channels with more prominent lesion-related features to receive reasonable weights. Furthermore, by statistically analyzing extreme values ​​for each channel, fixing the stretching range, combining weights with contrast stretching methods, and adjusting brightness based on a target brightness of 128 and color balance adjustment based on an 80 difference threshold, key features related to seed lesions are specifically enhanced while ensuring the overall brightness uniformity and color coordination of the image. This results in enhanced images with clear detail presentation and distinct feature differentiation, providing high-quality and reliable data support for the accurate analysis of subsequent microscopic and macroscopic visual features, effectively ensuring the accuracy and stability of the subsequent recognition process.

[0101] S3. Extract microscopic and macroscopic visual features from the enhanced image, and couple the microscopic and macroscopic visual features in a dual-stream manner to obtain the comprehensive feature representation of the seed.

[0102] In this embodiment of the invention, the step of parsing microscopic and macroscopic visual features from the enhanced image, and coupling the microscopic and macroscopic visual features in a two-stream configuration to obtain the comprehensive feature representation of the seed, includes:

[0103] Gaussian pyramids are constructed on the enhanced image to obtain the image pyramid of the enhanced image;

[0104] Global geometric features are extracted from the image pyramid and used as the macroscopic visual feature stream of the enhanced image;

[0105] High-frequency emphasis filtering is applied to the enhanced image to obtain a detail enhancement map of the enhanced image;

[0106] Texture spectrum analysis is performed on the enhanced detail map to obtain the microscopic visual feature flow of the enhanced image;

[0107] The macroscopic visual feature stream and the microscopic visual feature stream are subjected to cross-scale feature interaction to obtain the intermediate feature pair of the enhanced image;

[0108] Gated fusion is performed on the intermediate feature pairs to obtain the comprehensive feature representation of the seed.

[0109] The step of performing cross-scale feature interaction between the macroscopic visual feature stream and the microscopic visual feature stream to obtain intermediate feature pairs of the enhanced image includes:

[0110] Based on the spatial resolution of the microscopic visual feature stream, super-resolution reconstruction is performed on the macroscopic visual feature stream to obtain the macroscopic upsampled feature stream of the enhanced image;

[0111] The macroscopic upsampled feature stream and the microscopic visual feature stream are multiplied element-wise to obtain the feature interaction weight map of the enhanced image;

[0112] Based on the feature interaction weight map, feature modulation is performed on the macroscopic upsampled feature stream and the microscopic visual feature stream to obtain the modulated macroscopic feature stream and the modulated microscopic feature stream of the enhanced image;

[0113] The modulated macroscopic feature stream and the modulated microscopic feature stream are aggregated into an intermediate feature pair for the enhanced image.

[0114] A Gaussian pyramid is constructed on the enhanced image, with a total of 4 layers. The original enhanced image is used as the first layer of the pyramid. The grayscale value of the first layer image is averaged using a fixed 5×5 window, with each window outputting the grayscale value of one pixel, reducing the width and height of the image to half of the original, thus obtaining the second layer image. The same 5×5 window averaging method is used to process the second and third layers respectively, resulting in the third and fourth layers with a width and height of half that of the previous layer. The images from the first to the fourth layer are stacked in ascending order of layer number to obtain the image pyramid of the enhanced image.

[0115] The algorithm iterates through each layer of the image pyramid, identifies the contour boundaries of the seeds in each layer by scanning pixel by pixel, records the coordinate information of all pixels on the contour boundaries, and calculates the contour perimeter, contour area, major axis length, minor axis length, and center coordinates of the seeds based on the coordinate information. At the same time, it extracts the geometric parameters such as the outer rectangle size and outer circle radius of the seeds in each layer of the image, and integrates these geometric parameters of all layers in order of layer number to form a set of continuous feature sequences. This feature sequence is the macroscopic visual feature flow of the enhanced image.

[0116] The enhanced image is subjected to high-frequency emphasis filtering. First, a 7×7 fixed window is used to perform mean blurring on the enhanced image to obtain a blurred image that retains only low-frequency components. The gray values ​​of the corresponding pixels in the blurred image are subtracted from the gray values ​​of each pixel in the enhanced image to obtain a high-frequency image that contains only high-frequency components. The gray values ​​of each pixel in the high-frequency image are multiplied by a gain coefficient of 1.5. Then, the processed high-frequency image is added to the gray values ​​of the corresponding pixels in the original enhanced image to obtain a detail enhancement image of the enhanced image that highlights detail information.

[0117] Texture spectrum analysis is performed on the detail enhancement image. Eight neighborhood templates are set in eight directions: horizontal to the right, horizontal to the left, vertical to the up, vertical to the down, top left to bottom right, bottom right to top left, top right to bottom left, and bottom left to top right. Each template covers a 3×3 pixel area. Each pixel of the detail enhancement image is traversed. Taking the pixel as the center, the gray value difference between the center pixel and the surrounding eight pixels in each of the eight neighborhood templates is calculated. The occurrence frequency of each gray value difference pattern in the whole image is counted. The occurrence frequency of the difference patterns in the eight directions is arranged in the order of the set directions. The resulting feature set is the microscopic visual feature flow of the enhanced image.

[0118] First, the spatial resolution of the image corresponding to the microscopic visual feature flow is calculated, namely the number of pixels in width and height of the image. Using this resolution as the target, super-resolution reconstruction is performed on the image corresponding to the macroscopic visual feature flow. For each pixel in the macroscopic visual feature flow image, grayscale interpolation is performed between its four neighboring pixels. The grayscale value of the newly added pixel is obtained by weighted averaging of the grayscale values ​​of the neighboring pixels. The weights are distributed according to their distance from the center pixel, with the closer the distance, the greater the weight. By continuously interpolating and supplementing pixels, the number of pixels in width and height of the macroscopic visual feature flow image is made completely consistent with the image corresponding to the microscopic visual feature flow, thus obtaining the macroscopic upsampling feature flow of the enhanced image.

[0119] The macroscopic upsampled feature stream and the microscopic visual feature stream are mapped one-to-one according to pixel position. The feature value of each pixel in the macroscopic upsampled feature stream is multiplied with the feature value of the corresponding pixel in the microscopic visual feature stream. The result of the operation at each position is used as the weight value at that position. The weight values ​​of all positions are arranged in order according to their corresponding pixel positions to form the feature interaction weight map of the enhanced image.

[0120] Feature modulation is performed based on the feature interaction weight map. The weight value at each position in the feature interaction weight map is multiplied by the feature value at the corresponding position in the macroscopic upsampled feature flow to obtain the modulated macroscopic feature value at each position. All modulated macroscopic feature values ​​are arranged in order of position to form the modulated macroscopic feature flow of the enhanced image. In the same way, the weight value at each position in the feature interaction weight map is multiplied by the feature value at the corresponding position in the microscopic visual feature flow to obtain the modulated microscopic feature value at each position. All modulated microscopic feature values ​​are arranged in order of position to form the modulated microscopic feature flow of the enhanced image.

[0121] The modulated macroscopic feature stream and the modulated microscopic feature stream are combined according to pixel position. The modulated macroscopic feature value and the modulated microscopic feature value at each pixel position form a feature element pair. All feature element pairs at all pixel positions are arranged in order of their position in the image and aggregated to form intermediate feature pairs of the enhanced image.

[0122] Gated fusion is performed on intermediate feature pairs. The similarity threshold is set to 0.6. The similarity between the modulated macroscopic feature value and the modulated microscopic feature value in each feature element pair is calculated. The similarity is obtained by dividing the absolute value of the difference between the two by the maximum value of the two. When the similarity is greater than or equal to 0.6, the gating coefficient is set to 0.7. When the similarity is less than 0.6, the gating coefficient is set to 0.3. The gating coefficient is multiplied by the modulated macroscopic feature value, and then (1-gating coefficient) is multiplied by the modulated microscopic feature value. The two results are added together to obtain the fused feature value of the feature element pair. All fused feature values ​​are integrated in positional order to obtain the comprehensive feature expression of the seed.

[0123] The beneficial effects are that by clearly setting parameters such as the number of layers, window size, and gain coefficient, the processing procedures such as Gaussian pyramid construction and high-frequency emphasis filtering are standardized, and macroscopic geometric features and microscopic texture features are accurately extracted. Through steps such as super-resolution reconstruction, element-wise multiplication, feature modulation, and gated fusion, deep coupling of macroscopic and microscopic features is achieved. This makes the comprehensive feature expression include both the overall geometric information of the seed and the subtle texture details, improving the comprehensiveness and accuracy of feature expression. This provides high-quality feature support for subsequent location of lesion areas and determination of health status based on comprehensive features, and ensures the reliability of the recognition process.

[0124] S4. Based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, locate the lesion area of ​​the seed, and morphologically close the lesion area to obtain the boundary of the lesion area of ​​the seed.

[0125] In this embodiment of the invention, the step of locating the lesion region of the seed based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and performing morphological closure on the lesion region to obtain the boundary of the lesion region of the seed, includes:

[0126] The texture features and spectral features in the comprehensive feature representation are subjected to spectral residual analysis to construct the texture anomaly response map and spectral anomaly response map of the seed.

[0127] The texture anomaly response map and the spectral anomaly response map are fused in a multi-dimensional anomaly response to obtain the lesion region probability map of the seed.

[0128] Adaptive threshold segmentation is performed on the probability map of the lesion region to obtain the lesion region label of the seed;

[0129] Using the lesion area as a seed point, region growth iteration is performed under the guidance of the texture anomaly response map and the spectral anomaly response map to obtain a fine lesion area mask of the seed.

[0130] The edges of the fine lesion area mask are refined to obtain the lesion area boundary of the seed.

[0131] The step of fusing the texture anomaly response map and the spectral anomaly response map in a multi-dimensional anomaly response model to obtain the lesion region probability map of the seed includes:

[0132] The texture anomaly response map and the spectral anomaly response map are affine registered to obtain the registered anomaly response map pair of the seed.

[0133] The texture and spectral anomaly response on the pixels in the registered anomaly response map are correlated and mapped to obtain the spatial consistency weight map of the seed.

[0134] Based on the spatial consistency weight map, attention-weighted aggregation is performed on the registered abnormal response map pairs to obtain the fused response map of the seed;

[0135] A nonlinear transformation is performed on the fusion response map to obtain the lesion region probability map of the seed.

[0136] The texture features and spectral features in the comprehensive feature representation are converted into corresponding image data. The texture feature image data is then transformed in the frequency domain, and the mean amplitude of all frequency components in the frequency domain is calculated. The actual amplitude of each frequency component is subtracted from the mean to obtain the texture spectrum residual. The texture spectrum residual is then transformed back into time domain data to obtain the texture anomaly response value of each pixel. The response value benchmark is set to 1.2 times the mean. Pixels with response values ​​higher than the benchmark are marked as texture anomaly candidate points. The texture anomaly response values ​​of all pixels are arranged in order of position to form the texture anomaly response map of the seed. Using the same processing method, the spectral feature image data is transformed in the frequency domain, the spectral residual is calculated, and the time domain is transformed to obtain the spectral anomaly response value of each pixel. The spectral anomaly response map of the seed is generated with 1.2 times the mean amplitude of the spectral feature in the frequency domain as the benchmark.

[0137] Feature points are extracted from both the texture anomaly response map and the spectral anomaly response map. The feature points are selected from the intersections formed by the continuous changes of edge pixels. At least 50 feature points are extracted from each map. The Euclidean distance between each feature point in the texture anomaly response map and each feature point in the spectral anomaly response map is calculated. Feature points with a distance of less than 2 pixels are considered as corresponding point pairs. Based on all corresponding point pairs, three affine transformation parameters, namely translation, rotation angle and scaling ratio, are calculated. The spectral anomaly response map is then translated, rotated and scaled according to these three parameters to make the corresponding feature points in the two maps completely overlap, thus obtaining the seed-registered anomaly response map pair.

[0138] For each pixel location in the registered anomaly response map pair, extract the response value in the texture anomaly response map and the response value in the spectral anomaly response map for that location. Calculate the covariance of the two response values, and then calculate the standard deviation of each response value. Divide the covariance by the product of the two standard deviations to obtain the correlation coefficient of that pixel location. The correlation coefficient ranges from 0 to 1, where a coefficient of 1 indicates complete correlation and a coefficient of 0 indicates no correlation. Arrange the correlation coefficients of all pixel locations according to their corresponding positions to obtain the spatial consistency weight map of the seed.

[0139] Attention-weighted aggregation is performed based on the spatial consistency weight map. For each pixel position in the registered anomaly response map pair, the weight value of that position in the spatial consistency weight map is taken. This weight value is multiplied by the response value of the corresponding position in the texture anomaly response map, and then (1-weight value) is multiplied by the response value of the corresponding position in the spectral anomaly response map. The two product results are added together to obtain the fused response value of that pixel position. The fused response values ​​of all pixel positions are arranged in order according to their positions in the image to obtain the seed fused response map.

[0140] Traverse the fusion response values ​​of all pixels in the fusion response map, record the minimum and maximum response values, perform a non-linear transformation on the fusion response value of each pixel, subtract the minimum response value from the response value to obtain the difference, subtract the minimum response value from the maximum response value to obtain the difference range, divide the aforementioned difference by the difference range to obtain the normalized result between 0 and 1, and use this result as the probability value of the pixel belonging to the lesion region. Arrange the probability values ​​of all pixels according to their positions to form the seed lesion region probability map.

[0141] An adaptive threshold segmentation is performed on the lesion region probability map. A 3×3 local window is constructed with each pixel as the center. The mean of the probability values ​​of all pixels in each window is calculated. The mean is increased by 0.1 to serve as the adaptive threshold for the central pixel. Each pixel in the lesion region probability map is traversed, and the probability value of each pixel is compared with the corresponding adaptive threshold. Pixels with a probability value greater than the threshold are marked as lesion region pixels and assigned a value of 255. Pixels with a probability value less than or equal to the threshold are marked as non-lesion region pixels and assigned a value of 0. All marking results are arranged in order to obtain the seed lesion region label.

[0142] The pixel with a value of 255 in the lesion region marker is used as the initial seed point. The region growth conditions are set as follows: the response value of the adjacent pixel in the texture anomaly response map is greater than the global mean of the texture anomaly response map, and the response value in the spectral anomaly response map is greater than the global mean of the spectral anomaly response map. The four adjacent pixels above, below, left, and right of each initial seed point are traversed to determine whether the growth conditions are met. If the conditions are met, the adjacent pixel is marked as a lesion region pixel and included in the seed point set. This process is repeated until no new pixel meets the growth conditions. The final image containing all lesion region pixels is the fine lesion region mask of the seed.

[0143] Edge refinement processing is performed on the fine lesion region mask. The edge pixels in the mask are traversed. An edge pixel is defined as a pixel whose non-lesion pixel is assigned a value of 0 among its 8 surrounding pixels. It is determined whether each edge pixel is a skeleton pixel. The criteria for determination are that the number of lesion pixels with a value of 255 among the 8 surrounding pixels of the pixel is between 2 and 6, and the pixel is connected to the adjacent lesion pixels. All skeleton pixels are retained, and non-skeleton pixels are assigned a value of 0. Finally, the lesion region boundary with only a single pixel width edge is obtained.

[0144] The beneficial effects are as follows: spectral residual analysis accurately captures abnormal information of texture and spectral features; affine registration ensures the spatial consistency of the two types of abnormal features; correlation mapping and attention-weighted aggregation enhance the feature expression of collaborative abnormal regions; nonlinear transformation converts fused features into an intuitive lesion probability distribution; adaptive threshold segmentation and region growth iteration achieve accurate extraction of lesion regions; edge refinement yields clear single-pixel boundaries; the entire process is progressive, effectively eliminating non-lesion interference information, providing accurate and reliable lesion region data support for subsequent seed health status discrimination, and improving the accuracy of seed lesion identification.

[0145] S5. Based on the morphological characteristics and coverage of the lesion area boundary, the health status of the seed is visually pattern-based to obtain the seed identification conclusion.

[0146] In this embodiment of the invention, the step of visually pattern-based identification of the seed's health status based on the morphological characteristics and coverage of the lesion region boundary to obtain the seed's identification conclusion includes:

[0147] The curvature scale space of the lesion region boundary is analyzed to obtain the curvature change spectrum and geometric complexity information of the lesion region boundary.

[0148] The relative coverage description of the seed is obtained by extracting the regional topological relationship between the coverage area of ​​the lesion region boundary and the overall contour of the standardized image.

[0149] The curvature variation spectrum, the geometric complexity information, and the relative coverage description are integrated into the visual pattern discrimination criteria for the seed;

[0150] Based on the aforementioned visual pattern discrimination criteria, the typical morphological pattern and coverage level of the lesion area boundary are simultaneously evaluated;

[0151] The membership degree of the synchronous evaluation results is determined to obtain the health status category of the seed.

[0152] The seed identification conclusion is generated based on the spatial distribution of the health status category and the boundary of the lesion area in the standardized image.

[0153] Curvature scale space analysis was performed on the boundary of the lesion region. Three Gaussian smoothing windows with fixed scales of 5×5, 7×7, and 9×9 were set. The pixel coordinates of the lesion region boundary were smoothed sequentially in ascending order of window size. Within each window, the weighted average of the coordinates of the center pixel and the surrounding pixels was calculated to eliminate small fluctuations in the boundary pixels. For the smoothed boundary at each scale, three consecutive adjacent pixels on the boundary were selected. The first tangent direction was calculated using the first two pixels, and the second tangent direction was calculated using the last two pixels. The curvature value of the center pixel was obtained by dividing the angle between the two tangent directions by the distance between the adjacent pixels. The curvature values ​​of all pixels were arranged sequentially according to the scale order and the boundary pixel arrangement order to form the curvature change spectrum of the lesion region boundary. At the same time, the number of pixels with an absolute curvature value greater than 0.5 and the number of times the difference between the curvature values ​​of adjacent pixels was greater than 0.3 were counted at each scale. These two data at different scales were integrated to obtain the geometric complexity information of the lesion region boundary.

[0154] First, by using a foreground region mask of a standardized image, the total number of foreground pixels is counted. The area of ​​the overall seed contour is calculated with each pixel corresponding to a 1×1 pixel area. Then, the number of pixels enclosed by the boundary of the lesion region is counted to calculate the coverage area of ​​the lesion region. The coverage area of ​​the lesion region is divided by the area of ​​the overall seed contour to obtain the coverage ratio. At the same time, the center coordinates of the overall seed contour and the center coordinates of the lesion region boundary are obtained. The pixel offsets of the two center coordinates in the horizontal and vertical directions are calculated. The coverage ratio is integrated with the horizontal and vertical offsets to obtain the relative coverage description of the seed.

[0155] The curvature change spectrum, geometric complexity information, and relative coverage description of the lesion area boundary are structurally combined in the order of "curvature change spectrum - geometric complexity information - relative coverage description" to ensure that all information is completely preserved and the correspondence is clear, thus forming the basis for visual pattern discrimination of the seed.

[0156] Synchronous evaluation is performed based on visual pattern discrimination criteria. Three typical morphological patterns and judgment criteria are preset: regular morphology, relatively irregular morphology, and extremely irregular morphology. The corresponding typical morphological patterns are matched according to the curvature change spectrum and geometric complexity information. Four coverage levels and judgment criteria are preset: level 1, level 2, level 3, and level 4. The corresponding coverage level is determined according to the coverage ratio in the relative coverage description.

[0157] Four health status categories and membership criteria are preset: healthy, minor lesion, moderate lesion, and severe lesion. The matching degree between the current assessment result and each health status category is calculated. The matching degree is calculated by the average of the morphological conformity and the coverage level conformity. The morphological conformity is the proportion of the indicator overlap between the current morphology and the category's preset morphology. The coverage level conformity is the degree of fit between the current level and the category's preset level. When the matching degree reaches the corresponding category membership threshold, the seed is determined to belong to that health status category.

[0158] The results of health status categories are extracted, and the spatial distribution information of the lesion area boundary in the standardized image is obtained, including the center coordinates of the lesion area and the longest diameter of the lesion area. The health status category, spatial distribution information, coverage level, and typical morphological pattern are integrated to form the seed recognition conclusion containing status identifier, spatial location details, and coverage ratio.

[0159] The beneficial effects are that by clearly defining the scale window, curvature threshold, and coverage ratio classification, the entire process of curvature scale spatial analysis, relative coverage calculation, and evaluation is standardized, ensuring that the evaluation of morphological characteristics and coverage is accurate and reproducible. Through the integration of discrimination criteria, synchronous evaluation, and membership determination, the scientific classification of seed health status is achieved. The identification conclusion includes both the status category and key information such as spatial distribution, providing a comprehensive and reliable decision-making basis for the accurate screening of subsequent sorting terminals, and improving the accuracy and practicality of seed disease identification and screening.

[0160] In this embodiment of the invention, S6, the status identifier in the identification conclusion is sent to the sorting execution terminal to complete the screening of the seeds.

[0161] The status identifiers contained in the identification results are extracted. The status identifiers are presented in a fixed format of "health status category - coverage level - typical morphological pattern". Specifically, there are four types: healthy - level 1 - regular morphology, minor lesion - level 2 - regular morphology, moderate lesion - level 3 - relatively irregular morphology, and severe lesion - level 4 - extremely irregular morphology. The corresponding status identifiers are accurately extracted according to the category, level and morphological information clearly marked in the identification results.

[0162] A wired Ethernet connection is used to establish a communication link between the sending end and the sorting execution terminal. The sorting execution terminal has a preset fixed IP address of 192.168.1.100 and a communication port number of 8080. The sending end sends a connection request to this IP address and port number, along with a preset 6-digit checksum of 123456. After receiving the connection request, the sorting execution terminal compares the received checksum with the built-in checksum. If the two match completely, a stable communication link is established; otherwise, the connection is rejected and a checksum failure message is sent back to the sending end.

[0163] The extracted status identifier is converted into an 8-bit binary code. The encoding rule is fixed as follows: healthy corresponds to 00000001, minor lesions correspond to 00000010, moderate lesions correspond to 00000100, and severe lesions correspond to 00001000. After encoding, the code is sent byte by byte to the sorting execution terminal through the established communication link. During the sending process, a 10-millisecond wait is made after each byte is sent to ensure stable data transmission. After all bytes are sent, the system waits for the sorting execution terminal to return a receipt confirmation.

[0164] After receiving the complete 8-bit binary code, the sorting execution terminal converts the code into the corresponding status identifier according to the preset decoding rules. At the same time, it detects the real-time position of the seed on the conveyor track through the built-in sensor. When the sensor detects that the seed has reached the sorting execution position, it performs the corresponding screening action according to the status identifier: for seeds with a healthy status identifier, the pneumatic sorting valve is kept closed and the seed enters the retention bin along the horizontal conveyor track; for seeds with a slightly diseased, moderately diseased, or severely diseased status identifier, the corresponding pneumatic sorting valves No. 1, 2, and 3 are opened respectively, and the opening duration is 50 milliseconds. The seeds are pushed to the corresponding rejection bins No. 1, 2, and 3 by airflow.

[0165] After the sorting execution terminal completes the sorting action of a single seed, it sends a receipt confirmation acknowledgment to the sending end, which includes the seed status identifier, sorting time, and target silo number. After receiving the acknowledgment, the sending end confirms that the status identifier transmission and sorting action execution are correct. When all seeds in a single batch have been sorted, the sending end sends a communication termination command to the sorting execution terminal. After receiving the command, the sorting execution terminal closes the communication link and completes the seed sorting process.

[0166] The beneficial effects are that by extracting status identifiers in a fixed format, clarifying communication parameters and encoding rules, and setting precise screening execution actions and times, the accuracy and stability of status identifier transmission are ensured. The sorting execution terminal accurately distinguishes seeds in different health states according to clear rules, effectively separating healthy seeds from seeds with different degrees of disease, avoiding screening confusion, improving the accuracy and efficiency of seed screening, and providing a standardized and reproducible execution solution for seed screening.

[0167] Figure 2 shows a functional block diagram of a seed screening system provided in an embodiment of the present invention.

[0168] The seed screening system 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the seed screening system 100 may include an image normalization module 101, a feature enhancement module 102, a feature fusion module 103, a lesion localization module 104, a health assessment module 105, and a decision execution module 106. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0169] In this embodiment, the functions of each module / unit are as follows:

[0170] The image normalization module 101 is used to acquire sample images of the seed and perform foreground-aware fusion on the sample images to obtain a standardized image of the seed.

[0171] The feature enhancement module 102 is used to perform channel differentiation enhancement on the standardized image to obtain the enhanced image of the seed;

[0172] The feature fusion module 103 is used to parse microscopic visual features and macroscopic visual features from the enhanced image, and to couple the microscopic visual features and macroscopic visual features in a two-stream manner to obtain the comprehensive feature expression of the seed.

[0173] The lesion localization module 104 is used to locate the lesion region of the seed based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and to perform morphological closure on the lesion region to obtain the boundary of the lesion region of the seed.

[0174] The health discrimination module 105 is used to perform visual pattern discrimination on the health status of the seed based on the morphological characteristics and coverage of the boundary of the lesion area, and obtain the identification conclusion of the seed.

[0175] The decision execution module 106 is used to send the status identifier in the identification conclusion to the sorting execution terminal to complete the seed screening.

[0176] In the several embodiments provided by this invention, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0177] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0178] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0179] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0180] This application embodiment can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for identifying diseased seeds, characterized in that, The method includes: S1, acquiring sample images of seeds and performing foreground-aware fusion on the sample images to obtain a standardized image of the seeds; S2, performing channel differentiation enhancement on the standardized image to obtain an enhanced image of the seeds; S3, parsing microscopic and macroscopic visual features from the enhanced image, and coupling the microscopic and macroscopic visual features with dual-stream features to obtain a comprehensive feature expression of the seeds; S4, locating the lesion region of the seeds based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and performing morphological closure on the lesion region to obtain the boundary of the lesion region of the seeds; S5, performing visual pattern discrimination on the health status of the seeds based on the morphological features and coverage of the boundary of the lesion region to obtain the identification conclusion of the seeds; S6, sending the status identifier in the identification conclusion to the sorting execution terminal to complete the screening of the seeds.

2. The seed disease identification method as described in claim 1, characterized in that, The step of acquiring a sample image of the seed and performing foreground-aware fusion on the sample image to obtain a standardized image of the seed includes: acquiring a sample image of the seed and binarizing the sample image to obtain a foreground region mask and a background region mask of the seed; extracting a set of foreground pixels from the sample image based on the foreground region mask and performing homomorphic filtering on the foreground pixel set to obtain a uniformly illuminated foreground image of the seed; performing pixel-level fusion of the uniformly illuminated foreground image and the background pixels indicated by the background region mask to obtain an intermediate fused image of the seed; and performing an affine transformation on the intermediate fused image to obtain a standardized image of the seed.

3. The seed disease identification method as described in claim 1, characterized in that, The step of performing channel differentiation enhancement on the standardized image to obtain the enhanced image of the seed includes: performing multi-scale edge detection on the standardized image to obtain an edge density map of the standardized image; dynamically assigning weights to the color channels of the standardized image based on the density values ​​of the regions in the edge density map to obtain differentiation weight coefficients for the color channels; performing contrast stretching on the pixel values ​​of the color channels based on the differentiation weight coefficients; and performing visual perception optimization on the stretched color channels to obtain the enhanced image of the seed.

4. The seed disease identification method as described in claim 3, characterized in that, The formula for calculating the differential weighting coefficient is as follows: In the formula, For color channels Differential weighting coefficients, The total number of color channels in the standardized image. For summation index variables, Edge density map At pixel position Density value at that location, For color channels pixel matrix At pixel position The gradient vector at that point, For color channels pixel matrix At pixel position The gradient vector at that point, It is a very small positive number. This is the absolute value operator.

5. The seed disease identification method as described in claim 1, characterized in that, The step of parsing microscopic and macroscopic visual features from the enhanced image and coupling the microscopic and macroscopic visual features in a two-stream configuration to obtain the comprehensive feature representation of the seed includes: constructing a Gaussian pyramid on the enhanced image to obtain an image pyramid; extracting global geometric features from the image pyramid and using the global geometric features as the macroscopic visual feature stream of the enhanced image; performing high-frequency emphasis filtering on the enhanced image to obtain a detail enhancement map; performing texture spectrum analysis on the detail enhancement map to obtain a microscopic visual feature stream of the enhanced image; performing cross-scale feature interaction between the macroscopic and microscopic visual feature streams to obtain intermediate feature pairs of the enhanced image; and performing gated fusion on the intermediate feature pairs to obtain the comprehensive feature representation of the seed.

6. The seed disease identification method as described in claim 5, characterized in that, The step of performing cross-scale feature interaction between the macroscopic visual feature stream and the microscopic visual feature stream to obtain intermediate feature pairs of the enhanced image includes: performing super-resolution reconstruction of the macroscopic visual feature stream based on the spatial resolution of the microscopic visual feature stream to obtain a macroscopic upsampled feature stream of the enhanced image; performing element-wise multiplication of the macroscopic upsampled feature stream and the microscopic visual feature stream to obtain a feature interaction weight map of the enhanced image; performing feature modulation on the macroscopic upsampled feature stream and the microscopic visual feature stream according to the feature interaction weight map to obtain a modulated macroscopic feature stream and a modulated microscopic feature stream of the enhanced image; and aggregating the modulated macroscopic feature stream and the modulated microscopic feature stream into intermediate feature pairs of the enhanced image.

7. The seed disease identification method as described in claim 1, characterized in that, The step of locating the lesion region of the seed based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and performing morphological closure on the lesion region to obtain the boundary of the lesion region of the seed, includes: performing spectral residual analysis on the texture features and spectral features in the comprehensive feature expression to construct a texture abnormality response map and a spectral abnormality response map of the seed; performing multi-dimensional abnormality response fusion on the texture abnormality response map and the spectral abnormality response map to obtain a probability map of the lesion region of the seed; performing adaptive threshold segmentation on the probability map of the lesion region to obtain a marker of the lesion region of the seed; using the marker of the lesion region as a seed point, performing iterative region growth under the guidance of the texture abnormality response map and the spectral abnormality response map to obtain a fine lesion region mask of the seed; and refining the edges of the fine lesion region mask to obtain the boundary of the lesion region of the seed.

8. The seed disease identification method as described in claim 7, characterized in that, The step of fusing the texture anomaly response map and the spectral anomaly response map in a multi-dimensional manner to obtain the lesion region probability map of the seed includes: performing affine registration on the texture anomaly response map and the spectral anomaly response map to obtain a registered anomaly response map pair of the seed; performing correlation mapping on the texture and spectral anomaly response of pixels in the registered anomaly response map pair to obtain a spatial consistency weight map of the seed; performing attention-weighted aggregation on the registered anomaly response map pair based on the spatial consistency weight map to obtain a fused response map of the seed; and performing a nonlinear transformation on the fused response map to obtain the lesion region probability map of the seed.

9. The seed disease identification method as described in claim 1, characterized in that, The step of visually pattern-based identification of the seed's health status based on the morphological features and coverage of the lesion region boundary to obtain the seed's identification conclusion includes: performing curvature scale spatial analysis on the lesion region boundary to obtain the curvature change spectrum and geometric complexity information of the lesion region boundary; extracting the regional topological relationship between the coverage of the lesion region boundary and the overall contour of the standardized image to obtain the relative coverage description of the seed; integrating the curvature change spectrum, the geometric complexity information, and the relative coverage description into the visual pattern identification criteria for the seed; simultaneously evaluating the typical morphological pattern and coverage level of the lesion region boundary based on the visual pattern identification criteria; determining the membership degree of the results of the simultaneous evaluation to obtain the seed's health status category; and generating the seed's identification conclusion based on the health status category and the spatial distribution of the lesion region boundary in the standardized image.

10. A seed screening system, characterized in that, To implement the seed lesion identification method of claim 1, the system comprises: an image normalization module for acquiring sample images of seeds and performing foreground-aware fusion on the sample images to obtain a standardized image of the seeds; a feature enhancement module for performing channel differentiation enhancement on the standardized image to obtain an enhanced image of the seeds; a feature fusion module for parsing microscopic and macroscopic visual features from the enhanced image and coupling the microscopic and macroscopic visual features with dual-stream features to obtain a comprehensive feature expression of the seeds; a lesion localization module for locating the lesion region of the seeds based on the synergistic abnormality of texture features and spectral features in the comprehensive feature expression, and performing morphological closure on the lesion region to obtain the boundary of the lesion region of the seeds; a health discrimination module for performing visual pattern discrimination on the health status of the seeds based on the morphological features and coverage of the lesion region boundary to obtain an identification conclusion of the seeds; and a decision execution module for sending the status identifier in the identification conclusion to a sorting execution terminal to complete the screening of the seeds.