Intelligent color sorting control method and system for organic pumpkin seeds based on deep learning

The intelligent color sorting method based on deep learning and multi-source feature fusion solves the problem of insufficient sorting accuracy of traditional color sorting equipment for white melon seeds, realizes an efficient and adaptive sorting process, and improves the quality consistency and production automation level of white melon seed products.

CN121847485APending Publication Date: 2026-04-14HEILONGJIANG QIUHUA SHUOYUAN FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Traditional color sorting equipment has difficulty accurately identifying impurities that are similar in color to white melon seeds, resulting in low sorting accuracy. Furthermore, it requires frequent manual adjustment of parameters for different batches and origins of white melon seeds, which cannot meet the needs of modern production.

Method used

A deep learning-based intelligent color sorting control method is adopted. Through deep convolutional neural networks and attention mechanisms, the characteristic differences between white melon seeds and impurities are automatically learned. Combined with a multi-source feature fusion algorithm, adaptive sorting is performed, and a non-contact physical rejection device is used to achieve real-time separation.

Benefits of technology

It significantly improves the accuracy of distinguishing white melon seeds from impurities, reduces the need for manual parameter adjustment, enhances the versatility and ease of use of sorting equipment, and meets the precision and efficiency requirements of modern production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121847485A_ABST
    Figure CN121847485A_ABST
Patent Text Reader

Abstract

The invention provides an organic pumpkin seed intelligent color sorting control method and system based on deep learning, and the method comprises the steps: obtaining visual feature image data of to-be-sorted particles through an image collection device; inputting the visual feature image data into a pre-trained deep learning model, and outputting a multi-dimensional feature vector; the multi-dimensional feature vectors serve as input, matching judgment is carried out based on a preset multi-source feature fusion algorithm, and a classification decision result indicating whether the to-be-sorted particles are qualified products or not is output; and if the classification decision result indicates that the to-be-sorted particles are unqualified products, generating a corresponding rejection control signal to control a non-contact physical rejection device to perform real-time separation on the unqualified products. According to the intelligent color selection control method and system for the organic pumpkin seeds based on deep learning, the color selection accuracy of the pumpkin seeds is remarkably improved; the device can adapt to characteristic changes of pumpkin seeds in different batches and from different producing areas, frequent manual parameter adjustment is not needed, and the production automation level is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of food processing automation and computer vision technology, and in particular to a method and system for intelligent color sorting control of organic white melon seeds based on deep learning. Background Technology

[0002] In the production and processing of organic white melon seeds, color sorting is a crucial step in ensuring product quality. Traditional color sorting technology mainly relies on simple optical sensors and preset thresholds for sorting, which has the following technical drawbacks: Traditional color sorting equipment has difficulty accurately identifying impurities that are similar in color to white melon seeds (such as seeds of similar color, broken shells, etc.), resulting in low sorting accuracy and high impurity residue rate in qualified products; For white melon seeds from different batches and different origins, due to natural differences in color, size and shape, traditional color sorting systems with fixed thresholds require frequent manual adjustment of parameters, which increases the difficulty of operation and time cost. Existing automated color sorting equipment cannot meet the requirements of modern production in terms of sorting accuracy and efficiency when processing organic white melon seeds due to their surface gloss and irregular shape.

[0003] In view of this, there is an urgent need for a deep learning-based intelligent color sorting control method and system for organic white melon seeds, in order to at least address the above-mentioned shortcomings. Summary of the Invention

[0004] One of the objectives of this invention is to provide an intelligent color sorting control method and system for organic white melon seeds based on deep learning. By using a deep convolutional neural network to automatically learn the characteristic differences between white melon seeds and impurities, it achieves high-precision, adaptive color sorting, significantly improves sorting accuracy, reduces labor costs, and enhances the quality consistency of organic white melon seed products.

[0005] The intelligent color sorting control method for organic white melon seeds based on deep learning provided in this embodiment of the invention includes: The visual feature image data of the particles to be sorted is acquired through an image acquisition device. Visual feature image data is input into a pre-trained deep learning model, which includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector. The multi-dimensional feature vector is used as input, and a matching judgment is performed based on the preset multi-source feature fusion algorithm. The output is a classification decision result indicating whether the particles to be sorted are qualified products. The multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object. If the classification decision indicates that the particles to be sorted are non-conforming, a corresponding rejection control signal is generated and sent to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of non-conforming products.

[0006] Preferably, the visual feature image data of the particles to be sorted is acquired using an image acquisition device, including: The acquisition module, which includes a multispectral illumination system and a binocular stereo vision camera, acquires RGB image data, near-infrared image data, and three-dimensional depth map data of the particles to be sorted.

[0007] Preferably, the adaptive weighting process performed by the attention mechanism module includes: The initial feature map is input into the channel attention submodule of the attention mechanism module to calculate the importance weights of different spectral and color channels, and thus obtain the channel-weighted feature map. The channel-weighted feature map is input into the spatial attention submodule in the attention mechanism module to locate the two-dimensional spatial coordinate parameters of impurities and texture abnormalities on the surface of the particles to be sorted, and generate a spatial-weighted feature map. Generate multidimensional feature vectors based on spatially weighted feature maps.

[0008] Preferably, the matching determination process of the multi-source feature fusion algorithm includes: The RGB color features in the visual feature image data are converted to the HSV color space, and the enhanced color quantization features are extracted and fused with the multidimensional feature vector. Contour integrity score is extracted by combining the extracted grayscale texture features; The fused feature and contour integrity score is compared with the pre-set multi-level sorting dynamic threshold. If the comparison result deviates from the set qualified product threshold range, the classification decision result of the unqualified product is output.

[0009] Preferably, the feature extraction network adopts a visual Transformer architecture or a lightweight object detection network structure; the deep learning model is pre-pruned and weight quantized before deployment, and is deployed in an edge AI acceleration node to perform forward inference.

[0010] Preferably, the process of controlling the non-contact physical rejection device to perform real-time separation includes: The rejection control signal is analyzed, the spatial coordinates of the defective product are calculated, and the motion delay time of the defective product reaching the non-contact physical rejection device is calculated based on the production line speed. Based on the delay time, the logic processing unit activates the electromagnetic jet valve that matches the spatial position coordinates within a millisecond-level time window, and blows the defective products away from the main conveyor belt track through high-pressure airflow.

[0011] The intelligent color sorting control method for organic white melon seeds based on deep learning provided in this embodiment of the invention further includes: Edge computing nodes filter out unqualified particle images and their feature data with a confidence level below a preset threshold in real time, and upload them to the cloud server as incremental samples. The cloud server uses a global dataset containing incremental samples to perform offline training and updates on the main cloud model, generating incremental weight parameters. Incremental weight parameters are distributed and synchronized to the deep learning models of each execution node to adaptively update the dynamic threshold parameters for multi-level sorting.

[0012] Preferably, the contour integrity score is extracted by combining the extracted grayscale texture features, including: Extract the semi-transparent bright bands from the side edges of the near-infrared image, construct a brightness sequence of the bright bands arranged along the circumference of the ellipse, and output the brightness sequence of the semi-transparent bright bands and the circumference parameters of the side edge ellipse. Abrupt node detection is performed on the brightness sequence of the semi-transparent bright band of the side edge to locate the damaged position and quantify the degree of damage, and output the side edge damage bitmap and the side edge continuity score; Separate the specular highlight region of the wax layer on the main surface from the RGB image, perform highlight ellipse fitting, and output the highlight ellipse shape residual map and highlight coverage index. Based on the specular elliptical morphological residual map, the spatial location of the morphological residual distribution is correlated with the side edge damage map to identify the specular distortion area caused by the damage, and output the spatial correlation map of wax layer defects and the wax layer integrity score. Multiple thickness gradient profiles are extracted from the 3D depth map along the short axis to verify the degree of preservation of the ridge-shaped symmetric gradient and output the fullness score of the mid-ridge. The product-square root fusion framework integrates the side edge continuity score, wax layer integrity score, and mid-ridge fullness score to output the contour integrity score.

