A multi-stage screening and quality detection method for fruit pears
By using multi-angle image acquisition and graph neural network models, combined with the growth deviation vector of peaches and dynamic threshold adjustment, high-precision identification and grading of peach varieties has been achieved. This solves the problem of low screening accuracy caused by inter-variety variation in existing technologies and improves the grading accuracy and adaptability of peaches.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-17
AI Technical Summary
Existing peach screening methods cannot effectively adapt to the natural variations in shape, texture, and color among different varieties, resulting in a one-size-fits-all grading standard that affects screening accuracy and market competitiveness.
Multi-angle image acquisition and synchronous control are adopted, and color, texture and contour structure features are combined. A graph neural network model is used to classify varieties, construct growth deviation vectors, perform hierarchical perception analysis, and use a dynamic threshold strategy to determine quality level.
It achieves high-precision identification of different peach varieties, improves grading accuracy and adaptability, avoids interference from low-sensitivity areas on the overall evaluation, and enhances the resolution and reliability of peach quality detection.
Smart Images

Figure CN121354095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fruit and peach screening technology, and in particular to a multi-stage screening and quality testing method for fruit and peaches. Background Technology
[0002] In the field of fruit grading and processing, peaches are an economic crop that is highly sensitive to appearance and maturity. The grading quality of peaches is directly related to market price and sales efficiency. With the development of automated sorting technology, machine vision-based peach sorting methods have gradually replaced manual sorting and become the core link in the fruit processing line. The current mainstream system usually adopts a combination of multi-angle imaging, image recognition algorithms and mechanical sorting structures to achieve preliminary identification and processing of fruit appearance indicators.
[0003] However, existing peach screening methods still have many shortcomings. Most schemes rely on single-angle images or local features for variety classification and defect identification, which cannot effectively adapt to the natural variations in morphology, texture and color between different varieties. In addition, the grading judgment often lacks a dynamic adjustment mechanism based on variety characteristics, which easily leads to the problem of a one-size-fits-all grading standard. This results in highly mature but non-standard peaches being misjudged as substandard products, affecting the overall screening accuracy and market competitiveness. Summary of the Invention
[0004] This invention provides a multi-level screening and quality inspection method for peaches, which comprehensively perceives the varietal attributes, growth status and surface defects of peaches, realizes an intelligent screening strategy based on the personalized characteristics of varieties, and improves the grading accuracy, adaptability and processing efficiency of peaches.
[0005] A multi-stage screening and quality testing method for peaches includes the following steps:
[0006] S1, Automatic identification and modeling of peach varieties: Collect multi-angle images of the peaches to be tested, extract their surface color features, texture frequency features and contour structure features, and input them into the peach variety classification model to output peach variety labels and corresponding variety parameter sets;
[0007] S2, Construction of growth feature mapping: Based on the parameter set of peach varieties, extract the set of key points of morphological structure from the multi-angle images of peaches, and perform graph structure matching with the predefined variety growth morphology feature template to output the growth deviation vector of individual peaches.
[0008] S3, Regional Stratification Perception Analysis: Based on the growth deviation vector of individual peaches, an adaptive regional division map for fruit surface stratification is constructed, dividing the peach image into high-sensitivity areas and low-sensitivity areas, and performing independent defect identification and maturity determination in each area.
[0009] S4, Dynamic Grade Adjustment and Judgment: Integrating the identification results of each region, the overall quality grade of the peach is evaluated based on the variety label and growth deviation vector of the peach, and the comprehensive quality label is output after adjustment based on the variety and individual growth differences.
[0010] S5, Screening Control Instruction Generation: Converts the comprehensive quality label into control instructions to drive the multi-channel sorting execution device to complete the grading, screening, and output of peaches.
[0011] Optionally, the automatic peach variety identification modeling in S1 includes:
[0012] S11, Multi-angle image acquisition and synchronous control: During the movement of the peaches along the conveyor line, multiple sets of industrial cameras deployed at different positions (top, side, tilt angle) are used to acquire images. The acquisition process is synchronously triggered and controlled by the image acquisition control unit, and the multi-angle images are packaged to generate a peach image set.
[0013] S12, Multimodal image feature extraction: Extract surface color features (average hue, color distribution histogram), texture main frequency features (Gabor filter response, local binary pattern coding histogram), and contour structure features (edge shape, approximate ellipticity, symmetry axis offset) from the generated peach image set, and uniformly encode the multimodal image features to generate multimodal image feature vectors.
[0014] S13, Variety Classification Model Inference and Label Output: Input the multimodal image feature vector into the peach variety classification model to distinguish and identify multiple varieties of peaches, output the variety label of the peach, and associate it with the preset variety parameter set of the variety.
[0015] Optionally, the multi-angle image acquisition and synchronization control in S11 includes:
[0016] S111, Multi-directional Deployment of Industrial Cameras: Multiple industrial camera mounting points are set on both sides and above the fruit and peach conveyor path. The industrial cameras are fixed at the top, the front side, and the tilt angle, with imaging angles at the vertical angle, respectively. , and ;
[0017] S112, Synchronous Trigger Timing Setting: The image acquisition control unit and the encoder of the conveyor device are set to link data. Based on the sensor trigger signal at the center position of the peach, shooting commands are simultaneously sent to all industrial cameras via the control bus, ensuring the synchronous trigger timing meets the requirements. ,in, For the first Each camera's data acquisition time, For camera The delay compensation time parameter, The reference time for triggering the target peach to enter the shooting area;
[0018] S113, Multi-angle image integration and packaging: After completing the synchronous acquisition of multiple cameras, the image acquisition control unit numbers and binds the images of the corresponding peach from each perspective according to the acquisition sequence, generating a peach image set including top view, side view and oblique view.
[0019] Optionally, the multimodal image feature extraction in S12 includes:
[0020] S121, Color Feature Extraction: Perform color space conversion on each image in the peach image set, converting the RGB images to HSV space, and extract the average hue value of each image. and hue distribution histogram ;
[0021] S122, Texture Dominant Frequency Feature Extraction: For each peach image, a Gabor filter bank is used to calculate the texture response, obtaining texture dominant frequency response maps at different scales and orientations. And extract the mean of its response. As texture features, a gray-level co-occurrence pattern map is generated using Local Binary Pattern (LBP) encoding to construct a texture histogram. ;
[0022] S123, Contour Structure Feature Extraction and Unified Encoding: The Canny edge detection algorithm is used to extract the edge contour of the peach, fit the minimum ellipse circumcircle contour, and calculate its approximate ellipticity index. Offset from the axis of symmetry ;
[0023] S124, Unified Encoding of Multimodal Feature Vectors: Integrating Color Features Texture frequency characteristics Contour structure features Encode the features into multimodal image features using a unified dimension. .
[0024] Optionally, the texture dominant frequency feature extraction in S122 includes:
[0025] S1221, Gabor response mean calculation: Calculate the grayscale image of the peach. Inputting the data into a multi-scale, multi-directional Gabor filter bank yields a scale of... , direction is Main frequency response diagram Calculate the mean response for each response plot. The mean responses from all scale and orientation combinations are then sequentially concatenated to form Gabor texture response features. ;
[0026] S1222, LBP Texture Histogram Construction: Converting Peach Images into Local Binary Pattern (LBP) Encoded Maps The normalized frequency of each encoding mode in the image was counted, and a texture distribution histogram was constructed. ;
[0027] S1223, Texture Feature Vector Construction: Constructing Gabor texture response feature vectors and texture distribution histogram splicing into texture main frequency features .
[0028] Optionally, the variety classification model inference and label output in S13 include:
[0029] S131, Variety Classification Inference Calculation: Calculate the feature vector of the multimodal image. Input the data into the peach variety classification model to calculate the predicted probability distribution for each peach variety. ;
[0030] S132, Tag Determination and Parameter Set Association: Determine peach variety tags based on the maximum probability principle. And search for the corresponding peach variety label in the variety configuration library. Corresponding variety parameter set ,in, The preset parameter set for this variety includes fruit shape model, color distribution range, and maturity standard.
[0031] Optionally, the peach variety classification model adopts a graph neural network (GNN) model, which includes:
[0032] S1311, Graph Structure Construction and Node Initialization: For Multimodal Image Features Color features, texture frequency features, and contour structure features are used as graph nodes. Construct the initial node embedding matrix The node adjacency graph is ,in, For a set of nodes, Let it be the set of edges;
[0033] S1312, Modality-labeled graph attention propagation mechanism: Modality type (color / texture / structure) is introduced as graph node label to guide the weighted adjustment of information within the same modality or across modalities during information propagation, and to calculate attention weights;
[0034] S1313, Graph Node Information Aggregation and Update: Through the graph propagation mechanism, each feature node integrates neighbor information while retaining its own expression;
[0035] S1314, Graph-level readout and variety prediction: Global average pooling is used to aggregate the representations of all feature nodes to form a full graph representation, which is then fed into a fully connected layer to complete the classification of peach varieties.
[0036] Optionally, the construction of the growth feature map in S2 includes:
[0037] S21, Key point extraction of morphological structure: A three-dimensional contour point cloud model is constructed from multi-angle images of the peach, and a set of key points for the morphological structure of the peach is extracted based on boundary extraction algorithms and feature point discrimination rules. ;
[0038] S22, Construction of Variety Characteristic Template Map: Load the growth morphological characteristic template map of the corresponding variety from the peach variety parameter set. ,in, For the key points of the template, This represents the standard growing topological relationship edge set between key points;
[0039] S23, Graph Structure Matching and Growth Deviation Vector Generation: This involves matching the key points of the fruit / peach morphological structure. Node set of the growth morphology feature template diagram Perform node alignment and edge structure difference analysis, calculate the positional deviation and structural consistency index between each pair of nodes, and output the growth deviation vector. .
[0040] Optionally, the region-level perception analysis in S3 includes:
[0041] S31, Adaptive Region Partitioning Map Construction: Based on the Growth Deviation Vector of Individual Peach Fruits Each structural key point growth deviation value Mapping to the image coordinate system to construct a region sensitivity distribution map A Gaussian-weighted kernel smoothing method is used to generate a continuous sensitivity heatmap. ;
[0042] S32, Region Classification and Mask Generation: Sensitivity Heatmap With dynamic threshold Compare and generate region category mask maps The high-sensitivity area and the low-sensitivity area are divided as follows:
[0043] ;
[0044] S33, Independent Judgment by Region: Within high-sensitivity and low-sensitivity zones, the defect types and maturity levels of the peaches are determined separately, and the judgment results are summarized into a regional label set. .
[0045] Optionally, the level dynamic adjustment judgment in S4 includes:
[0046] S41, Regional Weighted Score Fusion: Based on the maturity scores of high-sensitivity and low-sensitivity areas. , Defect Score , The weighted maturity score is generated by fusion. Weighted defect score ;
[0047] S42, Dynamic threshold adjustment function calculation: based on the current peach variety label. With growth deviation vector Calculate the dynamic adjustment factor ;
[0048] S43, Overall Quality Level Output: Weighted maturity score Weighted defect score With dynamic adjustment factor The final comprehensive quality grade label for peaches determined jointly. , is represented as:
[0049] .
[0050] The beneficial effects of this invention are:
[0051] This invention acquires multi-angle images of peaches and combines them with multimodal image features such as color, texture, and contour structure. It then uses a graph neural network model to construct a variety classification reasoning mechanism, which enables high-precision identification of different peach varieties. Furthermore, based on the variety parameter set, it guides the extraction of structural key points and alignment with the graph structure to construct individualized growth deviation vectors, providing structured input for subsequent zoning identification and quality judgment.
[0052] This invention constructs a sensitivity heatmap by using the growth deviation vector of peaches and generates an adaptive partition map of high-sensitivity and low-sensitivity areas, achieving a structural understanding of the differences on the peach surface. Based on this, a locally enhanced convolutional network and a color-texture evaluation model are used to independently analyze the maturity and defect level of different regions, making the model more accurate in recognizing local features such as micro-cracks, deformations, and developmental abnormalities, while avoiding interference from low-sensitivity areas in the overall evaluation, effectively improving the resolution and reliability of peach quality detection.
[0053] This invention introduces a dynamic threshold adjustment mechanism based on variety labels and individual deviations, and weightedly integrates multi-region identification results with growth deviation adjustment factors to generate a comprehensive quality grade label. This label can flexibly adapt to the evaluation standards of peaches of different varieties and under different growth conditions, and further drive the multi-channel sorting execution device to complete the graded output, thus constructing a closed-loop system from image recognition, region analysis to equipment control. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic diagram of the multi-level screening and quality inspection method according to an embodiment of the present invention;
[0056] Figure 2 This is a schematic diagram of the automatic identification and modeling of peach varieties according to an embodiment of the present invention. Detailed Implementation
[0057] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Those skilled in the art may employ other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0058] like Figures 1-2 As shown, a multi-stage screening and quality testing method for peaches includes the following steps:
[0059] S1, Automatic identification and modeling of peach varieties: Collect multi-angle images of the peaches to be tested, extract their surface color features, texture frequency features and contour structure features, and input them into the peach variety classification model to output peach variety labels and corresponding variety parameter sets;
[0060] S2, Construction of growth feature mapping: Based on the parameter set of peach varieties, extract the set of key points of morphological structure from the multi-angle images of peaches, and perform graph structure matching with the predefined variety growth morphology feature template to output the growth deviation vector of individual peaches.
[0061] S3, Regional Stratification Perception Analysis: Based on the growth deviation vector of individual peaches, an adaptive regional division map for fruit surface stratification is constructed, dividing the peach image into high-sensitivity areas and low-sensitivity areas, and performing independent defect identification and maturity determination in each area.
[0062] S4, Dynamic Grade Adjustment and Judgment: Integrating the identification results of each region, the overall quality grade of the peach is evaluated based on the variety label and growth deviation vector of the peach, and the comprehensive quality label is output after adjustment based on the variety and individual growth differences.
[0063] S5, Screening Control Instruction Generation: Converts the comprehensive quality label into control instructions to drive the multi-channel sorting execution device to complete the grading, screening, and output of peaches.
[0064] The automatic peach variety identification modeling in S1 includes:
[0065] S11, Multi-angle image acquisition and synchronous control: During the movement of the peaches along the conveyor line, multiple sets of industrial cameras deployed at different positions (top, side, tilt angle) are used to acquire images. The acquisition process is synchronously triggered and controlled by the image acquisition control unit, and the multi-angle images are packaged to generate a peach image set.
[0066] S12, Multimodal image feature extraction: Extract surface color features (average hue, color distribution histogram), texture main frequency features (Gabor filter response, local binary pattern coding histogram), and contour structure features (edge shape, approximate ellipticity, symmetry axis offset) from the generated peach image set, and uniformly encode the multimodal image features to generate multimodal image feature vectors.
[0067] S13, Variety Classification Model Inference and Label Output: Input the multimodal image feature vector into the peach variety classification model to distinguish and identify multiple varieties of peaches, output the variety label of the peach, and associate it with the preset variety parameter set of the variety.
[0068] The multi-angle image acquisition and synchronization control in S11 includes:
[0069] S111, Multi-directional Deployment of Industrial Cameras: Multiple industrial camera mounting points are set on both sides and above the fruit and peach conveyor path. The industrial cameras are fixed at the top, the front side, and the tilt angle, with imaging angles at the vertical angle, respectively. , and This ensures that the top, circumference, and part of the bottom surface of the peach are completely captured during rotation or translation.
[0070] S112, Synchronous Trigger Timing Setting: The image acquisition control unit and the encoder of the conveyor device are set to link data. Based on the sensor trigger signal at the center position of the peach, shooting commands are simultaneously sent to all industrial cameras via the control bus, ensuring the synchronous trigger timing meets the requirements. ,in, For the first Each camera's data acquisition time, For camera The delay compensation time parameter, The reference time for triggering the target peach to enter the shooting area;
[0071] S113, Multi-angle image integration and packaging: After completing the synchronous acquisition of multiple cameras, the image acquisition control unit numbers and binds the images of the corresponding peach from each perspective according to the acquisition sequence, generating a peach image set including top view, side view and oblique view.
[0072] Multimodal image feature extraction in S12 includes:
[0073] S121, Color Feature Extraction: Perform color space conversion on each image in the peach image set, converting the RGB images to HSV space, and extract the average hue value of each image. and hue distribution histogram , Indicates the first The proportion of pixels in each color tone range The number of intervals in the histogram is represented as:
[0074] ;
[0075] in, For the image at the pixel point Hue value, , These represent the number of rows and columns of the image, respectively.
[0076] S122, Texture Dominant Frequency Feature Extraction: For each peach image, a Gabor filter bank is used to calculate the texture response, obtaining texture dominant frequency response maps at different scales and orientations. And extract the mean of its response. As texture features, a gray-level co-occurrence pattern map is generated using Local Binary Pattern (LBP) encoding to construct a texture histogram. ;
[0077] S123, Contour Structure Feature Extraction and Unified Encoding: The Canny edge detection algorithm is used to extract the edge contour of the peach, fit the minimum ellipse circumcircle contour, and calculate its approximate ellipticity index. Offset from the axis of symmetry , is represented as:
[0078] ;
[0079] ;
[0080] in, , These are the major and minor axes of the fitted ellipse, respectively. The actual position of the contour point about the geometric center axis of symmetry. Let its position be the mirror image point on the axis of symmetry. This represents the total number of contour feature points involved in the symmetry calculation.
[0081] S124, Unified Encoding of Multimodal Feature Vectors: Integrating Color Features Texture frequency characteristics Contour structure features Encode the features into multimodal image features using a unified dimension. .
[0082] Texture frequency feature extraction in S122 includes:
[0083] S1221, Gabor response mean calculation: Calculate the grayscale image of the peach. Inputting the data into a multi-scale, multi-directional Gabor filter bank yields a scale of... , direction is Main frequency response diagram Calculate the mean response for each response plot. The mean responses from all scale and orientation combinations are then sequentially concatenated to form Gabor texture response features. , is represented as:
[0084] ;
[0085] in, For the image of a peach at pixel location grayscale value, For the scale , direction is Gabor kernel function;
[0086] ;
[0087] in, , These are the width and height of the image, respectively;
[0088] ;
[0089] in, respectively scale ,direction The mean response of the main frequency response map obtained after Gabor filtering the image of the lower peach;
[0090] S1222, LBP Texture Histogram Construction: Converting Peach Images into Local Binary Pattern (LBP) Encoded Maps The normalized frequency of each encoding mode in the image was counted, and a texture distribution histogram was constructed. , is represented as:
[0091] ;
[0092] in, For the first Normalized frequency of each coding pattern The total number of encoding patterns. This is an indicator function; it returns 1 if the condition is true, and 0 otherwise.
[0093] S1223, Texture Feature Vector Construction: Constructing Gabor texture response feature vectors and texture distribution histogram splicing into texture main frequency features .
[0094] The variety classification model inference and label output in S13 include:
[0095] S131, Variety Classification Inference Calculation: Calculate the feature vector of the multimodal image. Input the data into the peach variety classification model to calculate the predicted probability distribution for each peach variety. ;
[0096] S132, Tag Determination and Parameter Set Association: Determine peach variety tags based on the maximum probability principle. And search for the corresponding peach variety label in the variety configuration library. Corresponding variety parameter set ,in, The preset parameter set for this variety, including fruit shape model, color distribution range, and maturity standard, is represented as follows:
[0097] .
[0098] The peach variety classification model uses a graph neural network (GNN) model, which includes:
[0099] S1311, Graph Structure Construction and Node Initialization: For Multimodal Image Features Color features, texture frequency features, and contour structure features are used as graph nodes. Construct the initial node embedding matrix The node adjacency graph is ,in, For a set of nodes, Let the set of edges be represented as:
[0100] ;
[0101] ;
[0102] in, For the initial projection function, The projection parameter matrix is learnable;
[0103] S1312, Modality-labeled graph attention propagation mechanism: Modality type (color / texture / structure) is introduced as a graph node label to guide information propagation. This label is used to weight and adjust information within the same or across different modalities, and to calculate attention weights, expressed as:
[0104] ;
[0105] in, For attention weights, For attention weight vectors, , For the first Nodes in the layer graph , The expression, , These are modal tags, The relative weights between modal labels;
[0106] ;
[0107] in, The attention weights are normalized. For nodes The set of neighboring nodes, For nodes All neighboring nodes Attention weight score The index and;
[0108] S1313, Graph Node Information Aggregation and Update: Through the graph propagation mechanism, each feature node integrates neighbor information while retaining its own representation, as shown below:
[0109] ;
[0110] in, For the first Layer nodes The updated version indicates that It is the ReLU activation function. A weighted representation of neighbor node information;
[0111] S1314, Graph-level readout and variety prediction: Global average pooling is used to aggregate the representations of all feature nodes to form a full graph representation, which is then fed into a fully connected layer to complete the classification of peach varieties, represented as:
[0112] ;
[0113] in, For the last layer ( Nodes in the layer The expression, For full-map representation, This represents the total number of nodes;
[0114] ;
[0115] ;
[0116] in, For the first The classification score corresponding to each variety , The first Weights and biases of fully connected layers for each variety The fruit peach belongs to the first Predicted probability of each variety This represents the total number of variety categories.
[0117] The construction of the growth feature map in S2 includes:
[0118] S21, Key point extraction of morphological structure: A three-dimensional contour point cloud model is constructed from multi-angle images of the peach, and a set of key points for the morphological structure of the peach is extracted based on boundary extraction algorithms and feature point discrimination rules. ,in, The first The spatial coordinates of key points are given by the key point extraction function as follows:
[0119] ;
[0120] in, For the current individual peach Key points of each form For the first Images from different perspectives It is a combined algorithm that includes contour fitting, boundary curvature determination, and boundary symmetry detection;
[0121] Combinatorial Algorithm Represented as:
[0122] (1) Contour fitting: from the image Extract the set of contour points ,in, To extract from the image The total number of peach contour points extracted through edge detection is represented by the least squares fitted boundary curve, as follows:
[0123] ;
[0124] in, The fitting order is... The boundary function is fitted using polynomial form. These are the polynomial fitting coefficients. for of Power of;
[0125] (2) Boundary curvature judgment: Calculate the boundary curvature value of each contour point and set the curvature threshold. Select a set of high curvature points , is represented as:
[0126] ;
[0127] in, , For point The first derivative on the boundary curve, , It is the second derivative. For point Curvature at that point;
[0128] ;
[0129] ;
[0130] in, For curvature The mean, For curvature Standard deviation;
[0131] (3) Boundary symmetry detection: Map the points to both sides of the center axis of symmetry of the peach, and calculate the symmetry deviation of each pair of points. Select the one that satisfies The points are selected as candidate key points, among which, To determine whether the symmetry error is acceptable, the final set of key points for the morphological structure of the peach was determined. , is represented as:
[0132] ;
[0133] in, For a point about the axis of symmetry Mirrored coordinates;
[0134] ;
[0135] in, To meet The point set, To select the most representative points based on the distribution and concentration of key points, The number of key structural points required for the output;
[0136] S22, Construction of Variety Characteristic Template Map: Load the growth morphological characteristic template map of the corresponding variety from the peach variety parameter set. ,in, For the key points of the template, The standard growth topology edge set between key points is used as the template diagram as the structural benchmark of the ideal growth state, forming a matching reference diagram.
[0137] S23, Graph Structure Matching and Growth Deviation Vector Generation: This involves matching the key points of the fruit / peach morphological structure. Node set of the growth morphology feature template diagram Perform node alignment and edge structure difference analysis, calculate the positional deviation and structural consistency index between each pair of nodes, and output the growth deviation vector. , is represented as:
[0138] ;
[0139] in, To reflect the degree of structural deviation of this point relative to the standard template for the variety, For the current individual peach Key points of each form These are the standard key points corresponding to the template diagram.
[0140] The region-level perception analysis in S3 includes:
[0141] S31, Adaptive Region Partitioning Map Construction: Based on the Growth Deviation Vector of Individual Peach Fruits Each structural key point growth deviation value Mapping to the image coordinate system to construct a region sensitivity distribution map A Gaussian-weighted kernel smoothing method is used to generate a continuous sensitivity heatmap. , is represented as:
[0142] ;
[0143] in, Key structural points The growth deviation value, The width of the Gaussian kernel;
[0144] S32, Region Classification and Mask Generation: Sensitivity Heatmap With dynamic threshold Compare and generate region category mask maps The high-sensitivity area and the low-sensitivity area are divided as follows:
[0145] ;
[0146] in, , This represents the mean of the overall image sensitivity heatmap. The standard deviation of the heatmap. The coefficient used to adjust the threshold sensitivity;
[0147] S33, Independent Judgment by Region: In high-sensitivity and low-sensitivity regions, the defect type and maturity level of the peach are determined separately. A locally enhanced convolutional detection network is used in the high-sensitivity region, while a color-texture joint evaluation model is used in the low-sensitivity region. The judgment results are then summarized into a region-level label set. , is represented as:
[0148] ;
[0149] in, This is a region category label, with a value of (Highly sensitive area) or (Low-sensitivity area) In order to cooperate with the region The corresponding quality labels include maturity level or "defect level";
[0150] The highly sensitive region is represented by a locally enhanced convolutional detection network as follows:
[0151] ;
[0152] ;
[0153] ;
[0154] in, For the first The first layer Feature map of each channel For the first The first layer One convolutional kernel, For the first Layer bias terms, For activation function, This is the original feature map after convolution. For spatial attention modules, As an attention fusion factor, Input the number of channels. This is the weighted enhanced feature map. It is a global average pooling layer. It is a fully connected layer. For the probability distribution of defect types, when At that time, it is a serious defect. At that time, it is a moderate defect. At that time, it was a minor defect. At that time, it is without defects;
[0155] The color-texture joint evaluation model is represented as follows:
[0156] ;
[0157] ;
[0158] ;
[0159] in, , , These represent the average hue, saturation, and brightness of the image region, respectively. , The mean and standard deviation of the LBP encoding. For Gabor response energy, , This is the maturity reference feature vector corresponding to the variety template. , , , These are weighting coefficients. For cosine similarity, To score maturity, if If it is judged to be mature, If it is judged to be sub-mature, It was determined to be immature.
[0160] The dynamic adjustment of levels in S4 includes:
[0161] S41, Regional Weighted Score Fusion: Based on the maturity scores of high-sensitivity and low-sensitivity areas. , Defect Score , The weighted maturity score is generated by fusion. Weighted defect score , is represented as:
[0162] ;
[0163] ;
[0164] in, , This refers to the regional weighting coefficient.
[0165] S42, Dynamic threshold adjustment function calculation: based on the current peach variety label. With growth deviation vector Calculate the dynamic adjustment factor , is represented as:
[0166] ;
[0167] ;
[0168] in, , For dynamic adjustment coefficients, This represents the mean of growth deviation. The number of structural key points in an individual peach;
[0169] S43, Overall Quality Level Output: Weighted maturity score Weighted defect score With dynamic adjustment factor The final comprehensive quality grade label for peaches determined jointly. , is represented as:
[0170] .
[0171] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0172] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for multi-stage screening and quality detection of fruit peaches, characterized by, The method comprises the following steps: S1, automatic fruit variety identification modeling: collecting multi-angle images of the fruit to be tested, extracting surface color features, texture frequency features and contour structure features, and inputting them into a fruit variety classification model to output fruit variety labels and corresponding variety parameter sets; S2, growth feature mapping construction: based on the fruit variety parameter set, key point sets of morphological structures are extracted from the multi-angle images of the fruit, and graph structure matching is performed between the key point sets and pre-defined variety growth morphological feature templates to output a growth deviation vector of the fruit individual; S3, regional hierarchical perception analysis: according to the growth deviation vector of the fruit individual, an adaptive region division graph for fruit surface layering is constructed, the fruit image is divided into a high-sensitivity region and a low-sensitivity region, and independent defect recognition and maturity determination are performed in each region; S4, grade dynamic adjustment identification: the recognition results of each region are fused, the fruit overall quality grade is evaluated based on the fruit variety label and the growth deviation vector by using a dynamic threshold strategy, and a comprehensive quality label adjusted based on the variety and individual growth difference is output; S5, screening control instruction generation: the comprehensive quality label is converted into a control instruction for driving a multi-channel sorting execution device to complete the grading and output of the fruit; The growth feature mapping construction in S2 comprises: S21, morphological structure key point extraction: a three-dimensional contour point cloud model is constructed from multi-angle images of the fruit, and a set of morphological structure key points of the fruit is extracted based on a boundary extraction algorithm and a feature point discrimination rule ; S22, variety feature template graph construction: load the growth morphological feature template graph of the corresponding variety from the fruit variety parameter set wherein, is the template key point position, is the standard growth topology relationship edge set between key points; S23, Graph Structure Matching and Growth Deviation Vector Generation: This involves matching the key points of the fruit / peach morphological structure. Node set of the growth morphology feature template diagram Perform node alignment and edge structure difference analysis, calculate the positional deviation and structural consistency index between each pair of nodes, and output the growth deviation vector. ; The regional hierarchical perception analysis in S3 comprises: S31, Adaptive Region Partitioning Map Construction: Based on the Growth Deviation Vector of Individual Peach Fruits Each structural key point growth deviation value Mapping to the image coordinate system to construct a region sensitivity distribution map A Gaussian-weighted kernel smoothing method is used to generate a continuous sensitivity heatmap. ; S32, Region Classification and Mask Generation: Sensitivity Heatmap With dynamic threshold Compare and generate region category mask maps The high-sensitivity area and the low-sensitivity area are divided as follows: ; S33, sub-region independent determination: in the high sensitivity area and the low sensitivity area, the defect type and the maturity grade of the fruit are determined respectively, and the determination results are collected as a region-level label set .
2. The multi-stage screening and quality detection method of fruit peaches according to claim 1, characterized in that, The fruit variety automatic identification modeling in S1 comprises: S11, multi-angle image acquisition and synchronous control: during the movement of the fruit via the conveying line, multi-angle images are acquired by multiple groups of industrial cameras arranged at different positions, the acquisition process is synchronously triggered and controlled by an image acquisition control unit, and multi-angle image sets are packaged to generate fruit image sets; S12, multi-modal image feature extraction: surface color features, texture frequency features and contour structure features are extracted from the generated fruit image sets, and multi-modal image features are uniformly encoded to generate multi-modal image feature vectors; S13, variety classification model reasoning and label output: the multi-modal image feature vectors are input into the fruit variety classification model to distinguish and identify the multi-variety fruit, and the variety label of the fruit is output, and the variety parameter set preset for the variety is associated.
3. The multi-stage screening and quality detection method of fruit peaches according to claim 2, characterized in that, The multi-angle image acquisition and synchronous control in S11 comprises: S111, multi-directional deployment of industrial cameras: multiple industrial camera installation sites are set on both sides and above the peach conveying path, and the industrial cameras are fixed on the top, the front side and the inclined angle direction, respectively, with imaging angles of 90° , and ; S112, synchronization trigger timing setting: set the image acquisition control unit and the encoder of the conveying device in data linkage, according to the sensor trigger signal of the center position of the fruit, simultaneously issue shooting instructions to all industrial cameras through the control bus, and the synchronization trigger timing meets wherein, is the acquisition time of the th camera, is the delay compensation time parameter of the camera , and is the trigger reference time when the target fruit enters the shooting area. S113, multi-angle image integration packaging: after the multi-camera synchronous acquisition is completed, the image acquisition control unit numbers and binds each view image of the corresponding fruit according to the acquisition time sequence to generate a fruit image set including a top view, a side view and an oblique view.
4. The multi-stage screening and quality detection method of fruit peaches according to claim 3, characterized in that, The multi-modal image feature extraction in S12 comprises: S121, color feature extraction: color space conversion is performed on each image in the peach image set, the RGB image is converted into HSV space, and the average hue value of each image is extracted and a hue distribution histogram ; S122, texture main frequency feature extraction: for each peach image, texture response calculation is performed using a Gabor filter bank to obtain texture main frequency response maps under different scales and directions , and the response mean value is extracted As a texture feature, a gray level co-occurrence pattern map is generated using a local binary pattern code to construct a texture histogram ; S123, contour structure feature extraction and unified coding: using Canny edge detection algorithm to extract the peach edge contour, fitting the minimum ellipse circumscribed contour, and calculating its approximate ellipticity index Axis of symmetry offset ; S124, multi-modal feature vector unified encoding: the color feature , texture main frequency feature , contour structure feature is spliced into a multi-modal image feature in a unified dimension .
5. The method for multi-stage screening and quality detection of fruit peaches according to claim 4, characterized in that, The texture frequency feature extraction in S122 comprises: S1221, Gabor response mean value calculation: the gray image of the peach image is input to a multi-scale multi-direction Gabor filter bank, and a main frequency response graph with a scale of , a direction of is obtained , the response mean value of each response graph is calculated , and all response mean values under the combination of all scales and directions are spliced in order to form a Gabor texture response feature ; S1222, LBP texture histogram construction: convert the peach image to a local binary pattern encoded image , count the normalized occurrence frequency of each encoding pattern in the image, and construct a texture distribution histogram ; S1223, texture feature vector construction: the Gabor texture response feature vector and the texture distribution histogram are spliced into the texture main frequency feature .
6. The multi-stage screening and quality detection method of fruit peaches according to claim 5, characterized in that, The variety classification model reasoning and label output in S13 comprises: S131, variety classification inference calculation: the multi-modal image feature vector is input to the peach variety classification model, and the prediction probability distribution of each peach variety is calculated ; S132, label determines the variety of the peach according to the parameter set: determine the variety of the peach according to the maximum probability principle , and find the corresponding variety parameter set in the variety configuration library corresponding to the variety label of the peach , wherein The preset parameter set for the variety, including the fruit shape model, the color distribution range, and the maturity standard.
7. A method of multi-stage screening and quality detection of fruit peaches according to claim 6, characterized in that, The fruit variety classification model adopts a graph neural network model, and the graph neural network model comprises: S1311, graph structure construction and node initialization: for multi-modal image features color features, texture frequency features, and contour structure features are taken as graph nodes An initial node embedding matrix is constructed The node adjacency graph is wherein, is a node set, is an edge set; S1312, modal label guided graph attention propagation mechanism: introducing a modal type as a graph node label to guide the weighting adjustment of same-modal or cross-modal information during information propagation, and calculating attention weights; S1313, graph node information aggregation and update: each feature node fuses neighbor information through the graph propagation mechanism, while retaining its own expression; S1314, graph-level readout and variety prediction: the representations of all feature nodes are aggregated to form a global graph representation using global average pooling, which is sent to a fully connected layer to complete peach variety classification.
8. The method for multi-stage screening and quality detection of fruit peaches according to claim 7, characterized in that, The level dynamic adjustment discrimination in S4 comprises: S41, region weight score fusion: according to the maturity score of the high sensitivity region and the low sensitivity region , and the defect score , , the weighted maturity score is generated by fusion and the weighted defect score ; S42, dynamic threshold adjustment function calculation: according to the current fruit variety label and growth deviation vector , calculate the dynamic adjustment factor ; S43, output a composite quality grade: the weighted maturity score , the weighted defect score and the dynamic adjustment factor to determine the final composite quality grade label for the fruit , denoted as: 。
Citation Information
Patent Citations
Fruit quality grading method based on image processing
CN117808746A
Machine vision-based screening method and device for similar varieties of highland barley seeds and storage medium
CN120071334A