Green pepper quality analysis method based on appearance inspection
By synchronously collecting green pepper data through multimodal sensors and combining the technical means of U-Net network and attention mechanism, the problems of low efficiency and insufficient accuracy of existing green pepper quality detection are solved, and efficient and accurate green pepper quality assessment and grading are achieved.
Patent Information
- Application Number
- CN202510582845.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-09-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing green pepper quality detection technology is inefficient and the single sensor detection dimension is insufficient, resulting in inaccurate quality analysis and a lack of quantitative evaluation standards, which affects grading consistency.
Multimodal sensors are used to synchronously collect visible light images, three-dimensional point cloud data, and near-infrared images of green peppers. The U-Net network is then used to perform pixel-level defect recognition, generate a three-dimensional curvature map reflecting the surface deformation characteristics, and fuse spectral and geometric features through an attention mechanism for comprehensive defect detection and quality scoring.
It significantly improves the efficiency and accuracy of green pepper quality detection, achieves comprehensive capture of surface and internal defects of green peppers, provides objective and quantifiable quality evaluation standards, and ensures the reliability and consistency of grading results.
Smart Images

Figure CN120673114A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a green pepper quality analysis method based on appearance inspection. Background Art
[0002] Current green pepper quality testing relies primarily on manual visual inspection or single-sensor technology, which suffers from low efficiency, high subjectivity, and limited coverage. Traditional visible light image analysis struggles to detect internal defects, while 3D scanning or near-infrared technology alone cannot fully assess surface texture and geometry.
[0003] Furthermore, multimodal data fusion methods are not yet mature, resulting in insufficient defect identification accuracy and a lack of quantitative evaluation standards, which impacts grading consistency. Existing technologies struggle to balance efficiency and precision, hindering the development of automated testing. Therefore, there is an urgent need for an efficient analysis method that integrates multi-source data and incorporates artificial intelligence to address technical bottlenecks in green pepper quality testing, such as low efficiency, incomplete feature coverage, and subjective grading. Summary of the Invention
[0004] The present invention provides a green pepper quality analysis method based on appearance inspection, the main purpose of which is to solve the problem of inaccurate quality analysis caused by low detection efficiency and insufficient detection dimension of a single sensor during green pepper detection.
[0005] To achieve the above objectives, the present invention provides a green pepper quality analysis method based on appearance inspection, comprising:
[0006] Multimodal sensors are used to simultaneously collect visible light images, three-dimensional point cloud data, and near-infrared images of green peppers;
[0007] Performing surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations;
[0008] Performing local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics;
[0009] Fusing the near-infrared image with the three-dimensional curvature map in terms of channel dimension to obtain a second defect feature map containing spectral-geometric joint features;
[0010] Performing attention weight allocation on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper;
[0011] Performing geometric feature quantification processing on the three-dimensional point cloud data to extract morphological parameters of the green pepper including aspect ratio, curvature variance, and volume asymmetry;
[0012] Performing HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity;
[0013] Multi-dimensional feature fusion and grading decision are performed on the green pepper morphological parameters, the color distribution parameters and the comprehensive defect detection results to obtain the quality grading result of the green pepper.
[0014] Optionally, performing surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations includes:
[0015] performing semantic segmentation on the visible light image to generate a defect probability map;
[0016] Performing adaptive threshold segmentation on the defect probability map to generate a binary defect mask map, wherein the pixel value of the defect area in the defect mask map is 1 and the pixel value of the non-defect area is 0;
[0017] Performing a pixel-by-pixel multiplication operation on the defect mask image and the visible light image to generate a first defect feature map with pixel-level defect annotations.
[0018] Optionally, performing semantic segmentation on the visible light image to generate a defect probability map includes:
[0019] Performing pixel-level classification processing on the visible light image using a pre-trained U-Net network model;
[0020] The classification results of the pixel-level classification processing are subjected to probability normalization processing by using a Softmax function to generate a defect probability map.
[0021] Optionally, performing local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics includes:
[0022] Performing Delaunay triangulation processing on the three-dimensional point cloud data to construct a triangular mesh model;
[0023] Performing surface fitting processing on the neighborhood of each vertex in the triangular mesh model based on the least squares method to obtain a quadratic surface equation;
[0024] The principal curvature calculation process is performed on the quadratic surface equation to obtain a three-dimensional curvature map reflecting the surface deformation characteristics.
[0025] Optionally, the performing channel dimension fusion on the near-infrared image and the three-dimensional curvature map to obtain a second defect feature map containing spectral-geometric joint features includes:
[0026] Converting the near-infrared image grayscale into a near-infrared grayscale map, and normalizing it with the three-dimensional curvature map;
[0027] The normalized three-dimensional curvature map is used as a new channel to perform channel splicing with the near-infrared grayscale map to generate the second defect feature map.
[0028] Optionally, performing attention weight distribution on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper includes:
[0029] Performing feature extraction processing on the first defect feature map and the second defect feature map respectively through a two-stream convolutional network to obtain a deep feature map;
[0030] Performing dynamic weight allocation processing on the deep feature map based on a spatial attention mechanism, and performing feature weighting on the deep feature map based on the allocated dynamic weights;
[0031] The feature-weighted deep feature map is subjected to feature fusion processing to obtain a comprehensive defect detection result of the green pepper.
[0032] Optionally, the performing geometric feature quantization processing on the three-dimensional point cloud data to extract the morphological parameters of the green pepper including aspect ratio, curvature variance and volume asymmetry includes:
[0033] Performing principal axis analysis on the three-dimensional point cloud data to calculate the ratio of the major axis to the minor axis as the aspect ratio;
[0034] Perform variance statistics on the surface principal curvature to obtain the curvature variance;
[0035] The three-dimensional point cloud data is subjected to volume segmentation processing through a mirror symmetry plane, and the volume difference between the two sides is calculated to obtain the volume asymmetry.
[0036] Optionally, performing HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity includes:
[0037] Performing HSV color space conversion processing on the visible light image;
[0038] Perform histogram equalization and standard deviation calculation on the converted H channel to obtain the color uniformity index;
[0039] The converted S channel is processed by mean value calculation to obtain the maturity index.
[0040] Optionally, performing multi-dimensional feature fusion and grading decision on the green pepper morphological parameters, the color distribution parameters, and the comprehensive defect detection results to obtain the quality grading result of the green pepper includes:
[0041] Performing Z-score standardization processing on the green pepper morphological parameters, color distribution parameters and comprehensive defect detection results;
[0042] Performing importance weighting processing on the standardized features obtained after the standardization processing to obtain the quality score of the green pepper;
[0043] The quality score is graded and mapped according to a preset grading threshold value, and a special grade, first grade or second grade quality result is output.
[0044] Optionally, the performing dynamic weight allocation processing on the deep feature map based on the spatial attention mechanism, and performing feature weighting on the deep feature map based on the allocated dynamic weights, includes:
[0045] Performing global average pooling processing on the two types of deep feature maps to generate channel description vectors;
[0046] Perform correlation learning processing on the channel description vector through a fully connected layer to generate an attention weight matrix;
[0047] The deep feature map is spatially weighted based on the attention weight matrix.
[0048] The present invention uses multimodal sensors to synchronously collect data, combined with automated algorithm processing, significantly reducing manual intervention and time costs, and realizing rapid analysis of green pepper quality; using the U-Net network for pixel-level defect recognition, combined with three-dimensional curvature map and near-infrared image fusion, it can comprehensively capture surface and internal defects and improve detection accuracy; dynamically allocating weights through the attention mechanism, fusing spectral, geometric and color features, solving the limitation problem of single modality data and making quality assessment more comprehensive; extracting morphological parameters such as aspect ratio and curvature variance and color distribution parameters, providing an objective and quantifiable basis for green pepper quality grading; based on Z-score standardization and importance weighted processing, it realizes automated grading of green pepper quality, and the output results are reliable and consistent, meeting practical application needs. Through the above technical means, the present invention effectively solves the problems of low efficiency and insufficient precision in traditional green pepper quality analysis, and provides strong support for agricultural intelligent detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic flow chart of a green pepper quality analysis method based on appearance inspection provided by one embodiment of the present invention;
[0050] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0052] The embodiment of the present application provides a green pepper quality analysis method based on appearance inspection. The execution subject of the green pepper quality analysis method based on appearance inspection includes but is not limited to at least one of the electronic devices such as the server, terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the green pepper quality analysis method based on appearance inspection can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0053] Reference Figure 1 FIG. 1 is a flow chart of a method for analyzing the quality of green peppers based on appearance inspection according to an embodiment of the present invention. In this embodiment, the method for analyzing the quality of green peppers based on appearance inspection includes:
[0054] S1. Use multimodal sensors to synchronously collect visible light images, three-dimensional point cloud data, and near-infrared images of green peppers.
[0055] In an embodiment of the present invention, a multimodal sensor is a device that integrates multiple sensing functions and can simultaneously acquire different physical signals (such as optical, depth, and spectrum). In this solution, it is necessary to integrate a visible light camera (to capture surface texture and color), a three-dimensional lidar or a structured light camera (to obtain spatial geometric information), and a near-infrared spectrometer (to detect internal quality information).
[0056] In detail, visible light images record the intensity and color information of the reflected light of an object in the visible spectrum of the human eye (400-760nm), for example: stored in the form of an RGB three-channel matrix (such as size W×H×3, W is width, H is height), which can intuitively present surface texture, spots, color and other features; three-dimensional point cloud data is a collection of a large number of discrete points in space, each point contains X, Y, and Z coordinates, which is used to describe the surface geometry of the object; near-infrared images capture the reflection or radiation information of an object in the near-infrared spectrum, and are often used to detect internal defects or components.
[0057] For example, a Basler ac A2440-75um visible light camera (resolution 2448×2048), an LMIGocator 2350 structured light sensor (point cloud accuracy ±0.02mm) and a SpecimFX17 near-infrared spectrometer (900-1700nm) are used to achieve multi-sensor spatial alignment through the checkerboard calibration method.
[0058] Specifically, a green pepper is placed on a turntable and rotated at a constant speed (e.g., 5 rpm). The sensor collects multiple frames of data from fixed angles, ultimately synthesizing complete surface information. For example, after collecting 10 frames of visible light images, an image stitching algorithm (such as the OpenCV Stitcher module) is used to generate a panoramic texture map.
[0059] Specifically, a synchronization trigger mechanism (such as hardware synchronization line or software timestamp calibration) is used to ensure that the time difference between the three types of data collection is less than 10ms, avoiding data misalignment caused by changes in the posture of the green pepper.
[0060] For example: use hardware-triggered synchronization lines to connect each sensor, and the main controller sends a synchronization pulse signal; or use PTP (Precision Time Protocol) to achieve software time synchronization, and ensure that the data collection time difference is less than 10ms through timestamp alignment.
[0061] Specifically, an NI-9467 synchronization signal generator is used to connect each sensor and send trigger pulses based on a 10 MHz clock reference; software synchronization uses the PTP protocol and achieves nanosecond-level clock alignment through the IEEE1588 standard.
[0062] In general, visible light images are used for surface defect recognition in step S2; three-dimensional point clouds are used for morphological analysis in steps S3 and S6; near-infrared images combined with three-dimensional curvature maps are used for spectral-geometric feature fusion in step S4, and finally multi-dimensional feature comprehensive scoring is achieved in step S8.
[0063] S2. Perform surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations.
[0064] In an embodiment of the present invention, semantic segmentation refers to the task of classifying each pixel in an image into a predefined category (such as "defect" or "normal"), and outputting a probability map or label map of the same size as the original image.
[0065] In an embodiment of the present invention, performing surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations includes:
[0066] performing semantic segmentation on the visible light image to generate a defect probability map;
[0067] Performing adaptive threshold segmentation on the defect probability map to generate a binary defect mask map, wherein the pixel value of the defect area in the defect mask map is 1 and the pixel value of the non-defect area is 0;
[0068] Performing a pixel-by-pixel multiplication operation on the defect mask image and the visible light image to generate a first defect feature map with pixel-level defect annotations.
[0069] In detail, the defect probability map is the intermediate result of semantic segmentation. Each pixel value represents the confidence that the location belongs to the "defect" category (range 0-1). The closer the value is to 1, the higher the possibility of a defect. Adaptive threshold segmentation is an algorithm that automatically calculates the threshold based on the distribution of image pixel values and converts the continuous probability map into a binary image.
[0070] In detail, the binarized defect mask image is a black and white image obtained after threshold segmentation. The pixel value of the defect area is 1 (white) and the pixel value of the non-defect area is 0 (black), which is used to mark the defect position; the first defect feature map is the result of fusing the defect mask image with the original visible light image, retaining the color and texture information of the defect area, and setting the non-defect area to black to achieve pixel-level defect labeling.
[0071] Specifically, performing adaptive threshold segmentation on the defect probability map to generate a binary defect mask automatically calculates the threshold based on the principle of maximizing the between-class variance. Assuming the pixel value range of the defect probability map is [0, 1], the Otsu algorithm traverses all possible thresholds (e.g., from 0.01 to 0.99, with a step size of 0.01), calculates the variance of the "defective" and "normal" pixels under each threshold, and selects the threshold corresponding to the maximum variance as the segmentation threshold. For example, if the calculated threshold is 0.6, pixels with a probability ≥ 0.6 are set to 1 (defective) and pixels with a probability < 0.6 are set to 0 (normal), generating a binary mask.
[0072] Specifically, pixel-by-pixel multiplication of the defect mask and the visible light image to generate a first defect feature map with pixel-level defect annotations involves pixel-by-pixel multiplication of the binary defect mask (size W×H×1) with the original visible light image (size W×H×3). Specifically, pixels with a value of 1 in the mask retain the RGB value of the corresponding visible light image, while pixels with a value of 0 have their RGB value set to (0,0,0). The resulting first defect feature map, the same size as the original image, is output, visually displaying the defect location and its color texture.
[0073] In detail, traditional image processing algorithms (such as edge detection and threshold segmentation) rely on manually designed features and are difficult to adapt to complex defect forms (such as irregular mildew and insect spots). U-Net automatically learns defect features through end-to-end training and can accurately identify tiny or fuzzy defects.
[0074] In detail, manually setting the threshold requires repeated adjustment for different lighting conditions and green pepper varieties, which is inefficient and has poor generalization. The Otsu algorithm automatically calculates the threshold based on the statistical characteristics of the image and is robust to lighting changes and defect diversity.
[0075] Specifically, only outputting a binary mask image cannot reflect the defect details (such as color and degree of damage). By multiplying it with the visible light image, the original information of the defect area is retained, which facilitates subsequent defect classification and severity assessment.
[0076] In an embodiment of the present invention, performing semantic segmentation on the visible light image to generate a defect probability map includes:
[0077] Performing pixel-level classification processing on the visible light image using a pre-trained U-Net network model;
[0078] The classification results of the pixel-level classification processing are subjected to probability normalization processing by using a Softmax function to generate a defect probability map.
[0079] Specifically, the model parameters were pre-trained using a classic U-Net architecture (a symmetrical encoder-decoder structure with skip connections) based on publicly available green pepper disease datasets (e.g., PlantVillage). In this method, a visible light image of 256×256×3 size was input. The encoder extracted features using convolutional layers (e.g., 3×3 convolution kernels) and pooling layers (e.g., 2×2 max pooling), while the decoder restored pixel-level details using deconvolutional layers and skip connections. The final output was a 256×256×2 feature map, corresponding to the scores for the "defect" and "normal" categories, respectively.
[0080] In detail, the pre-trained U-Net model was trained based on 2,800 green pepper disease images in the PlantVillage dataset, and was fine-tuned for 50 epochs using a learning rate of 0.0001 in the embodiment of the present application.
[0081] Furthermore, the U-Net network contains 4 layers of downsampling and 4 layers of upsampling, with the number of convolution kernels in each layer being 64, 128, 256, and 512 respectively; the Adam optimizer is used with an initial learning rate of 0.001 and a batch size of 16, and trained for 50 epochs on the PlantVillage dataset.
[0082] In detail, the feature map output by U-Net is probabilistically normalized, and the calculation formula of the Softmax function is: Among them, z jis the raw score of the j-th defect output by the U-Net network, K is the number of categories, K = 2 (defective / normal), and finally a defect probability map of size 256 × 256 × 1 is obtained. Each pixel value represents the probability that the position belongs to the "defect" category.
[0083] For example, if the probability value of a pixel in the image after the output of the Softmax function is 0.9, it means that there is a 90% probability that there is a defect at that location.
[0084] S3. Perform local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics.
[0085] In this embodiment, 3D point cloud data is a geometric data set consisting of a large number of discrete points, each containing three-dimensional spatial coordinates (x, y, z). It is used to describe the spatial shape of the pepper's surface. It is typically collected by devices such as lidar and structured light cameras, and the data is formatted as .pcd or .ply. The density of the point cloud determines the accuracy of surface detail (e.g., 100-1000 points per square centimeter).
[0086] In an embodiment of the present invention, performing local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics includes:
[0087] Performing Delaunay triangulation processing on the three-dimensional point cloud data to construct a triangular mesh model;
[0088] Performing surface fitting processing on the neighborhood of each vertex in the triangular mesh model based on the least squares method to obtain a quadratic surface equation;
[0089] The principal curvature calculation process is performed on the quadratic surface equation to obtain a three-dimensional curvature map reflecting the surface deformation characteristics.
[0090] In an embodiment of the present invention, Delaunay triangulation is an algorithm that converts a discrete point set into a triangular mesh, ensuring that the generated triangles satisfy the empty circumcircle property (i.e., the circumcircle of any triangle does not contain other points), thereby constructing a continuous, non-overlapping surface model.
[0091] In detail, for each vertex in the triangular mesh model, the kd-tree algorithm is used to search for neighborhood points within a radius of 5 mm (usually containing 15-30 points) for surface fitting.
[0092] In an embodiment of the present invention, a triangular mesh model is a three-dimensional surface representation composed of multiple triangular facets, where each triangle is connected by three vertices and is used to approximately describe the geometric shape of the green pepper surface; local surface fitting is to fit a local surface through the points in the neighborhood of each vertex in the triangular mesh model to approximate the true shape of the area; the least squares method is a mathematical optimization technique that solves the optimal parameters by minimizing the sum of squared errors between the observed data and the fitted model.
[0093] In an embodiment of the present invention, the quadratic surface equation is as follows:
[0094] z=ax 2 +bxy+cy 2 +dx+ey+f
[0095] In detail, the quadratic surface equation is used to approximate the curved shape of the local surface, and the coefficients a, b, c, d, e, and f are solved by the least squares method.
[0096] Specifically, in the vertex local coordinate system, the z-axis is along the vertex normal direction and the xy plane is the tangent plane.
[0097] In detail, the principal curvature calculation formula is:
[0098]
[0099] Among them, H is the mean curvature and K is the Gaussian curvature.
[0100] In an embodiment of the present invention, the principal curvature is a numerical value that describes the maximum and minimum curvatures of a surface in two mutually perpendicular directions at a certain point, and is used to quantify the surface concave-convex characteristics; the three-dimensional curvature map maps the principal curvature value to a grayscale value or a pseudo-color image, which intuitively displays the deformation characteristics of the green pepper surface. The area with greater curvature has a darker color or a higher brightness.
[0101] In detail, performing Delaunay triangulation processing on the three-dimensional point cloud data to construct a triangular mesh model means using an open source computational geometry library (such as CGAL-Computational Geometry Algorithms Library) or Python's scipy.spatial.Delaunay module, inputting three-dimensional point cloud data (in the format of an N×3 array, where N is the number of points), and the algorithm automatically calculates the topological relationship between points, connects discrete points into non-overlapping triangles, and generates a triangular mesh model.
[0102] For example, if we input point cloud data of green peppers containing 1,000 points and perform Delaunay triangulation, we obtain a mesh consisting of approximately 2,000 triangular facets, generating structured data containing vertex coordinates and triangle facet indices. For example, each triangle is represented by 3 vertex indices (for example, [v1, v2, v3]) for subsequent processing.
[0103] Specifically, for each vertex v in the triangular mesh model, the points around it are selected by the k-neighborhood or radius neighborhood method (for example, k=10 nearest neighbor points are selected), and the coordinates (x, y, z) of the points in the neighborhood are substituted into the quadratic surface equation z=ax 2 +bxy+cy 2 +dx+ey+f, construct an overdetermined linear equation system (there are 6 unknowns a, b, c, d, e, f, and the number of equations is equal to the number of neighborhood points).
[0104] Furthermore, the least squares method (such as the numpy.linalg.lstsq function) is used to solve the system of equations to obtain the coefficients a, b, c, d, e, and f, thereby determining the local quadratic surface equation.
[0105] For example, if there are 15 points in the neighborhood of a vertex v, and the coefficients a=0.01, b=0, c=0.02, d=-θ.1, e=0.05, f=1 are obtained by least squares method, then the local surface equation of the neighborhood of this vertex is z=0.01x 2 +0.02y 2 -0.1x+0.05y+1.
[0106] Specifically, calculating the principal curvatures of the quadratic surface equation to obtain a three-dimensional curvature map reflecting surface deformation characteristics involves calculating the eigenvalues of the Hessian matrix (second-order partial derivative matrix) of the quadratic surface equation in the neighborhood of each vertex to obtain the principal curvatures κ1 and k2. For example, the igl.curvature library (available for C++ / Python) can be used to directly calculate the principal curvatures of triangular mesh vertices.
[0107] Furthermore, using the formula Where κ1*κ2 is the Gaussian curvature, the principal curvature values are normalized to a range of 0-255 and mapped to grayscale or pseudocolor to generate a 3D curvature map corresponding to the surface shape of the pepper. Larger curvature values (such as depressions or convexities) correspond to brighter image areas or more vivid colors.
[0108] Specifically, raw point cloud data is discrete and disordered, making it unsuitable for direct geometric analysis. Triangulation transforms it into a structured surface model, facilitating subsequent surface fitting and curvature calculation while ensuring the topological correctness of the model (e.g., avoiding facet intersections).
[0109] Specifically, the surface of a green pepper is complex and irregular, making it difficult to describe its local shape directly using a point cloud. Fitting the quadratic surface equation using the least squares method effectively smooths out noise and approximates the true surface, providing a continuous mathematical model for curvature calculation.
[0110] Specifically, the principal curvature is a key indicator for quantifying surface deformation. Compared with simple height difference or slope calculations, it can more accurately reflect geometric defects such as tiny depressions and protrusions (such as a 0.5mm indentation), providing a quantitative basis for quality assessment. For example, the principal curvature value can be used to quantify the degree of surface concavity and convexity, supporting defect severity grading (such as determining areas with a curvature value > 0.1 as severe deformation).
[0111] S4. Fusing the near-infrared image and the three-dimensional curvature map in a channel dimension to obtain a second defect feature map containing spectral-geometric joint features.
[0112] In an embodiment of the present invention, the near-infrared image captures the reflection or radiation information of the green pepper under the near-infrared spectrum (760-2500nm), which can penetrate the surface to detect internal moisture distribution, rot and other defects that are invisible to the naked eye. It is usually a single-channel grayscale image or a multi-channel spectral image.
[0113] In an embodiment of the present invention, the three-dimensional curvature map is an image generated in step S3, which quantifies the concave and convex characteristics of the green pepper surface through principal curvature calculation, and intuitively displays the surface deformation in grayscale values or pseudo-color, and each pixel value reflects the curvature size of the corresponding position.
[0114] In detail, channel dimension fusion refers to splicing the features of different modal data in the channel dimension to form a new data structure containing multi-source information, such as expanding a single-channel image into a multi-channel image; spectral-geometric joint features refer to the fusion of near-infrared spectral information (reflecting internal quality) and three-dimensional curvature geometric information (reflecting surface shape) to achieve multi-dimensional characterization of green pepper defects; the second defect feature map refers to the fused image, which serves as the comprehensive feature input for subsequent defect detection. Its number of channels is greater than that of the original image, and it contains both spectral and geometric information.
[0115] In an embodiment of the present invention, the channel-dimensional fusion of the near-infrared image and the three-dimensional curvature map to obtain a second defect feature map containing spectral-geometric joint features includes:
[0116] Converting the near-infrared image grayscale into a near-infrared grayscale map, and normalizing it with the three-dimensional curvature map;
[0117] The normalized three-dimensional curvature map is used as a new channel to perform channel splicing with the near-infrared grayscale map to generate the second defect feature map.
[0118] Specifically, if the near-infrared image is a multi-channel spectral image (e.g., a 16-channel hyperspectral image), it can be converted to a single-channel grayscale image using band selection or band fusion. For example, a specific band sensitive to moisture (e.g., 900-1100 nm) can be selected and a grayscale image generated using weighted averaging or maximum reflectance. If the original image is already a single-channel image, it can be used directly. For example, the conversion can be performed using the OpenCV library's cvtColor function (e.g., cv2.cvtColor(near_infrared_image, cv2.COLOR_BGR2GRAY)) or Python's numpy array operations.
[0119] In detail, normalization processing with the three-dimensional curvature map refers to unifying the pixel values of the near-infrared grayscale image and the three-dimensional curvature map to the same range (such as 0-1 or 0-255) to avoid imbalance of features after fusion due to numerical differences. Perform normalization processing, where x is the original pixel value, x norm is the normalized value.
[0120] For example, the normalized 3D curvature map is used as a new channel and concatenated with the near-infrared grayscale image in the channel dimension. If the near-infrared grayscale image is a single channel (size W×H×1) and the 3D curvature map is also a single channel (size W×H×1), then a dual-channel image (size W×H×2) is obtained after concatenation. The generated second defect feature map contains two channels: the first channel is near-infrared spectral information, and the second channel is surface curvature geometry information.
[0121] Specifically, while near-infrared images can detect internal defects, they cannot locate their spatial location. Three-dimensional curvature maps only reflect surface shape, making it difficult to identify internal anomalies. By combining spectral and geometric information through channel stitching, this method achieves the dual capabilities of "internal defect location and surface deformation analysis." Compared to using data from both modalities independently, the fused feature map can serve as direct input to deep learning models, reducing model design complexity and improving feature extraction efficiency.
[0122] S5. Perform attention weight allocation on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper.
[0123] In the embodiment of the present invention, the step of performing attention weight distribution on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper includes:
[0124] Performing feature extraction processing on the first defect feature map and the second defect feature map respectively through a two-stream convolutional network to obtain a deep feature map;
[0125] Performing dynamic weight allocation processing on the deep feature map based on a spatial attention mechanism, and performing feature weighting on the deep feature map based on the allocated dynamic weights;
[0126] The feature-weighted deep feature map is subjected to feature fusion processing to obtain a comprehensive defect detection result of the green pepper.
[0127] In an embodiment of the present invention, a dual-stream convolutional network refers to a network comprising two parallel convolutional network branches, which respectively extract features from feature maps of different modalities, retain the unique information of each modality while learning deep semantics; deep feature maps refer to abstract features extracted by the convolutional network through multi-layer convolution and pooling operations, which contain higher-level semantic information (such as defect categories and shape patterns) than the original images; spatial attention mechanism refers to a method of dynamically adjusting the weights of different areas in the feature map, so that the network focuses on key defect areas and suppresses irrelevant background information; comprehensive defect detection results refer to the final output after fusing and weighting the information of the two types of feature maps, which is used to determine the type, location and severity of green pepper defects.
[0128] Specifically, the branch architecture of the two-stream convolutional network uses a classic convolutional neural network (such as ResNet-18 or VGG-16) for each branch, including multiple convolutional layers (such as 3×3 convolution kernels), batch normalization layers, and ReLU activation functions. For example, the first branch inputs the first defect feature map (size W×H×3), and the second branch inputs the second defect feature map (size W×H×2).
[0129] In an embodiment of the present invention, the dynamic weight allocation processing is performed on the deep feature map based on the spatial attention mechanism, and the feature weighting of the deep feature map is performed based on the allocated dynamic weight, including:
[0130] Performing global average pooling processing on the two types of deep feature maps to generate channel description vectors;
[0131] Perform correlation learning processing on the channel description vector through a fully connected layer to generate an attention weight matrix;
[0132] The deep feature map is spatially weighted based on the attention weight matrix.
[0133] In detail, the attention weight matrix refers to a two-dimensional matrix generated by learning, where each element corresponds to the weight of a spatial position in the feature map, and the larger the value, the more important the position.
[0134] Specifically, global average pooling is performed on the deep feature maps of the two branches, compressing the spatial dimension (W'×H') to 1 to generate a channel description vector. For example, if the deep feature map size is 16×16×64, a vector of length 64 is obtained after pooling.
[0135] In detail, Among them F ijc is the c-th channel value of the feature map at position (i, j), v c The cth element of the channel description vector.
[0136] In detail, the two channel description vectors are concatenated and input into the fully connected layer (e.g., a hidden layer containing 128 neurons and 2 output neurons), the correlation between feature maps is learned through ReLU and Sigmoid activation functions, and the attention weight matrix (size W'×H') is output.
[0137] For example, the attention weight matrix is expanded to the same number of channels as the deep feature map, and element-by-element multiplication is performed to enhance the key area features and suppress the secondary areas. For example, if the weight matrix is 16×16, it is expanded to 16×16×64 and then multiplied with the feature map.
[0138] In detail, the fully connected layer contains a 128-dimensional hidden layer and a 16×16 output layer. The attention weight is optimized using the cross-entropy loss function, the learning rate is 0.001, and the batch size is 32. The channel description vectors of the two branches are concatenated and input into the fully connected layer, and a 16×16 attention weight matrix is generated through the Sigmoid function.
[0139] Furthermore, the weighted deep feature maps are fused by element-by-element addition or channel concatenation followed by convolution. For example, two weighted feature maps are element-wise added, and dimensionality reduction is performed through the nn.Conv2d layer (e.g., a 1×1 convolution kernel). The resulting output is a single-channel comprehensive defect detection result map, where higher pixel values indicate a greater likelihood of a defect.
[0140] In general, the first and second defect feature maps contain surface texture and spectral-geometric information, respectively. The dual-stream structure can independently extract modality-specific features (such as color texture of visible light images and moisture features of near-infrared images) to avoid information loss.
[0141] In general, the surface of green peppers contains complex backgrounds (such as leaves and stems). The attention mechanism learns dynamic weights to focus the network on defective areas and reduce interference from irrelevant information. For example, when the near-infrared image detects internal rot but the visible light image shows no obvious surface changes, the attention mechanism can enhance the weight of the near-infrared features.
[0142] S6. Performing geometric feature quantification processing on the three-dimensional point cloud data to extract morphological parameters of the green pepper including aspect ratio, curvature variance, and volume asymmetry.
[0143] In an embodiment of the present invention, geometric feature quantification processing refers to converting the geometric shape information represented by the three-dimensional point cloud data into specific, quantifiable numerical features, so as to analyze and compare the morphology of the green peppers; the aspect ratio refers to the ratio of the major axis length to the minor axis length of an object, which reflects the slenderness of the object and can be used to determine whether the shape of the green peppers meets the standards in the quality analysis of green peppers; the curvature variance refers to a statistic that describes the change in the curvature of the object surface, reflecting the smoothness of the green pepper surface. The larger the variance, the more uneven the surface; the volume asymmetry refers to an indicator that measures the volume difference between the left and right sides of an object, reflecting the symmetry of the green pepper. The higher the asymmetry, the more irregular the shape of the green pepper.
[0144] In an embodiment of the present invention, the geometric feature quantization processing of the three-dimensional point cloud data to extract the morphological parameters of the green pepper including aspect ratio, curvature variance and volume asymmetry includes:
[0145] Performing principal axis analysis on the three-dimensional point cloud data to calculate the ratio of the major axis to the minor axis as the aspect ratio;
[0146] Perform variance statistics on the surface principal curvature to obtain the curvature variance;
[0147] The three-dimensional point cloud data is subjected to volume segmentation processing through a mirror symmetry plane, and the volume difference between the two sides is calculated to obtain the volume asymmetry.
[0148] In an embodiment of the present invention, principal axis analysis processing refers to a mathematical method that determines the main direction of the point cloud data by calculating the eigenvectors and eigenvalues of the covariance matrix of the point cloud data, thereby finding the major axis and the minor axis; principal curvature refers to two numerical values that describe the degree of curvature of the surface at a certain point, representing the maximum and minimum curvatures respectively, and is used to analyze the local shape of the surface; a mirror symmetry plane refers to a plane that divides an object into two symmetrical parts on the left and right, through which the three-dimensional point cloud data can be segmented to calculate the volume difference on both sides.
[0149] In detail, performing principal axis analysis on the three-dimensional point cloud data refers to using Python's numpy library to calculate the covariance matrix of the three-dimensional point cloud data. First, the center of mass of the point cloud data is calculated, and the point cloud data is centered, that is, the center of mass coordinates of each point is subtracted. Then, the covariance matrix of the centered point cloud data is calculated. Next, the eigenvalues and eigenvectors of the covariance matrix are calculated using numpy's eig function. The size of the eigenvalue represents the degree of discreteness of the data in the direction of the corresponding eigenvector. The eigenvector corresponding to the largest eigenvalue is the major axis direction, and the eigenvector corresponding to the second largest eigenvalue is the minor axis direction.
[0150] Furthermore, calculating the ratio of the major axis to the minor axis as the aspect ratio means projecting the point cloud data into the major and minor axis directions, respectively calculating the maximum and minimum values after projection, and the difference between the two is the length of the major axis and the minor axis, and finally calculating the ratio of the major axis to the minor axis.
[0151] In detail, in step S3, local surface fitting and principal curvature calculation have been performed on the three-dimensional point cloud data to obtain the principal curvature value of each point.
[0152] In detail, the variance statistics of the surface principal curvature are processed to obtain the curvature variance, which means that the variance statistics can be used to calculate the variance of the principal curvature values of all points using Python's numpy library. The variance of the maximum and minimum values of the principal curvature can be calculated separately, or the average of the two can be calculated.
[0153] Specifically, the three-dimensional point cloud data is volume segmented using a mirror symmetry plane, and the volume asymmetry degree is obtained by calculating the volume difference between the two sides. The steps include: determining the long axis direction through principal axis analysis, finding a plane perpendicular to the long axis and passing through the centroid as the mirror symmetry plane; converting the three-dimensional point cloud data into a triangular mesh model using the Delaunay triangulation algorithm in the scipy library, and then segmenting the triangular mesh into left and right parts according to the mirror symmetry plane; calculating the volume of the left and right triangular meshes after segmentation using the trimesh library. The trimesh library can calculate the volume by integrating the triangular mesh; and calculating the difference between the left and right volumes and dividing it by the total volume to obtain the volume asymmetry degree.
[0154] Generally speaking, green peppers can have irregular shapes, making direct measurement of their major and minor axes difficult. Principal axis analysis can automatically identify the principal directions of point cloud data and accurately calculate the aspect ratio, providing a quantitative metric for evaluating the shape of green peppers. The smoothness of a green pepper's surface can affect its quality, and calculating the curvature variance can quantify surface unevenness and detect peppers with surface damage or deformities. Symmetrical green peppers are typically exposed to more even environmental influences during growth and are likely to be of higher quality. Calculating volume asymmetry can screen out irregularly shaped green peppers, improving the accuracy of quality grading.
[0155] S7. Perform HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity.
[0156] In an embodiment of the present invention, performing HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity includes:
[0157] Performing HSV color space conversion processing on the visible light image;
[0158] Perform histogram equalization and standard deviation calculation on the converted H channel to obtain the color uniformity index;
[0159] The converted S channel is processed by mean value calculation to obtain the maturity index.
[0160] In the embodiments of the present invention, HSV is a method for representing points in the RGB color space within an inverted cone. H represents hue, ranging from 0° to 360°, representing the type of color, such as red, green, and blue; S represents saturation, ranging from 0 to 1, reflecting the vividness of the color; and V represents value, ranging from 0 to 1, describing the brightness of the color. By converting visible light images from the common RGB color space to the HSV color space, different color attributes can be more easily analyzed and processed.
[0161] Specifically, histogram equalization is an image enhancement technique that adjusts the image's grayscale histogram to make the grayscale distribution more uniform, thereby improving the image's contrast and visual quality. In this step, the histogram of the H channel is equalized to better analyze the color distribution, ensuring that the subsequently calculated color uniformity index more accurately reflects the actual color uniformity in the image.
[0162] In detail, in most image processing libraries, such as OpenCV, there are corresponding functions to implement the conversion from RGB color space to HSV color space. Taking OpenCV as an example, the cv2.cvtColor() function is used to convert the input visible light image from RGB format to HSV format.
[0163] Specifically, first, the H channel is separated from the converted HSV image. Then, the H channel is processed using the histogram equalization function in the image processing library. In OpenCV, this can be achieved using the cv2.equalizeHist() function. After histogram equalization, the standard deviation of the H channel pixel values is calculated. The standard deviation reflects the degree of pixel dispersion and serves as an indicator of color uniformity. A larger standard deviation indicates a more uneven color distribution.
[0164] Specifically, performing mean calculation on the converted S channel to obtain the maturity indicator involves separating the S channel from the HSV image and then calculating the mean of the S channel pixel values. The mean value reflects the average vividness of the colors in the image. For determining the maturity of green peppers, mature ones are typically brighter and more saturated, so the mean value of the S channel can be used as a maturity indicator.
[0165] S8. Perform multi-dimensional feature fusion and grading decision on the green pepper morphological parameters, the color distribution parameters, and the comprehensive defect detection results to obtain a quality grading result of the green pepper.
[0166] In an embodiment of the present invention, the multi-dimensional feature fusion and grading decision-making are performed on the green pepper morphological parameters, the color distribution parameters, and the comprehensive defect detection results to obtain the quality grading result of the green pepper, including:
[0167] Performing Z-score standardization processing on the green pepper morphological parameters, color distribution parameters and comprehensive defect detection results;
[0168] Performing importance weighting processing on the standardized features obtained after the standardization processing to obtain the quality score of the green pepper;
[0169] The quality score is graded and mapped according to a preset grading threshold value, and a special grade, first grade or second grade quality result is output.
[0170] In an embodiment of the present invention, Z-score normalization is a data normalization method that converts the data into a standard normal distribution with a mean of 0 and a standard deviation of 1 by subtracting the mean of the data set from each data point in the data set and dividing the result by the standard deviation of the data set.
[0171] In detail, suppose that the data set consisting of green pepper morphological parameters, color distribution parameters and comprehensive defect detection results is X = {x1, x2, ..., x n}, first calculate the mean of the data set Then calculate the standard deviation
[0172] Furthermore, for each data point x in the dataset i , the result after standardization is Among them, μ i and σ i They correspond to the mean and standard deviation of the i-th feature respectively.
[0173] For example, for the aspect ratio feature of the green pepper morphological parameters, if the mean of the aspect ratio in the original data set is 5 and the standard deviation is 1.5, and the aspect ratio of one green pepper is 6, then after standardization, the standardized value of the aspect ratio of the green pepper is (6-5) / 1.5≈0.67.
[0174] Specifically, in actual green pepper quality grading, the numerical ranges and units of different features can vary significantly. Without standardization, the model may over-rely on certain features while ignoring other important ones, thus affecting grading accuracy. Standardization can effectively address this issue, enabling the model to more objectively and comprehensively consider various features.
[0175] In detail, the importance weighting process is to assign corresponding weights to each feature according to its importance to the quality of green peppers, and then multiply the standardized feature values with the corresponding weights and sum them to obtain a comprehensive quality score.
[0176] Specifically, weighting the importance of the standardized features obtained after standardization to obtain the quality score of the green pepper includes the following steps: First, the weight of each standardized feature needs to be determined. This can be achieved through various methods, such as subjective assignment based on domain knowledge and experience, or automatic determination of weights using feature selection algorithms in machine learning. Assume that the morphological parameters, color distribution parameters, and comprehensive defect detection results of the green pepper after standardization are x'1, x'2, ..., x' m , the corresponding weights are w1,w2,…,w m , then the quality score of green pepper is For example, assuming that the standardized values of the aspect ratio, curvature variance, volume asymmetry, color uniformity index, maturity index and comprehensive defect detection results are 0.5, 0.3, 0.2, 0.4, 0.6, and 0.8 respectively, and their weights are determined to be 0.2, 0.1, 0.1, 0.2, 0.2, and 0.2 respectively, then the quality score S = 0.5×0.2+0.3×0.1+0.2×0.1+0.4×0.2+0.6×0.2+0.8×0.2=0.53.
[0177] Specifically, different features have varying degrees of influence on green pepper quality. Treating all features equally can lead to inaccurate quality assessments. Importance weighting can be used to weight features appropriately based on their actual importance, improving the accuracy and reliability of quality scores.
[0178] Specifically, the preset grading thresholds are numerical limits set in advance based on green pepper quality grading standards and experience. They are used to map quality scores to different grading categories. The grading mapping process categorizes green peppers into corresponding quality grades based on the relationship between the quality score and the preset grading thresholds.
[0179] Specifically, performing a level mapping process on the quality score according to a preset grading threshold and outputting a special grade, first grade or second grade quality result includes the following steps: Assume that the preset grading thresholds are T1 and T2 (T1 < T2). If the quality score S ≥ T2, the green pepper is determined to be of special grade; if T1 ≤ S < T2, it is determined to be of first grade; if S < T1, it is determined to be of second grade. For example, setting T1 = 0.6 and T2 = 0.8, if the quality score of a certain green pepper is 0.7, then according to the level mapping process, this green pepper is determined to be of first grade quality.
[0180] Specifically, in the actual grading of green pepper quality, it is necessary to divide green peppers into different grades for easy distinction and sales. By performing a level mapping process through preset grading thresholds, green peppers can be accurately classified into different grades according to the quality score, meeting the requirements for green pepper quality grading in practical applications.
[0181] In several embodiments provided by the present invention, it should be understood that the disclosed method can be implemented in other ways.
[0182] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.
[0183] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence is the theory, method and technology that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A green pepper quality analysis method based on appearance inspection, characterized in that, The method comprises: Multimodal sensors are used to simultaneously collect visible light images, three-dimensional point cloud data, and near-infrared images of green peppers; Performing surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations; Performing local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics; Fusing the near-infrared image with the three-dimensional curvature map in terms of channel dimension to obtain a second defect feature map containing spectral-geometric joint features; Performing attention weight allocation on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper; Performing geometric feature quantification processing on the three-dimensional point cloud data to extract morphological parameters of the green pepper including aspect ratio, curvature variance, and volume asymmetry; Performing HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity; Multi-dimensional feature fusion and grading decision are performed on the green pepper morphological parameters, the color distribution parameters and the comprehensive defect detection results to obtain the quality grading result of the green pepper.
2. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The performing surface defect recognition on the visible light image to obtain a first defect feature map with pixel-level defect annotations includes: performing semantic segmentation on the visible light image to generate a defect probability map; Performing adaptive threshold segmentation on the defect probability map to generate a binary defect mask map, wherein the pixel value of the defect area in the defect mask map is 1 and the pixel value of the non-defect area is 0; Performing a pixel-by-pixel multiplication operation on the defect mask image and the visible light image to generate a first defect feature map with pixel-level defect annotations.
3. A green pepper quality analysis method based on appearance inspection as claimed in claim 2, characterized in that, The performing semantic segmentation on the visible light image to generate a defect probability map includes: Performing pixel-level classification processing on the visible light image using a pre-trained U-Net network model; The classification results of the pixel-level classification processing are subjected to probability normalization processing by using a Softmax function to generate a defect probability map.
4. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The performing of local surface fitting and principal curvature calculation on the three-dimensional point cloud data to generate a three-dimensional curvature map reflecting surface deformation characteristics includes: Performing Delaunay triangulation processing on the three-dimensional point cloud data to construct a triangular mesh model; Performing surface fitting processing on the neighborhood of each vertex in the triangular mesh model based on the least squares method to obtain a quadratic surface equation; The principal curvature calculation process is performed on the quadratic surface equation to obtain a three-dimensional curvature map reflecting the surface deformation characteristics.
5. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The step of fusing the near-infrared image with the three-dimensional curvature map in a channel dimension to obtain a second defect feature map containing spectral-geometric joint features includes: Converting the near-infrared image grayscale into a near-infrared grayscale map, and normalizing it with the three-dimensional curvature map; The normalized three-dimensional curvature map is used as a new channel to perform channel splicing with the near-infrared grayscale map to generate the second defect feature map.
6. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The performing attention weight distribution on the first defect feature map and the second defect feature map to obtain a comprehensive defect detection result of the green pepper includes: Performing feature extraction processing on the first defect feature map and the second defect feature map respectively through a two-stream convolutional network to obtain a deep feature map; Performing dynamic weight allocation processing on the deep feature map based on a spatial attention mechanism, and performing feature weighting on the deep feature map based on the allocated dynamic weights; The feature-weighted deep feature map is subjected to feature fusion processing to obtain a comprehensive defect detection result of the green pepper.
7. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The geometric feature quantization processing of the three-dimensional point cloud data to extract the morphological parameters of the green pepper including aspect ratio, curvature variance and volume asymmetry includes: Performing principal axis analysis on the three-dimensional point cloud data to calculate the ratio of the major axis to the minor axis as the aspect ratio; Perform variance statistics on the surface principal curvature to obtain the curvature variance; The three-dimensional point cloud data is subjected to volume segmentation processing through a mirror symmetry plane, and the volume difference between the two sides is calculated to obtain the volume asymmetry.
8. A green pepper quality analysis method based on appearance inspection as claimed in claim 1, characterized in that, The performing of HSV space conversion and statistical feature analysis on the visible light image to obtain color distribution parameters representing color uniformity and maturity includes: Performing HSV color space conversion processing on the visible light image; Perform histogram equalization and standard deviation calculation on the converted H channel to obtain the color uniformity index; The converted S channel is processed by mean value calculation to obtain the maturity index.
9. A method for analyzing green pepper quality based on appearance inspection as claimed in claim 1, characterized in that, The multi-dimensional feature fusion and grading decision-making are performed on the green pepper morphological parameters, the color distribution parameters, and the comprehensive defect detection results to obtain the quality grading result of the green pepper, including: Performing Z-score standardization processing on the green pepper morphological parameters, color distribution parameters and comprehensive defect detection results; Performing importance weighting processing on the standardized features obtained after the standardization processing to obtain the quality score of the green pepper; The quality score is graded and mapped according to a preset grading threshold value, and a special grade, first grade or second grade quality result is output.
10. A method for analyzing green pepper quality based on appearance inspection according to claim 6, characterized in that: The dynamic weight allocation processing is performed on the deep feature map based on the spatial attention mechanism, and feature weighting is performed on the deep feature map based on the allocated dynamic weight, including: Performing global average pooling processing on the two types of deep feature maps to generate channel description vectors; Perform correlation learning processing on the channel description vector through a fully connected layer to generate an attention weight matrix; The deep feature map is spatially weighted based on the attention weight matrix.
Citation Information
Cited By
Intelligent pipe surface defect detection method based on image recognition
CN121504913A
Fruit and vegetable processing raw material maturity and defect image intelligent sorting method and system
CN121616579A