[0013] Preferably, the process involves extracting the semi-transparent bright bands from the near-infrared image, constructing a brightness sequence of the bright bands arranged along the circumference of an ellipse, and outputting the brightness sequence of the semi-transparent bright bands and the circumference parameters of the ellipse, including: Extract the inner and outer boundary coordinates of the side edge from the 3D depth map, perform ellipse fitting, and calculate the local wall thickness of the side edge at each arc length position along the ellipse circumference to obtain the ellipse fitting parameters and the circumference wall thickness distribution sequence of the side edge. Based on the perimeter wall thickness distribution sequence and the physical law of near-infrared semi-transmission, a geometric prediction brightness envelope along the perimeter of an ellipse is established, and a geometric prediction brightness envelope sequence is output. In near-infrared images, the semi-transmittance original brightness of the side edge region is extracted using radial gradient monotonicity as the weight, and the perimeter original brightness sequence and the sampling point radial confidence weight sequence are obtained. The original perimeter brightness sequence and the geometrically predicted brightness envelope sequence are aligned by envelope normalization to eliminate geometric modulation components and determine the de-envelope residual sequence and the effective sampling coverage index. Using the envelope-removed residual sequence as the core, and combining the effective sampling coverage index and the ellipse perimeter parameter, the final side edge semi-transparent bright band brightness sequence and side edge ellipse perimeter parameter are constructed.

[0014] The intelligent color sorting control system for organic white melon seeds based on deep learning provided in this embodiment of the invention includes: The image acquisition module is used to acquire visual feature image data of the particles to be sorted through an image acquisition device. The feature extraction module is used to input visual feature image data into a pre-trained deep learning model. The deep learning model includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector. The feature fusion module is used to take multi-dimensional feature vectors as input, perform matching and judgment based on a preset multi-source feature fusion algorithm, and output a classification decision result indicating whether the particles to be sorted are qualified products; the multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object. The color sorting control module generates a corresponding rejection control signal if the classification decision indicates that the particles to be sorted are defective. The rejection control signal is then sent to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of defective products.

[0015] The beneficial effects of this invention are as follows: This invention significantly improves the accuracy of distinguishing white melon seeds from impurities by combining deep convolutional neural networks with attention mechanisms. The system can adapt to changes in the characteristics of white melon seeds from different batches and origins, eliminating the need for frequent manual parameter adjustments and improving the equipment's versatility and ease of use. Through multi-source feature fusion technology, it effectively identifies similar-colored impurities and subtle surface defects that are difficult to distinguish using traditional color sorting equipment. Seamlessly integrated with existing processes, it can be directly integrated into organic white melon seed production lines, improving the level of production automation.

[0016] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in this application.

[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of a deep learning-based intelligent color sorting control method for organic white melon seeds in an embodiment of the present invention; Figure 2 This is a schematic diagram of an intelligent color sorting control system for organic white melon seeds based on deep learning, as described in an embodiment of the present invention. Detailed Implementation

[0019] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0020] This invention provides a deep learning-based intelligent color sorting control method for organic white melon seeds. This method aims to address technical problems in existing organic white melon seed color sorting processes, such as insufficient accuracy in identifying local texture defects and subtle color anomalies, weak generalization ability of traditional feature engineering, and lack of cross-batch adaptive capability. Through this invention, the color sorting control system can automatically learn and accurately identify surface defect features of organic white melon seeds using a deep learning model under the real-time constraints of industrial-grade high-speed production lines, and achieve continuous adaptive optimization of the model through a cloud-edge collaborative incremental learning mechanism.

[0021] In a typical preferred embodiment, the color sorting control system is equipped with the following core hardware components: Image acquisition module: Integrates a multispectral illumination system and a binocular stereo vision camera. The multispectral illumination system employs a programmable multi-channel LED array, encompassing two illumination bands: visible light (400nm-700nm) and near-infrared (700nm-1100nm). Timing control enables time-division alternating illumination of the two bands, eliminating spectral crosstalk. The binocular stereo vision camera consists of two industrial-grade area array cameras. The baseline spacing is calibrated according to the size range of sunflower seeds (typically approximately 15mm-25mm long and 8mm-12mm wide), and equipped with a fixed-focus telecentric lens to eliminate the influence of perspective distortion on dimensional measurements. The camera sensor resolution is no less than 2048×1024 pixels, and the frame rate is no less than 120fps to adapt to the conveyor belt speed of the production line (typically 0.5m / s-2.0m / s).

[0022] Edge AI Acceleration Node: This node serves as the runtime platform for the deep learning inference algorithm of this invention. It is equipped with a dedicated neural network inference acceleration chip, such as the NVIDIA Jetson series, Intel Movidius Neural Compute Stick, or Ascend Atlas series. The acceleration chip integrates a Tensor Processing Unit (TPU) or a Neural Processing Unit (NPU), supporting forward inference acceleration with INT8 precision. The node connects to the image acquisition module via GigE industrial Ethernet or a USB 3.0 interface and communicates with the logic processing unit via a high-speed industrial bus (such as EtherCAT or PROFINET).

[0023] The logic processing unit (PLC or dedicated controller) is responsible for receiving rejection control signals from the edge AI acceleration nodes, parsing spatial position information, performing motion delay calculations, and sending precise trigger pulses to the electromagnetic jet valve array. This unit requires microsecond-level I / O response time to ensure the timing accuracy of the rejection action.

[0024] Non-contact physical rejection device: Composed of multiple parallel high-speed electromagnetic jet valves arranged along the conveyor belt outlet direction, covering the effective width of the conveyor belt. Each valve corresponds to a position interval in the width direction of the conveyor belt. When the valve opens, a transient high-speed airflow is generated by high-pressure compressed air (usually 0.3MPa-0.6MPa), which deflects non-conforming particles flowing directly above it into the recovery tank, achieving physical separation from qualified particles. The valve response time (from electrical signal triggering to airflow establishment) should be less than 5ms.

[0025] Cloud server: Deploys the main model in the cloud and undertakes offline incremental training tasks. It performs bidirectional synchronization of model parameters with the edge AI acceleration nodes of each production line through a secure and encrypted network channel.

[0026] This invention provides a deep learning-based intelligent color sorting control method for organic white melon seeds, such as... Figure 1 As shown, it includes: Step 1: Acquire visual feature image data of the particles to be sorted using an image acquisition device.

[0027] In this invention, the image acquisition device employs an acquisition module that includes a multispectral illumination system and a binocular stereo vision camera to simultaneously acquire RGB image data, near-infrared image data, and three-dimensional depth map data of the particles to be sorted.

[0028] After the sunflower seeds are arranged in a single layer by the vibrating feeder, they pass through the image acquisition area at a constant speed on the conveyor belt. Black light shields are placed on both sides of the image acquisition area to isolate interference from external ambient light and ensure the stability of the lighting environment for image acquisition.

[0029] The multispectral illumination system operates as follows: During odd-numbered frame acquisition times, the system triggers the visible light LED array to illuminate, and the binocular camera simultaneously acquires RGB color images of the particles under visible light illumination. During even-numbered frame acquisition times, the system triggers the near-infrared LED array to illuminate, and the binocular camera switches to near-infrared sensing mode, simultaneously acquiring near-infrared grayscale images of the particles. Through alternating triggering and frame synchronization mechanisms, the same particle can continuously acquire both visible light RGB images and near-infrared images within a short period of time while passing through the acquisition area. The displacement difference between the two frames in the direction of the conveyor belt movement is compensated by the system based on the frame interval and the conveyor belt speed.

