A method for on-line evaluation of uniformity of mixing of a pesticide preparation
Patent Information
- Application Number
- CN202610708303.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]为了解决现有技术中图像分割特征维度单一、模糊边界归属不准、均匀度指标表征不足、评估结果稳定性差,难以实时无损评估农药制剂整体混合状态的问题,本发明提出一种农药制剂混合均匀度在线评估方法及系统
[0006]This invention employs a joint distance metric that integrates color, Gabor texture, and spatial information for superpixel segmentation, enabling the detection of local details in sample images and improving initial segmentation accuracy. During the clustering stage, blurred superpixels are identified using the Euclidean distance ratio in the feature space, and a redistribution is performed by calculating the total affinity based on color difference and spatial location, reducing the impact of blurred cluster boundaries and misclassification on the evaluation results. By selecting the main channel with the largest variance to extract weighted moment features and performing dimensionless processing to construct moment vectors, core variation information is highlighted and redundant interference is reduced. A global dispersion index is constructed by calculating the mean Euclidean distance between the centroids of the moment vector point set, enabling the evaluation of pesticide formulation mixing uniformity and improving the scientific rigor and efficiency of formulation quality testing.
Smart Images

Figure CN122597928A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing, and in particular relates to an online method for evaluating the uniformity of pesticide formulation mixing. Background Technology
[0002] Current methods for assessing the uniformity of pesticide formulation mixing primarily rely on visual inspection or chemical sampling. Visual inspection is subjective, inefficient, and easily influenced by the observer's experience. While chemical detection methods such as high-performance liquid chromatography (HPLC) and spectrophotometry offer high accuracy, they typically suffer from long testing cycles, high costs, complex procedures, and destructive nature. Furthermore, sampling only reflects the state of local samples, making it difficult to achieve real-time, non-destructive, and comprehensive monitoring of the overall mixing state of pesticide formulations on a production line. Image analysis-based non-destructive testing methods, by acquiring images of pesticide formulation surfaces and combining them with superpixel segmentation, color feature extraction, and texture feature extraction algorithms, can objectively characterize the mixing state. However, existing image analysis methods suffer from insufficient segmentation accuracy in areas such as particle aggregation, phase transitions, and local details. In superpixel clustering, a rigid partitioning strategy is typically employed, failing to identify fuzzy superpixels located at the boundaries of different phases or with unclear affiliations. Furthermore, a redistribution mechanism based on local affinity is lacking, easily leading to boundary misclassification and evaluation noise. Regarding the construction of uniformity evaluation metrics, traditional methods primarily focus on global color variance statistics, making it difficult to select the most discriminative dominant color channel for different local regions and to utilize higher-order statistical features to characterize the spatial distribution details within regions. Therefore, current technologies lack a complete evaluation system covering multi-dimensional feature joint segmentation, fuzzy region correction, and moment vector discreteness calculation, resulting in a need to improve the stability and overall characterization ability of pesticide formulation mixing uniformity evaluation results. Summary of the Invention
[0003] To address the problems of existing technologies, such as single-dimensional image segmentation features, inaccurate classification of fuzzy boundaries, insufficient uniformity index representation, and poor stability of evaluation results, making it difficult to evaluate the overall mixing state of pesticide formulations in real time without damage, this invention proposes an online evaluation method and system for pesticide formulation mixing uniformity.
[0004] In a first aspect, the present invention proposes an online evaluation method for the mixing uniformity of pesticide formulations, comprising: Images of pesticide formulation samples to be evaluated are acquired under preset imaging conditions; the images are converted to the target color space to extract color features and Gabor texture features; a multidimensional joint distance metric including color distance, Gabor texture distance and spatial distance is constructed, and a superpixel segmentation algorithm is performed using the multidimensional joint distance metric to obtain initial superpixels; A clustering algorithm is used to cluster all initial superpixels to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its first and second cluster centers, ambiguous superpixels with unclear affiliations are identified; the total affinity is calculated based on the color feature differences and spatial distances between the ambiguous superpixels and their adjacent clearly grouped superpixels, and the superpixel groups are reassigned. For each superpixel group, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zero-order moment and the weighted central moments of each order. After dimensionless processing, construct the moment vector. Calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, obtain the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
[0005] On the other hand, the present invention also proposes an online evaluation system for the mixing uniformity of pesticide formulations, comprising: The module is used to acquire images of pesticide formulation samples to be evaluated under preset imaging conditions; convert the images to the target color space to extract color features and Gabor texture features; construct a multi-dimensional joint distance metric including color distance, Gabor texture distance and spatial distance; and use the multi-dimensional joint distance metric to perform a superpixel segmentation algorithm to obtain initial superpixels. The allocation module is used to cluster all initial superpixels using a clustering algorithm to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its respective first cluster center and second cluster center, it identifies fuzzy superpixels with unclear affiliation; and by calculating the total affinity based on the color feature difference and spatial distance between the fuzzy superpixel and its adjacent clearly grouped superpixels, it reassigns the superpixel groups. The construction module is used to group each superpixel, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zero-order moment and the weighted central moments of each order. After dimensionless processing, the moment vector is constructed. The evaluation module is used to calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, calculate the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
[0006] This invention employs a joint distance metric that integrates color, Gabor texture, and spatial information for superpixel segmentation, enabling the detection of local details in sample images and improving initial segmentation accuracy. During the clustering stage, blurred superpixels are identified using the Euclidean distance ratio in the feature space, and a redistribution is performed by calculating the total affinity based on color difference and spatial location, reducing the impact of blurred cluster boundaries and misclassification on the evaluation results. By selecting the main channel with the largest variance to extract weighted moment features and performing dimensionless processing to construct moment vectors, core variation information is highlighted and redundant interference is reduced. A global dispersion index is constructed by calculating the mean Euclidean distance between the centroids of the moment vector point set, enabling the evaluation of pesticide formulation mixing uniformity and improving the scientific rigor and efficiency of formulation quality testing. Attached Figure Description
[0007] Figure 1 A flowchart of the first embodiment; Figure 2 This is a schematic diagram of the correlation analysis for uniformity assessment. Figure 3 This is a schematic diagram comparing the effects of ablation experiments. Detailed Implementation
[0008] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0009] In the first embodiment, the present invention proposes an online evaluation method for the mixing uniformity of pesticide formulations, such as... Figure 1 As shown, it includes: S1. Acquire images of pesticide formulation samples to be evaluated under preset imaging conditions; convert the images to the target color space to extract color features and Gabor texture features; construct a multidimensional joint distance metric including color distance, Gabor texture distance and spatial distance, and use the multidimensional joint distance metric to perform a superpixel segmentation algorithm to obtain initial superpixels.
[0010] An industrial camera was used in conjunction with the VideoCapture function to capture a top-view image of the pesticide mixture in a preset imaging chamber with constant light source and no shadows. The acquired BGR format image was converted to the CIELAB target color space, and the L luminance channel, a color channel, and b color channel were separated as color features.
[0011] Gabor filter kernels of different scales and orientations are generated to perform two-dimensional convolution filtering on the image. The mean and variance of the amplitude of each pixel under each filter response are calculated as Gabor texture features. A feature vector is set for each pixel. The Euclidean distance in CIELAB space between two points is calculated as the color distance. The Euclidean distance of the Gabor feature vectors is calculated as the texture distance. The Euclidean distance in the pixel coordinate plane is calculated as the spatial distance. After normalizing the color distance, texture distance and spatial distance respectively, the above three distances are multiplied by the corresponding preset weight coefficients and then summed to construct a multidimensional joint distance metric.
[0012] Based on this multidimensional joint distance metric, a custom distance metric version of the SLIC algorithm is used for superpixel segmentation. In the image, cluster centers are initialized according to a preset step size, and the position with the minimum gradient in the 3×3 neighborhood of the cluster center is found to fine-tune the cluster center. According to the multidimensional joint distance metric, each pixel is assigned to the nearest cluster center. The cluster centers are iteratively updated until the residual is less than the convergence threshold, and the initial superpixel set of the image is output.
[0013] In some implementations, converting the image to a target color space to extract color features and Gabor texture features includes: The image of the pesticide formulation sample to be evaluated was converted from the red-green-blue color space to the CIELAB color space, and the first lightness channel, the second chromaticity channel and the third chromaticity channel were separated. Select a set of Gabor filter banks containing preset scale and direction parameters; The images of the first luminance channel, the second chroma channel, and the third chroma channel are respectively convolved with the Gabor filter bank; The convolution calculation results of each channel are concatenated to form a multidimensional texture feature vector representing the image pixels.
[0014] An RGB color image sample of a pharmaceutical preparation with a resolution of 1920×1080 was read. Using a D65 standard light source, the image was first converted from the RGB model to the XYZ space and then to the CIELAB space. The first luminance channel L and the second and third chroma channels a and b were extracted. A set of preset multi-scale and multi-directional Gabor filter banks was initialized, with an optimal configuration of 5 frequency scales and 8 directions. The standard deviation of the Gaussian envelope was set to 1.5, generating a total of 40 two-dimensional filter matrices with different parameter combinations. For the separated L, a, and b color channels, matrix convolution filtering in two-dimensional space was performed using the above 40 filters. Each channel outputs 40 feature response maps, generating a total of 120 texture feature components. These 120 components were concatenated pixel-by-pixel with the original 3D color values to form a 123-dimensional multi-dimensional feature vector representing each pixel.
[0015] In some implementations, the construction includes a multi-dimensional joint distance metric comprising color distance, Gabor texture distance, and spatial distance, and a superpixel segmentation algorithm is performed using the multi-dimensional joint distance metric to obtain initial superpixels, including: Set the initial superpixel cluster center. For each pixel in the search neighborhood, calculate the joint distance between the pixel and the corresponding cluster center. The formula for calculating the joint distance is: the first preset weight coefficient multiplied by the normalized color distance, plus the second preset weight coefficient multiplied by the normalized Gabor texture distance, plus the third preset weight coefficient multiplied by the normalized spatial Euclidean distance. Each pixel is assigned to the cluster center with the smallest joint distance, and the cluster centers are iteratively updated until convergence, thus completing image segmentation and obtaining a series of initial superpixels.
[0016] Set the initial expected total number of superpixels K, such as K=1000, and denote the total number of pixels in the image as N. Then, according to... The grid sampling step size S is calculated, and the initial centroid is placed according to the grid pattern throughout the entire image area. The center point is adjusted by searching for small gradient positions within a 3×3 pixel neighborhood. The search neighborhood is set to a 2S×2S range. After normalizing the color distance, Gabor texture distance, and spatial Euclidean distance, the joint distance between the pixel and the candidate cluster center is calculated. Due to the large fluctuations in color gradient of the formulation system, the optimal range of parameters is determined through experimental calculation. The first preset weight coefficient is preferably 0.5, the second preset weight coefficient is preferably 0.3, and the third preset weight coefficient is preferably 0.2. A K-Means-like local search iterative operation is performed, calculating the joint distance between each pixel and each surrounding candidate cluster center within the local area, and establishing the cluster center based on the principle of minimizing the numerical value. After each round of allocation, the center point is updated by recalculating the mean based on the coordinates and features of the group members. This iterative process is repeated until the center point displacement is less than the convergence threshold of 0.5 pixels, or the maximum iteration limit of 10 is reached, outputting an initial superpixel set with continuous boundaries.
[0017] S2, use a clustering algorithm to cluster all initial superpixels to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its first and second cluster centers, identify fuzzy superpixels with unclear affiliations; calculate the total affinity based on the color feature differences and spatial distances between the fuzzy superpixels and their adjacent clearly grouped superpixels, and reassign them to obtain superpixel groups.
[0018] The average value of all pixels within each initial superpixel in terms of color and texture features is calculated as the representative feature vector of that superpixel. The KMeans algorithm is used, and the target number of groups is set. Unsupervised clustering is performed using the representative feature vector as input data to obtain the class label of each initial superpixel and the cluster center vector of each class to form the initial group. For each initial superpixel, the first Euclidean distance between its representative feature vector and the cluster center of its current class and the second Euclidean distance between its representative feature vector and the shortest cluster center of other classes are calculated. The distance ratio is obtained by dividing the first Euclidean distance by the second Euclidean distance. When the ratio is greater than the set fuzzy judgment threshold, the initial superpixel is determined to be at the inter-class boundary and is marked as a fuzzy superpixel with unclear classification.
[0019] Traverse each fuzzy superpixel, extract its spatially adjacent superpixel nodes, filter out the clearly grouped adjacent superpixels, calculate the color feature difference between the fuzzy superpixel and the above-mentioned clearly grouped adjacent superpixels and take the negative exponent as the color affinity component, calculate the spatial position difference of the centroid coordinates of the two and take the negative exponent as the spatial affinity component, fuse the color affinity component and the spatial affinity component according to the preset fusion rule, and preferably multiply them to obtain the total affinity, compare the total affinity of the fuzzy superpixel with all adjacent clearly grouped superpixels, and reassign the fuzzy superpixel to the group of the adjacent superpixel with the maximum total affinity. After processing all fuzzy superpixels, the superpixel grouping is obtained.
[0020] In some implementations, the step of identifying ambiguous superpixels by calculating the ratio of the feature space Euclidean distances from each initial superpixel to its respective first cluster center and second cluster center includes: Calculate the first Euclidean distance in feature space between the initial superpixel of the target and the center of its first cluster; Among the cluster centers of other initial groups, find the nearest second cluster center, and calculate the second Euclidean distance between the target initial superpixel and the second cluster center in the feature space; Calculate the Euclidean distance ratio between the first Euclidean distance and the second Euclidean distance; If the Euclidean distance ratio is greater than the preset judgment threshold, the target initial superpixel is determined to be located at the boundary of different initial groups and is marked as an ambiguous superpixel with unclear affiliation.
[0021] The arithmetic mean of the aforementioned multidimensional modal features of all pixels within the initial superpixel is extracted and used as the macroscopic feature point. The centroid of the current cluster to which the superpixel belongs is taken as the first cluster center. The first Euclidean distance D1 between the target feature point and the first cluster center in high-dimensional space is calculated, and this value represents the internal cluster compactness. A traversal search is initiated for the remaining non-subordinate clusters. By comparing the feature coordinates of the centroids of all competing clusters, the one with the smallest difference is found as the second cluster center, and the second Euclidean distance D2 between the target feature point and this external suboptimal matching centroid is calculated. The purity of the superpixel is represented by comparing the above two core distance indicators. The quotient of the distances is calculated, and the Euclidean distance ratio R after dividing D1 by D2 is obtained. Since this method is aimed at the diffusion boundary region of pesticide formulations, a threshold of 0.8 is preferably set. For example, when a target has D1 of 34 and D2 of 40, the calculated R value is 0.85. Since the value is greater than the threshold of 0.8, it indicates that it is floating in the transition zone between the current group and the outer group and the feature boundary is blurred. Therefore, it is marked as a blurred superpixel to be optimized and allocated.
[0022] In some implementations, the step of calculating the total affinity based on the color feature differences and spatial distances between the blurred superpixels and their adjacent clearly defined superpixel groups, and then reassigning the superpixel groups, includes: The total affinity between the blurred superpixel and each of its adjacent clearly grouped superpixels is calculated. The total affinity is obtained by multiplying the color affinity component and the spatial affinity component. The color affinity component is a function with the natural constant as the base and the product of the negative first preset attenuation constant and the square of the color feature difference as the exponent. The spatial affinity component is a function with the natural constant as the base and the product of the negative second preset attenuation constant and the square of the spatial distance as the exponent. The blurred superpixels are reassigned to the group containing the adjacent known superpixel with the highest total affinity value, thus completing the assignment replacement of the blurred boundary pixels and generating superpixel groups.
[0023] A bi-exponential decay affinity quantification model based on the natural logarithm base was constructed to improve the jagged and irregular segmentation at the transition interfaces between different components or phases of pesticide formulations in the initial segmentation. The average LAB color value and center XY coordinates of the labeled fuzzy superpixels and each adjacent well-defined group were extracted to measure the deviation. and The calculation involves setting the first preset attenuation constant for adjusting color sensitivity to 0.1 to handle small gradient changes in color density; and setting the second preset attenuation constant for balancing local connectivity distance penalties to 0.02. Therefore, the expansion formula for calculating total affinity is defined as... This converts the similarity into a normalized exponent value ranging from 0 to 1. When a blurred unit is matched with 4 to 6 known superpixels, an affinity feedback score is obtained for each one. If the affinity score for a certain adjacent group reaches the highest value of 0.82, which is much higher than the scores of other neighboring objects, its original group label is updated, and it is reassigned to the adjacent group with the highest score, resulting in a superpixel group with smoother boundaries and fewer outliers.
[0024] S3. For each superpixel group, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zeroth moment and the weighted central moments of each order. After dimensionless processing, construct the moment vector.
[0025] For each superpixel group, calculate the variance of the grayscale values of all pixels within that group in the CIELAB color space for the L, a, and b channels. Compare the variance values of the three channels, and designate the channel with the largest variance as the dominant channel for that group. Extract the intensity values of the pixels within that group in the dominant channel. Using a minimum-maximum normalization algorithm, map all pixel intensity values to the 0-1 range as the quality weight for each pixel. The dominant color channel is only used to determine the normalized intensity weights within that group.
[0026] In the pixel coordinate system, the weight values of each pixel within a group are summed to obtain the weighted zeroth moment. The sum of the horizontal and vertical coordinates multiplied by their respective weights is calculated, and then divided by the weighted zeroth moment to obtain the weighted centroid coordinates of that group. The deviation of each pixel coordinate from the weighted centroid coordinates in each direction is calculated, and the corresponding order is raised to the power of the centroid, multiplied by the pixel's weight, and summed to obtain the weighted central moments of each order. Each weighted central moment is then divided by a specific power of the weighted zeroth moment for dimensionless scaling, for example, according to... The normalized weighted central moments are obtained, resulting in a 7-dimensional moment feature formed by the combination of normalized weighted central moments of a preset order. Indicates the order is , The weighted central moments; This represents the weighted zeroth moment, which is the sum of the weights of all pixels within a superpixel group. These seven values are concatenated to construct a 7-dimensional moment vector representing the spatial distribution characteristics of the superpixel group.
[0027] In some implementations, for each superpixel group, the variance of the pixel in each color channel is calculated, the color channel with the largest variance is selected as the main channel, and the weighted zeroth moment and weighted central moments of each order are calculated using the normalized intensity value of each pixel in the main channel as weights. After dimensionless processing, a moment vector is constructed, including: Calculate the variance of all pixels in each color channel within the superpixel group, and select the color channel with the largest variance value as the main channel. Using the maximum-minimum normalization method, the pixel value of each pixel in the main channel within the superpixel group is subtracted from the minimum value within the superpixel group, and then divided by the difference between the maximum and minimum values within the superpixel group to obtain the normalized intensity value as the weight. Calculate the weighted zeroth moment, which is the sum of all weights; When calculating the weighted central moments of each order, the difference between the horizontal coordinate of each pixel and the weighted average of the horizontal coordinates is used as the horizontal offset, and the difference between the vertical coordinate of each pixel and the weighted average of the vertical coordinates is used as the vertical offset. The horizontal and vertical offsets are raised to the corresponding preset order and then multiplied, and then multiplied by the weight corresponding to the pixel. The calculation results of all pixels in the superpixel group are accumulated to obtain the weighted central moments of the corresponding order. The calculated weighted zeroth moment and weighted central moments of each order are dimensionless and combined to form a moment vector representing the spatial distribution pattern and internal density variation characteristics.
[0028] It iterates through and reads approximately 200 to 400 pixel sequences within each generated closed polygon, calculating their dispersion variance values in the brightness and two chromaticity dimensions. When a comparison reveals that, for example, channel b's variance is 110, exceeding the other two, channel b is designated as the master channel capable of representing the main fluctuation characteristics of the cluster's component distribution. Min-Max linear normalization is used to perform quality weighting of channel grayscale, mapping the brightness value at each coordinate position to a weight constant factor that continuously transitions from 0.00 to 1.00. Based on this set of weight fields, a weighted zero-order moment representing the comprehensive weight distribution of the local superpixel group is first accumulated. The sub-pixel level coordinates of the centroid are then calculated using the first-order moment. A spatial central moment polynomial based on specific order parameters is constructed for calculation. By calculating the p-th and q-th powers of the horizontal and vertical offsets from the center and combining them with weighted summation, the distribution tilt and shape diffusion characteristics are detected. The central moment data of all orders are divided by the zero-order moment of the corresponding power to perform scale dimensionless processing, generating a feature moment vector containing seven normalized moment feature dimensions, which represents the comprehensive attributes of the local region's morphological distribution and intensity weight distribution.
[0029] S4. Calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, calculate the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
[0030] Extract the 7-dimensional moment vectors corresponding to all superpixel groups in the entire image and combine them into a feature matrix, where rows represent different groups and columns represent moment feature dimensions. Calculate the average value along the column direction and obtain the arithmetic mean of all group moment vectors in each dimension. Use the average value to form a new 7-dimensional vector as the centroid vector of this high-dimensional point set.
[0031] The multidimensional Euclidean distance between the moment vector of each superpixel group and the centroid vector is calculated. The arithmetic mean of all calculated Euclidean distances is obtained to generate a single scalar value, namely the global dispersion index. According to the characteristics of pesticide formulations, the larger the value of the global dispersion index, the greater the difference in component distribution in each region, and the lower the corresponding macroscopic mixing uniformity. This negative correlation is used as the evaluation result for judging the mixing quality of the pesticide formulation to be evaluated.
[0032] In some implementations, the process of calculating the centroid vector of the point set formed by the moment vectors of all superpixel groups, obtaining the Euclidean distance from each moment vector to the centroid vector, and calculating the mean to obtain a global dispersion index as the evaluation result includes: The moment vectors of all superpixels are grouped to form a point set in the high-dimensional feature space, and the centroid vector of the point set is calculated. Calculate the Euclidean distance between the moment vector and the centroid vector of each superpixel group. The calculation method is to transpose the difference vector between the moment vector and the centroid vector, multiply it by the difference vector itself, and then take the square root of the multiplication result. The mean Euclidean distance is obtained by summing the Euclidean distances of all superpixel groups and dividing by the total number of groups. The mean Euclidean distance is then output as the global dispersion index to complete the evaluation of the mixing uniformity of pesticide formulations.
[0033] Extract all M superpixel groups from a mixed sample image of a formulation, and collect the multidimensional dimensionless moment vector carried by each group as a point source projected onto a high-dimensional topological structure space. Accumulate all superpixel vector values along each coordinate system dimension and perform an average operation to synthesize a high-dimensional feature centroid vector representing the average state of the moment features of each superpixel group in the current sample.
[0034] Extract the i-th group moment vector and subtract it from the calculated macroscopic centroid vector, outputting the difference vector in the direction of difference. Multiply the transpose of this difference vector by itself to obtain the sum of squares of the differences in each dimension. Then, take the square root of this sum of squares to obtain the Euclidean distance between two points in the high-dimensional space. .
[0035] The calculated M distance results are summed and then divided by M to offset the bias effect caused by the sample collection range and the total number of superpixels. The resulting mean Euclidean distance is used as a quantitative global dispersion output index. Since the more uniform the mixing and blending of the pesticide formulation system, the smaller the differences in color, texture, and spatial distribution characteristics of each local area, and the more concentrated the moment vector distribution, the lower the global dispersion is when the degree of mixing is high. Conversely, the global dispersion usually increases when stratification or agglomeration occurs, thus providing a quantitative evaluation basis for the uniformity of pesticide formulation mixing. Correlation analysis for uniformity assessment is as follows: Figure 2 As shown.
[0036] This ablation experiment used a self-constructed high-resolution image dataset of pesticide formulation mixtures, containing 1200 high-resolution sample images at different dissolution stages and mixing degrees. All images were preprocessed to a resolution of 1920×1080. The experiment was run on a computing workstation equipped with a high-end processor and a professional graphics accelerator card. Three sets of models were set up for comparison: the first set was a basic comparison model that removed Gabor texture feature extraction and did not include blurred superpixel boundary optimization; the second set was an ablation model that included a multidimensional joint distance metric but removed the affinity-based blurred superpixel redistribution mechanism; and the third set was the complete model of this application that included multidimensional feature fusion and affinity boundary redrawing.
[0037] Running the three models above under the same hardware environment and dataset, and statistically analyzing the core performance metrics, the results are as follows: Figure 3 As shown in the figures, the average edge overlap of the first set of basic models was 79.4%, the accuracy rate for assessing the homogeneity of the formulation mixture was 81.2%, and the absolute error of the global dispersion index was 0.15. The average edge overlap of the second set of ablation models improved to 87.5%, the accuracy rate for homogeneity assessment was 88.6%, and the absolute error of the global dispersion index decreased to 0.09. The average edge overlap of the third set of complete scheme models reached 96.3%, the accuracy rate for homogeneity assessment increased to 95.8%, and the absolute error of the global dispersion index decreased to 0.02.
[0038] By utilizing a multidimensional spatial metric incorporating Gabor texture joint distance, the texture and local structural changes on the surface of pesticide formulation samples can be detected, distinguishing formulation regions with similar colors but different dispersion states. Based on this, an affinity-based fuzzy superpixel reassignment mechanism improves the jagged segmentation and misclassification defects at the transition interfaces between different components or phases of pesticide formulations, generating clustering results with relatively smooth boundaries and fewer outliers. The underlying pixel partitioning improves the reliability of microscopic feature moment vector calculation, enabling the aggregated global dispersion value to better characterize the formulation mixing state.
[0039] In a second embodiment, the present invention also proposes an online evaluation system for the mixing uniformity of pesticide formulations, comprising: The module is used to acquire images of pesticide formulation samples to be evaluated under preset imaging conditions; convert the images to the target color space to extract color features and Gabor texture features; construct a multi-dimensional joint distance metric including color distance, Gabor texture distance and spatial distance; and use the multi-dimensional joint distance metric to perform a superpixel segmentation algorithm to obtain initial superpixels. The allocation module is used to cluster all initial superpixels using a clustering algorithm to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its respective first cluster center and second cluster center, it identifies fuzzy superpixels with unclear affiliation; and by calculating the total affinity based on the color feature difference and spatial distance between the fuzzy superpixel and its adjacent clearly grouped superpixels, it reassigns the superpixel groups. The construction module is used to group each superpixel, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zero-order moment and the weighted central moments of each order. After dimensionless processing, the moment vector is constructed. The evaluation module is used to calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, calculate the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
[0040] In some implementations, converting the image to a target color space to extract color features and Gabor texture features includes: The image of the pesticide formulation sample to be evaluated was converted from the red-green-blue color space to the CIELAB color space, and the first lightness channel, the second chromaticity channel and the third chromaticity channel were separated. Select a set of Gabor filter banks containing preset scale and direction parameters; The images of the first luminance channel, the second chroma channel, and the third chroma channel are respectively convolved with the Gabor filter bank; The convolution calculation results of each channel are concatenated to form a multidimensional texture feature vector representing the image pixels.
[0041] In some implementations, the construction includes a multi-dimensional joint distance metric comprising color distance, Gabor texture distance, and spatial distance, and a superpixel segmentation algorithm is performed using the multi-dimensional joint distance metric to obtain initial superpixels, including: Set the initial superpixel cluster center. For each pixel in the search neighborhood, calculate the joint distance between the pixel and the corresponding cluster center. The formula for calculating the joint distance is: the first preset weight coefficient multiplied by the normalized color distance, plus the second preset weight coefficient multiplied by the normalized Gabor texture distance, plus the third preset weight coefficient multiplied by the normalized spatial Euclidean distance. Each pixel is assigned to the cluster center with the smallest joint distance, and the cluster centers are iteratively updated until convergence, thus completing image segmentation and obtaining a series of initial superpixels.
[0042] In some implementations, the step of identifying ambiguous superpixels by calculating the ratio of the feature space Euclidean distances from each initial superpixel to its respective first cluster center and second cluster center includes: Calculate the first Euclidean distance in feature space between the initial superpixel of the target and the center of its first cluster; Among the cluster centers of other initial groups, find the nearest second cluster center, and calculate the second Euclidean distance between the target initial superpixel and the second cluster center in the feature space; Calculate the Euclidean distance ratio between the first Euclidean distance and the second Euclidean distance; If the Euclidean distance ratio is greater than the preset judgment threshold, the target initial superpixel is determined to be located at the boundary of different initial groups and is marked as an ambiguous superpixel with unclear affiliation.
[0043] In some implementations, the step of calculating the total affinity based on the color feature differences and spatial distances between the blurred superpixels and their adjacent clearly defined superpixel groups, and then reassigning the superpixel groups, includes: The total affinity between the blurred superpixel and each of its adjacent clearly grouped superpixels is calculated. The total affinity is obtained by multiplying the color affinity component and the spatial affinity component. The color affinity component is a function with the natural constant as the base and the product of the negative first preset attenuation constant and the square of the color feature difference as the exponent. The spatial affinity component is a function with the natural constant as the base and the product of the negative second preset attenuation constant and the square of the spatial distance as the exponent. The blurred superpixels are reassigned to the group containing the adjacent known superpixel with the highest total affinity value, thus completing the assignment replacement of the blurred boundary pixels and generating superpixel groups.
[0044] In some implementations, for each superpixel group, the variance of the pixel in each color channel is calculated, the color channel with the largest variance is selected as the main channel, and the weighted zeroth moment and weighted central moments of each order are calculated using the normalized intensity value of each pixel in the main channel as weights. After dimensionless processing, a moment vector is constructed, including: Calculate the variance of all pixels in each color channel within the superpixel group, and select the color channel with the largest variance value as the main channel. Using the maximum-minimum normalization method, the pixel value of each pixel in the main channel within the superpixel group is subtracted from the minimum value within the superpixel group, and then divided by the difference between the maximum and minimum values within the superpixel group to obtain the normalized intensity value as the weight. Calculate the weighted zeroth moment, which is the sum of all weights; When calculating the weighted central moments of each order, the difference between the horizontal coordinate of each pixel and the weighted average of the horizontal coordinates is used as the horizontal offset, and the difference between the vertical coordinate of each pixel and the weighted average of the vertical coordinates is used as the vertical offset. The horizontal and vertical offsets are raised to the corresponding preset order and then multiplied, and then multiplied by the weight corresponding to the pixel. The calculation results of all pixels in the superpixel group are accumulated to obtain the weighted central moments of the corresponding order. The calculated weighted zeroth moment and weighted central moments of each order are dimensionless and combined to form a moment vector representing the spatial distribution pattern and internal density variation characteristics.
[0045] In some implementations, the process of calculating the centroid vector of the point set formed by the moment vectors of all superpixel groups, obtaining the Euclidean distance from each moment vector to the centroid vector, and calculating the mean to obtain a global dispersion index as the evaluation result includes: The moment vectors of all superpixels are grouped to form a point set in the high-dimensional feature space, and the centroid vector of the point set is calculated. Calculate the Euclidean distance between the moment vector and the centroid vector of each superpixel group. The calculation method is to transpose the difference vector between the moment vector and the centroid vector, multiply it by the difference vector itself, and then take the square root of the multiplication result. The mean Euclidean distance is obtained by summing the Euclidean distances of all superpixel groups and dividing by the total number of groups. The mean Euclidean distance is then output as the global dispersion index to complete the evaluation of the mixing uniformity of pesticide formulations.
[0046] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0047] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for online evaluation of the mixing uniformity of pesticide formulations, characterized in that, Includes the following steps: Images of pesticide formulation samples to be evaluated are acquired under preset imaging conditions; the images are converted to a target color space to extract color features and Gabor texture features; A multidimensional joint distance metric is constructed, which includes color distance, Gabor texture distance and spatial distance. The multidimensional joint distance metric is then used to perform a superpixel segmentation algorithm to obtain the initial superpixels. A clustering algorithm is used to cluster all initial superpixels to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its first and second cluster centers, ambiguous superpixels with unclear affiliations are identified; the total affinity is calculated based on the color feature differences and spatial distances between the ambiguous superpixels and their adjacent clearly grouped superpixels, and the superpixel groups are reassigned. For each superpixel group, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zero-order moment and the weighted central moments of each order. After dimensionless processing, construct the moment vector. Calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, obtain the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
2. The method according to claim 1, characterized in that, The step of converting the image to a target color space to extract color features and Gabor texture features includes: The image of the pesticide formulation sample to be evaluated was converted from the red-green-blue color space to the CIELAB color space, and the first lightness channel, the second chromaticity channel and the third chromaticity channel were separated. Select a set of Gabor filter banks containing preset scale and direction parameters; The images of the first luminance channel, the second chroma channel, and the third chroma channel are respectively convolved with the Gabor filter bank; The convolution calculation results of each channel are concatenated to form a multidimensional texture feature vector representing the image pixels.
3. The method according to claim 1, characterized in that, The construction of a multi-dimensional joint distance metric includes color distance, Gabor texture distance, and spatial distance. A superpixel segmentation algorithm is then performed using this multi-dimensional joint distance metric to obtain initial superpixels, including: Set the initial superpixel cluster center. For each pixel in the search neighborhood, calculate the joint distance between the pixel and the corresponding cluster center. The formula for calculating the joint distance is: the first preset weight coefficient multiplied by the normalized color distance, plus the second preset weight coefficient multiplied by the normalized Gabor texture distance, plus the third preset weight coefficient multiplied by the normalized spatial Euclidean distance. Each pixel is assigned to the cluster center with the smallest joint distance, and the cluster centers are iteratively updated until convergence, thus completing image segmentation and obtaining a series of initial superpixels.
4. The method according to claim 2 or 3, characterized in that, The step of identifying ambiguous superpixels by calculating the ratio of the feature space Euclidean distances from each initial superpixel to its respective first cluster center and second cluster center includes: Calculate the first Euclidean distance in feature space between the initial superpixel of the target and the center of its first cluster; Among the cluster centers of other initial groups, find the nearest second cluster center, and calculate the second Euclidean distance between the target initial superpixel and the second cluster center in the feature space; Calculate the Euclidean distance ratio between the first Euclidean distance and the second Euclidean distance; If the Euclidean distance ratio is greater than the preset judgment threshold, the target initial superpixel is determined to be located at the boundary of different initial groups and is marked as an ambiguous superpixel with unclear affiliation.
5. The method according to claim 1, characterized in that, The process of calculating the total affinity based on the color feature differences and spatial distances between the blurred superpixels and their adjacent clearly defined superpixel groups, and then reassigning the superpixel groups, includes: The total affinity between the blurred superpixel and each of its adjacent clearly grouped superpixels is calculated. The total affinity is obtained by multiplying the color affinity component and the spatial affinity component. The color affinity component is a function with the natural constant as the base and the product of the negative first preset attenuation constant and the square of the color feature difference as the exponent. The spatial affinity component is a function with the natural constant as the base and the product of the negative second preset attenuation constant and the square of the spatial distance as the exponent. The blurred superpixels are reassigned to the group containing the adjacent known superpixel with the highest total affinity value, thus completing the assignment replacement of the blurred boundary pixels and generating superpixel groups.
6. The method according to claim 1, characterized in that, For each superpixel group, the variance of the pixel in each color channel is calculated, and the color channel with the largest variance is selected as the main channel. The weighted zeroth moment and weighted central moments of each order are calculated using the normalized intensity value of each pixel in the main channel as weights. After dimensionless processing, a moment vector is constructed, including: Calculate the variance of all pixels in each color channel within the superpixel group, and select the color channel with the largest variance value as the main channel. Using the maximum-minimum normalization method, the pixel value of each pixel in the main channel within the superpixel group is subtracted from the minimum value within the superpixel group, and then divided by the difference between the maximum and minimum values within the superpixel group to obtain the normalized intensity value as the weight. Calculate the weighted zeroth moment, which is the sum of all weights; When calculating the weighted central moments of each order, the difference between the horizontal coordinate of each pixel and the weighted average of the horizontal coordinates is used as the horizontal offset, and the difference between the vertical coordinate of each pixel and the weighted average of the vertical coordinates is used as the vertical offset. The horizontal and vertical offsets are raised to the corresponding preset order and then multiplied, and then multiplied by the weight corresponding to the pixel. The calculation results of all pixels in the superpixel group are accumulated to obtain the weighted central moments of the corresponding order. The calculated weighted zeroth moment and weighted central moments of each order are dimensionless and combined to form a moment vector representing the spatial distribution pattern and internal density variation characteristics.
7. The method according to claim 1, characterized in that, The process involves calculating the centroid vector of the point set formed by the moment vectors of all superpixel groups, obtaining the Euclidean distance from each moment vector to the centroid vector, and calculating the mean. This yields a global dispersion index as the evaluation result, including: The moment vectors of all superpixels are grouped to form a point set in the high-dimensional feature space, and the centroid vector of the point set is calculated. Calculate the Euclidean distance between the moment vector and the centroid vector of each superpixel group. The calculation method is to transpose the difference vector between the moment vector and the centroid vector, multiply it by the difference vector itself, and then take the square root of the multiplication result. The mean Euclidean distance is obtained by summing the Euclidean distances of all superpixel groups and dividing by the total number of groups. The mean Euclidean distance is then output as the global dispersion index to complete the evaluation of the mixing uniformity of pesticide formulations.
8. An online evaluation system for the mixing uniformity of pesticide formulations, characterized in that, include: The module is used to acquire images of pesticide formulation samples to be evaluated under preset imaging conditions; The image is converted to the target color space to extract color features and Gabor texture features; A multidimensional joint distance metric is constructed, which includes color distance, Gabor texture distance and spatial distance. The multidimensional joint distance metric is then used to perform a superpixel segmentation algorithm to obtain the initial superpixels. The allocation module is used to cluster all initial superpixels using a clustering algorithm to obtain initial groups; by calculating the ratio of the feature space Euclidean distance between each initial superpixel and its respective first cluster center and second cluster center, it identifies fuzzy superpixels with unclear affiliation; and by calculating the total affinity based on the color feature difference and spatial distance between the fuzzy superpixel and its adjacent clearly grouped superpixels, it reassigns the superpixel groups. The construction module is used to group each superpixel, calculate the variance of the pixel in each color channel, select the color channel with the largest variance as the main channel, and use the normalized intensity value of each pixel in the main channel as the weight to calculate the weighted zero-order moment and the weighted central moments of each order. After dimensionless processing, the moment vector is constructed. The evaluation module is used to calculate the centroid vector of the point set formed by the moment vectors of all superpixel groups, calculate the Euclidean distance from each moment vector to the centroid vector and calculate the mean, and obtain the global dispersion index as the evaluation result.
9. The system according to claim 8, characterized in that, The step of converting the image to a target color space to extract color features and Gabor texture features includes: The image of the pesticide formulation sample to be evaluated was converted from the red-green-blue color space to the CIELAB color space, and the first lightness channel, the second chromaticity channel and the third chromaticity channel were separated. Select a set of Gabor filter banks containing preset scale and direction parameters; The images of the first luminance channel, the second chroma channel, and the third chroma channel are respectively convolved with the Gabor filter bank; The convolution calculation results of each channel are concatenated to form a multidimensional texture feature vector representing the image pixels.
10. The system according to claim 8, characterized in that, The construction of a multi-dimensional joint distance metric includes color distance, Gabor texture distance, and spatial distance. A superpixel segmentation algorithm is then performed using this multi-dimensional joint distance metric to obtain initial superpixels, including: Set the initial superpixel cluster center. For each pixel in the search neighborhood, calculate the joint distance between the pixel and the corresponding cluster center. The formula for calculating the joint distance is: the first preset weight coefficient multiplied by the normalized color distance, plus the second preset weight coefficient multiplied by the normalized Gabor texture distance, plus the third preset weight coefficient multiplied by the normalized spatial Euclidean distance. Each pixel is assigned to the cluster center with the smallest joint distance, and the cluster centers are iteratively updated until convergence, thus completing image segmentation and obtaining a series of initial superpixels.