Screening and grading system and method for fresh cut Chinese herbaceous peony flowers based on image recognition
By combining image recognition technology and dynamic lighting compensation module with disease detection model and feature analysis, the problems of low efficiency, high cost and insufficient accuracy in the screening and grading of peony cut flowers have been solved, achieving efficient and accurate screening and grading, reducing labor costs and ensuring the consistency of product quality.
Patent Information
- Application Number
- CN202410918256.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies are inefficient, costly, and susceptible to human factors in the screening and grading of peony cut flowers. Image recognition systems exhibit inconsistent image quality under different lighting conditions, lack accuracy in disease detection and classification, and suffer from insufficient data standardization and classification model optimization, resulting in unstable and inaccurate classification results.
A peony cut flower screening and grading system based on image recognition was adopted, including an image processing module, a dynamic light compensation module, a disease detection module, a feature analysis module, and a database module. Through image preprocessing, dynamic light compensation, disease detection models, and feature analysis, combined with a multilayer perceptron, variety classification and quality grading were carried out.
It improves screening and grading efficiency, reduces labor costs, ensures product quality consistency and reliability, and achieves efficient and accurate disease detection and classification analysis.
Smart Images

Figure CN118968117A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of screening and grading of fresh cut peony flowers, and in particular to a screening and grading system and method of fresh cut peony flowers based on image recognition. Background Art
[0002] Peony fresh cut flowers occupy an important position in the flower market due to their beautiful appearance and rich colors. With the growth of market demand, higher requirements are placed on the screening and grading of peony fresh cut flowers. The traditional manual screening method is inefficient, costly, and easily affected by human factors, resulting in unstable product quality. In order to improve the screening efficiency and quality, an automated screening and grading system based on image recognition has become a research hotspot.
[0003] At present, some screening systems based on image recognition technology have been applied to flower grading, but these systems still have many problems in practical applications. For example, it is difficult for existing systems to maintain consistent image quality under different lighting conditions, which affects the accuracy of disease detection and classification. At the same time, traditional image processing and disease detection algorithms are inefficient when processing complex image data and cannot fully identify and classify a variety of disease characteristics. In addition, existing technologies still have deficiencies in data standardization and classification model optimization, resulting in instability and inaccuracy in classification results, making it difficult to meet the market demand for efficient and accurate screening and grading.
[0004] In order to solve the above problems, the present invention provides a screening and grading system and method for fresh cut peony flowers based on image recognition, which improves work efficiency, reduces labor costs, ensures the product quality of fresh cut peony flowers, and provides strong technical support for the flower market. Summary of the invention
[0005] Based on the above objectives, the present invention provides a screening and grading system and method for fresh cut peony flowers based on image recognition.
[0006] The screening and grading system of fresh cut peony flowers based on image recognition comprises an image processing module, a dynamic illumination compensation module, a disease detection module, a feature analysis module, a database module and a display and control module, wherein;
[0007] The image processing module collects image data of fresh cut peony flowers, and preprocesses the collected image data, including denoising, enhancement, cropping and graying;
[0008] The dynamic illumination compensation module automatically adjusts the exposure and brightness parameters of the image data of the fresh cut peony flowers by real-time monitoring of the illumination intensity of the collection environment;
[0009] The disease detection module identifies diseases and damages of fresh cut peony flowers, specifically including:
[0010] Data collection: Collect disease data of fresh cut peony flowers through cameras and image sensors;
[0011] Preliminary data processing: Preliminary processing of the collected disease data, including noise suppression, geometric correction, color correction, edge enhancement and contrast stretching;
[0012] Model construction: Use the preliminarily processed disease data to build a disease detection model;
[0013] Real-time detection: Use the disease detection model to perform disease detection on the real-time collected peony cut flower image data, identify the disease features in the image data, and generate detection results;
[0014] The feature analysis module extracts features of the fresh cut peony flowers from the preprocessed images in combination with the recognition results of diseases and damages of the fresh cut peony flowers, including shape features, color features and texture features, and classifies the fresh cut peony flowers according to the extracted features, including variety classification and quality grading;
[0015] The database module stores standard features and classification standards of fresh cut peony flowers for comparison and reference of classification results of fresh cut peony flowers;
[0016] The display and control module displays the classification and grading results, and coordinates and controls the workflow.
[0017] Optionally, the image processing module includes:
[0018] Image acquisition: Use cameras and image sensors to obtain image data of fresh cut peony flowers in real time;
[0019] Data denoising: Use Gaussian filtering algorithm to denoise the collected image data and retain image details;
[0020] Data enhancement: Enhance the contrast and clarity of image data through histogram equalization method;
[0021] Data cropping: crop the image data according to preset parameters to remove irrelevant background, and obtain the cropped image area by setting the starting coordinates (x0, y0) and width and height (w, h) of the cropping window;
[0022] Grayscale processing: Convert the enhanced and cropped color image to a grayscale image.
[0023] Optionally, the dynamic illumination compensation module includes:
[0024] Light detection: real-time monitoring of the light intensity of the collection environment;
[0025] Exposure adjustment: Calculate the exposure parameters and dynamically adjust the exposure time of the image acquisition device, expressed as:
[0026]
[0027] Among them, E' is the adjusted exposure time, E is the initial exposure time, L ref is the reference light intensity, L current is the current light intensity;
[0028] Brightness adjustment: Calculate the brightness parameter and dynamically adjust the brightness of the image, expressed as:
[0029]
[0030] Among them, I′ is the adjusted image brightness value, I is the initial image brightness value, and L ref is the reference light intensity, L current is the current light intensity.
[0031] Optionally, the data collection includes:
[0032] Camera shooting: Use the camera to shoot fresh cut peony flowers;
[0033] Light source device setting: Set up a uniform light source device to provide uniform lighting for fresh cut peony flowers;
[0034] Image sensor capture: Use an image sensor to capture the light signal collected by the camera and convert the light signal into digital image data;
[0035] Automatic focus adjustment: Automatically adjust the focus of the camera to collect disease data of fresh cut peony flowers.
[0036] Optionally, the preliminary data processing includes:
[0037] Noise suppression processing: Use bilateral filtering algorithm to suppress noise in the collected disease data and retain edge details;
[0038] Geometric correction processing: Correct the disease data to the standard viewing angle through the image registration algorithm;
[0039] Color correction processing: Use color correction algorithm to adjust the color distortion of disease data;
[0040] Edge enhancement processing: Use the Laplace operator to enhance the edge of the disease data;
[0041] Contrast stretching: Enhance the overall contrast of the disease data through linear contrast stretching.
[0042] Optionally, the disease detection model adopts a convolutional neural network (CNN) model, and the convolutional neural network (CNN) model includes:
[0043] Multi-scale convolution kernel feature extraction: Use multi-scale convolution kernels to perform convolution operations on images to capture features of different scales, expressed as:
[0044]
[0045] H (l) ={h (l,1) ,h (l,2) , .., h (l,s)};
[0046] in, is the output feature value of the i-th, j-th position in the l-th layer, σ is the ReLU activation function, is the convolution kernel of the sth scale in the lth layer, is the input feature value of the i+m, j+n position in the l-1th layer, b (l) is the bias of the lth layer;
[0047] Attention mechanism weighted features: Add attention mechanism to increase the attention to features by weighting, expressed as:
[0048]
[0049] in, is the attention weight of the i-th, j-th position in the l-th layer, is the score value of the i-th, j-th position in the l-th layer, W a is the weight matrix of the attention mechanism, b a is the bias of the attention mechanism, is the weighted eigenvalue;
[0050] Depth-wise separable convolution: Use depth-wise separable convolution to reduce the number of parameters and computation, expressed as:
[0051]
[0052]
[0053] in, is the eigenvalue after depth convolution, and are the convolution kernels of depth convolution and point convolution respectively, b (l,depth) and b (l,point) is the corresponding bias, is the eigenvalue after point convolution;
[0054] Pooling layer: Use the pooling layer to reduce the dimension of the feature map and retain the main feature information, expressed as:
[0055]
[0056] in, is the feature value after pooling;
[0057] Fully connected layer and output: The pooled features are vectorized and passed through the fully connected layer to obtain the final classification result, which is expressed as:
[0058] z=σ(W fc ·h (pool) +b fc );
[0059] Among them, W fc is the weight matrix of the fully connected layer, b fc is the bias, h (pool) is the feature vector after pooling.
[0060] Optionally, the real-time detection includes:
[0061] Real-time image data input: input the real-time collected image data of fresh cut peony flowers into the disease detection model;
[0062] Feature extraction: The disease detection model is used to perform feature extraction on the input image data using multi-scale convolution kernels, attention mechanisms, and depthwise separable convolutions to capture the disease features in the image data;
[0063] Feature aggregation and pooling: Pool the extracted disease features to aggregate high-dimensional feature information into low-dimensional representation;
[0064] Classification result generation: The pooled disease features are input into the fully connected layer, and the disease detection results, including disease type and severity, are generated through activation function calculation;
[0065] Detection result output: Output disease detection results, including the detected disease type, location and disease severity.
[0066] Optionally, the feature analysis module includes:
[0067] Shape feature extraction: Based on the identification results of diseases and damages, the Canny edge detection algorithm is used to obtain the contour, and the Fourier descriptor is calculated to represent the shape features;
[0068] Color feature extraction: extract color features through color space conversion and color histogram analysis, convert image data from RGB color space to HSV color space, and calculate the color histogram and color moment of each channel;
[0069] Texture feature extraction: Use gray-level co-occurrence matrix and local binary pattern to extract texture features, and calculate the energy, entropy, contrast of gray-level co-occurrence matrix and histogram representation of local binary pattern;
[0070] Feature fusion: Shape features, color features and texture features are fused through principal component analysis (PCA) to form a comprehensive feature vector;
[0071] Classification and grading: The comprehensive feature vector is input into the multi-layer perceptron (MLP) to classify the varieties and grade the quality of fresh cut peony flowers, which is expressed as:
[0072] y=MLP(F combined );
[0073] Among them, F combined is the comprehensive feature vector.
[0074] Optionally, the database module includes:
[0075] Standard feature storage: store the standard shape features, color features and texture features of fresh cut peony flowers in the database;
[0076] Classification standard storage: Stores the standards for the variety classification and quality grading of fresh cut peony flowers, including multi-layer perceptron parameters, classification thresholds, and grading standards;
[0077] Comparison and reference: When classifying fresh cut peony flowers in real time, the extracted features are compared with the standard features in the database, and the classification standards are used to classify the varieties and grade the quality, which is expressed as:
[0078]
[0079] Among them, F input is the input feature vector, F standard is the standard feature vector, and Similarity is the similarity calculation result.
[0080] The method for screening and grading fresh cut peony flowers based on image recognition is implemented by the above-mentioned screening and grading system for fresh cut peony flowers based on image recognition, and comprises the following steps:
[0081] S1, image acquisition and preprocessing: collecting image data of fresh cut peony flowers, and preprocessing the collected image data, including denoising, enhancement, cropping and grayscale processing;
[0082] S2, dynamic light compensation: real-time monitoring of the light intensity of the collection environment, and automatic adjustment of the exposure and brightness parameters of the image data of fresh cut peony flowers;
[0083] S3, disease detection: Use the disease detection model to identify diseases and damages of fresh cut peony flowers and obtain disease information;
[0084] S4, feature extraction and classification: Combined with the recognition results of diseases and injuries, the features of fresh cut peony flowers are extracted from the preprocessed image data, including shape features, color features and texture features, and fresh cut peony flowers are classified according to the extracted features, including variety classification and quality grading;
[0085] S5, standard features and classification standard storage: store the standard features and classification standards of fresh cut peony flowers for comparison and reference classification results;
[0086] S6, Result display and control: Display the classification and grading results, and coordinate and control the workflow of the entire screening and grading process.
[0087] Beneficial effects of the present invention:
[0088] The present invention pre-processes the image data of fresh cut peony flowers through an image processing module, including denoising, enhancement, cropping and grayscale processing, thereby effectively improving the consistency and clarity of image quality. The dynamic illumination compensation module monitors the illumination intensity of the acquisition environment in real time, automatically adjusts the exposure and brightness parameters of the image data, ensures the consistency of image quality under different illumination conditions, significantly improves the efficiency and accuracy of image processing, and provides a reliable data basis for subsequent feature extraction and classification.
[0089] The present invention collects disease data of fresh cut peony flowers through a camera and an image sensor, performs preliminary processing such as noise suppression, geometric correction, color correction, edge enhancement and contrast stretching, and then uses a convolutional neural network model to perform real-time disease detection, effectively identifies disease features in image data, and extracts shape, color and texture features from the image in combination with the recognition results of diseases and damage by a feature analysis module, and performs variety classification and quality grading using a multi-layer perceptron, thereby achieving efficient and accurate disease detection and classification analysis.
[0090] The present invention stores standard features and classification standards of fresh cut peony flowers, including mean values and variances of shape features, color features and texture features, as well as parameters and classification thresholds of classification models, through a database module. In the real-time classification process, the system compares the extracted features with the standard features in the database to ensure the accuracy and consistency of the classification results. The display and control module is responsible for displaying the classification and grading results, and coordinating and controlling the entire work flow, thereby greatly improving the work efficiency of the system, reducing labor costs, and ensuring the consistency and reliability of product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0092] Figure 1 A schematic diagram of system function modules according to an embodiment of the present invention;
[0093] Figure 2 The figure is a schematic diagram of a grading method flow chart according to an embodiment of the present invention. DETAILED DESCRIPTION
[0094] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. At the same time, it is explained here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments, and those skilled in the art may also adopt other alternatives to implement some known technologies; and the accompanying drawings are only for more specific description of the embodiments, and are not intended to specifically limit the present invention.
[0095] It should be noted that the references to "one embodiment", "an embodiment", "an exemplary embodiment", "some embodiments" and the like in the specification indicate that the embodiments described may include specific features, structures or characteristics, but not every embodiment may include the specific features, structures or characteristics. In addition, when a specific feature, structure or characteristic is described in conjunction with an embodiment, it should be within the knowledge of a person skilled in the art to implement such feature, structure or characteristic in conjunction with other embodiments (whether or not explicitly described).
[0096] In general, a term can be understood, at least in part, from its use in context. For example, depending, at least in part, on the context, the term "one or more" as used herein can be used to describe any feature, structure, or characteristic in the singular sense, or can be used to describe a combination of features, structures, or characteristics in the plural sense. Additionally, the term "based on" can be understood as not necessarily intended to convey an exclusive set of factors, but can instead, depending, at least in part, on the context, allow for the presence of other factors that are not necessarily explicitly described.
[0097] like Figure 1 As shown, the screening and grading system of fresh cut peony flowers based on image recognition includes an image processing module, a dynamic illumination compensation module, a disease detection module, a feature analysis module, a database module, and a display and control module, wherein;
[0098] The image processing module collects image data of fresh cut peony flowers and preprocesses the collected image data, including denoising, enhancement, cropping and grayscale conversion;
[0099] The dynamic light compensation module automatically adjusts the exposure and brightness parameters of the image data of fresh cut peony flowers by real-time monitoring of the light intensity of the collection environment, ensuring consistent image quality under different lighting conditions;
[0100] The disease detection module identifies diseases and damages of fresh cut peony flowers and improves the screening quality of fresh cut peony flowers. Specifically, it includes:
[0101] Data collection: Collect disease data of fresh cut peony flowers through cameras and image sensors;
[0102] Preliminary data processing: Preliminary processing of the collected disease data, including noise suppression, geometric correction, color correction, edge enhancement and contrast stretching, to ensure the consistency and quality of the input image;
[0103] Model construction: Use the preliminarily processed disease data to build a disease detection model;
[0104] Real-time detection: Use the disease detection model to perform disease detection on the real-time collected peony cut flower image data, identify the disease features in the image data, and generate detection results;
[0105] The feature analysis module combines the recognition results of diseases and damages of fresh cut peony flowers, extracts the features of fresh cut peony flowers from the preprocessed images, including shape features, color features and texture features, and classifies the fresh cut peony flowers according to the extracted features, including variety classification and quality grading;
[0106] The database module stores the standard features and classification standards of fresh cut peony flowers, which are used for comparing and referencing the classification results of fresh cut peony flowers;
[0107] The display and control module displays the classification and grading results and coordinates and controls the workflow;
[0108] Through the above content, efficient and accurate automated screening and grading of fresh cut peony flowers have been achieved. The system can automatically adjust image data parameters, detect diseases, improve screening quality, ensure image quality consistency, and provide accurate classification and grading results, which greatly improves work efficiency, reduces labor costs, and ensures the consistency and reliability of product quality.
[0109] The image processing module includes:
[0110] Image acquisition: Use cameras and image sensors to obtain image data of fresh cut peony flowers in real time;
[0111] Data denoising: Use the Gaussian filtering algorithm to denoise the collected image data and retain the image details, expressed as:
[0112]
[0113] Where f(x, y) is the pixel value after filtering, g(x, y) is the original pixel value, σ is the standard deviation of the Gaussian function, and * represents the convolution operation;
[0114] Data enhancement: The contrast and clarity of image data are enhanced by the histogram equalization method, which is expressed as:
[0115]
[0116] Among them, s k is the gray level after equalization, T is the transformation function, r k is the original gray level, n j is the number of pixels of gray level j, and N is the total number of pixels in the image;
[0117] Data cropping: crop the image data according to the preset parameters, remove irrelevant background, and ensure that the image is focused on the fresh cut peony flowers. By setting the starting coordinates (x0, y0) and width and height (w, h) of the cropping window, the cropped image area is obtained, which is expressed as:
[0118] I crop =I(y0:y0+h,x0:x0+w);
[0119] Among them, I is the original image, I crop is the cropped image;
[0120] Grayscale processing: Convert the enhanced and cropped color image into a grayscale image to facilitate subsequent feature extraction and analysis, expressed as:
[0121] I gray =α·R+β·G+γ·B;
[0122] Among them, I gray is a grayscale image, R, G, B are the red, green, and blue channel values of the image respectively, and α, β, and γ are weight coefficients;
[0123] Through the above content, efficient and accurate image processing and classification are achieved. The system automatically adjusts image data parameters, enhances contrast, performs standardized processing, and combines real-time disease detection to significantly improve image quality and classification accuracy, reduce labor costs, and ensure the consistency and reliability of product quality.
[0124] The dynamic lighting compensation module includes:
[0125] Light detection: real-time monitoring of the light intensity of the collection environment;
[0126] Exposure adjustment: Calculate the exposure parameters and dynamically adjust the exposure time of the image acquisition device, expressed as:
[0127]
[0128] Among them, E' is the adjusted exposure time, E is the initial exposure time, L ref is the reference light intensity, L current is the current light intensity;
[0129] Brightness adjustment: Calculate the brightness parameter and dynamically adjust the brightness of the image, expressed as:
[0130]
[0131] Among them, I′ is the adjusted image brightness value, I is the initial image brightness value, and L ref is the reference light intensity, L current is the current light intensity;
[0132] Through the above content, the exposure time and brightness of the image acquisition device can be dynamically adjusted to ensure the consistency and stability of image quality under different lighting conditions. This not only improves the accuracy of image processing and feature analysis, but also significantly improves the reliability and adaptability of the overall system, reducing human intervention and errors.
[0133] Data collection includes:
[0134] Camera shooting: Use the camera to shoot fresh cut peony flowers;
[0135] Light source device setting: Set up a uniform light source device to provide uniform lighting for fresh cut peony flowers, reduce shadows and reflections, and ensure image quality;
[0136] Image sensor capture: Use an image sensor to capture the light signal collected by the camera and convert the light signal into digital image data;
[0137] Automatic focus adjustment: Automatically adjust the focus of the camera to collect disease data of fresh cut peony flowers;
[0138] Disease data include:
[0139] Leaf spot: Black or brown spots on leaves caused by pathogens;
[0140] Powdery mildew: A white powdery substance that appears on leaves and stems;
[0141] Gray mold: Gray mold appears on petals, leaves or stems;
[0142] Rust: Rust-colored spots on leaves, often accompanied by small blisters;
[0143] Rot: Decay of the stem, root, or petals, often accompanied by softening and color change;
[0144] Wilt: Leaves and flowers of the whole plant or part of the plant wilt and turn yellow or brown;
[0145] Insect damage: Damage to leaves, stems or petals caused by insects, which may include holes, cuts, etc.
[0146] Mechanical damage: physical damage caused during picking or transportation, such as breakage, squeezing marks, etc.;
[0147] Through the above contents, we ensure that high-quality, stable and consistent image data can be obtained under different lighting conditions, and automatic focus can be used to capture clear disease characteristics, which significantly improves the accuracy and reliability of disease detection and provides a solid data foundation for the screening and grading of fresh cut peony flowers.
[0148] Image sensors capture:
[0149] Photoelectric conversion: The photodiode in the image sensor converts the light signal into electric charge;
[0150] Charge accumulation: The photodiode of each pixel accumulates charge during exposure;
[0151] Charge transfer: The accumulated charge is transferred to the amplifier and converted into a voltage signal;
[0152] Analog signal reading: The voltage signal is converted into a digital signal through an analog-to-digital converter (ADC);
[0153] Digital signal processing: Process the converted digital signal to generate digital image data.
[0154] Initial data processing includes:
[0155] Noise suppression processing: Use the bilateral filtering algorithm to suppress the noise of the collected disease data and retain the edge details, which can be expressed as:
[0156]
[0157] Among them, W p is the normalization constant, Ω is the filter window, σ d and σ r are the standard deviations in the spatial and intensity domains, respectively;
[0158] Geometric correction processing: Through the image registration algorithm, the disease data is corrected to the standard viewing angle to correct the distortion caused by the shooting angle or other factors, which is expressed as:
[0159] I corrected (x′,y′)==I(x,y);
[0160]
[0161] Where H is the perspective transformation matrix, (x′, y′) is the corrected coordinate;
[0162] Color correction processing: Use the color correction algorithm to adjust the color distortion of the disease data, expressed as:
[0163]
[0164] Among them, I(c) is a color channel of the image, I ref is the reference image;
[0165] Edge enhancement processing: Use the Laplace operator to enhance the edge of the disease data to improve the visibility of the disease features, which is expressed as:
[0166]
[0167] in, is the Laplace operator;
[0168] Contrast stretching: The overall contrast of the disease data is enhanced by linear contrast stretching, which is expressed as:
[0169]
[0170] Among them, I min and I max are the minimum and maximum grayscale values of the input image, O min and O max is the target grayscale range of the output image;
[0171] Through the above content, the collected peony fresh cut flower disease image data can be processed in many aspects to ensure the consistency and quality of the data, providing a more solid foundation for subsequent disease detection and classification.
[0172] The disease detection model uses a convolutional neural network (CNN) model, which includes:
[0173] Multi-scale convolution kernel feature extraction: Use multi-scale convolution kernels to perform convolution operations on images to capture features of different scales, expressed as:
[0174]
[0175] H (l) ={h (l,1) ,h (l,2) , ..., h (l,s)};
[0176] in, is the output feature value of the i-th, j-th position in the l-th layer, σ is the ReLU activation function, is the convolution kernel of the sth scale in the lth layer, is the input feature value of the i+m, j+n position in the l-1th layer, b (l) is the bias of the lth layer;
[0177] Attention mechanism weighted features: After feature extraction, the attention mechanism is added to increase the attention to the features by weighting, which is expressed as:
[0178]
[0179] in, is the attention weight of the i-th, j-th position in the l-th layer, is the score value of the i-th, j-th position in the l-th layer, W a is the weight matrix of the attention mechanism, b a is the bias of the attention mechanism, is the weighted eigenvalue;
[0180] Depthwise separable convolution: Using depthwise separable convolution reduces the number of parameters and computation while improving model efficiency, expressed as:
[0181]
[0182] in, is the eigenvalue after depth convolution, and are the convolution kernels of depth convolution and point convolution respectively, b (l,depth) and b (l,point) is the corresponding bias, is the eigenvalue after point convolution;
[0183] Pooling layer: Use the pooling layer to reduce the dimension of the feature map and retain the main feature information, expressed as:
[0184]
[0185] in, is the feature value after pooling;
[0186] Fully connected layer and output: The pooled features are vectorized and passed through the fully connected layer to obtain the final classification result, which is expressed as:
[0187] z=σ(W fc ·h (pool) +b fc );
[0188] Among them, W fc is the weight matrix of the fully connected layer, bfc is the bias, h (pool) is the feature vector after pooling;
[0189] Through the above content, multi-scale convolution kernels, attention mechanism and deep separable convolution are introduced to make it more suitable for disease detection of peony fresh cut flowers. The multi-scale convolution kernel can capture disease characteristics at different levels, the attention mechanism improves the attention to key disease areas, and the deep separable convolution significantly reduces the amount of calculation and parameters. It not only improves the accuracy and efficiency of disease detection, but also ensures the efficiency and reliability of the model in practical applications, providing strong technical support for the screening and grading of peony fresh cut flowers.
[0190] Real-time detection includes:
[0191] Real-time image data input: input the real-time collected image data of fresh cut peony flowers into the disease detection model;
[0192] Feature extraction: The disease detection model is used to perform feature extraction on the input image data using multi-scale convolution kernels, attention mechanisms, and depthwise separable convolutions to capture the disease features in the image data;
[0193] Feature aggregation and pooling: Pool the extracted disease features to aggregate high-dimensional feature information into low-dimensional representation;
[0194] Classification result generation: The pooled disease features are input into the fully connected layer, and the disease detection results, including disease type and severity, are generated through activation function calculation;
[0195] Detection result output: Output disease detection results, including the detected disease type, location and severity of the disease;
[0196] Through the above content, disease detection is performed on the real-time collected peony fresh cut flower image data, the disease characteristics in the image are effectively identified, and accurate detection results are generated, providing a scientific basis for the screening and grading of peony fresh cut flowers.
[0197] The feature analysis module includes:
[0198] Shape feature extraction: Based on the identification results of diseases and damages, the Canny edge detection algorithm is used to obtain the contour, and the Fourier descriptor is calculated to represent the shape features, which is expressed as:
[0199] E(x, y) = Canny(I(x, y));
[0200] Where E(x, y) is the edge map and I(x, y) is the input image;
[0201]
[0202] Where F(k) is the k-th Fourier descriptor, z(n) is the complex representation of the n-th point on the shape contour, N is the total number of points on the shape contour, and j is the imaginary unit;
[0203] Color feature extraction: Color features are extracted through color space conversion and color histogram analysis. The image data is converted from RGB color space to HSV color space, and the color histogram and color moment of each channel are calculated, which are expressed as:
[0204] HSV=convert(I RGB , HSV);
[0205] Among them, HSV is the converted image;
[0206]
[0207] Among them, H k is the kth bucket of the color histogram, N is the total number of pixels, and δ is the Dirac delta function;
[0208]
[0209] Among them, R(i), G(i), B(i) are the red, green, and blue values of the i-th pixel;
[0210] Texture feature extraction: Use gray-level co-occurrence matrix and local binary pattern to extract texture features, calculate the energy, entropy, contrast of gray-level co-occurrence matrix and the histogram representation of local binary pattern, expressed as:
[0211] P(i, j) = ∑ (p,q)∈I δ(I(p, q)-i, I(p+Δx,q+Δy)-j);
[0212] Where P(i, j) is the gray level co-occurrence matrix, Δx, Δy are the offsets;
[0213] E=∑ i,j P(i,j) 2 ;
[0214] S=-∑ i,j P(i,j)logP(i,j);
[0215] C=∑ i,j (ij) 2 P(i,j);
[0216] Among them, E, S, and C are the energy, entropy, and contrast of the gray-level co-occurrence matrix, respectively;
[0217]
[0218] Where s(x) is the sign function, I p is the neighborhood pixel value, I c is the center pixel value;
[0219] Feature fusion: The shape features, color features and texture features are fused through principal component analysis PCA to form a comprehensive feature vector, reduce feature redundancy and improve the effectiveness of feature representation, which is expressed as:
[0220] F combined =[F shape , F color , F texture ];
[0221] Among them, F shape 、F color 、F texture They are shape features, color features, and texture features;
[0222] Z = XW;
[0223] Among them, Z is the feature after dimensionality reduction, X is the feature matrix after fusion, and W is the feature vector matrix;
[0224] Classification and grading: The comprehensive feature vector is input into the multi-layer perceptron (MLP) to classify the varieties and grade the quality of fresh cut peony flowers, which is expressed as:
[0225] y=MLP(F combined );
[0226] Among them, F combined is the comprehensive feature vector;
[0227] The multi-layer perceptron (MLP) specifically includes:
[0228] Input layer to hidden layer: Let the input feature vector be x, expressed as:
[0229] h (1) =σ(W (1) x+b (1) );
[0230] Where x is the input feature vector, W (1) is the weight matrix from the input layer to the first hidden layer, b (1) is the bias vector of the first hidden layer, σ is the ReLU activation function, and h (1) is the output vector of the first hidden layer;
[0231] Hidden layer to hidden layer: For the lth hidden layer to the l+1th hidden layer, it is expressed as:
[0232] h (l+1) =σ(W(l+1) h (l) +b (l+1) );
[0233] Among them, h (l) is the output vector of the lth hidden layer, W (l+1) is the weight matrix from the lth hidden layer to the l+1th hidden layer, b (l+1) is the bias vector of the l+1th hidden layer, h (l+1) is the output vector of the l+1th hidden layer;
[0234] Hidden layer to output layer: Assume that the output layer has k nodes (corresponding to k categories), expressed as:
[0235] y=W (L) h (L-1) +b (L) ;
[0236] Among them, h (L-1) is the output vector of the last hidden layer, W (L) is the weight matrix from the last hidden layer to the output layer, b (L) is the bias vector of the output layer, and y is the output vector, which represents the score or probability of the classification result;
[0237] Through the above content, multiple characteristics can be comprehensively considered to improve the accuracy and robustness of classification and grading, and fresh cut peony flowers of different varieties and quality grades can be more accurately identified and distinguished, providing efficient and reliable screening and grading support.
[0238] The Canny edge detection algorithm specifically includes:
[0239] Gaussian filtering: Gaussian filtering is performed on image data to remove noise, which is expressed as:
[0240] I blur (x, y)=I(x, y)*G(x, y, σ);
[0241] Among them, I blur is the image after Gaussian filtering, I(x, y) is the original image, and G(x, y, σ) is the Gaussian kernel function;
[0242] Gradient calculation: Use the Sobel operator to calculate the gradient strength and direction of the image, expressed as:
[0243]
[0244] Among them, G x and G y are the gradients in the horizontal and vertical directions respectively, G is the gradient strength, and θ is the gradient direction;
[0245] Non-maximum suppression: Non-maximum suppression of gradient intensity is performed to refine the edge, which is expressed as:
[0246]
[0247] Among them, G nms is the gradient strength after non-maximum suppression;
[0248] Dual threshold detection: Apply high and low threshold detection to determine the edge, expressed as:
[0249]
[0250] Among them, T high and T low are the high and low thresholds, G edge is the edge graph;
[0251] Edge connection: Connect weak edges with strong edges.
[0252] Color space conversion includes:
[0253] Calculate the V component (brightness): V = max(R, G, B);
[0254] Calculate the S component (saturation):
[0255] Calculate the H component (hue):
[0256] Normalized H:
[0257] Among them, R, G, B are the red, green, and blue color channel values of the image, ranging from [0, 1], H is the hue, ranging from [0°, 360°], S is the saturation, ranging from [0, 1], and V is the brightness, ranging from [0, 1].
[0258] The database modules include:
[0259] Standard feature storage: store the standard shape features, color features and texture features of fresh cut peony flowers in the database;
[0260] Classification standard storage: Stores the standards for the variety classification and quality grading of fresh cut peony flowers, including multi-layer perceptron parameters, classification thresholds, and grading standards;
[0261] Comparison and reference: When classifying fresh cut peony flowers in real time, the extracted features are compared with the standard features in the database, and the classification standards are used to classify the varieties and grade the quality, which is expressed as:
[0262]
[0263] Among them, F input is the input feature vector, F standard is the standard feature vector, Similarity is the similarity calculation result;
[0264] The standard features are as follows:
[0265] Sample collection: Collect a large number of sample images from fresh cut peony flowers of different varieties and quality grades;
[0266] Image preprocessing: preprocess the collected sample images, including denoising, enhancement, cropping and grayscale processing to ensure the consistency of image data;
[0267] Feature extraction: extract shape features, color features and texture features from the preprocessed sample images;
[0268] Feature statistical analysis: Calculate the mean and variance of the shape, color, and texture features of each variety and quality grade as standard shape features, standard color features, and standard texture features, expressed as:
[0269]
[0270] Among them, f shape (i) is the shape feature of the i-th sample, μ shape and σ shape are the mean and variance of the shape features, f color (i) is the color feature of the i-th sample, μ color and σ color are the mean and variance of the color features, f texture (i) is the texture feature of the i-th sample, μ texture and σ texture are the mean and variance of the texture features, respectively;
[0271] Formation of standard features: The mean and variance of shape features, color features, and texture features of each variety and quality grade are stored in the database as standard features.
[0272] The classification criteria are as follows:
[0273] Sample collection: Collect a large amount of sample data from fresh cut peony flowers of different varieties and quality grades to ensure data diversity and coverage;
[0274] Feature extraction: extract shape features, color features and texture features from the preprocessed sample data;
[0275] Dataset division: Divide the collected sample dataset into training set and validation set;
[0276] Model training: Use the training set data to train the multilayer perceptron (MLP) and optimize the model parameters, expressed as:
[0277] a. Loss function: The cross entropy loss function is used to measure the difference between the predicted result and the actual label, expressed as:
[0278]
[0279] Where N is the number of samples, C is the number of categories, and y i,c is the actual label of the i-th sample, is the predicted probability of the i-th sample;
[0280] b. Weight update: Update weights and biases through the back-propagation algorithm, expressed as:
[0281]
[0282] Where η is the learning rate, and is the gradient of the loss function with respect to weights and biases;
[0283] Model validation: Use validation set data to evaluate the trained model and adjust model parameters and hyperparameters (such as learning rate, number of hidden layers, etc.) to improve the generalization ability and accuracy of the model;
[0284] Determine the classification threshold: Determine the classification threshold based on the validation set results, which is used for variety classification and quality grading, expressed as:
[0285] a. Variety classification standard: define the feature vector range and classification threshold for each variety. For example, for variety A and variety B, define the decision boundary in the feature space, expressed as:
[0286] Class A if F∈[μ A -κσ A , μ A +Kσ A ];
[0287] Class B if F∈[μ B -Kσ B , μ B +κσ B ];
[0288] Among them, μ A and σ A are the characteristic mean and variance of variety A, respectively, and κ is the adjustment parameter;
[0289] b. Quality grading standard: Define feature thresholds and scoring standards according to quality grades. For example, for high-quality and low-quality peony cut flowers, define feature thresholds, expressed as:
[0290] High Quality if F quality ≥T high ;
[0291] Low Quality if F quality <T low ;
[0292] Among them, T high and T low is the threshold for quality classification;
[0293] Standard storage: The trained classification model parameters (weights and biases), classification thresholds, and quality grading standards are stored in the database for reference and comparison during real-time classification.
[0294] like Figure 2 As shown, the screening and grading method of fresh cut peony flowers based on image recognition is implemented by the screening and grading system of fresh cut peony flowers based on image recognition, and comprises the following steps:
[0295] S1, image acquisition and preprocessing: collecting image data of fresh cut peony flowers, and preprocessing the collected image data, including denoising, enhancement, cropping and grayscale processing;
[0296] S2, dynamic light compensation: real-time monitoring of the light intensity of the collection environment, and automatic adjustment of the exposure and brightness parameters of the image data of fresh cut peony flowers;
[0297] S3, disease detection: Use the disease detection model to identify diseases and damages of fresh cut peony flowers and obtain disease information;
[0298] S4, feature extraction and classification: Combined with the recognition results of diseases and injuries, the features of fresh cut peony flowers are extracted from the preprocessed image data, including shape features, color features and texture features, and fresh cut peony flowers are classified according to the extracted features, including variety classification and quality grading;
[0299] S5, standard features and classification standard storage: store the standard features and classification standards of fresh cut peony flowers for comparison and reference classification results;
[0300] S6, Result display and control: Display the classification and grading results, and coordinate and control the workflow of the entire screening and grading process.
[0301] The present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention. In order to make the public have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention, but those skilled in the art can fully understand the present invention without the description of these details. In addition, in order to avoid unnecessary confusion about the essence of the present invention, well-known methods, processes, procedures, components and circuits are not described in detail.
[0302] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A screening and grading system for fresh cut peony flowers based on image recognition, characterized in that: It includes image processing module, dynamic illumination compensation module, disease detection module, feature analysis module, database module and display and control module, among which; The image processing module collects image data of fresh cut peony flowers, and preprocesses the collected image data, including denoising, enhancement, cropping and graying; The dynamic illumination compensation module automatically adjusts the exposure and brightness parameters of the image data of the fresh cut peony flowers by real-time monitoring of the illumination intensity of the collection environment; The disease detection module identifies diseases and damages of fresh cut peony flowers, specifically including: Data collection: Collect disease data of fresh cut peony flowers through cameras and image sensors; Preliminary data processing: Preliminary processing of the collected disease data, including noise suppression, geometric correction, color correction, edge enhancement and contrast stretching; Model construction: Use the preliminarily processed disease data to build a disease detection model; Real-time detection: Use the disease detection model to perform disease detection on the real-time collected peony cut flower image data, identify the disease features in the image data, and generate detection results; The feature analysis module extracts features of the fresh cut peony flowers from the preprocessed images in combination with the recognition results of diseases and damages of the fresh cut peony flowers, including shape features, color features and texture features, and classifies the fresh cut peony flowers according to the extracted features, including variety classification and quality grading; The database module stores standard features and classification standards of fresh cut peony flowers for comparison and reference of classification results of fresh cut peony flowers; The display and control module displays the classification and grading results, and coordinates and controls the workflow.
2. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 1, characterized in that: The image processing module comprises: Image acquisition: Use cameras and image sensors to obtain image data of fresh cut peony flowers in real time; Data denoising: Use Gaussian filtering algorithm to denoise the collected image data and retain image details; Data enhancement: Enhance the contrast and clarity of image data through histogram equalization method; Data cropping: crop the image data according to preset parameters to remove irrelevant background, and obtain the cropped image area by setting the starting coordinates (x0, y0) and width and height (w, h) of the cropping window; Grayscale processing: Convert the enhanced and cropped color image to a grayscale image.
3. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 1, characterized in that: The dynamic illumination compensation module comprises: Light detection: real-time monitoring of the light intensity of the collection environment; Exposure adjustment: Calculate the exposure parameters and dynamically adjust the exposure time of the image acquisition device, expressed as: Among them, E' is the adjusted exposure time, E is the initial exposure time, L ref is the reference light intensity, L current is the current light intensity; Brightness adjustment: Calculate the brightness parameter and dynamically adjust the brightness of the image, expressed as: Among them, I' is the adjusted image brightness value, I is the initial image brightness value, L ref is the reference light intensity, L current is the current light intensity.
4. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 1, characterized in that: The data collection includes: Camera shooting: Use the camera to shoot fresh cut peony flowers; Light source device setting: Set up a uniform light source device to provide uniform lighting for fresh cut peony flowers; Image sensor capture: Use an image sensor to capture the light signal collected by the camera and convert the light signal into digital image data; Automatic focus adjustment: Automatically adjust the focus of the camera to collect disease data of fresh cut peony flowers.
5. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 4, characterized in that: The preliminary data processing includes: Noise suppression processing: Use bilateral filtering algorithm to suppress noise in the collected disease data and retain edge details; Geometric correction processing: Correct the disease data to the standard viewing angle through the image registration algorithm; Color correction processing: Use color correction algorithm to adjust the color distortion of disease data; Edge enhancement processing: Use the Laplace operator to enhance the edge of the disease data; Contrast stretching: Enhance the overall contrast of disease data through linear contrast stretching.
6. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 5, characterized in that: The disease detection model adopts a convolutional neural network model, and the convolutional neural network model includes: Multi-scale convolution kernel feature extraction: Use multi-scale convolution kernels to perform convolution operations on images to capture features of different scales, expressed as: H (l) ={h (l,1) ,h (l,2) ,...,h (l,s) }; in, is the output feature value of the i,jth position in the lth layer, σ is the ReLU activation function, is the convolution kernel of the sth scale in the lth layer, is the input feature value of the i+m,j+nth position in the l-1th layer, b (l) is the bias of the lth layer; Attention mechanism weighted features: Add attention mechanism to increase the attention to features by weighting, expressed as: in, is the attention weight of the i,jth position in the lth layer, is the score value of the i,jth position in the lth layer, W a is the weight matrix of the attention mechanism, b a is the bias of the attention mechanism, is the weighted eigenvalue; Depth-wise separable convolution: Use depth-wise separable convolution to reduce the number of parameters and computation, expressed as: in, is the eigenvalue after depth convolution, and are the convolution kernels of depth convolution and point convolution respectively, b (l,depth) and b (l,point) is the corresponding bias, is the eigenvalue after point convolution; Pooling layer: Use the pooling layer to reduce the dimension of the feature map and retain the main feature information, expressed as: in, is the feature value after pooling; Fully connected layer and output: The pooled features are vectorized and passed through the fully connected layer to obtain the final classification result, which is expressed as: z=σ(W fc ·h (pool) +b fc ); Among them, W fc is the weight matrix of the fully connected layer, b fc is the bias, h (pool) is the feature vector after pooling.
7. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 6, characterized in that: The real-time detection includes: Real-time image data input: input the real-time collected image data of fresh cut peony flowers into the disease detection model; Feature extraction: The disease detection model is used to perform feature extraction on the input image data using multi-scale convolution kernels, attention mechanisms, and depthwise separable convolutions to capture the disease features in the image data; Feature aggregation and pooling: Pool the extracted disease features to aggregate high-dimensional feature information into low-dimensional representation; Classification result generation: The pooled disease features are input into the fully connected layer, and the disease detection results, including disease type and severity, are generated through activation function calculation; Detection result output: Output disease detection results, including the detected disease type, location and disease severity.
8. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 1, characterized in that: The feature analysis module comprises: Shape feature extraction: Based on the identification results of diseases and damages, the Canny edge detection algorithm is used to obtain the contour, and the Fourier descriptor is calculated to represent the shape features; Color feature extraction: extract color features through color space conversion and color histogram analysis, convert image data from RGB color space to HSV color space, and calculate the color histogram and color moment of each channel; Texture feature extraction: Use gray-level co-occurrence matrix and local binary pattern to extract texture features, and calculate the energy, entropy, contrast of gray-level co-occurrence matrix and histogram representation of local binary pattern; Feature fusion: Shape features, color features and texture features are fused through principal component analysis (PCA) to form a comprehensive feature vector; Classification and grading: The comprehensive feature vector is input into the multi-layer perceptron to classify the varieties and grade the quality of fresh cut peony flowers, which can be expressed as: y=MLP(F combined ); Among them, F combined is the comprehensive feature vector.
9. The screening and grading system for fresh cut peony flowers based on image recognition according to claim 8, characterized in that: The database module includes: Standard feature storage: store the standard shape features, color features and texture features of fresh cut peony flowers in the database; Classification standard storage: Stores the standards for the variety classification and quality grading of fresh cut peony flowers, including multi-layer perceptron parameters, classification thresholds, and grading standards; Comparison and reference: When classifying fresh cut peony flowers in real time, the extracted features are compared with the standard features in the database, and the classification standards are used to classify the varieties and grade the quality, which is expressed as: Among them, F input is the input feature vector, F standard is the standard feature vector, and Similarity is the similarity calculation result.
10. A method for screening and grading fresh cut peony flowers based on image recognition, implemented by a screening and grading system for fresh cut peony flowers based on image recognition according to any one of claims 1 to 9, characterized in that: The following steps are involved: S1, image acquisition and preprocessing: collecting image data of fresh cut peony flowers, and preprocessing the collected image data, including denoising, enhancement, cropping and grayscale processing; S2, dynamic light compensation: real-time monitoring of the light intensity of the collection environment, and automatic adjustment of the exposure and brightness parameters of the image data of fresh cut peony flowers; S3, disease detection: Use the disease detection model to identify diseases and damages of fresh cut peony flowers and obtain disease information; S4, feature extraction and classification: Combined with the recognition results of diseases and injuries, the features of fresh cut peony flowers are extracted from the preprocessed image data, including shape features, color features and texture features, and fresh cut peony flowers are classified according to the extracted features, including variety classification and quality grading; S5, standard features and classification standard storage: store the standard features and classification standards of fresh cut peony flowers for comparison and reference classification results; S6, Result display and control: Display the classification and grading results, and coordinate and control the workflow of the entire screening and grading process.
Citation Information
Cited By
Fresh-keeping parameter dynamic optimization method and system based on waxberry state matching analysis
CN119206263A
Visual identification-based fresh cut hydrangea flower sorting method and system and computer readable storage medium
CN119456469A
Hydrangea fresh cut flower sorting method, system and computer-readable storage medium based on visual recognition
CN119456469B
Intelligent camera system based on image processing algorithm and optimization method
CN119888630A
Flower quality grading method, equipment and medium
CN120071063A