[0030] RGB image data can reflect the visible color information of the particle surface, including yellowing, browning, and black spots caused by mold, as well as color abnormalities such as cracks caused by processing damage. Near-infrared image data can penetrate the waxy layer on the particle surface and reveal internal defects that are difficult to detect under visible light, such as uneven distribution of internal moisture (usually corresponding to diseased or moldy areas) and abnormal kernel development, because there is a significant difference in reflectance between moldy tissue and normal tissue in the near-infrared band.

[0031] The 3D depth map data is obtained by parallax calculation using a binocular stereo vision camera. It reflects the 3D morphological information of the particle surface, including the particle thickness profile, surface depressions, and geometric defects such as missing corners caused by breakage. This provides a direct 3D basis for extracting the contour integrity score in subsequent steps.

[0032] During the image preprocessing stage, the edge AI acceleration node performs the following operations on the acquired raw images: distortion correction and stereo alignment of the RGB and near-infrared images based on the intrinsic and extrinsic parameter calibration matrix of the binocular camera; motion compensation for inter-frame particle displacement using the conveyor belt speed signal; and adaptive histogram equalization (CLAHE) to enhance the visibility of low-contrast defect areas. After preprocessing, the RGB image, near-infrared image, and 3D depth map are combined in a multi-channel stitched manner into a unified visual feature image data tensor, which serves as the input to the deep learning model.

[0033] Step 2: Input the visual feature image data into a pre-trained deep learning model. The deep learning model includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector.

[0034] The deep learning model of this invention comprises two core parts: a feature extraction network and an attention mechanism module.

[0035] In this embodiment, the feature extraction network adopts a lightweight target detection network structure, preferably based on the YOLO series (such as YOLOv8-nano or YOLOv10-s) backbone network, and its detection head part is removed, leaving only the neck network (i.e. FPN / PAN structure) for multi-scale feature extraction, and its output multi-scale feature map is used as the input of the attention mechanism module.

[0036] The core reason for adopting a lightweight network structure is that in the industrial scenario of organic white melon seed color sorting, several to dozens of particles often appear simultaneously in a single frame image (depending on the conveyor belt width and arrangement density), and the size of each particle is relatively small in the image (usually only occupying 0.5% to 3% of the image area). The multi-scale FPN / PAN structure can effectively capture cross-scale information from fine-grained texture (high-resolution shallow features) to overall morphology (low-resolution deep semantic features), making the model highly sensitive to defect types of varying sizes. At the same time, the lightweight network can control the single-frame inference latency on edge AI acceleration nodes to within 10ms, meeting the real-time requirements of the pipeline.

[0037] In another alternative implementation, the feature extraction network can also employ a VisionTransformer (ViT) architecture, such as Swin Transformer-Tiny or DeiT-Small. The multi-head self-attention mechanism in the ViT architecture enables the model to establish long-range dependencies between any two regions in an image, which helps capture the global contextual features of extended stripe defects (such as insect damage marks) on the surface of organic white melon seeds, offering an advantage over pure convolutional networks in identifying such defects. However, due to the relatively high computational cost of the ViT architecture, more aggressive model pruning and weight quantization are required before deployment (see below for details).

[0038] The feature extraction network loads weights pre-trained on a large-scale agricultural product defect detection dataset (such as a defect image dataset that integrates various nut agricultural products) during initialization, and then fine-tunes it using the organic white melon seed dataset collected in this invention to utilize the general texture and morphological feature representations learned in the pre-training stage.

[0039] The attention mechanism module consists of a channel attention submodule and a spatial attention submodule connected in series. Its design is based on the CBAM (Convolutional Block Attention Module) mechanism and has been adaptively improved for multispectral input.

[0040] The initial feature map output by the feature extraction network usually has a large number of channels (e.g., 256 or 512 channels). These channels include color response channels that are highly sensitive to identifying mold spots, edge response channels that are sensitive to identifying texture damage, spectral response channels that are sensitive to the input near-infrared image data, and a large number of background feature channels that contribute little to the current discrimination task.

[0041] The design goal of the channel attention submodule is to automatically calculate the importance weight of each channel to the current discrimination task, enhance high-contribution channels, and suppress low-contribution channels.

[0042] In practice, global average pooling and global max pooling are performed on the initial feature map to obtain two vectors describing the global distribution characteristics of each channel. These two vectors are concatenated and then mapped to a weight vector with the same dimension as the number of channels through a multilayer perceptron (MLP) with shared weights. The weight vector is then normalized to the (0,1) interval using a sigmoid activation function to obtain the channel importance weight vector. This weight vector is then multiplied channel by channel of the initial feature map to obtain the channel-weighted feature map.

[0043] For the multispectral input scenario of this invention, the channel attention submodule can adaptively learn that: when the near-infrared image channel of the target particle shows a significant difference from the green channel response of the RGB image (usually corresponding to internal mold), the weights of these two channels should be increased; when the blue channel in the particle's RGB image shows a locally abnormally high value (usually corresponding to the bluish-gray hue of mineral contamination), the weights of the blue-related channels should be increased. This adaptive weighting mechanism enables the model to dynamically focus on the most discriminative spectral dimension for different types of defects.

[0044] After obtaining the channel-weighted feature map, the spatial attention submodule further accurately locates the key defect regions on the particle surface in a two-dimensional spatial dimension.

[0045] In practice, the channel-weighted feature maps are averaged and maximized along the channel dimension to obtain two single-channel heatmaps reflecting the overall activation intensity of spatial locations. These heatmaps are then concatenated and passed through a 7×7 large-kernel convolutional layer (to capture a larger range of spatial context) to map a single-channel spatial attention weight map, which is then normalized to the (0,1) interval using a Sigmoid activation function. Positions with higher values ​​in this weight map correspond to spatial regions in the feature maps that contain more information and contribute more to the discrimination.

[0046] Spatial attention weight maps implicitly locate the two-dimensional spatial coordinate parameters of impurities and texture abnormalities on the surface of particles to be sorted. For example, for a sunflower seed with localized brown spots, the high-weighted regions on the spatial attention map will be concentrated near the local coordinates of the brown spots, while the weights of the intact kernel area in the center of the particle and the background area will be relatively low. Multiplying the spatial attention weight map pixel-by-pixel with the channel-weighted feature map yields the spatially weighted feature map.

[0047] Finally, adaptive average pooling is performed on the spatially weighted feature map, flattening it into a fixed-length one-dimensional vector, i.e., a multi-dimensional feature vector, which serves as the input for subsequent multi-source feature fusion algorithms. The dimension of the multi-dimensional feature vector is typically set to 256 to 512 dimensions to achieve a balance between expressive power and computational efficiency.

[0048] After training and validation, deep learning models must undergo the following compression and optimization process before being officially deployed on edge AI acceleration nodes: First, structured model pruning is performed: based on L1 norm sensitivity analysis of each convolutional layer filter, redundant filter channels with the lowest contribution to the model output are identified and removed (typically pruning 20% ​​to 40% of the parameters, with classification accuracy loss controlled within 0.5%). After pruning, the model is restored through short-term fine-tuning to compensate for the accuracy loss.

[0049] Then, weight quantization is performed: the floating-point (FP32) weights of the pruned model are quantized into INT8 integer format, and quantization-aware training (QAT) strategy is used to minimize quantization error. After INT8 quantization, the storage volume of the model is reduced to about 1 / 4 of the original, and the execution speed on the INT8 inference engine of the edge AI acceleration node can be improved by 2 to 4 times, while the power consumption is significantly reduced. This ensures that the end-to-end latency of the single-granular complete inference process (from image preprocessing to classification decision output) of the model on the edge AI acceleration node meets the pipeline real-time requirements.

