A quantitative evaluation method for momordica grosvenori based on image segmentation
By using a spatial-frequency domain feature component decoupling algorithm and nonlinear dimensionality reduction technology, the problems of edge recognition and residual energy level evaluation in complex backgrounds in the quantitative evaluation of Luo Han Guo were solved, achieving high-precision quantitative evaluation results.
Patent Information
- Application Number
- CN202610469226.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies struggle to effectively handle the representation of irregular edge images in complex backgrounds and the nonlinear coupling between pixel-level semantic features and physical residual energy level attributes in the quantitative evaluation of monk fruit, leading to inaccurate quantitative evaluation.
A spatial-frequency domain feature component decoupling algorithm is used for image noise suppression and feature equalization to generate decoupled light and shadow features, extract cross-level deep semantic information, perform edge tensor correction, calculate geometric morphology vector and lesion distribution density, and use nonlinear dimensionality reduction to generate residual energy level evaluation grades of Luo Han Guo traits.
It achieves high-precision quantitative evaluation of monk fruit under complex backgrounds, solves the problem of edge recognition diffusion, ensures automated sensing and comprehensive energy level determination of particle size, roundness and disease severity, and improves the accuracy and consistency of quantitative evaluation.
Smart Images

Figure CN122367938A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image segmentation technology, specifically to a quantitative evaluation method for monk fruit based on image segmentation. Background Technology
[0002] In the fields of computer vision and image analysis, automatic identification and geometric quantization of specific agricultural product targets are core to achieving automated sorting. Monk fruit, a spherical fruit with unique morphological characteristics, contains complex texture information and edge features in its images. To achieve particle size measurement, surface defect statistics, and maturity determination of monk fruit, image segmentation technology must first be used to accurately extract the monk fruit target from the acquired raw images. The accuracy of image segmentation directly determines the accuracy and robustness of subsequent quantitative evaluation indicators.
[0003] In existing technologies, some progress has been made in the evaluation and optimization algorithms for image segmentation results. For example, image segmentation quality can be scored by fusing subjective and objective indicators; or the optimal image segmentation algorithm can be selected by analyzing sub-results such as missegmentation, missed segmentation, and oversegmentation generated during the image segmentation process. However, the above-mentioned existing technologies still have significant limitations when applied to the quantitative evaluation scenario of monk fruit.
[0004] First, existing technologies primarily focus on evaluating the performance of the image segmentation algorithm itself, that is, only paying attention to the overlap between the segmentation mask and the standard ground truth, without establishing a direct mapping model from the semantic features of image segmentation to the quantification of the specific physical properties of monk fruit. Second, the surface of monk fruit has fine burrs and uneven color spots, and in actual production lines, there are target adhesion and shadow interference. General image segmentation evaluation metrics are unable to perceive the specific anatomical structure of monk fruit (such as the semantic differences between the stem region and the fruit body region), resulting in insufficient fitting of image segmentation edges in complex environments, which in turn leads to geometric calculation bias in quantitative evaluation. In addition, due to the lack of deep logic for the semantic characteristics of monk fruit, existing image segmentation processes, when handling multi-target parallel analysis, find it difficult to achieve simultaneous and refined stripping of target parts (such as normal epidermis and lesion areas) through image semantic segmentation, limiting the dimension and depth of quantitative evaluation.
[0005] To address the above issues, a quantitative evaluation method is needed to represent the image signal of irregular edges of monk fruit in complex backgrounds, and to overcome the technical challenge of low nonlinear coupling between pixel-level semantic features and physical residual energy level attributes.
[0006] To address this, a quantitative evaluation method for monk fruit based on image segmentation is proposed. Summary of the Invention
[0007] The purpose of this invention is to provide a quantitative evaluation method for monk fruit based on image segmentation, which realizes the image signal representation of irregular edges of monk fruit in complex backgrounds, as well as the nonlinear coupling between pixel and physical property residual energy level attributes.
[0008] To achieve the above objectives, the present invention provides the following technical solution: A quantitative evaluation method for monk fruit based on image segmentation includes: The texture features of the irregular edges of the monk fruit and the diffuse reflection of the surface are obtained as data image information. The spatial-frequency domain feature component decoupling algorithm is used to perform image noise suppression and feature equalization on the data image information to generate decoupled light and shadow features. Based on the decoupled light and shadow features, deep semantic information across different spatial resolutions is extracted to obtain a semantic probability distribution map covering the global outline and local pixel association of Luo Han Guo, and edge tensor correction is performed; pixel-level category determination is performed on the corrected semantic probability distribution map to generate a semantic deconstruction set of fruit lesions; Pixel counting and contour topological mapping are performed on the semantic deconstruction set of fruit lesions to calculate the target fruit diameter, roundness and projected area scores of Luo Han Guo and obtain the geometric shape vector; the set of pixels marked as lesion regions in the semantic deconstruction set of fruit lesions is obtained, and spatial gravitational field analysis is performed to calculate the lesion distribution density and surface texture loss weight. The geometric morphology vector, lesion distribution density, and surface texture loss weights are substituted into the preset trait residual energy level discriminant formula to perform multi-parameter nonlinear dimensionality reduction, and the residual energy level evaluation level of Luo Han Guo is output.
[0009] Preferably, the process of generating decoupled light and shadow features includes: acquiring the overall picture of the fruit body and the texture features of surface diffuse reflection of the irregular edges of the monk fruit in the automated sorting station as data image information; using a spatial-frequency domain feature component decoupling algorithm to perform basis function projection mapping on the monk fruit data image information to construct a feature decoupling mapping space; separating the monk fruit data image information into pixel correlation components representing local spatial correlation and spectral energy components representing global illuminance distribution through orthogonal basis decomposition; performing neighborhood convolution smoothing operation on the pixel correlation components to suppress random noise interference, performing mapping gain processing on the spectral energy components to achieve feature distribution balance, and performing joint feature space reconstruction on the processed pixel correlation components and spectral energy components to generate decoupled light and shadow features.
[0010] Preferably, the process of generating a semantic probability distribution map and correcting the edge tensor includes: performing layered feature mapping based on decoupled light and shadow features to extract cross-level deep semantic information with different spatial resolutions; calculating a semantic probability distribution map covering the global contour of the monk fruit and the association of local pixels using the deep semantic information; calculating the pixel gradient tensor of the edge region of the semantic probability distribution map; constraining the boundary of the target pixel of the monk fruit using the directional calibration logic of the pixel gradient tensor; and outputting the corrected semantic probability distribution map.
[0011] Preferably, the process of generating the semantic deconstruction set of fruit lesions includes: constructing a pixel density feature space using the corrected semantic probability distribution map; performing nonlinear mapping activation judgment logic on the pixel density feature space to identify the preset semantic label corresponding to each pixel coordinate; and calling the pixel space consistency constraint algorithm to aggregate pixels with the same preset semantic label to generate a semantic deconstruction set of fruit lesions containing the target mask of monk fruit, the lesion feature mask, and the environmental background mask.
[0012] Preferably, the process of obtaining the geometric morphology vector includes: extracting the target mask pixel set corresponding to the semantic deconstruction set of fruit lesions, counting the total number of pixels and calculating the projected area score using pixel space conversion logic; using the contour topology mapping algorithm to determine the edge closed curve of the target mask pixel set, calculating the Euclidean distance distribution from each pixel of the edge closed curve to the centroid pixel, and determining the target fruit diameter of the monk fruit; calculating the ratio coefficient between the projected area score of the monk fruit and the square of the perimeter of the edge closed curve to determine the roundness; and vectorizing the target fruit diameter, roundness, and projected area score of the monk fruit to obtain the geometric morphology vector.
[0013] Preferably, the process of calculating the lesion distribution density and surface texture loss weights includes: extracting the semantic deconstruction set of fruit lesions and labeling it as a lesion region pixel set; establishing an inverse proportional model based on the geometric spacing of each pixel in the lesion region pixel set; performing spatial gravitational field analysis on the lesion region pixel set using the inverse proportional model, accumulating the scalar value of the gravitational interaction force generated by each pixel in the lesion region pixel set in unit pixel space, and determining the lesion distribution density; and performing weighted fitting between the lesion distribution density and the area ratio occupied by the lesion region pixel set in the target mask pixel set, and outputting the surface texture loss weights.
[0014] Preferably, the process of outputting the residual energy level evaluation grade of Luo Han Guo (monk fruit) includes: performing a cascade recombination operation on the geometric morphology vector, lesion distribution density, and surface texture loss weight to generate a comprehensive residual energy level index of Luo Han Guo; performing nonlinear dimensionality reduction projection on the comprehensive residual energy level index of Luo Han Guo using a preset residual energy level discriminant to obtain the corresponding coordinate mapping point in the low-dimensional discriminant space; and outputting the residual energy level evaluation grade of Luo Han Guo by calculating the geometric membership relationship of the coordinate mapping point relative to the energy level threshold space.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention utilizes a spatial-frequency domain feature component decoupling algorithm to substantially combine image noise suppression and feature equalization. It suppresses spatial random noise through pixel-related components and corrects global illumination deviations using spectral energy components. The resulting decoupled light and shadow features possess extremely high signal-to-noise ratio and consistent feature distribution. Compared to single noise reduction processing, this synergistic design of spatial and frequency domain feature components solves the problem of original feature obscuring caused by uneven lighting and environmental interference in field collection or complex industrial environments of monk fruit.
[0016] 2. This invention substantially combines the extraction logic of cross-level semantic feature vectors with the correction logic of edge direction tensor fields. It constructs a probability field using the semantic correlation between global contours and local textures, and forcibly constrains the target boundary through edge tensor directional calibration. This correlation of technical features solves the problem of boundary recognition blurring caused by the fine surface burrs and complex geometric curvature of monk fruit. The generated semantic deconstruction set of fruit lesions achieves fine differentiation of the fruit body, lesions, and background at the pixel level, providing a high-precision mask reference for subsequent geometric quantization.
[0017] 3. This invention cascades and recombines a geometric morphology vector generated based on geometric moment operations with a lesion distribution density generated based on an inverse proportional model of pixel-to-pixel geometric spacing to construct a high-dimensional trait residual energy level feature matrix. This matrix is then projected onto a low-dimensional discriminant space using nonlinear dimensionality reduction. This substantial combination of morphological attributes and lesion distribution characteristics changes the existing technology's reliance on a single segmented area for coarse evaluation. It achieves automated sensing and comprehensive energy level determination of Luo Han Guo's grain size, roundness, and disease severity, ensuring consistency and deterministic feature space mapping in the Luo Han Guo trait residual energy level results. Attached Figure Description
[0018] Figure 1 This is a flowchart of a method for quantitative evaluation of monk fruit based on image segmentation according to the present invention; Figure 2 This is a flowchart illustrating the generation of a semantic deconstruction set of bodily lesions according to an embodiment of the present invention. Figure 3This is a flowchart illustrating the logic of feature extraction and energy level determination based on residual energy levels in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Please see Figures 1 to 3 This invention provides a quantitative evaluation method for monk fruit based on image segmentation, the technical solution of which is as follows: Example 1 Reference Figure 1 This is a flowchart of a method for quantitative evaluation of monk fruit based on image segmentation according to the present invention. This embodiment provides a specific application scenario for the method, specifically, the fine-grained hierarchical mapping of trait residual energy levels performed on monk fruit targets with irregular geometric edges and complex surface textures in an automated production and processing environment. The specific steps are as follows: The texture features of the irregular edges of the monk fruit and the diffuse reflection of the surface are obtained as data image information. The spatial-frequency domain feature component decoupling algorithm is used to perform image noise suppression and feature equalization on the data image information to generate decoupled light and shadow features. Based on the decoupled light and shadow features, deep semantic information across different spatial resolutions is extracted to obtain a semantic probability distribution map covering the global outline and local pixel association of Luo Han Guo, and edge tensor correction is performed; pixel-level category determination is performed on the corrected semantic probability distribution map to generate a semantic deconstruction set of fruit lesions; Pixel counting and contour topological mapping are performed on the semantic deconstruction set of fruit lesions to calculate the target fruit diameter, roundness and projected area scores of Luo Han Guo and obtain the geometric shape vector; the set of pixels marked as lesion regions in the semantic deconstruction set of fruit lesions is obtained, and spatial gravitational field analysis is performed to calculate the lesion distribution density and surface texture loss weight. The geometric morphology vector, lesion distribution density, and surface texture loss weights are substituted into the preset trait residual energy level discriminant formula to perform multi-parameter nonlinear dimensionality reduction, and the residual energy level evaluation level of Luo Han Guo is output.
[0021] Furthermore, the process of generating decoupled light and shadow features includes: acquiring the overall view of the monk fruit and the texture features of surface diffuse reflection at the irregular edges of the monk fruit in the automated sorting station as data image information; using a spatial-frequency domain feature component decoupling algorithm to perform basis function projection mapping on the monk fruit data image information to construct a feature decoupling mapping space; separating the monk fruit data image information into pixel correlation components representing local spatial correlation and spectral energy components representing global illuminance distribution through orthogonal basis decomposition; within the feature decoupling mapping space, performing neighborhood convolution smoothing operation on the pixel correlation components to suppress random noise interference, performing mapping gain processing on the spectral energy components to achieve feature distribution balance, and performing joint feature space reconstruction on the processed pixel correlation components and spectral energy components to generate decoupled light and shadow features.
[0022] Specifically, the texture features of the entire fruit body and surface diffuse reflection of the monk fruit within the irregular edges of the automated sorting station are acquired as data image information. A spatial-frequency domain feature component decoupling algorithm is used to perform basis function projection mapping on the monk fruit data image information to construct a feature decoupling mapping space. The spatial-frequency domain feature component decoupling algorithm refers to a method that uses a discrete wavelet transform matrix to perform orthogonal basis projection on pixels. In this embodiment, the Haar wavelet basis or the Daubechies-4 wavelet basis is preferably used as the transform basis.
[0023] The process of mapping data image information to the feature decoupling mapping space is as follows: the data image information is transformed into a two-dimensional discrete pixel matrix. Using a preset transformation kernel function consisting of a set of low-pass filter coefficients and a set of high-pass filter coefficients, row-direction convolution and column-direction convolution dot product operations are performed on the two-dimensional discrete pixel matrix respectively, projecting the brightness values in the pixel coordinate system onto the multi-dimensional mapping vector space (i.e., the feature decoupling mapping space). The feature decoupling mapping space consists of mutually orthogonal low-frequency coefficient subspaces and high-frequency coefficient subspaces, and logically it is represented by a four-part matrix architecture consisting of a subset of approximate coefficients, a subset of horizontal detail coefficients, a subset of vertical detail coefficients, and a subset of diagonal detail coefficients.
[0024] The process of separating the pixel correlation component representing local spatial correlation and the spectral energy component representing global illumination distribution includes: extracting a preset scaling factor in the decoupled feature space based on the frequency distribution characteristics of wavelet subbands; determining the four corner boundary coordinates of the two-dimensional image spectral matrix based on the original sampling resolution of the Luo Han Guo data image information; calculating the geometric displacement distance from the center coordinate point of the two-dimensional image spectral matrix to the four corner boundary coordinates, and determining the maximum value of the geometric displacement distance as the reference scale; obtaining a preset scaling factor of 0.25, and performing a multiplication operation between the reference scale and the preset scaling factor of 0.25 to obtain the radial frequency value; dividing the decoupled feature space into a preset low-frequency region and a preset high-frequency band using the radial frequency value; determining the mapping coefficients within the preset high-frequency band as the pixel correlation component representing local spatial correlation, and determining the mapping coefficients within the preset low-frequency band as the spectral energy component representing global illumination distribution.
[0025] Specifically, a polar coordinate system with the center point of the spectrum as the origin is established in the decoupled feature space. The preset scaling factor of 0.25 is determined based on the spectral energy distribution law of the diffuse reflectance characteristics of the monk fruit peel. According to experimental statistical data of the diffuse reflectance model of the monk fruit surface, the low-frequency components representing the background light field and the macroscopic illuminance trend of the fruit show a significant concentration in the energy accumulation distribution function, and more than 90% of the illuminance energy is concentrated in the region of 0 to 0.25 times the scale with the center point of the spectrum as the center and the reference scale as the radius. If the preset scaling factor is greater than 0.25, low-frequency illuminance background information will be mixed into the pixel-related components, causing false artifacts in the edge detection stage; if the preset scaling factor is less than 0.25, the spectral energy components will lose the macroscopic illuminance trend, causing contrast distortion of the standardized image features. The physical meaning of the radial frequency value definition represents the critical cutoff frequency for dividing the illuminance field and the texture field in the decoupled feature space. The absolute radial position of the spectrum segmentation is determined by multiplying the reference scale by 0.25. The adaptive dynamic alignment mechanism works by dynamically determining the reference scale value by acquiring the coordinates of the four corners of the spectral matrix of the two-dimensional image at different original sampling resolutions in real time. When the original sampling resolution changes, the reference scale is linearly scaled, causing the radial frequency values to be synchronously translated on the frequency axis. This ensures that the spectral energy components can always accurately extract the low-frequency trend coefficient matrix reflecting the background light field distribution under image inputs with different pixel densities, thus achieving automatic adaptation of the algorithm processing criteria to the hardware acquisition resolution.
[0026] The process of performing neighborhood convolution smoothing on pixel-related components is as follows: a 3×3 pixel window is selected as the convolution kernel, and a moving average operation is performed on the coefficient matrix of the pixel-related components. Starting from the first and second coordinates of the first row of the coefficient matrix of the pixel-related components, the kernel slides along the row direction with a single pixel as the displacement unit. After completing a single row traversal, the kernel moves vertically to the starting position of the next row and repeats the sliding process until the pixel coordinates of the entire domain are traversed. During the sliding process, the kernel extracts the values of 9 neighboring pixels in the current coverage area, calculates the sum of the dot product of the 9 neighboring pixel values and the corresponding weight factors to obtain the weighted average value, and assigns the weighted average value to the pixel point corresponding to the center position of the convolution kernel to replace the original value. This completes the smoothing and elimination of discrete noise isolated points in the coefficient matrix and maintains the gradient sharpness of the lesion edge.
[0027] The process of performing mapping gain processing on the spectral energy components is as follows: The mean value of each coefficient in the spectral energy component is calculated. A preset normalized brightness median is defined as an ideal brightness reference point within the normalized energy space from 0 to 1, with a value of 0.5, used as the energy balance benchmark for Luo Han Guo target recognition. The mean value is compared with the preset normalized brightness median. If the mean value is lower than the preset normalized brightness median, it indicates that the overall image is too dark. In this case, all coefficient values within the spectral energy components are multiplied by a linear gain coefficient.
[0028] To establish an energy gradient difference of no less than 0.35 between the target (monk fruit) and the background: According to experimental statistics, the average reflectance of mature monk fruit in the visible light band ranges from 0.18 to 0.22, while the background grayscale gradient in the automated sorting station ranges from 0.03 to 0.08. When the mean value representing the fruit's energy is aligned to a standardized brightness median of 0.5 using a linear gain coefficient, the enhancement limit of the background environment's grayscale gradient is simultaneously limited to below 0.12. By calculating the difference between the standardized brightness median value of 0.5 and the upper limit of the background environment's grayscale gradient of 0.12, a measured energy gradient difference of 0.38 is obtained, thus ensuring that the measured energy gradient difference of 0.38 meets the preset recognition requirement of no less than 0.35.
[0029] The linear gain coefficient is a scaling factor used to enhance the weight of feature energy distribution. The value of the linear gain coefficient ranges from 1.1 to 1.5, determined based on experimental statistical intervals of the average reflectance of the monk fruit peel and the grayscale gradient of the background environment. The mapping gain processing procedure is as follows: The initial gain ratio is obtained by dividing the preset standardized brightness median by the mean of the statistically obtained coefficient values. The initial gain ratio is then truncated within the preset range of 1.1 to 1.5. If the initial gain ratio is greater than 1.5, the linear gain coefficient is forcibly set to 1.5; if the initial gain ratio is less than 1.1, the linear gain coefficient is forcibly set to 1.1; if the initial gain ratio is between 1.1 and 1.5, the linear gain coefficient is directly set to the initial gain ratio. By performing pixel-by-pixel multiplication between the linear gain coefficient and the coefficient values within the spectral energy components, the energy amplitude of the monk fruit target area is aligned to the ideal brightness reference point of 0.5, while the grayscale gradient of the background environment is limited to the unsaturated range below 0.12. This avoids spectral energy saturation distortion and achieves dynamic balance of overall image brightness.
[0030] The process of jointly reconstructing the feature space using the processed pixel correlation components and spectral energy components is as follows: Using the inverse discrete wavelet transform operator, the smoothed high-frequency detail coefficient matrix and the gain-processed low-frequency trend coefficient matrix are subjected to inverse projection. Specifically, the low-frequency trend coefficient matrix and the high-frequency detail coefficient matrix are used as inputs, and layer-by-layer upsampling interpolation is performed according to the reconstruction logic defined by the inverse discrete wavelet transform. Convolution and superposition operations are then performed using the corresponding reconstruction filter kernels, enabling linear integration of different frequency band components in the decoupled feature space on the spatial pixel coordinate axes, thus completing the inverse projection operation.
[0031] The coordinate values of each point restored to the spatial pixel coordinate axis are subjected to energy normalization processing, that is, the pixel intensity values are mapped to the dimensionless value range of [0, 1] to generate decoupled light and shadow features. The decoupled light and shadow features are logically represented as a feature intensity distribution matrix with the same dimension as the original two-dimensional discrete pixel matrix, where each element in the matrix corresponds to the normalized pixel value of the Luo Han Guo target.
[0032] This invention achieves simultaneous processing of high-frequency noise suppression and low-frequency illumination equalization in images through the coordinated design of spatial and frequency domain feature components. This improves the contrast and distribution stability of the edge texture of the monk fruit target, providing basic feature data with controlled signal-to-noise ratio and normalized brightness distribution for subsequent accurate image semantic segmentation.
[0033] Furthermore, the process of generating a semantic probability distribution map and correcting the edge tensor includes: performing layered feature mapping based on decoupled light and shadow features to extract cross-level deep semantic information with different spatial resolutions; calculating a semantic probability distribution map covering the global contour of the monk fruit and the association of local pixels through the deep semantic information; calculating the pixel gradient tensor of the edge region of the semantic probability distribution map; constraining the boundary of the target pixel of the monk fruit through the directional calibration logic of the pixel gradient tensor; and outputting the corrected semantic probability distribution map.
[0034] Specifically, the decoupled light and shadow features are input into the stacked feature mapping process. A 3×3 convolution operator with a stride of 2 is used to perform feature extraction and dimensionality compression on the decoupled light and shadow features.
[0035] The process of performing stacked feature mapping is as follows: Decoupled lighting features are acquired as the original input data for the downsampling link. During the construction of the downsampling link, Xavier initialization is performed on all three convolutional operation sequences. Xavier initialization involves determining the variance scale of the weight distribution based on the number of input and output channels of the current convolutional layer, and then randomly generating initial feature weights in the zero-mean space using this variance scale. In each convolutional operation, a uniform same-dimensional padding method is applied. Same-dimensional padding is defined as padding the feature matrix boundaries with zero-value pixels of a preset width, ensuring that the convolutional kernel's sliding range covers the original boundary coordinates, and guaranteeing that the spatial layout of the output feature map logically matches the input stride. In the 1 / 2 scale space convolution operation, the number of input channels is 1, and the number of output channels is set to 32. In the 1 / 4 scale space convolution operation, the number of input channels is 32, and the number of output channels is set to 64. In the 1 / 8 scale space convolution operation, the number of input channels is 64, and the number of output channels is set to 128.
[0036] After feature extraction is completed at each convolutional layer, a modified linear unit activation (MRU) process is performed. The MRU process involves determining the positive or negative attribute of the linear mapping components output by the convolution operation, forcibly resetting all components less than or equal to 0 to 0, and keeping all components greater than 0 unchanged. Cascaded downsampling is then used to sequentially perform halved spatial resolution compression on the image data based on the output of the previous convolutional layer. A 32-channel feature matrix is generated at a 1 / 2 scale, a 64-channel feature matrix at a 1 / 4 scale, and a 128-channel feature matrix at a 1 / 8 scale, thereby extracting and fusing cross-layer deep semantic information with different spatial resolutions.
[0037] The process of extracting cross-level deep semantic information at different spatial resolutions is as follows: at the end of each cyclic convolution operation cycle, the feature mapping matrix corresponding to the current spatial resolution is extracted and temporarily stored. Cross-level deep semantic information is defined as a set of hierarchical semantic tensors composed of feature mapping matrices at different spatial resolutions. The logical structure of the hierarchical semantic tensor set is a topological architecture that progresses sequentially from the bottom-level spatial geometric detail tensor to the top-level category attribute tensor. Specifically, the feature matrix at the 1 / 2 scale is defined as the bottom-level spatial geometric detail tensor, used to preserve the edge contours and surface texture of the monk fruit target; the feature matrix at the 1 / 8 scale is defined as the top-level category attribute tensor, used to represent the mapping relationship between image regions and the monk fruit target. By arranging the bottom-level spatial geometric detail tensor and the top-level category attribute tensor in scale order, cross-level deep semantic information is finally formed.
[0038] The process of calculating the semantic probability distribution map is as follows: the top-level category attribute tensor is subjected to bilinear interpolation to restore it to the original image size, and then an additive fusion operation is performed with the bottom-level spatial geometric detail tensor to generate a fused feature field. The normalized exponential activation function is used to perform numerical transformation on each coordinate point of the fused feature field to obtain a semantic probability distribution map covering the range of zero to one.
[0039] The process of performing bilinear interpolation is as follows: determine the scaling ratio between the original image size and the top-level class attribute tensor size, map the pixel coordinates of the original image to the coordinate space of the top-level class attribute tensor, retrieve the four pixel center points adjacent to the mapped point, determine the weight coefficients based on the distance relationship between the mapped point and the four pixel center points, perform the multiplication and accumulation operations of the pixel value and the weight coefficients, and complete the spatial resolution completion of the top-level class attribute tensor.
[0040] The process of generating a fused feature field by performing an additive fusion operation is as follows: the top-level category attribute tensor and the bottom-level spatial geometric detail tensor after bilinear interpolation are dimensionally aligned to ensure that the two tensors have the same dimensions in the pixel space dimension and the feature channel dimension. Element-level addition is then performed according to the coordinate point correspondence to generate the fused feature field.
[0041] The process of performing numerical transformation on the coordinates of each point in the fused feature field using the normalized exponential activation function (Softmax function) is as follows: The original values of each coordinate point in the fused feature field are used as the exponent of the natural constant, and an exponentiation operation is performed to obtain the corresponding median exponent. The sum of the median exponents of all coordinate points is calculated. The median exponent of each coordinate point is divided by the sum of the median exponents to lock the numerical range between 0 and 1, thus obtaining the semantic probability distribution map. The semantic probability distribution map is defined as a feature intensity map representing the weight of pixel coordinate assignment. Its structure is a two-dimensional floating-point numerical matrix with the same size as the original image. Each element in the matrix represents the confidence probability of the corresponding pixel position, which is the target category of the monk fruit.
[0042] This scheme achieves deep coupling between the category attributes and geometric details of monk fruit by combining multi-scale feature fusion and normalization mapping, eliminating positional bias in semantic recognition and establishing a high-confidence pixel attribution distribution.
[0043] Subsequently, the pixel gradient tensor of the semantic probability distribution map edge region is calculated. The pixel gradient tensor of the edge region is defined as a second-order autocorrelation matrix that characterizes the edge gradient distribution characteristics of the semantic probability distribution map. Its structure is a 2×2 matrix containing the squared terms of the horizontal gradient partial derivatives, the squared terms of the vertical gradient partial derivatives, and the product terms of the horizontal and vertical partial derivatives. The horizontal and vertical gradient partial derivatives are obtained by performing Sobel operator convolution on the semantic probability distribution map.
[0044] The directional calibration logic process is as follows: A principal eigenvector is extracted by performing eigenvalue decomposition on a 2×2 matrix. This principal eigenvector represents the spatial orientation of the most significant pixel gradient change. The direction of the principal eigenvector is compared with the direction of the radial reference vector generated by the physical modeling of the Luo Han Guo sphere to obtain the centroid pixel coordinates of the Luo Han Guo semantic probability distribution map. The radial reference vector is defined as the spatial orientation vector pointing from the centroid pixel coordinates to the edge pixel coordinates to be calibrated in the Luo Han Guo semantic probability distribution map. The radial reference vector is obtained by subtracting the centroid pixel coordinates from the edge pixel coordinates to be calibrated.
[0045] Specifically, the pixel gradient tensor of the edge region is extracted. The pixel gradient tensor of the edge region is represented as a 2×2 second-order autocorrelation matrix. The internal structure of the second-order autocorrelation matrix is as follows: within the 3×3 neighborhood of the pixel coordinates to be calibrated, the gray-level partial derivatives of the pixel in the horizontal and vertical directions are calculated; the sum of the squares of the horizontal gray-level partial derivatives of all pixels in the neighborhood is used as the element in the first row and first column of the matrix; the sum of the squares of the vertical gray-level partial derivatives of all pixels in the neighborhood is used as the element in the second row and second column of the matrix; the sum of the products of the horizontal and vertical gray-level partial derivatives of all pixels in the neighborhood is used as the elements in the first row and second column and the second row and first column of the matrix. Eigenvalue decomposition is performed on the 2×2 second-order autocorrelation matrix to obtain two eigenvalues and two corresponding eigenvectors. By comparing the absolute values of the two eigenvalues, the eigenvector corresponding to the eigenvalue with the higher absolute value is determined as the principal eigenvector.
[0046] The process of performing deviation comparison is as follows: perform a vector dot product operation on the main feature vector and the radial reference vector to obtain the cosine similarity value that represents the consistency of the two vector directions.
[0047] The process of outputting the corrected semantic probability distribution map is as follows: The original confidence probability value corresponding to the coordinates of the edge pixels to be calibrated in the semantic probability distribution map is multiplied by the cosine similarity value. If the cosine similarity value is between 0.85 and 1, it is determined that the direction of the principal feature vector is basically consistent with the direction of the radial reference vector, and the original confidence probability value remains stable. If the cosine similarity value is lower than a preset deviation threshold of 0.6, the original confidence probability value is proportionally decayed through multiplication. The corrected confidence probability values across the entire domain are then rearranged according to the coordinate sequence to generate the corrected semantic probability distribution map.
[0048] This invention solves the boundary blurring problem in irregular target recognition by integrating global contour attributes and edge geometric constraints, ensuring that the semantic probability distribution map has pixel-level fit in complex backgrounds, and providing an accurate target pixel space for subsequent quantization parameter extraction.
[0049] Furthermore, the process of generating the semantic deconstruction set of fruit lesions includes: constructing a pixel density feature space using the corrected semantic probability distribution map; performing nonlinear mapping activation judgment logic on the pixel density feature space to identify the preset semantic label corresponding to each pixel coordinate; and calling the pixel space consistency constraint algorithm to aggregate pixels with the same preset semantic label to generate a semantic deconstruction set of fruit lesions containing the target mask of monk fruit, the lesion feature mask, and the environmental background mask.
[0050] Specifically, the process of constructing a pixel density feature space using the corrected semantic probability distribution map includes: extracting the multidimensional confidence probability vector corresponding to each pixel coordinate point in the corrected semantic probability distribution map. The multidimensional confidence probability vector consists of a background component, a fruit component, and a lesion component. Using this vector as the height dimension feature and the pixel coordinate axes as the spatial dimension feature, a three-dimensional feature probability tensor is established. The pixel density feature space is a non-uniform probability field distribution model with the pixel spatial coordinates as the base and the confidence probability as the perpendicular axis.
[0051] The process of performing nonlinear mapping activation judgment logic on the pixel density feature space is as follows: A preset classification mapping table is established. This table is a mapping data structure that establishes a one-to-one correspondence between integer logical indices and the physical attributes of the monk fruit. It includes the environmental background attribute corresponding to index value zero, the monk fruit body attribute corresponding to index value 1, and the fruit surface lesion attribute corresponding to index value 2. For each pixel coordinate point in the pixel density feature space, the maximum value index discrimination function is called to perform nonlinear mapping on the multidimensional confidence probability vector corresponding to the pixel point. The maximum value index discrimination function is defined as a mathematical judgment logic that retrieves the numerical distribution within the vector and extracts the index of the highest value position. Its function is to compare the component-level amplitudes of the input multidimensional confidence probability vector.
[0052] The multidimensional confidence probability vector corresponding to specific pixel coordinates in the pixel density feature space is read. The nonlinear activation threshold is set to 0.6, based on statistical analysis of 2000 sets of historical Luo Han Guo (monk fruit) sample annotation data. By calculating the confidence probability distribution curve of fruit pixel points in historical samples, the lower limit of the probability distribution in the 95% confidence interval is found to be between 0.55 and 0.65. To balance recognition accuracy and false negative rate, the nonlinear activation threshold is set to 0.6. The nonlinear mapping process is as follows: It is determined whether the confidence probability value corresponding to the target index exceeds 0.6. If the fruit component value is at its maximum in the three-dimensional feature dimension, and the confidence probability value of the fruit component exceeds 0.6, then the pixel coordinate point is determined to have significant category classification characteristics. The corresponding pixel coordinate point is mapped from the continuous probability space to the discrete label space and assigned the target label 1. If the confidence probability value of the fruit component is at its maximum but does not exceed 0.6, then the pixel point is determined to belong to the uncertainty region, and the background label 0 is forcibly assigned to suppress background noise interference. Similarly, if the value of the lesion component is at the maximum position and exceeds 0.6, then the lesion is labeled with tag 2.
[0053] The pixel space consistency constraint algorithm is defined as a smoothing and denoising algorithm based on neighborhood logical association. The working principle is as follows: retrieve the state of the eight neighboring pixels of the pixel coordinates to be processed. If the central pixel is identified as lesion label 2, and its eight neighboring pixels are all identified as target label 1, and the area of the connected region formed by the lesion pixels is less than ten pixels below the preset threshold, then the preset semantic label of the central pixel is forcibly corrected to target label 1 to eliminate discrete noise interference.
[0054] The process of generating a semantic deconstruction set of fruit lesions is as follows: count the coordinates of all pixels after recognition, perform pixel clustering according to the preset semantic labels, and establish an independent binary matrix for each label category; assign the binary value 1 to the corresponding coordinates of the pixels identified as target label 1 in the matrix, and assign the value 0 to the other positions to generate the Luo Han Guo target mask; generate the lesion feature mask and the environmental background mask; perform logical assembly on the generated Luo Han Guo target mask, lesion feature mask and environmental background mask to generate a semantic deconstruction set of fruit lesions.
[0055] Specifically, pixel clustering is defined as the process of grouping the spatial coordinates of pixels with the same preset semantic labels into the same spatial point set. Pixel clustering is performed on target label 1 to obtain the pixel spatial point set belonging to the fruit body of the monk fruit; pixel clustering is performed on lesion label 2 to obtain the pixel spatial point set belonging to the lesion region; and pixel clustering is performed on background label 0 to obtain the pixel spatial point set belonging to the environmental background.
[0056] The process of creating an independent binarization matrix for each label category is as follows: Three blank numerical arrays with dimensions identical to the image information of the monk fruit data are preset. The specific content of the binarization matrix is a spatial mapping matrix composed of numerical values 1 and 0. For the monk fruit target mask, the first corresponding blank numerical array is traversed. If the current coordinate belongs to the pixel spatial point set of target label 1, then the value at that coordinate is assigned a binary value of 1; otherwise, it is assigned a binary value of 0. The process of generating the lesion feature mask is as follows: In the second corresponding blank numerical array, the pixel coordinates belonging to lesion label 2 are retrieved, and the value at the retrieved pixel coordinates is updated to a binary value of 1; the remaining coordinates are retained as binary values of 0.
[0057] The process of generating the environmental background mask is as follows: In the corresponding third blank numerical array, the pixel coordinates belonging to background label 0 are retrieved, and the value at that coordinate is updated to the binary value 1, while the remaining coordinates are retained as the binary value 0. The process of executing the logic assembly is as follows: Following the order of target mask, lesion mask, and background mask, the three independent binary matrices are stacked and merged along the channel axis to generate a semantic deconstruction set of fruit lesions. The structure of the semantic deconstruction set of fruit lesions is defined as a three-channel binary feature tensor, where each channel independently records the spatial distribution characteristics of the Luo Han Guo fruit body, lesions, and background. (Refer to...) Figure 2 This is a flowchart illustrating the generation of semantic deconstruction sets for fruit lesions according to an embodiment of the present invention. This solution achieves the structured data stripping of key physical partitions in *Monk Fruit* through the collaborative application of pixel clustering and logic assembly.
[0058] This invention achieves a precise mapping from continuous probability to discrete categories by substantially combining activation determination and spatial constraints, eliminating isolated noise and boundary holes in semantic segmentation, ensuring the integrity of the target mask and the purity of the category, and providing a structured and denoised semantic data foundation for subsequent feature quantization.
[0059] Furthermore, the process of obtaining the geometric morphology vector includes: extracting the target mask pixel set corresponding to the semantic deconstruction set of fruit lesions, counting the total number of pixels and calculating the projected area score using pixel space conversion logic; using the contour topology mapping algorithm to determine the edge closed curve of the target mask pixel set, calculating the Euclidean distance distribution from each pixel of the edge closed curve to the centroid pixel, and determining the target fruit diameter of the monk fruit; calculating the ratio coefficient of the projected area score of the monk fruit to the square of the perimeter of the edge closed curve, and determining the roundness; and vectorizing the target fruit diameter, roundness, and projected area score of the monk fruit to obtain the geometric morphology vector.
[0060] Specifically, pixel coordinates with binary values of 1 are separated from the semantic deconstruction set of the fruit lesions, forming a target mask pixel set for the monk fruit. A traversal and counting operation is performed on this target mask pixel set to obtain the total number of pixel units contained in the set. The projected area score is calculated using pixel space conversion logic, defined as a geometric scale mapping rule based on image acquisition resolution. The process of calculating the projected area score is as follows: a preset unit pixel actual area mapping coefficient (obtained based on camera intrinsic parameter calibration) is obtained; the total number of pixels is multiplied by the unit pixel actual area mapping coefficient to generate the projected area score.
[0061] The calculation process for the edge closure curve is as follows: The contour topology mapping algorithm is used to determine the edge closure curve of the target mask pixel set. This algorithm is an edge extraction logic based on binary matrix boundary connectivity analysis, performing boundary tracking on the binary matrix. The algorithm retrieves the boundary coordinates adjacent to background pixels with a value of 0 within the target mask pixel set. The boundary coordinates are then logically sorted clockwise using Moore's neighborhood tracking logic. Specifically, a starting boundary coordinate point is selected, and adjacent boundary points satisfying the pixel connectivity criterion are searched sequentially in the eight-neighbor space in a clockwise direction. The coordinates of the searched adjacent boundary points are stored in a preset pixel list according to the search order. This search is repeated until the starting boundary coordinate point is reached, generating a continuous and closed pixel list as the edge closure curve. The centroid pixel is determined by calculating the arithmetic mean of the horizontal and vertical coordinates of all pixels in the target mask pixel set.
[0062] The process of calculating the Euclidean distance distribution is as follows: extract each coordinate point within the closed edge curve one by one, calculate the sum of squares of the differences between the horizontal and vertical coordinates of each coordinate point and the horizontal and vertical coordinates of the centroid pixel, and perform a square root operation on the sum of squares to obtain the set of geometric distances from each edge point to the centroid pixel.
[0063] The process of determining the target diameter of the monk fruit is as follows: First, calculate the arithmetic mean of the coordinates of all pixels in the target mask to determine the coordinates of the centroid pixel. Then, calculate the Euclidean distance from each pixel in the edge list to the centroid, forming a geometric spacing set. Next, calculate the arithmetic mean of this set as the equivalent radius, and determine the target diameter of the monk fruit by multiplying the equivalent radius by two.
[0064] The process of determining roundness is as follows: Count the total number of pixels contained in the closed edge curve, perform chain code length compensation at the diagonal connection positions, and calculate the perimeter of the closed edge curve. Calculate the ratio of the projected area fraction to the square of the perimeter, and introduce 4... The roundness index is obtained by calculating the constant correction term, i.e., roundness index = 4. • Projected area score The square of the perimeter is used to characterize the fullness of the monk fruit's shape. This method is suitable for monk fruits with a projected outline that is approximately circular. For severely deformed or concave targets, the accuracy may be ±10%. It is recommended to use it in conjunction with a roundness index. The accuracy is better when the projected area fraction is >100 pixels; for targets with a projected area fraction <20 pixels, it is not recommended to rely solely on the roundness index.
[0065] The process of vectorization construction is as follows: a three-dimensional numerical storage sequence is established, and the target fruit diameter, roundness, and projected area scores of the monk fruit are sequentially filled into each data position of the three-dimensional numerical storage sequence according to a preset topological order. Tensorization processing is performed on the filled three-dimensional numerical storage sequence to generate a geometric shape vector with multi-dimensional geometric attribute description capabilities.
[0066] This invention achieves a precise transformation of the morphological characteristics of monk fruit from pixel distribution to physical measurement by combining contour topological mapping and geometric moment operation, solving the problem of random error in manual measurement. The generated geometric morphology vector provides an objective, high-dimensional geometric data basis for subsequent determination of trait residual energy levels.
[0067] Furthermore, the process of calculating the lesion distribution density and surface texture loss weights includes: extracting the semantic deconstruction set of fruit lesions and labeling it as a lesion region pixel set; establishing an inverse proportional model based on the geometric spacing of each pixel in the lesion region pixel set; performing spatial gravitational field analysis on the lesion region pixel set using the inverse proportional model, accumulating the scalar value of the gravitational interaction force generated by each pixel in the lesion region pixel set in unit pixel space, and determining the lesion distribution density; and performing weighted fitting between the lesion distribution density and the area ratio occupied by the lesion region pixel set in the target mask pixel set, and outputting the surface texture loss weights.
[0068] Specifically, pixel coordinates identified by specific semantic indices are extracted from the semantic deconstruction set of fruit lesions to form a pixel set of the lesion region. The process of establishing an inverse proportional model of geometric spacing is as follows: the geometric displacement distance between any two pixel coordinates within the pixel set of the lesion region is used as the input parameter, the square of the geometric displacement distance is calculated, and the constant term unit value 1 is divided by the square value to generate the corresponding gravitational correlation factor, i.e., gravitational correlation factor = 1 / square of geometric displacement distance + ,in This is a preset minimal smoothing offset term used to prevent the denominator from being zero and to ensure the stability of the calculated values; during the model building process, the dimension of the geometric displacement distance is uniformly set to pixel units.
[0069] The process of performing spatial gravitational field analysis is as follows: traverse the pixel set of the lesion region, take each pixel in the set as the reference center, and sequentially search for the gravitational correlation factor between the pixel and all other pixels in the set to form a response matrix characterizing the degree of mutual influence between pixels.
[0070] The process of determining the lesion distribution density is as follows: A global double summation is performed on all gravitational correlation factors within the response matrix to obtain the total gravitational potential energy scalar value. The global double summation operation involves traversing the response matrix and summing the gravitational correlation factors between any two pixels within the recorded lesion region pixel set. The unit pixel space is defined as a square reference region with a side length of one pixel. The physical meaning of the total gravitational potential energy scalar value is defined as the spatial interaction intensity generated by the lesion region pixel set within the unit pixel space; the dimension of the total gravitational potential energy scalar value is expressed as the energy density scalar within the unit pixel space. If the geometric displacement distance of pixels within the lesion region pixel set decreases, the value of the gravitational correlation factor increases, leading to an increase in the total gravitational potential energy scalar value; conversely, if the geometric displacement distance of pixels within the lesion region pixel set increases, the total gravitational potential energy scalar value decreases. The lesion distribution density is determined by the total gravitational potential energy scalar value, serving as a dimensionless spatial topological aggregation index for subsequent trait residual energy level assessment.
[0071] The weighting process is as follows: The area ratio is obtained by dividing the set of pixels in the lesion region by the number of pixels in the target mask pixel set of the monk fruit. A binary evaluation matrix is established, consisting of lesion distribution density and area ratio. After normalizing the lesion distribution density, it is linearly accumulated with the area ratio according to preset empirical weights. The result of the linear accumulation operation is mapped to the [0,1] numerical space to generate the final surface texture loss weights.
[0072] This invention utilizes simulated physical gravitational field logic to establish a lesion distribution model, realizing a technological evolution from a single area dimension to a spatial clustering topological dimension for diseased areas. It can accurately identify the differences in damage between connected lesions and discrete lesions, ensuring that the residual energy level determination results of traits are more consistent with the actual physical characteristics of fruit damage.
[0073] Furthermore, the process of outputting the residual energy level evaluation grade of Luo Han Guo (monk fruit) includes: performing a cascade recombination operation on the geometric morphology vector, lesion distribution density, and surface texture loss weight to generate a comprehensive residual energy level index of Luo Han Guo; performing nonlinear dimensionality reduction projection on the comprehensive residual energy level index of Luo Han Guo using a preset residual energy level discriminant to obtain the corresponding coordinate mapping points in the low-dimensional discriminant space; and outputting the residual energy level evaluation grade of Luo Han Guo by calculating the geometric membership relationship of the coordinate mapping points relative to the energy level threshold space.
[0074] Specifically, the process of performing the cascade recombination operation is as follows: First, linear normalization is performed on the fruit diameter, roundness, area fraction, lesion distribution density, and surface texture loss weights in the geometric shape vector.
[0075] For each feature component in the geometric morphology vector, lesion distribution density, and surface texture loss weights, the maximum and minimum values of the corresponding feature components in the historical standard sample library are pre-calculated. For the original feature values to be evaluated, a normalization formula is used, i.e., normalized feature value = (original feature value - preset feature minimum value) / (preset feature maximum value - the aforementioned feature minimum value), to compress each feature value into the dimensionless interval [0,1]. According to the preset feature dimension order, the normalized components are concatenated and spliced to generate a multi-dimensional fusion feature vector of Luo Han Guo (Monk Fruit).
[0076] The process of performing nonlinear dimensionality reduction projection using a preset trait residual energy level discriminant is as follows: A pre-learned mapping matrix is obtained, which stores projection operators based on kernel principal component analysis. A multidimensional fused feature vector is input into the mapping matrix to perform a nonlinear kernel mapping operation. Through feature extraction and orthogonal projection, the high-dimensional feature space is compressed into a low-dimensional discriminant space. The result of the dimensionality reduction is represented as a coordinate mapping point in the low-dimensional discriminant space.
[0077] Obtain the mapping matrix stored in the preset trait residual energy level discriminant formula. The mapping matrix is generated by offline learning from a training set containing 2000 historical samples of Luo Han Guo (Monk Fruit). The 2000 historical samples of Luo Han Guo were obtained by pixel-based sampling from multiple planting bases in the main production areas of Luo Han Guo, covering the entire harvest season from September to November. The trait residual energy level distribution ratio of the 2000 historical samples of Luo Han Guo is: 600 sets of premium samples, 800 sets of first-level samples, and 600 sets of second-level samples. The mapping matrix internally stores a projection operator based on kernel principal component analysis.
[0078] The process of performing nonlinear dimensionality reduction projection is as follows: The residual energy level index of the comprehensive trait is input into the mapping matrix. The kernel function used in the kernel mapping operation is the Gaussian radial basis function (RBF) kernel function. The kernel mapping operation is performed using a multidimensional fused feature vector and 500 preset support vectors. These 500 preset support vectors are obtained by performing K-means clustering on 2000 historical samples of *Salvia miltiorrhiza* and extracting the cluster center vectors. The squared Euclidean distance between the multidimensional fused feature vector and the 500 preset support vectors is calculated. The scaling parameter 1.25 is defined as the bandwidth component of the Gaussian RBF kernel function, obtained by calculating the mean global distribution variance of the 2000 historical samples of *Salvia miltiorrhiza* in the comprehensive feature space. The squared Euclidean distance is divided by 1.25 and the negative value is used as the exponent of the natural constant 2.718 to perform an exponentiation operation, obtaining a 500-dimensional kernel mapping response vector, thus realizing the mapping from the original feature space to a high-dimensional regenerated Hilbert kernel space. The projection operator for kernel principal component analysis (KPI) is obtained; it is a 500-row by 3-column weight coefficient matrix. A linear combination projection operation is performed on the 500-dimensional kernel mapping response vector and the weight coefficient matrix. The choice of projecting to 3D space is based on the fact that the cumulative contribution rate corresponding to the first three eigenvalues reaches 92%, ensuring that the morphological and lesion evolution characteristics of *Monk Fruit* are fully represented while compressing the data. The projection scores on the three principal component projection axes are calculated respectively, and these three projection scores are determined as 3D coordinate values in the low-dimensional discriminant space, generating coordinate mapping points.
[0079] This scheme effectively extracts the deep nonlinear correlation between morphology and lesion features through kernel mapping operations, thereby improving the accuracy of grade determination for complex samples.
[0080] The process of calculating the geometric membership of coordinate mapping points relative to the energy level threshold space is as follows: The preset energy level threshold space consists of mutually isolated closed geometric clusters within the low-dimensional discriminant space. The closed geometric clusters are obtained by performing feature space projection on 2000 sets of historical Luo Han Guo samples and statistically analyzing their coordinate distribution features; the 2000 sets of historical Luo Han Guo samples include 600 sets of top-level samples, 800 sets of first-level samples, and 600 sets of second-level samples that have been manually calibrated.
[0081] The threshold acquisition process corresponding to the energy level threshold space is as follows: Calculate the coordinates of 2000 historical samples of Luo Han Guo in the low-dimensional discriminant space, and extract the cluster centers of the residual energy level sample coordinates of the same trait. Statistically analyze the Euclidean distance distribution of the residual energy level sample coordinates of the same trait relative to the cluster centers, and use the probability density to determine the confidence interval radius corresponding to each trait residual energy level. The threshold for the premium grade energy level region is 0.15, determined by extracting the maximum distribution radius of 600 premium grade sample coordinates at a 95% confidence level. The threshold range for the first-grade energy level region is 0.15 to 0.35, determined based on the distance envelope range of 800 first-grade sample coordinates deviating from the premium grade cluster center. The process of calculating the geometric membership of the coordinate mapping point relative to the energy level threshold space is as follows: Perform Euclidean distance calculations between the coordinate mapping point and the premium grade and first-grade cluster centers respectively. If the Euclidean distance between the coordinate mapping point and the premium grade cluster center is less than or equal to 0.15, the coordinate mapping point is determined to fall into the premium grade energy level region. In scenarios where commercial standards for monk fruit or the sampling frequency of image sensors change, adaptive dynamic correction of the threshold is achieved by recalculating the center migration vector of 2000 sets of historical monk fruit samples. If the coordinate mapping point falls within the coordinate range corresponding to the premium grade energy level region, the output monk fruit trait residual energy level evaluation grade is premium grade; otherwise, the output is qualified or second-grade. (Refer to...) Figure 3 This is a flowchart illustrating the logic of feature extraction and energy level determination of residual energy levels in an embodiment of the present invention.
[0082] This invention achieves nonlinear discrimination of residual energy level parameters of multidimensional traits of monk fruit by substantially combining feature fusion and energy level mapping. It effectively solves the problem of evaluation bias in traditional single-parameter evaluation and ensures that the evaluation level has a high degree of objectivity.
[0083] This invention achieves image noise suppression and feature equalization through spatial-frequency domain feature component decoupling. Furthermore, by utilizing the synergistic evolution of multi-scale semantic mapping and edge tensor calibration, it solves the boundary diffusion problem caused by surface burrs on monk fruit, generating a high-precision semantic deconstruction set of fruit lesions. Combining geometric moment topological mapping and lesion spatial gravitational field analysis, this scheme achieves deep coupling between fruit geometric attributes and disease clustering features, establishing a precise mapping from pixel semantic features to physical trait residual energy levels through nonlinear dimensionality reduction logic. The substantial coordination of end-to-end technologies significantly improves the quantitative sensing accuracy of irregular targets in complex environments, ensuring consistency in evaluation results and determinism in feature space mapping.
[0084] Example 2 This embodiment provides a specific application scenario for a Luo Han Guo (monk fruit) quantitative evaluation method based on image segmentation. Specifically, it involves performing fine-grained classification mapping of residual energy levels of Luo Han Guo during high-speed conveyor belt transport in an environment with uneven distribution of natural light. In this scenario, the image information of Luo Han Guo is severely affected by ambient light interference, and the surface texture and edge boundaries exhibit dynamic diffusion characteristics under high-speed motion. Therefore, high-precision quantitative characterization requires substantial coordination of the entire data stream. The specific execution process is as follows: Image information of monk fruit (Luo Han Guo) collected by an industrial vision sensor under natural light conditions is acquired. Due to the significant spatial inconsistency of natural light sources, the image information of monk fruit contains local overexposed areas and deep shadow areas caused by differences in illumination. Surface texture spectral deconstruction preprocessing is performed, and a spatial-frequency feature component decoupling algorithm is applied to map the image information of monk fruit to the analytical space. In this process, an orthogonal basis projection operation is performed using a discrete pixel matrix as input. The pixel correlation component, which represents local spatial correlation, and the spectral energy component, which represents the global illumination distribution, are separated. For the pixel correlation component, a neighborhood convolution smoothing operation is performed. Specifically, a 3×3 pixel window is used as the convolution kernel, starting from the first and second coordinates of the first row of the coefficient matrix of the pixel correlation component, and sliding bit by bit along the row direction with a single pixel displacement unit until all pixel coordinates are traversed. During the sliding process, the values of 9 adjacent pixels within the coverage area of the convolution kernel are extracted. The sum of the product of the 9 adjacent pixel values and the preset weight factor is calculated to obtain the weighted average value. The weighted average value is then assigned to the pixel corresponding to the center position of the convolution kernel to achieve smooth elimination of discrete noise outliers in the coefficient matrix.
[0085] For the spectral energy components, mapping gain processing is performed. The mean value of each coefficient in the spectral energy component is calculated and compared with a preset 0.5 normalized brightness median. If the mean value is lower than the normalized brightness median, all coefficient values in the spectral energy component are multiplied by a linear gain coefficient, which is preset to 1.35 based on the average reflectivity of the monk fruit peel, thus achieving dynamic balance of overall image brightness. After processing, the smoothed high-frequency detail coefficient matrix and the gain-processed low-frequency trend coefficient matrix are inversely projected using the discrete wavelet inverse transform operator. Convolution is then performed through the reconstruction filter kernel to remap the frequency domain feature energy to the spatial domain pixel coordinate axis, generating decoupled light and shadow features. The decoupled light and shadow features are represented by a feature intensity matrix where the intensity values of each pixel coordinate point are normalized to the [0,1] interval, eliminating the occlusion effect of light and shadow interference on the target contour.
[0086] Subsequently, the decoupled light and shadow features are input into the stacked feature mapping process. The stacked feature mapping process is as follows: a convolution operator with a stride of 2 is used to perform cyclic convolution and nonlinear activation processing on the decoupled light and shadow features. During this process, a downsampling link consisting of three consecutively connected convolution operation sequences is constructed. At the end of each cyclic convolution operation cycle, the feature mapping matrix corresponding to the current spatial resolution is extracted and temporarily stored, thereby extracting cross-level deep semantic information at different spatial resolutions. The structure of the cross-level deep semantic information is represented by a hierarchical architecture, including a bottom-level spatial geometric detail tensor in the 1 / 2 scale space, used to store the edge gradient features of the Luo Han Guo target; and a top-level class attribute tensor in the 1 / 8 scale space, used to store the global class determination weights of the Luo Han Guo target.
[0087] Based on deep semantic information across multiple levels, a semantic probability distribution map is calculated. Specifically, bilinear interpolation is used to restore the resolution of the top-level category attribute tensor, ensuring that the top-level category attribute tensor and the bottom-level spatial geometric detail tensor maintain consistent dimensions in the height, width, and feature channel dimensions of the pixel plane. The restored tensors are then fused element-wise to generate a fused feature field. A normalized exponential activation function is used to perform numerical transformation operations on each coordinate point within the fused feature field, locking the feature intensity values of the coordinate points within the zero-to-one range, thus generating the semantic probability distribution map. Each element in the semantic probability distribution map represents the confidence probability, characterizing the certainty that the corresponding pixel location belongs to the Luo Han Guo (monk fruit) target category.
[0088] For the semantic probability distribution map, edge tensor correction is performed. First, the pixel gradient tensor of the edge region of the semantic probability distribution map is calculated. The structure of the edge region pixel gradient tensor is a 2×2 matrix containing the squared terms of the horizontal gradient partial derivatives, the squared terms of the vertical gradient partial derivatives, and the product terms of the horizontal and vertical partial derivatives. The process of performing directional calibration logic is as follows: The principal eigenvector is extracted by performing eigenvalue decomposition on the 2×2 matrix. The centroid pixel coordinates of the Luo Han Guo semantic probability distribution map are obtained, and a radial reference vector is established pointing from the centroid pixel coordinates to the coordinates of the edge pixels to be calibrated. The direction of the principal eigenvector is multiplied by the direction of the radial reference vector to obtain the cosine similarity value. If the cosine similarity value is lower than the preset deviation threshold of 0.6, the pixel is determined to have a logical deviation. Weight decay processing is then performed to constrain the boundary of the Luo Han Guo target pixel, and the corrected semantic probability distribution map is output.
[0089] A pixel density feature space is constructed using the corrected semantic probability distribution map. The structure of the pixel density feature space is a non-uniform probability field distribution model with pixel spatial coordinates as the base and confidence probability as the perpendicular axis. A non-linear mapping activation judgment logic is performed on the pixel density feature space. First, a preset classification mapping table is established, containing logical indices for environmental background attributes, Luo Han Guo fruit body attributes, and fruit surface lesion attributes. For each pixel coordinate point, the maximum value index discrimination function is called to perform numerical comparison on the multi-dimensional confidence probability vector composed of background components, fruit body components, and lesion components. If the fruit body component value is at the maximum position and exceeds 0.6, the preset semantic label corresponding to that pixel coordinate is identified as the target label. Subsequently, a pixel space consistency constraint algorithm is called to retrieve the eight-neighbor pixel states of the pixel coordinate to be processed, eliminating isolated recognition noise. All pixel coordinates after recognition are counted, and pixel clustering is performed according to the preset semantic labels to generate a semantic deconstruction set of fruit body lesions containing Luo Han Guo target mask, lesion feature mask, and environmental background mask.
[0090] For the semantic deconstruction set of fruit lesions, a geometric moment fractal topological metric is performed to obtain a geometric morphology vector. The target mask pixel set of the monk fruit is extracted, the total number of pixels is counted, and the projected area score is calculated using the actual area mapping coefficient per unit pixel. Using a contour topological mapping algorithm, the edge closure curves of the target mask pixel set are determined through Moore's neighborhood tracking logic. The Euclidean distance distribution from each pixel on the edge closure curve to the centroid pixel is calculated, the numerical average of the geometric distance set is calculated, and multiplied by 2 to determine the target diameter of the monk fruit. The ratio coefficient between the projected area score and the square of the perimeter of the edge closure curve is calculated to determine the roundness. The target diameter, roundness, and projected area score of the monk fruit are vectorized to generate a geometric morphology vector of a three-dimensional numerical sequence structure.
[0091] Simultaneously calculate the lesion distribution density and surface texture loss weights. Extract the pixel set of the lesion region corresponding to the lesion feature mask, and establish an inverse proportional model based on the geometric spacing of each pixel in the lesion region pixel set. Perform spatial gravitational field analysis on the lesion region pixel set using the inverse proportional model of the square of the geometric spacing, and accumulate the scalar value of the gravitational interaction force generated by each pixel in the unit pixel space to characterize the degree of lesion aggregation and determine the lesion distribution density. Fit the lesion distribution density and the area ratio occupied by the lesion region in the target mask with weights, map it to the [0,1] numerical space, and output the surface texture loss weights.
[0092] Finally, the manifold evolution mapping of trait residual energy levels is performed. A cascaded recombination operation is performed on the geometric morphology vector, lesion distribution density, and surface texture loss weights to generate a high-dimensional trait residual energy level feature matrix for Luo Han Guo. A nonlinear dimensionality reduction projection is performed on the high-dimensional trait residual energy level feature matrix of Luo Han Guo using a pre-defined trait residual energy level discriminant, mapping the high-dimensional description vector to a low-dimensional discriminant space. The geometric membership of the coordinate mapping points generated by the dimensionality reduction to the energy level threshold space composed of the energy level regions of premium, first-grade, and second-grade products is calculated. If the coordinate mapping point falls within the coordinate range corresponding to the first-grade energy level region, the Luo Han Guo trait residual energy level evaluation level is output as first-grade.
[0093] This embodiment achieves pixel-level resolution of monk fruit targets under fluctuating natural light conditions through a substantial combination of spatial-frequency domain feature decoupling, multi-scale semantic extraction, and edge tensor directional calibration. This scheme solves the problem of boundary recognition obfuscation caused by surface burrs and overlapping light and shadow on irregular targets, and establishes a logical mapping link from pixel semantic features to physical residual energy levels, ensuring the consistency of monk fruit grading results and the determinism of feature space mapping on automated production lines.
[0094] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A quantitative evaluation method for monk fruit based on image segmentation, characterized in that, include: The texture features of the irregular edges of the monk fruit and the diffuse reflection of the surface are obtained as data image information. The spatial-frequency domain feature component decoupling algorithm is used to perform image noise suppression and feature equalization on the data image information to generate decoupled light and shadow features. Based on the decoupled light and shadow features, deep semantic information across different spatial resolutions is extracted to obtain a semantic probability distribution map covering the global outline and local pixel association of Luo Han Guo, and edge tensor correction is performed; pixel-level category determination is performed on the corrected semantic probability distribution map to generate a semantic deconstruction set of fruit lesions; Pixel counting and contour topological mapping are performed on the semantic deconstruction set of fruit lesions to calculate the target fruit diameter, roundness and projected area scores of Luo Han Guo and obtain the geometric shape vector; the set of pixels marked as lesion regions in the semantic deconstruction set of fruit lesions is obtained, and spatial gravitational field analysis is performed to calculate the lesion distribution density and surface texture loss weight. The geometric morphology vector, lesion distribution density, and surface texture loss weights are substituted into the preset trait residual energy level discriminant formula to perform multi-parameter nonlinear dimensionality reduction, and the residual energy level evaluation level of Luo Han Guo is output.
2. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of generating decoupled light and shadow features includes: acquiring the overall picture of the monk fruit and the texture features of the diffuse reflection of the surface of the irregular edges of the monk fruit in the automated sorting station as data image information; using the spatial-frequency domain feature component decoupling algorithm to perform basis function projection mapping on the monk fruit data image information to construct a feature decoupling mapping space; separating the monk fruit data image information into pixel correlation components that represent local spatial correlation and spectral energy components that represent global illuminance distribution through orthogonal basis decomposition; performing neighborhood convolution smoothing operation on the pixel correlation components to suppress random noise interference and performing mapping gain processing on the spectral energy components to achieve feature distribution balance; and performing joint feature space reconstruction on the processed pixel correlation components and spectral energy components to generate decoupled light and shadow features.
3. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of generating a semantic probability distribution map and correcting the edge tensors includes: performing layered feature mapping based on decoupled light and shadow features to extract cross-level deep semantic information at different spatial resolutions; calculating a semantic probability distribution map covering the global contour of the monk fruit and the association of local pixels using the deep semantic information; calculating the pixel gradient tensor of the edge region of the semantic probability distribution map; constraining the boundary of the target pixel of the monk fruit using the directional calibration logic of the pixel gradient tensor; and outputting the corrected semantic probability distribution map.
4. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of generating the semantic deconstruction set of fruit lesions includes: constructing a pixel density feature space using the corrected semantic probability distribution map; performing nonlinear mapping activation judgment logic on the pixel density feature space to identify the preset semantic label corresponding to each pixel coordinate; and calling the pixel space consistency constraint algorithm to aggregate pixels with the same preset semantic label to generate a semantic deconstruction set of fruit lesions containing the target mask of monk fruit, the lesion feature mask, and the environmental background mask.
5. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of obtaining the geometric morphology vector includes: extracting the target mask pixel set corresponding to the semantic deconstruction set of fruit lesions, counting the total number of pixels and calculating the projected area score using pixel space conversion logic; using the contour topology mapping algorithm to determine the edge closed curve of the target mask pixel set, calculating the Euclidean distance distribution from each pixel of the edge closed curve to the centroid pixel, and determining the target fruit diameter of the monk fruit; calculating the ratio coefficient between the projected area score of the monk fruit and the square of the perimeter of the edge closed curve to determine the roundness; and vectorizing the target fruit diameter, roundness, and projected area score of the monk fruit to obtain the geometric morphology vector.
6. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of calculating the lesion distribution density and surface texture loss weights includes: extracting the semantic deconstruction set of fruit lesions and labeling it as a lesion region pixel set; establishing an inverse proportional model based on the geometric spacing of each pixel in the lesion region pixel set; performing spatial gravitational field analysis on the lesion region pixel set using the inverse proportional model, accumulating the scalar value of the gravitational interaction force generated by each pixel in the lesion region pixel set in unit pixel space, and determining the lesion distribution density; and performing weighted fitting between the lesion distribution density and the area ratio occupied by the lesion region pixel set in the target mask pixel set, and outputting the surface texture loss weights.
7. The method for quantitative evaluation of monk fruit based on image segmentation according to claim 1, characterized in that, The process of outputting the residual energy level evaluation grade of Luo Han Guo (monk fruit) includes: performing a cascade recombination operation on the geometric morphology vector, lesion distribution density, and surface texture loss weight to generate a comprehensive residual energy level index of Luo Han Guo; performing nonlinear dimensionality reduction projection on the comprehensive residual energy level index of Luo Han Guo using a preset trait residual energy level discriminant to obtain the corresponding coordinate mapping points in the low-dimensional discriminant space; and outputting the residual energy level evaluation grade of Luo Han Guo by calculating the geometric membership relationship of the coordinate mapping points relative to the energy level threshold space.