[0050] Step 3: Using the multi-dimensional feature vector as input, perform matching and judgment based on the preset multi-source feature fusion algorithm, and output the classification decision result indicating whether the particles to be sorted are qualified products; the multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object.

[0051] In this invention, the "multi-source" in the multi-source feature fusion algorithm refers to the fact that the input features of the algorithm come from three independent heterogeneous feature streams: the first source is the multi-dimensional feature vector output by the deep learning model in step 2, whose information comes from the deep semantic abstraction of the visual feature image by the feature extraction network and attention mechanism module; the second source is the color space features explicitly extracted from the RGB image and converted to the HSV color space, whose information comes from the quantitative description of the color distribution on the particle surface; the third source is the grayscale texture features extracted from the near-infrared image and the contour integrity score calculated from the three-dimensional depth map data, whose information comes from the physical quantification of the particle surface structure and geometric morphology. The three types of feature sources are heterogeneous and complementary, respectively characterizing the defect attributes of the particles to be sorted from the semantic layer, color layer, and morphological layer. The algorithm integrates the three feature streams into the final classification decision basis through feature concatenation and weighted mapping of the classification decision layer.

[0052] When extracting and fusing features in the HSV color space, firstly, the color information of each particle to be sorted (excluding the background area) is extracted from the RGB image data obtained in step 1 using a particle region segmentation mask. The RGB color values ​​are then converted to the HSV color space: the H (hue) channel reflects the pure properties of color, is insensitive to changes in light intensity, and can reliably distinguish different types of defect colors such as yellowing (high H channel value), browning (medium H channel value), and black spots (extremely low H channel value). The S (saturation) channel reflects the purity of color; normal, qualified sunflower seeds typically appear as a low-saturation off-white, while mineral contamination or chemical residues often lead to abnormally high local saturation. The V (lightness) channel reflects the brightness of color and can be used to detect dark impurities or shadow-type surface depressions.

[0053] In the HSV color space, the mean, standard deviation, and skewness of each channel (H, S, V) of the particle region are calculated, and the distribution ratio of the H channel histogram within several predefined defect hue intervals is statistically analyzed to obtain an enhanced color quantization feature vector (typically 24 to 32 dimensions). The combination of the above-mentioned multidimensional statistics of the HSV color space (mean, standard deviation, skewness, and histogram interval distribution ratio) constitutes the enhanced color quantization feature referred to in this invention. Quantization refers to mapping the continuous color distribution of the particle surface into a discrete feature vector through numerical statistics; enhancement refers to the fact that, compared to a simple color description method using only RGB means, this invention significantly improves the robustness of color features to changes in light intensity through a combination of color space transformation and multi-moment statistics, and can effectively distinguish different defect types with similar hues but different saturation or brightness, thereby enhancing the ability to discriminate color features. This enhanced color quantization feature vector is fused with the multidimensional feature vector output in step 2 through a splicing operation to form a fused feature vector.

[0054] Gray-level texture feature extraction is based on the gray-level co-occurrence matrix (GLCM) method. After converting the near-infrared image into a normalized grayscale image, granular regions are selected as regions of interest, and GLCMs are constructed in four directions: 0°, 45°, 90°, and 135°. Four Haralick texture statistics—contrast, correlation, energy, and uniformity—are extracted from each GLCM, resulting in a total of 16 dimensions. Normal, qualified sunflower seeds exhibit uniform texture, high energy values, and low contrast. Regions with texture damage, deepened wrinkles, or impurities show significantly increased contrast and significantly decreased uniformity. These 16-dimensional gray-level texture feature vectors are further concatenated with the fused feature vector to form the final enhanced fused feature vector.

[0055] The contour integrity score is calculated based on the 3D depth map data obtained in step 1. A polynomial fit is performed on the depth contour of each particle, and the root mean square deviation (RMSE) between the fitted curve and the actual depth contour is used as the surface smoothness index. Simultaneously, significant abrupt depth changes (usually corresponding to broken corners or severe depressions) are detected on the 3D depth map. This is determined by setting a local depth gradient threshold, and a Boolean-type damage flag is output. Finally, combining the smoothness index and the damage flag, a contour integrity score between 0 and 1 is output through a pre-calibrated scoring function, where 1 represents contour integrity, and lower values ​​indicate more severe morphological damage.

[0056] The system inputs the enhanced fusion feature vector and the contour integrity score into a lightweight classification decision layer (usually a two-layer fully connected network or support vector machine classifier), and outputs a multi-class probability distribution of qualified products and various unqualified products (moldy particles, discolored particles, damaged particles, foreign objects, etc.).

[0057] The multi-level sorting dynamic threshold is the key design feature that distinguishes this invention from traditional fixed threshold methods. Instead of using a single global threshold, the system maintains independent threshold ranges for qualified products and each type of unqualified product. Each threshold range is determined during initial deployment by calibration experiments using standard samples and is dynamically updated through the cloud-edge collaborative incremental learning mechanism in subsequent step 5.

[0058] The decision logic is as follows: If the probability of the qualified product category corresponding to the particle is the highest and is higher than its lower bound of the qualified product threshold, then the classification decision result of the qualified product is output; if the probability of any unqualified product category exceeds its corresponding upper bound of the threshold, then the classification decision result of the unqualified product is output, and the main defect category label is recorded (for subsequent statistical analysis); if the probability of each category is in the fuzzy range (i.e., the probability of the qualified product is lower than the lower bound of the qualified product threshold, but no unqualified product category exceeds its upper bound of the threshold), then the particle is marked as a low confidence sample, the classification decision result is conservatively output as an unqualified product, and the image data and feature data of the sample are uploaded to the incremental learning queue in step 5.

[0059] Step 4: If the classification decision result indicates that the particles to be sorted are non-conforming products, a corresponding rejection control signal is generated and sent to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of non-conforming products.

[0060] When step 3 outputs the classification decision result of non-conforming products, the edge AI acceleration node immediately generates a rejection control signal and sends it to the logic processing unit via the high-speed industrial bus.

[0061] In step 2, the spatial attention submodule has already located the defective region at the feature level. When generating the rejection control signal, the system further determines the two-dimensional spatial coordinates (x, y) of the centroid of the defective particle in the conveyor belt's physical coordinate system by performing a reverse mapping of the RGB image. The x-axis is along the conveyor belt's movement direction, and the y-axis is along the conveyor belt's width direction. The y-axis coordinate information is used to determine the electromagnetic jet valve number to be triggered (i.e., the valve channel corresponding to the particle's width direction position).

[0062] Because there is a fixed physical distance L between the image acquisition area and the electromagnetic jet valve array (precisely measured during system installation and commissioning), particles need a certain amount of time to move to the area directly below the valve after being captured. The logic processing unit calculates the motion delay time L / v required for the defective product to reach the electromagnetic jet valve based on the conveyor belt linear speed v read in real time by the conveyor belt encoder.

[0063] It is important to note that the conveyor belt linear speed v may fluctuate slightly due to load changes or drive motor speed adjustments. Therefore, the logic processing unit uses the encoder's real-time speed value instead of the preset nominal speed value for calculation to ensure the accuracy of the delay time calculation. The system calculates T_delay to the millisecond level and uses a high-precision timer (resolution not less than 0.1ms) to control the triggering time of the rejection action.

[0064] After the delay time is reached, the logic processing unit sends an energizing trigger pulse to the electromagnetic jet valve (one or two adjacent channels) that matches the y-axis coordinate of the defective product within a millisecond time window. The opening duration of the electromagnetic jet valve is automatically calculated based on the size and width of the particle in that direction and the conveyor belt speed, and is usually set to 5ms to 20ms to ensure that the airflow can cover the entire defective product, while avoiding excessive airflow that may affect adjacent qualified products (reducing false rejection).

[0065] High-pressure compressed air forms a high-speed air column during valve opening, acting on the surface of defective particles and generating a lateral thrust perpendicular to the conveyor belt's direction of movement. This blows the defective particles off the main conveyor belt track, deflecting them into the side-mounted defective particle recovery trough. Qualified particles, unaffected by the airflow, continue moving along the main conveyor belt track to the qualified particle collection area.

[0066] Throughout the rejection process, the system monitors the air source pressure in real time (via a pressure sensor on the air line). If the air source pressure is lower than the preset lower limit (e.g., 0.25 MPa), the system generates an air pressure alarm signal and suspends the rejection action. At the same time, all particles in the current time period are marked as unprocessed and enter the manual re-inspection process to prevent missed detections due to insufficient air pressure.

[0067] Step 5: Cloud-edge collaborative incremental learning enables adaptive updates of dynamic threshold parameters for multi-level sorting.

[0068] In this invention, edge computing nodes and edge AI acceleration nodes refer to the same hardware entity, namely, embedded computing units deployed on each color sorting production line, responsible for executing forward inference and sorting control of deep learning models. Each execution node refers to the collection of all edge computing nodes deployed on different production lines or in different processing workshops. Each execution node operates independently, but unified management of model versions and parameter synchronization are achieved through a cloud server. The meaning of edge AI acceleration nodes is the same as that of edge computing nodes in the following context, and they will not be separately labeled.

[0069] Organic white melon seeds exhibit significant natural variations in surface color and texture under different origins, planting seasons, storage conditions, and processing batches. If the weights and sorting thresholds of a deep learning model remain fixed after deployment, the model's adaptability to the characteristics of each batch will gradually decrease with each production batch, leading to a systematic drift in the false rejection or false negative rate. The introduction of a cloud-edge collaborative incremental learning mechanism enables the system to continuously and automatically accumulate new effective samples from the production process, driving the continuous evolution of the model.

[0070] During each production shift, edge computing nodes continuously monitor the highest category probability value (i.e., confidence score) for the classification decision of each particle in step 3. The system sets a confidence upload threshold (usually between 0.75 and 0.85). When the classification confidence of a particle is lower than the confidence upload threshold, regardless of whether the final judgment result is a qualified product or a unqualified product, the original visual feature image data (RGB image, near-infrared image, 3D depth map), the intermediate layer multi-dimensional feature vector, the enhanced feature vector after multi-source fusion, and the final classification decision result corresponding to that particle are all stored in the local incremental sample buffer by the edge computing node as incremental sample candidates.

[0071] At the end of each production shift (or when the incremental sample buffer reaches its preset capacity limit), edge computing nodes upload incremental sample packages in batches to the cloud server via a secure and encrypted network channel. The upload includes metadata tags, such as the collection timestamp, production line number, batch number, and conveyor belt speed, enabling the cloud server to stratify data by batch during training.

[0072] After receiving incremental samples from multiple production lines, the cloud server first has manual quality inspectors quickly label the low-confidence samples (usually only needing to confirm or correct the classification results output by the system, without needing to label from scratch), and then incorporates them into the global training dataset after quality screening.

[0073] The incremental training of the cloud-based main model adopts a continuous learning framework and introduces an Elastic Weight Consolidation (EWC) regularization strategy. While injecting the characteristics of new batches of data into the model, it prevents catastrophic forgetting of the model by penalizing large modifications to historically important parameters, ensuring that the model's recognition performance of historically qualified batches does not significantly degrade due to fine-tuning of new batches.

[0074] After incremental training is completed, the cloud server evaluates the performance metrics (precision, recall, and F1 score) of the incrementally updated model on the standard validation set. If all performance metrics meet the preset quality thresholds, an incremental weight parameter package is generated, which includes the updated model weight difference, the revised multi-level sorting dynamic threshold parameters, and version control information.

[0075] The cloud server distributes incremental weight parameter packages to each execution node via a secure, encrypted channel. Upon receiving the parameter package, the node performs a hot update operation after the currently processing batch on the production line is completed (i.e., during the batch changeover between two batches): the incremental weight parameters are loaded into the corresponding layer of the model, and the locally stored multi-level sorting dynamic threshold parameters are replaced with the new thresholds from the incremental weight parameters. The hot update process typically completes within seconds, with minimal impact on the continuous operation of the production line.

[0076] The adaptive update mechanism for the multi-level sorting dynamic threshold parameters is as follows: After completing one round of incremental training, the cloud-based main model recalibrates the category decision boundaries between qualified products and various types of unqualified products using the statistical distribution of samples from each batch in the current global dataset. Specifically, the system estimates the kernel density of the classification probability distribution of samples from each category in the validation set, using a preset upper limit for false rejection rate (i.e., false positive rate constraint) and an upper limit for false negative rate (i.e., false negative rate constraint) as dual constraints. Through optimization, it determines the optimal threshold range for each category and generates a new set of multi-level sorting dynamic threshold parameters. This parameter set is distributed to each execution node along with the incremental weight parameter package. After the execution node replaces its local original threshold with the new threshold, the classification decision logic automatically adapts to the particle color and texture distribution characteristics of the current batch, thereby achieving adaptive sorting threshold updates without manual intervention. The meaning of "adaptive" is that the direction and magnitude of the threshold update are driven by the actual sample distribution characteristics of the current batch, rather than being fixed manually in advance, enabling the system to autonomously adjust the decision boundaries as the production batches evolve.

[0077] After the update is complete, the edge computing nodes send a confirmation receipt to the cloud server. The cloud records the model version status of each node, enabling global version management. If a node fails to send a confirmation receipt within a specified time (e.g., due to network failure), the cloud server will automatically resend the update task. If a node detects an anomaly in the inference result after receiving the update (e.g., the recognition rate on standard internal validation samples drops beyond a set threshold), it will automatically roll back to the previous version weight and report the anomaly to the cloud.

[0078] Through the aforementioned cloud-edge collaborative incremental learning loop, this invention enables the intelligent color sorting system for organic white melon seeds to automatically adapt to changes in production batches. Without the need for manual recalibration, it maintains high-precision sorting performance and effectively reduces the long-term operation and maintenance costs of the system.

[0079] Furthermore, to ensure the long-term stable operation of this invention in actual industrial environments, the system is also equipped with the following auxiliary protection mechanisms: Particle occlusion handling mechanism: On a high-speed pipeline, partial occlusion may occasionally occur between adjacent particles. The system introduces instance segmentation processing in step 2 to generate an independent pixel-level mask for each particle, excluding the occluded area from the region of interest in feature extraction, avoiding mutual contamination of color and texture features between adjacent particles, and ensuring the accuracy of independent judgment for each particle.

[0080] Throughput adaptive adjustment mechanism: When the conveyor belt speed changes due to fluctuations in the upstream feed, the system automatically adjusts the image acquisition frame rate (via the frequency of the external trigger signal of the camera trigger) and delay time calculation parameters to ensure that each particle can be stably acquired at different conveyor belt speeds, and that the timing accuracy of the rejection action is not affected by speed fluctuations.

[0081] Regular standard sample verification mechanism: Before the start of each production shift, operators submit a set of standard samples with known labeling results (including various types of qualified and unqualified products) to the system for sample verification. The system automatically calculates the precision and recall rate of this sample verification. If either indicator falls below the preset performance benchmark, the system enters an early warning state, prompting operators to check the light source brightness attenuation of the image acquisition module, the contamination of the camera lens, and the air pressure status of the gas path. It also triggers the uploading of the complete standard sample test log for the current batch to the cloud for remote technical support personnel to analyze and diagnose.

[0082] Furthermore, the extraction of the contour integrity score is not a generalized assessment of the morphological integrity of common agricultural products, but rather a dedicated detection channel designed specifically for the physical morphological specificity of organic white melon seeds among similar agricultural products. Specifically, the contour integrity score is extracted by combining extracted grayscale texture features, including: The coordinates of the inner and outer boundaries of the side edge are extracted from the 3D depth map, ellipse fitting is performed, and the local wall thickness of the side edge at each arc length position is calculated along the ellipse circumference to obtain the ellipse fitting parameters and the circumference wall thickness distribution sequence of the side edge.

[0083] In the 3D depth map, there are three levels of depth distribution within the white melon seed body region: the main surface platform depth region, the lateral edge transition gradient zone, and the background reference depth region. Within the lateral edge transition gradient zone, the pixel coordinates at the point where the depth change rate first exceeds the rising threshold are marked as the inner boundary of the lateral edge, and the pixel coordinates at the point where the depth value first falls back to near the background reference are marked as the outer boundary of the lateral edge. Least square ellipse fitting is performed independently on the coordinate sets of the inner and outer boundaries of the lateral edges to obtain the fitting parameters of the inner ellipse (center, semi-major and semi-minor axes, tilt angle) and the fitting parameters of the outer ellipse. The arc length is taken as the positive endpoint of the major axis. An elliptical arc length coordinate system is established with the zero point and clockwise as the increasing direction. The coordinates of all sampling points are determined on the inner ellipse with a fixed arc length interval. For each sampling point, the pixel spacing between the inner and outer elliptical curves along the radial direction of the species is calculated and multiplied by the spatial resolution calibration coefficient of the depth map to obtain the local wall thickness value of the side edge corresponding to the arc length position. The wall thickness values ​​of all sampling points are arranged in the order of arc length coordinates to form a perimeter wall thickness distribution sequence. The inner and outer ellipse fitting parameters, the definition of the elliptical arc length coordinate system, and the perimeter wall thickness distribution sequence are combined to form the side edge ellipse fitting parameters and the perimeter wall thickness distribution sequence.

[0084] Based on the perimeter wall thickness distribution sequence and the physical laws of near-infrared semi-transmission, a geometric prediction brightness envelope along the perimeter of an ellipse is established, and a geometric prediction brightness envelope sequence is output.

[0085] The near-infrared semi-transmittance brightness of the lateral ridges of white melon seeds is formed by near-infrared light penetrating the lateral ridge wall, being scattered by the internal kernel, and then reflected back. Its brightness is related to the degree of attenuation of near-infrared light within the lateral ridge wall, and the degree of attenuation increases with the wall thickness. Therefore, on a healthy seed without defects, there is a monotonically decreasing relationship between the near-infrared semi-transmittance brightness at each arc length position of the lateral ridge and the wall thickness at that position—the brightness is highest at the ends of the major axis of the ellipse with the thinnest wall (the pointed cone position), and lowest at the ends of the minor axis of the ellipse with the thickest wall (the ventral position), forming a periodic brightness modulation envelope strictly determined by the elliptical geometry. Using the perimeter wall thickness distribution sequence as the independent variable, the semi-transmittance brightness at each arc length position is predicted according to the monotonically decreasing near-infrared attenuation law, generating a geometrically predicted brightness envelope sequence of the same length as the perimeter wall thickness distribution sequence. This envelope sequence only reflects the normal brightness fluctuations determined by the elliptical geometry of the white melon seed itself and does not contain any defect information.

[0086] In near-infrared images, the semi-transmittance original brightness of the side edge region is extracted using radial gradient monotonicity as the weight, and the perimeter original brightness sequence and the radial confidence weight sequence of sampling points are obtained.

[0087] In the lateral ridge region, the near-infrared image superimposed two types of optical signals from different sources: diffuse reflection signals from the seed coat surface (which vary with the surface normal direction and have a complex distribution pattern) and near-infrared semi-transmissive signals (which monotonically increase from the outside to the inside with the wall thickness and have a stable radial gradient direction). Taking the radial direction between the inner and outer ellipses as the analysis axis, a column of pixels is extracted radially at each sampling arc length position. The pixel-by-pixel difference in near-infrared brightness value of this column of pixels from the outer boundary to the inner boundary is calculated. If the difference sequence remains positive overall (brightness monotonically increases), then the near-infrared signal of that radial column is determined to be semi-transmissive. The signal is dominant and assigned a high confidence weight. If a significant negative value segment (local decrease in brightness) appears in the difference sequence, it is determined that there is surface diffuse reflection interference at that location and assigned a lower confidence weight. The proportion of positive values ​​in the difference sequence is statistically analyzed for the radial pixel column at each sampling arc length position, and the proportion of positive values ​​is used as the radial confidence weight of that sampling point. The average brightness of all pixels in the radial pixel column of each sampling point is used as the original brightness value at that arc length position. The original brightness values ​​of all sampling points are arranged in order of arc length coordinates to form the original brightness sequence of the perimeter, which is matched with the corresponding radial confidence weight sequence.

[0088] The original perimeter brightness sequence and the geometrically predicted brightness envelope sequence are aligned by performing envelope normalization to eliminate geometric modulation components and determine the de-envelope residual sequence and the effective sampling coverage index.

[0089] Sampling points in the original perimeter brightness sequence whose radial confidence weight exceeds the validity threshold are marked as valid sampling points. The proportion of valid sampling points to the total number of sampling points is calculated to obtain the valid sampling coverage index. For the original brightness value of the valid sampling point, normalization is performed based on the geometric prediction brightness envelope value of the corresponding arc length position. The original brightness value is divided by the corresponding envelope prediction value to obtain the relative brightness ratio at that position. A relative brightness ratio of 1 indicates that the measured brightness is completely consistent with the geometric prediction (healthy side edges). A ratio higher than 1 indicates that the actual wall thickness at that position is less than the prediction (corresponding to enhanced transmission caused by perforation or local defects). A ratio lower than 1 indicates that the actual wall thickness at that position is greater than the prediction (corresponding to weakened transmission caused by the accumulation of broken fragments). The relative brightness ratio sequence is subtracted from the reference value of 1 to obtain the zero-centered de-envelope residual sequence. The residual sequence only retains the deviation information relative to the normal geometric shape of the white melon seed. The normal brightness fluctuation caused by geometric modulation has been completely eliminated. For invalid sampling point positions, linear interpolation is performed to fill the position using the residual values ​​of adjacent valid sampling points.

[0090] Using the envelope-removed residual sequence as the core, and combining the effective sampling coverage index and the ellipse perimeter parameter, the final side edge semi-transparent bright band brightness sequence and side edge ellipse perimeter parameter are constructed.

[0091] The input de-envelope residual sequence is combined with the effective sampling coverage index, the side ellipse fitting parameters, and the ellipse arc length coordinate system. If the effective sampling coverage index is lower than the integrity threshold, it indicates that the radial confidence weight is generally low, and the semi-transmittance signal of the side edge region in the near-infrared image is masked by large-area surface diffuse reflection interference. At this time, the extraction result of the side edge semi-transmittance bright band of the particle is marked as low confidence for subsequent steps. The envelope-removed residual sequence is smoothed by moving average along the circumference of the ellipse to suppress high-frequency pixel noise during the sampling process and retain the real defect signal with a certain arc length extension along the circumference. The smoothed envelope-removed residual sequence is used as the brightness sequence of the side edge semi-transmittance bright band, where the arc length coordinates, arc length interval, ellipse circumference and low confidence mark of each element together constitute the side edge ellipse circumference parameter. The brightness sequence of the side edge semi-transmittance bright band and the side edge ellipse circumference parameter are output. The value of each element of the brightness sequence is zero, which means that the measured semi-transmittance intensity at the arc length position is completely consistent with the predicted value of the ellipse geometry of the white melon seed. A positive value means that there is a perforation or local defect type of damage at the position, and a negative value means that there is a fragment accumulation type of damage at the position.

[0092] Abrupt node detection is performed on the brightness sequence of the semi-transparent bright band of the side edge to locate the damaged position and quantify the degree of damage, and output the side edge damage bitmap and the side edge continuity score; The semi-transmittance bright band on the side edge of a healthy white melon seed exhibits highly uniform brightness along the entire elliptical circumference, with its brightness sequence fluctuating slightly around the mean. When the side edge is fractured, the wall thickness at the crack increases abruptly locally (due to fragment compression causing local thickening) or is partially lost (due to fragment detachment causing perforation), manifesting as local dark valleys (weakened transmission at thickened areas) or local bright peaks (sudden increased transmission at perforations) in the brightness sequence, respectively. Using the sliding window mean of the bright band brightness sequence as a local benchmark, the signed deviation of the brightness value at each sampling point from the local benchmark is calculated. The deviation sequence is subjected to threshold detection. Sampling points exceeding the positive deviation threshold are marked as perforated damage nodes, and sampling points exceeding the negative deviation threshold are marked as thickened damage nodes. The positions and deviation amplitudes of all damage nodes are recorded according to the arc length coordinates to form a side edge damage map. The ratio of the total arc length of the damage nodes to the total circumference of the ellipse and the weighted average of the deviation amplitudes of each damage node are used as the comprehensive quantification basis. After normalization, the value is inverted to obtain the side edge continuity score in the interval of zero to one. The higher the score, the more complete and uniform the side edge is along the entire circumference.

[0093] The specular highlight region of the main surface wax layer is separated from the RGB image, and a highlight ellipse fitting is performed to output the highlight ellipse shape residual map and highlight coverage index.

[0094] Because the surface of the white melon seed shell is covered with a uniform and smooth waxy layer, under illumination from a fixed angle light source, the waxy layer on the main surface produces a specular highlight area that conforms to the curvature of the seed body. In the HSV color space of an RGB image, the specular highlight area presents a set of pixels with extremely low saturation (close to zero) and extremely high brightness. The two-dimensional shape of the highlight area is constrained by the curvature of the seed body surface, presenting a regular elliptical patch with a proportion similar to the major and minor axes of the seed body. The highlight pixel set is selected by jointly filtering the lower bound threshold of saturation and the upper bound threshold of brightness in the HSV space. Least square ellipse fitting is performed on the highlight pixel set to obtain a simulated... The center coordinates, major and minor axis lengths, and tilt angle of the fitted ellipse are determined. The signed distance residuals from each pixel in the set of highlight pixels to the boundary of the fitted ellipse are calculated. The more concentrated the residual distribution, the closer the highlight area is to a regular ellipse, i.e., the more complete the wax layer. The absolute values ​​of the residuals of each pixel are weighted by the pixel area to obtain the mean value of the highlight ellipse morphology residuals. The ratio of the highlight pixel area to the total area of ​​the main surface of the plant is used as the highlight coverage index. Mold or dampness causes the local wax layer to decompose, causing the highlight in that area to disappear (highlight coverage decrease) or the morphology of the highlight area to be distorted in an irregular direction (morphology residual increase).

[0095] Based on the specular elliptical morphological residual map, the spatial location of the morphological residual distribution is correlated with the side edge damage map to identify the specular distortion area caused by the damage, and output the spatial correlation map of wax layer defects and the wax layer integrity score.

[0096] Side edge damage is usually accompanied by synchronous damage to the wax layer in the main surface edge area near the damage location, manifested as a local increase in the specular elliptical morphological residual in the main surface edge area near the arc length coordinate of the damage. The arc length coordinates of each damaged node in the side edge damage bitmap are mapped to the corresponding pixel coordinates of the main surface edge. A fixed radius range is extended inward from this center to form a damage-related region of interest. The mean morphological residual in the damage-related region of interest is compared with the mean morphological residual in the non-related region. If the difference between the two exceeds a preset significance threshold, it is determined that there is synergistic damage to the wax layer caused by the damage in this region, and it is marked in the wax layer defect spatial association map. Independent specular distortion regions with abnormal specular morphological residuals in the non-damage-related region are marked separately. These regions correspond to local decomposition of the wax layer caused by mold or moisture rather than mechanical damage. The wax layer integrity score is obtained by normalizing the area of ​​all defect-marked regions and the specular coverage of the unmarked regions.

[0097] Multiple thickness gradient profiles are extracted from the 3D depth map along the short axis to verify the degree of preservation of the ridge-shaped symmetrical gradient and output the fullness score of the mid-ridge.

[0098] Because the flat dihedral body of white melon seeds exhibits a monotonically decreasing thickness gradient along its short axis from the central ridge to both sides, this gradient, in the three-dimensional depth map of a healthy, plump seed, presents a ridge-shaped depth profile along any cross-section perpendicular to the long axis, decreasing symmetrically to both sides with the central ridge as the apex. In the local coordinate system of the seed, several short-axis cross-section depth profiles are uniformly extracted within one-third of the seed's length along the direction perpendicular to the long axis. The following three indicators are extracted for each profile: first, whether the midpoint of the profile (corresponding to the central ridge position) is a local maximum to verify the convexity of the central ridge; second, whether the central ridge position is to the left... The monotonically decreasing sequence of depth difference between the side pixel column and the right symmetrical pixel column is used to verify the monotonicity of the gradient on both sides; thirdly, the root mean square difference of the point-by-point difference between the left half depth profile and the right half depth profile is used to quantify the symmetry deviation of the gradient on both sides; due to insufficient internal filling, the ridge of the shriveled grain sinks locally, causing the ridge protrusion of the corresponding cross-sectional profile to disappear, and the gradient monotonicity is interrupted; the three indicators of each cross-sectional profile are comprehensively evaluated, the proportion of cross-sections that meet all three conditions is counted to the total number of cross-sections, and then the proportion is corrected by the mean of the symmetry deviation of each cross-section that meets the conditions, and the ridge fullness score is obtained after normalization.

[0099] The product-square root fusion framework integrates the side edge continuity score, wax layer integrity score, and mid-ridge fullness score to output the contour integrity score.

[0100] The test uses the lateral ridge continuity score, wax layer integrity score, and mid-ridge fullness score as joint inputs. These three scores correspond to dedicated detection channels for three unique physical defect mechanisms in white melon seeds: the lateral ridge continuity score is driven by near-infrared semi-transparent bright band abrupt change node detection, specifically for detecting fracturing and perforation-type mechanical damage; the wax layer integrity score is driven by specular highlight elliptical morphology residual analysis, specifically for detecting wax layer decomposition caused by mold and moisture; and the mid-ridge fullness score is driven by ridge-type thickness gradient symmetry monotonicity verification, specifically for detecting shriveled seeds caused by insufficient internal filling. The defect types covered by these three scores are physically independent of each other, and any channel can detect... Any severe anomaly indicates that the particle should be removed. Therefore, a product fusion method is used instead of a weighted summation to prevent multiple normal indicators from masking a single severe anomaly. The cube root of the product of the three scores is performed to restore the fusion result to a uniform sensitivity distribution in the range of zero to one, so that the response sensitivity of the contour integrity score to the three types of defects remains balanced, rather than the overall low compression of the score caused by the product operation. The contour integrity score is output. A score of one indicates that all three white melon seed-specific morphological indicators—complete side edges, uniform wax layer, and full midrib—are normal. The closer the score is to zero, the more severe the at least one type of white melon seed-specific morphological defect.

[0101] This invention provides a deep learning-based intelligent color sorting control system for organic white melon seeds, such as... Figure 2 As shown, it includes: Image acquisition module 1 is used to acquire visual feature image data of particles to be sorted through an image acquisition device; Feature extraction module 2 is used to input visual feature image data into a pre-trained deep learning model. The deep learning model includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector. Feature fusion module 3 is used to take multi-dimensional feature vectors as input, perform matching and judgment based on a preset multi-source feature fusion algorithm, and output a classification decision result indicating whether the particles to be sorted are qualified products; the multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object; The color sorting control module 4 is used to generate a corresponding rejection control signal if the classification decision result indicates that the particles to be sorted are unqualified products, and send the rejection control signal to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of unqualified products.

[0102] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A deep learning-based intelligent color sorting control method for organic white melon seeds, characterized in that, include: The visual feature image data of the particles to be sorted is acquired through an image acquisition device. Visual feature image data is input into a pre-trained deep learning model, which includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector. The multi-dimensional feature vector is used as input, and a matching judgment is performed based on the preset multi-source feature fusion algorithm. The output is a classification decision result indicating whether the particles to be sorted are qualified products. The multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object. If the classification decision indicates that the particles to be sorted are non-conforming, a corresponding rejection control signal is generated and sent to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of non-conforming products.

2. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, The visual feature image data of the particles to be sorted is acquired through an image acquisition device, including: The acquisition module, which includes a multispectral illumination system and a binocular stereo vision camera, acquires RGB image data, near-infrared image data, and three-dimensional depth map data of the particles to be sorted.

3. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, The adaptive weighting process performed by the attention mechanism module includes: The initial feature map is input into the channel attention submodule of the attention mechanism module to calculate the importance weights of different spectral and color channels, and thus obtain the channel-weighted feature map. The channel-weighted feature map is input into the spatial attention submodule in the attention mechanism module to locate the two-dimensional spatial coordinate parameters of impurities and texture abnormalities on the surface of the particles to be sorted, and generate a spatial-weighted feature map. Generate multidimensional feature vectors based on spatially weighted feature maps.

4. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, The matching determination process of the multi-source feature fusion algorithm includes: The RGB color features in the visual feature image data are converted to the HSV color space, and the enhanced color quantization features are extracted and fused with the multidimensional feature vector. Contour integrity score is extracted by combining the extracted grayscale texture features; The fused feature and contour integrity score is compared with the pre-set multi-level sorting dynamic threshold. If the comparison result deviates from the set qualified product threshold range, the classification decision result of the unqualified product is output.

5. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, The feature extraction network adopts a visual Transformer architecture or a lightweight object detection network structure; the deep learning model is pre-pruned and weight quantized before deployment, and is deployed in an edge AI acceleration node to perform forward inference.

6. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, The process of controlling a non-contact physical rejection device to perform real-time separation includes: The rejection control signal is analyzed, the spatial coordinates of the defective product are calculated, and the motion delay time of the defective product reaching the non-contact physical rejection device is calculated based on the production line speed. Based on the delay time, the logic processing unit activates the electromagnetic jet valve that matches the spatial position coordinates within a millisecond-level time window, and blows the defective products away from the main conveyor belt track through high-pressure airflow.

7. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 1, characterized in that, Also includes: Edge computing nodes filter out unqualified particle images and their feature data with a confidence level below a preset threshold in real time, and upload them to the cloud server as incremental samples. The cloud server uses a global dataset containing incremental samples to perform offline training and updates on the main cloud model, generating incremental weight parameters. Incremental weight parameters are distributed and synchronized to the deep learning models of each execution node to adaptively update the dynamic threshold parameters for multi-level sorting.

8. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 4, characterized in that, The contour integrity score is extracted by combining the extracted grayscale texture features, including: Extract the semi-transparent bright bands from the side edges of the near-infrared image, construct a brightness sequence of the bright bands arranged along the circumference of the ellipse, and output the brightness sequence of the semi-transparent bright bands and the circumference parameters of the side edge ellipse. Abrupt node detection is performed on the brightness sequence of the semi-transparent bright band of the side edge to locate the damaged position and quantify the degree of damage, and output the side edge damage bitmap and the side edge continuity score; Separate the specular highlight region of the wax layer on the main surface from the RGB image, perform highlight ellipse fitting, and output the highlight ellipse shape residual map and highlight coverage index. Based on the specular elliptical morphological residual map, the spatial location of the morphological residual distribution is correlated with the side edge damage map to identify the specular distortion area caused by the damage, and output the spatial correlation map of wax layer defects and the wax layer integrity score. Multiple thickness gradient profiles are extracted from the 3D depth map along the short axis to verify the degree of preservation of the ridge-shaped symmetric gradient and output the fullness score of the mid-ridge. The product-square root fusion framework integrates the side edge continuity score, wax layer integrity score, and mid-ridge fullness score to output the contour integrity score.

9. The intelligent color sorting control method for organic white melon seeds based on deep learning as described in claim 8, characterized in that, Extract the semi-transparent bright bands from the side edges of the near-infrared image, construct a brightness sequence of the bright bands arranged along the circumference of the ellipse, and output the brightness sequence of the semi-transparent bright bands and the circumference parameters of the side edge ellipse, including: Extract the inner and outer boundary coordinates of the side edge from the 3D depth map, perform ellipse fitting, and calculate the local wall thickness of the side edge at each arc length position along the ellipse circumference to obtain the ellipse fitting parameters and the circumference wall thickness distribution sequence of the side edge. Based on the perimeter wall thickness distribution sequence and the physical law of near-infrared semi-transmission, a geometric prediction brightness envelope along the perimeter of an ellipse is established, and a geometric prediction brightness envelope sequence is output. In near-infrared images, the semi-transmittance original brightness of the side edge region is extracted using radial gradient monotonicity as the weight, and the perimeter original brightness sequence and the sampling point radial confidence weight sequence are obtained. The original perimeter brightness sequence and the geometrically predicted brightness envelope sequence are aligned by envelope normalization to eliminate geometric modulation components and determine the de-envelope residual sequence and the effective sampling coverage index. Using the envelope-removed residual sequence as the core, and combining the effective sampling coverage index and the ellipse perimeter parameter, the final side edge semi-transparent bright band brightness sequence and side edge ellipse perimeter parameter are constructed.

10. A deep learning-based intelligent color sorting control system for organic white melon seeds, characterized in that, include: The image acquisition module is used to acquire visual feature image data of the particles to be sorted through an image acquisition device. The feature extraction module is used to input visual feature image data into a pre-trained deep learning model. The deep learning model includes a feature extraction network and an attention mechanism module. The feature extraction network extracts the initial feature map of the particles to be sorted, and the attention mechanism module performs adaptive weighting on key feature regions that reflect the surface texture and color change points of the particles to be sorted, and outputs a multi-dimensional feature vector. The feature fusion module is used to take multi-dimensional feature vectors as input, perform matching and judgment based on a preset multi-source feature fusion algorithm, and output a classification decision result indicating whether the particles to be sorted are qualified products; the multi-source feature fusion algorithm is configured to integrate the color space features and grayscale texture features of the target object. The color sorting control module generates a corresponding rejection control signal if the classification decision indicates that the particles to be sorted are defective. The rejection control signal is then sent to the logic processing unit to control the non-contact physical rejection device to perform real-time separation of defective products.