A leaf vegetable cleaning control method and system based on yellow leaf identification
By using multimodal image fusion and intelligent analysis to dynamically adjust cleaning parameters, the problems of manual dependence and rigid strategies in traditional leafy vegetable cleaning methods have been solved, achieving efficient and precise leafy vegetable cleaning control and improving yield and consistency.
Patent Information
- Application Number
- CN202611585757.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-14
- Publication Date
- 2026-11-10
AI Technical Summary
Traditional leafy vegetable cleaning methods rely on manual sorting, which is inefficient, costly, and susceptible to subjective interference. Furthermore, existing mechanical cleaning equipment cannot make differentiated adjustments based on the degree of deterioration of individual leafy vegetables, resulting in insufficient or excessive cleaning, which affects the yield and product consistency.
By acquiring visible light and near-infrared images of leafy vegetables, color, texture, and moisture distribution features are extracted to generate a mask for yellow leaf areas. The proportion of yellow leaves, spatial distribution density, and moisture anomaly index are calculated, and a triple analysis is performed to dynamically adjust the water pressure, spray duration, and water flow intensity of the spray cleaning machine.
It has achieved fully automated leafy vegetable cleaning control, improved the accuracy of yellow leaf identification and the targeting of cleaning strategies, avoided manual omissions and rigid cleaning strategies, and improved yield and product consistency.
Smart Images

Figure CN123072006A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of leafy vegetable cleaning technology, and in particular to a leafy vegetable cleaning control method and system based on yellow leaf recognition. Background Technology
[0002] In the post-harvest processing of leafy vegetables, cleaning is a key step in ensuring food safety and product quality. As consumers' requirements for the cleanliness, appearance integrity, and food safety of vegetables continue to increase, traditional extensive cleaning methods can no longer meet the high standards of the modern fresh food supply chain. Especially when leafy vegetables are covered with mud, insect eggs, or have physiological deterioration areas such as yellowing or rotting, if they cannot be accurately identified and treated in a targeted manner, it will not only affect the sensory quality of the product, but may also become a breeding ground for microorganisms, thereby threatening food safety.
[0003] Currently, traditional leafy vegetable cleaning methods mostly involve manual sorting combined with mechanical cleaning with fixed parameters. Operators visually inspect and remove obviously yellowed or rotten leaves, and then send the leafy vegetables into spray or drum cleaning equipment for uniform cleaning. However, this model has obvious limitations: on the one hand, manual sorting is inefficient, costly, and easily affected by subjective factors, resulting in a high rate of missed inspections and poor consistency; on the other hand, existing cleaning equipment generally uses preset, unchanging water pressure, spray time, and water flow intensity, which cannot be adjusted according to the actual degree of deterioration of individual leafy vegetables, easily leading to under-cleaning or over-cleaning, thereby reducing the yield and product consistency.
[0004] Therefore, there is an urgent need for a technical solution for a leafy vegetable cleaning control method and system based on yellow leaf recognition. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a leafy vegetable washing control method based on yellow leaf recognition, specifically including the following steps:
[0006] S1. Acquire visible light and near-infrared images of leafy vegetables during the transportation process;
[0007] S2. Extract color and texture features from the visible light image, extract moisture distribution features from the near-infrared image, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask.
[0008] S3. Calculate several yellow leaf indicators of the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on the several yellow leaf indicators; the several yellow leaf indicators include: yellow leaf percentage, yellow leaf spatial distribution density, and moisture anomaly index of the yellow leaf area;
[0009] S301. Count the number of all pixels marked as yellow leaves in the yellow leaf area mask, and count the total number of all leafy vegetables pixels in the yellow leaf area mask.
[0010] S302. Calculate the ratio of the number of all pixels marked as yellow leaves in the yellow leaf area mask to the total number of pixels of all leafy vegetables to obtain the current percentage of yellow leaves in the leafy vegetables.
[0011] S303. Divide the entire area covered by the yellow leaf area mask into several sub-regions of equal area, and count the number of yellow leaf pixels in each sub-region.
[0012] S304. Calculate the standard deviation of the number of yellow leaves in all sub-regions to obtain the spatial distribution density of yellow leaves in the current leafy vegetable.
[0013] S305. Locate the position of the yellow leaf area in the near-infrared image based on the yellow leaf area mask, and extract the moisture response intensity of the yellow leaf area at the current position. At the same time, locate the position of the non-yellow leaf area in the near-infrared image, and extract the moisture response intensity of the non-yellow leaf area at the current position.
[0014] S306. Calculate the difference between the average water response intensity of the yellow leaf area and the average water response intensity of the non-yellow leaf area to obtain the water anomaly index of the yellow leaf area of the current leafy vegetable.
[0015] S311. Confidence analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the water anomaly index of the yellow leaf area to obtain the confidence coefficient of each yellow leaf index.
[0016] S3111. Perform edge detection on the yellow leaf region mask to obtain the set of edge pixels of the yellow leaf region mask;
[0017] S3112. Based on the edge pixel set, calculate the average gradient magnitude of the edge pixels, and perform a closure analysis on the contour of the yellow leaf region mask to obtain the number of contour closure gaps.
[0018] S3113. Based on the average gradient magnitude of edge pixels and the number of contour closure gaps, the confidence coefficient of the proportion of yellow leaves is calculated.
[0019] S3114. Calculate the coordinates of the geometric center of each sub-region with equal area;
[0020] S3115. Based on the geometric center coordinates of each sub-region, calculate the radial distance of each geometric center relative to the center point of the leaf vegetable, and calculate the standard deviation of the radial distance;
[0021] S3116. Based on the number of sub-regions and the standard deviation of radial distance, the confidence coefficient of the spatial distribution density of yellow leaves is calculated.
[0022] S3117. Obtain the set of near-infrared reflectance intensity values of the yellow leaf region located in the near-infrared image based on the yellow leaf region mask;
[0023] S3118. Based on the set of near-infrared reflectance intensity values of the yellow leaf region, calculate the standard deviation of the near-infrared reflectance intensity.
[0024] S3119. Based on the standard deviation of near-infrared reflectance intensity, the confidence coefficient of the moisture anomaly index in the yellow leaf area is calculated.
[0025] S312. Numerical deviation analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area to obtain the anomaly coefficient of each yellow leaf index.
[0026] S3121. Obtain the preset normal reference mean and normal reference standard deviation of the proportion of yellow leaves;
[0027] S3122. Based on the current percentage of yellow leaves in leafy vegetables, the preset normal reference mean and normal reference standard deviation of the percentage of yellow leaves, calculate the standardized deviation of the percentage of yellow leaves, and determine the abnormality coefficient of the percentage of yellow leaves based on the standardized deviation of the percentage of yellow leaves.
[0028] S3123. Obtain the preset normal reference mean and normal reference standard deviation of the spatial distribution density of yellow leaves;
[0029] S3124. Based on the current spatial distribution density of yellow leaves of leafy vegetables, the preset normal reference mean and normal reference standard deviation of yellow leaf spatial distribution density, calculate the standardized deviation of yellow leaf spatial distribution density, and determine the abnormality coefficient of yellow leaf spatial distribution density according to the standardized deviation of yellow leaf spatial distribution density.
[0030] S3125. Obtain the normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area;
[0031] S3126. Based on the current moisture abnormality index of the yellow leaf area of the leafy vegetable, the preset normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area, calculate the standardized deviation of the moisture abnormality index of the yellow leaf area, and determine the abnormality coefficient of the moisture abnormality index of the yellow leaf area according to the standardized deviation of the moisture abnormality index of the yellow leaf area.
[0032] S313. Perform a fusion analysis on the confidence coefficient and the anomaly coefficient of each yellow leaf index to obtain the comprehensive anomaly coefficient of each yellow leaf index.
[0033] S3131. Add the confidence coefficient of the proportion of yellow leaves to the anomaly coefficient of the proportion of yellow leaves to obtain the fusion baseline value of the proportion of yellow leaves. Divide the anomaly coefficient of the proportion of yellow leaves by the fusion baseline value of the proportion of yellow leaves to obtain the anomaly weight of the proportion of yellow leaves. Multiply the anomaly weight of the proportion of yellow leaves by the anomaly coefficient of the proportion of yellow leaves. At the same time, multiply the remaining weight by the confidence coefficient of the proportion of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the proportion of yellow leaves.
[0034] S3132. Add the confidence coefficient of the spatial distribution density of yellow leaves to the anomaly coefficient of the spatial distribution density of yellow leaves to obtain the fusion benchmark value of the spatial distribution density of yellow leaves. Divide the anomaly coefficient of the spatial distribution density of yellow leaves by the fusion benchmark value of the spatial distribution density of yellow leaves to obtain the anomaly weight of the spatial distribution density of yellow leaves. Multiply the anomaly weight of the spatial distribution density of yellow leaves by the anomaly coefficient of the spatial distribution density of yellow leaves, and multiply the remaining weight by the confidence coefficient of the spatial distribution density of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the spatial distribution density of yellow leaves.
[0035] S3133. Add the confidence coefficient of the water anomaly index of the yellow leaf area to the anomaly coefficient of the water anomaly index to obtain the fusion baseline value of the water anomaly index. Divide the anomaly coefficient of the water anomaly index by the fusion baseline value of the water anomaly index to obtain the anomaly weight of the water anomaly index. Multiply the anomaly weight of the water anomaly index by the anomaly coefficient of the water anomaly index. At the same time, multiply the remaining weight by the confidence coefficient of the water anomaly index. The sum of the two is the comprehensive anomaly coefficient of the water anomaly index of the yellow leaf area.
[0036] S4. Based on the triple analysis results and combined with several yellow leaf indicators, dynamically adjust the cleaning parameters of the spray cleaning machine for leafy vegetables, and start the spray cleaning machine to clean the leafy vegetables according to the adjustment results; if the proportion of yellow leaves is greater than the first preset threshold, the anomaly coefficient is greater than the third preset threshold, the confidence coefficient is greater than or equal to the second preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, and / or, the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, increase the water pressure, spray duration and water flow intensity; if the spatial distribution density of yellow leaves is greater than the fifth preset threshold, the anomaly coefficient is greater than the third preset threshold and the confidence coefficient is greater than or equal to the second preset threshold, increase the water flow intensity and spray duration.
[0037] This embodiment also discloses a leafy vegetable cleaning control system based on yellow leaf recognition, including the following modules:
[0038] Image acquisition module: used to acquire visible light and near-infrared images of leafy vegetables during transportation;
[0039] Feature fusion module: connected to the image acquisition module, used to extract color and texture features from visible light images, extract moisture distribution features from near-infrared images, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask;
[0040] Indicator Analysis Module: Connected to the Feature Fusion Module, it is used to calculate several yellow leaf indicators of the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on several yellow leaf indicators;
[0041] Cleaning Module: Connected to the index analysis module, this module dynamically adjusts the cleaning parameters of the spray cleaner for leafy vegetables based on triple analysis results and several yellowing leaf indicators. It then starts the spray cleaner to clean the leafy vegetables according to the adjustment results. If the proportion of yellow leaves is greater than the first preset threshold, the anomaly coefficient is greater than the third preset threshold, the confidence coefficient is greater than or equal to the second preset threshold, and the overall anomaly coefficient is greater than the fourth preset threshold, and / or the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold, and the overall anomaly coefficient is greater than the fourth preset threshold, the water pressure, spray duration, and water flow intensity are increased. If the spatial distribution density of yellow leaves is greater than the fifth preset threshold, the anomaly coefficient is greater than the third preset threshold, and the confidence coefficient is greater than or equal to the second preset threshold, the water flow intensity and spray duration are increased.
[0042] The embodiments of the present invention have the following technical effects:
[0043] This invention proposes a fully automated leafy vegetable cleaning control method based on multimodal image fusion and intelligent analysis. Specifically, it simultaneously acquires visible light and near-infrared images of leafy vegetables during transportation, extracts color texture features and moisture distribution features respectively, and fuses them to generate a high-precision yellow leaf area mask. Based on this, it calculates three quantitative indicators: the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area. For each indicator, it performs confidence and numerical deviation analysis, and then obtains the comprehensive anomaly coefficient of each indicator by fusing the confidence coefficient and the anomaly coefficient. Finally, based on the three quantitative indicators and the results of the triple analysis, it dynamically adjusts the cleaning parameters of the spray cleaning machine, such as water pressure, spray duration, and water flow intensity, and automatically starts the cleaning operation. The entire process requires no manual intervention, achieving a fully closed-loop intelligent control from yellow leaf identification and deterioration assessment to cleaning response, effectively avoiding the problems of manual omissions and rigid cleaning strategies.
[0044] In summary, this invention integrates visible light and near-infrared image information to construct a mask for yellow leaf areas and quantify the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of yellow leaf areas. By combining confidence analysis and anomaly deviation analysis, a comprehensive anomaly coefficient is generated, thereby driving the spray-type washing machine to achieve dynamic adaptive adjustment of washing parameters. This method completely eliminates the reliance on manual sorting, significantly improves the accuracy of yellow leaf identification and the targeting of washing strategies, effectively avoids quality damage caused by over-washing while ensuring the cleanliness of leafy vegetables, and improves yield and product consistency. Attached Figure Description
[0045] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0046] Figure 1 This is a flowchart of a leafy vegetable cleaning control method based on yellow leaf recognition provided in an embodiment of the present invention;
[0047] Figure 2 This is a framework diagram of a leafy vegetable cleaning control system based on yellow leaf recognition provided in an embodiment of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0049] Example 1: As Figure 1 As shown, the present invention provides a leafy vegetable washing control method based on yellow leaf recognition, comprising the following steps:
[0050] S1. Acquire visible light and near-infrared images of leafy vegetables during the transportation process;
[0051] It is worth noting that the leafy vegetables to be washed are first placed on a food-grade conveyor belt running at a constant speed. Above the conveyor belt, two sets of optical imaging devices are installed sequentially or side by side along the running direction: one is a visible light camera, and the other is a near-infrared camera. The visible light camera uses a high-resolution color industrial camera equipped with a uniform white LED light source to capture the color, texture, and morphological characteristics of the leafy vegetable surface under simulated natural light conditions. The near-infrared camera operates in typical near-infrared bands, such as 850 nm or 940 nm, and is used with a near-infrared illumination source of the corresponding wavelength to detect the water distribution state inside the leafy vegetable tissue. Because yellowing is usually accompanied by cell structure damage and abnormal water content, it will show obvious differences in reflectivity in near-infrared images. The two cameras image the same area of leafy vegetables at the same time, thus ensuring that the acquired visible light image and near-infrared image are strictly aligned in space and time. At the same time, it is worth noting that the speed of the conveyor belt is adjustable and remains stable to ensure that the leafy vegetables are in a relatively static state during the imaging process, avoiding motion blur. The entire imaging process requires no manual intervention and can be operated continuously in normal temperature and conventional workshop environments, meeting the needs of industrial assembly line operations.
[0052] S2. Extract color and texture features from the visible light image, extract moisture distribution features from the near-infrared image, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask.
[0053] It is worth noting that, firstly, the acquired visible light images are preprocessed, including denoising, illumination correction, and color space conversion, such as from RGB to HSV or Lab color spaces, to more accurately separate color information. Then, color features are extracted from the corrected images, focusing on hue ranges such as yellow and yellowish-green that significantly differ from the normal green of leafy vegetables. Saturation and brightness thresholds are used to initially screen for suspected yellowing areas. Simultaneously, methods such as gray-level co-occurrence matrix, local binary mode, or Gabor filters are used to further refine the local color information in the visible light images. The texture of the leaf is quantitatively analyzed because yellowing or early rot areas usually show decreased surface roughness, blurred texture or loose structure. These changes can be effectively captured by texture features. Then, for the near-infrared image acquired in step S1, healthy leaf tissue has high water content and strong absorption of near-infrared light, resulting in low reflectivity. However, yellowing or deteriorated areas have increased near-infrared reflectivity due to cell dehydration or structural disintegration. Therefore, an adaptive segmentation algorithm is used to extract the abnormal water area, i.e., the water distribution feature. This feature represents the relative water content of each part of the leafy vegetable in the form of a pixel-level grayscale image.
[0054] After obtaining the color and texture feature maps and the moisture distribution feature map respectively, the specific operation stage of fusing and generating the yellow leaf area mask is entered. First, for the color feature map, the hue-saturation joint threshold method based on experience is used to convert it into a first binary map. Specifically, since normal fresh leafy vegetables are mainly concentrated in the high saturation green area in the Lab or HSV color space, while yellowed leaves will obviously be yellow or yellowish-brown and the saturation is usually reduced. For example, when the hue value of a pixel falls between 50 and 75 degrees (corresponding to the yellow-green to yellow range), and its saturation is higher than 30% but lower than the typical saturation upper limit of normal green leaves (e.g., 80%), then the pixel is determined to meet the yellowing color condition. All pixels that meet the above hue and saturation combination conditions are marked as white in the first binary map, i.e., foreground, representing the yellow leaf area, and all other pixels are marked as black, i.e., background, representing the non-yellow leaf area.
[0055] Next, to eliminate color misjudgments caused by interference such as uneven lighting, reflection, or stains, texture features are introduced for secondary verification. The texture feature map reflects the surface roughness and structural regularity of the local area where each pixel is located. Yellowed areas usually have blurred textures and reduced details. The texture response value of each white pixel position in the first binary image is compared with the texture response value of its corresponding position in the texture feature map. If the texture response at that position is less than the preset yellowing texture threshold, and this threshold is obtained by comparing the texture energy of healthy leaf and yellow leaf samples, then its white mark is retained. Otherwise, even if the color matches, it is regarded as a non-yellow leaf and is changed back to black. This process is implemented by pixel-by-pixel logical AND operation, and the result forms the second binary image.
[0056] Subsequently, the moisture distribution characteristics obtained from the near-infrared images were processed. Due to the destruction of cell structure and decrease in water content in yellowed or early rotten parts, the reflectivity of near-infrared light is significantly higher than that of healthy tissue. Therefore, the near-infrared reflectance intensity value of each pixel in the near-infrared image was calculated, and an upper limit threshold based on the average near-infrared reflectance of normal leafy vegetables plus two standard deviations was set. Any pixel whose reflectance intensity exceeds this threshold is judged as having abnormal moisture and is marked as white in the third binary image, while the rest are marked as black. It is worth noting that since the visible light and near-infrared images have been strictly aligned in S1, each pixel in the three binary images completely overlaps in physical space.
[0057] Finally, a pixel-by-pixel logical AND operation is performed between the second and third binary images. For example, only when the same spatial location is white in both images is it marked as white in the final output yellow leaf area mask; all other cases are marked as black. In this way, only areas that simultaneously meet the three conditions of yellowing color, deterioration texture, and abnormal moisture status are identified as true yellow leaf areas; all other conditions are non-yellow leaf areas. Since this mask preserves the natural morphological features in the original detection results, it truly presents the actual distribution of yellow leaf areas on the leaf surface, providing an unmodified raw mask data foundation for subsequent analysis.
[0058] S3. Calculate several yellow leaf indicators of the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on the several yellow leaf indicators; the several yellow leaf indicators include: yellow leaf percentage, yellow leaf spatial distribution density, and moisture anomaly index of the yellow leaf area;
[0059] S301. Count the number of all pixels marked as yellow leaves in the yellow leaf area mask, and count the total number of all leafy vegetables pixels in the yellow leaf area mask.
[0060] S302. Calculate the ratio of the number of all pixels marked as yellow leaves in the yellow leaf area mask to the total number of pixels of all leafy vegetables to obtain the current percentage of yellow leaves in the leafy vegetables.
[0061] S303. Divide the entire area covered by the yellow leaf area mask into several sub-regions of equal area, and count the number of yellow leaf pixels in each sub-region.
[0062] S304. Calculate the standard deviation of the number of yellow leaves in all sub-regions to obtain the spatial distribution density of yellow leaves in the current leafy vegetable.
[0063] S305. Locate the position of the yellow leaf area in the near-infrared image based on the yellow leaf area mask, and extract the moisture response intensity of the yellow leaf area at the current position. At the same time, locate the position of the non-yellow leaf area in the near-infrared image, and extract the moisture response intensity of the non-yellow leaf area at the current position.
[0064] S306. Calculate the difference between the average water response intensity of the yellow leaf area and the average water response intensity of the non-yellow leaf area to obtain the water anomaly index of the yellow leaf area of the current leafy vegetable.
[0065] It is worth noting that, in the process of extracting the water response intensity of the yellow leaf area, the yellow leaf area mask generated in S2 is first aligned pixel by pixel with the original near-infrared image. Since the two have been strictly registered in S1, each white pixel position in the mask is traversed, and the pixel value with the same coordinates is found in the original near-infrared image. This pixel value is the reflection response intensity of the near-infrared light at that point, which directly reflects the water status of the local tissue. That is, the stronger the reflection, the lower the water content. Then, the near-infrared pixel values of all such corresponding positions are read one by one and collected to form a numerical set. This set completely represents the water response level of all yellow leaf areas on the current leafy vegetable. Similarly, all black pixel positions in the mask, i.e., non-yellow leaf areas, are also traversed, and the pixel values of the corresponding positions are extracted in the original near-infrared image to form another numerical set, representing the water response level of healthy or non-yellowed areas. Each value in these two sets comes from the original near-infrared image without any transformation, preserving the true physical response information.
[0066] After obtaining the sets of moisture response values for the yellow leaf area and the non-yellow leaf area respectively, the arithmetic mean of all values in the two sets is calculated, and the difference between the two is obtained. The result is the moisture abnormality index of the yellow leaf area. The larger the index is, the more significant the dehydration of the yellow leaf area is compared with the normal area.
[0067] It is worth further explaining that the reason why the three indicators of yellow leaf percentage, yellow leaf spatial distribution density, and yellow leaf area moisture anomaly index were chosen as the core yellow leaf indicators of this invention is based on a deep understanding of the yellowing phenomenon of leafy vegetables. They cannot be replaced by other common indicators, such as the absolute value of yellow leaf area, edge length, and average color value. The reasons are as follows:
[0068] First, the percentage of yellow leaves directly reflects the overall severity of yellowing and is the basis for judging the loss of commodity value. However, the percentage alone is not enough to distinguish between uniform mild yellowing and localized severe yellowing. The latter often indicates a faster decay process, so a second indicator needs to be introduced.
[0069] Second, the spatial distribution density of yellow leaves is reflected by the standard deviation of the number of yellow leaves in sub-regions, which describes the concentrated or diffuse characteristics of yellowing on the leaf surface. If the yellow leaves are highly clustered, i.e., the standard deviation is large, it usually means that the local rapid deterioration is caused by disease or mechanical damage. If the yellow leaves are evenly distributed, i.e. the standard deviation is small, it is more likely to be due to overall aging or nutrient deficiency. This spatial pattern has key guiding significance for the formulation of subsequent grading decisions, while simple color or area indicators cannot provide such information.
[0070] Third, the abnormal water content index in the yellow leaf area verifies the intrinsic mechanism of yellowing from a physiological perspective. Yellowing of leafy vegetables is often accompanied by cell dehydration and membrane structure damage, leading to increased near-infrared reflectivity. By quantifying the difference in water response between yellow and non-yellow leaf areas, it can not only eliminate color misjudgment caused by light, stains, etc., because true yellowing must be accompanied by abnormal water content, but also reflect the degree of decline in the physiological activity of yellowed tissues. This index links the apparent visual characteristics with the internal physiological state, significantly improving the reliability and scientific nature of the judgment.
[0071] In summary, these three indicators construct a multi-scale, multi-physical quantity integrated yellowing assessment system from three dimensions: overall degree, spatial pattern, and physiological mechanism. Together, they support the present invention to achieve accurate, robust, and physiologically interpretable quantitative analysis of the yellowing state of leafy vegetables.
[0072] S311. Confidence analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the water anomaly index of the yellow leaf area to obtain the confidence coefficient of each yellow leaf index.
[0073] S3111. Perform edge detection on the yellow leaf region mask to obtain the set of edge pixels of the yellow leaf region mask;
[0074] It is worth noting that in this embodiment, the Canny edge detection algorithm is preferred for processing the mask of the yellow leaf area.
[0075] S3112. Based on the edge pixel set, calculate the average gradient magnitude of the edge pixels, and perform a closure analysis on the contour of the yellow leaf region mask to obtain the number of contour closure gaps.
[0076] It is worth noting that in this embodiment, the gradient magnitude map in the intermediate results of the Canny algorithm, i.e., the gradient intensity value of each pixel, is used to extract the gradient magnitude corresponding to all positions belonging to the edge pixel set, and the arithmetic mean of these values is calculated to obtain the average gradient magnitude of the edge pixels. This value reflects the overall clarity of the edge; the higher the value, the more distinct the contrast between the yellow and non-yellow leaf areas and the sharper the boundary. At the same time, the closure analysis of the contour structure formed by the edge pixel set is performed. Specifically, a contour tracking algorithm such as Moore's neighborhood is first used. The tracking method extracts all independent contour chains from the edge pixel set. For each contour chain, it checks whether the first and last pixels are spatially adjacent, i.e., the Euclidean distance is less than or equal to √2 pixel units. If they are adjacent, it is determined to be a closed contour. If they are not adjacent, it is considered to have a gap. Then, the number of all unclosed contours is counted, which is the number of contour closure gaps. For example, if the yellow leaf area presents multiple separated patches due to severe fragmentation, if each patch has an unclosed contour, such as a C-shape or U-shape, then each such patch is counted as a gap. This number directly reflects the degree of integrity loss of the boundary of the yellow leaf area.
[0077] S3113. Based on the average gradient magnitude of edge pixels and the number of contour closure gaps, the confidence coefficient of the proportion of yellow leaves is calculated.
[0078] It is worth noting that, firstly, the average gradient magnitude of the edge pixels is dimensionlessly processed. Specifically, this average value is divided by the set value of the high threshold parameter in the Canny edge detection algorithm. This parameter is a fixed constant, such as 150, to obtain a normalized edge sharpness index, whose value naturally falls between 0 and 1. Subsequently, the number of contour closure gaps is dimensionlessly processed, that is, the actual number of gaps is divided by the number of all independent connected regions in the yellow leaf region mask, i.e., the total number of yellow leaf patches. If the yellow leaf region is empty, the confidence level is directly set to 0. This ratio reflects the average number of gaps contained in each yellow leaf patch. Then, it is converted into an integrity index by taking the negative value and adding 1, that is, by subtracting the number of gaps from 1 and dividing by the number of connected regions. If the result is less than 0, it is truncated to 0. Finally, the contour integrity index between 0 and 1 is obtained. Finally, the above two dimensionless indices are multiplied together, and the product is the confidence coefficient of the yellow leaf ratio. Its value range is strictly limited to between 0 and 1. The higher the value, the more reliable the yellow leaf ratio.
[0079] S3114. Calculate the coordinates of the geometric center of each sub-region with equal area;
[0080] It is worth noting that for each sub-region, all pixels within it are traversed, regardless of whether they belong to yellow leaves. The arithmetic mean of the x and y coordinates of these pixels is then calculated, and the result is the geometric center coordinate of that sub-region.
[0081] S3115. Based on the geometric center coordinates of each sub-region, calculate the radial distance of each geometric center relative to the center point of the leaf vegetable, and calculate the standard deviation of the radial distance;
[0082] It is worth noting that, firstly, the center point of the entire leafy vegetable area is calculated. Specifically, the horizontal and vertical coordinates of the leafy vegetable mask, i.e., all pixels belonging to the leafy vegetable (not limited to all pixels in the yellow leaf), are averaged to obtain the geometric center coordinates of the entire leafy vegetable. Then, for the geometric center coordinates of each sub-region, the Euclidean distance between it and the center point of the leafy vegetable is calculated, which is the radial distance of the sub-region. This distance reflects the relative position of the sub-region on the leaf surface, i.e., the distance is smaller near the petiole and larger near the leaf edge.
[0083] S3116. Based on the number of sub-regions and the standard deviation of radial distance, the confidence coefficient of the spatial distribution density of yellow leaves is calculated.
[0084] It is worth noting that, firstly, the standard deviation of the radial distance between the geometric center of each sub-region and the center point of the leafy vegetable is calculated and denoted as the original standard deviation. To eliminate the influence of image scale, this standard deviation is dimensionless, specifically by dividing it by half the length of the diagonal of the circumscribed rectangle of the leafy vegetable region, which is the theoretical maximum distance from the center of the leafy vegetable to the farthest corner point. The resulting ratio is the normalized radial dispersion, with a value between 0 and 1. Next, considering the role of the number of sub-regions in ensuring statistical stability, the number of sub-regions is substituted into a preset monotonically increasing saturation function. Specifically, the smaller value between the number of sub-regions and 9 is taken and then divided by 9. That is, when the number of sub-regions is ≥9, the factor is 1; when it is less than 9, it is scaled proportionally, thus obtaining a sampling adequacy factor between 0 and 1. Finally, the normalized radial dispersion is multiplied by the sampling adequacy factor, and the resulting product is the confidence coefficient of the spatial distribution density of the yellow leaves, with a value also between 0 and 1. The larger the value, the more reliable the spatial distribution density assessment.
[0085] S3117. Obtain the set of near-infrared reflectance intensity values of the yellow leaf region located in the near-infrared image based on the yellow leaf region mask;
[0086] It is worth noting that the near-infrared reflectance intensity value is obtained by directly reading the grayscale value of each pixel in the original near-infrared image, which is usually an 8-bit or 12-bit integer. This value is output by the near-infrared camera sensor after photoelectric conversion based on the incident light intensity. Without any nonlinear transformation, it directly characterizes the reflectance ability of the physical location to near-infrared bands such as 850nm or 940nm light. The higher the value, the stronger the reflection and the lower the tissue water content.
[0087] S3118. Based on the set of near-infrared reflectance intensity values of the yellow leaf region, calculate the standard deviation of the near-infrared reflectance intensity.
[0088] It is worth noting that the standard deviation of all values in the set is calculated. This standard deviation reflects the uniformity of moisture status within the yellowing area. If the standard deviation is small, it indicates that the degree of dehydration in the yellowing area is uniform; if the standard deviation is large, it indicates that some areas have lost a lot of water while other areas still have some moisture, which may be at different stages of yellowing.
[0089] S3119. Based on the standard deviation of near-infrared reflectance intensity, the confidence coefficient of the moisture anomaly index in the yellow leaf area is calculated.
[0090] It is worth noting that, firstly, the standard deviation of the near-infrared reflectance intensity values in the yellow leaf area is calculated as the original dispersion. To achieve dimensionlessness, this standard deviation should be divided by the average value of the near-infrared reflectance intensity values in the yellow leaf area. It is worth noting that if the average value is 0, the confidence level is set to 0. Finally, the coefficient of variation is obtained, which is naturally dimensionless and reflects the degree of relative fluctuation. Since the more consistent the moisture anomaly, the smaller the coefficient of variation should be, 1 is subtracted from the coefficient of variation. If the result is less than 0, it is truncated to 0, thus obtaining a moisture response consistency index between 0 and 1. This index is the confidence coefficient of the moisture anomaly index in the yellow leaf area. The higher the value, the more uniform the moisture status in the yellow leaf area, and the more representative the moisture anomaly index is.
[0091] S312. Numerical deviation analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area to obtain the anomaly coefficient of each yellow leaf index.
[0092] S3121. Obtain the preset normal reference mean and normal reference standard deviation of the proportion of yellow leaves;
[0093] It is worth noting that the preset normal reference mean and standard deviation for the proportion of yellow leaves, the preset normal reference mean and standard deviation for the spatial distribution density of yellow leaves, and the preset normal reference mean and standard deviation for the moisture anomaly index of yellow leaf areas are all retrieved from a pre-established leafy vegetable quality database. It should be noted that this retrieval should be targeted at the current type of leafy vegetable. Furthermore, the pre-established leafy vegetable quality database mainly consists of historical sample statistics of leafy vegetables in a fresh and healthy state, containing a large number of normal leafy vegetable samples with values for the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of yellow leaf areas. When retrieving these values, the arithmetic mean and standard deviation are directly read as the normal reference mean and standard deviation for the current yellow leaf indicators.
[0094] S3122. Based on the current percentage of yellow leaves in leafy vegetables, the preset normal reference mean and normal reference standard deviation of the percentage of yellow leaves, calculate the standardized deviation of the percentage of yellow leaves, and determine the abnormality coefficient of the percentage of yellow leaves based on the standardized deviation of the percentage of yellow leaves.
[0095] It is worth noting that, firstly, the difference between the current percentage of yellow leaves in leafy vegetables and the normal reference mean percentage of yellow leaves is calculated. Then, this difference is divided by the normal reference standard deviation of the percentage of yellow leaves. The result is the standardized deviation of the percentage of yellow leaves. This operation achieves dimensionless measurement of the degree of deviation, making it unaffected by the original percentage scale. Subsequently, the absolute value of this standardized deviation is taken and substituted into a monotonically increasing saturated mapping function. Specifically, if the absolute value is less than or equal to 2, the anomaly coefficient is equal to the absolute value divided by 2; if the absolute value is greater than 2, the anomaly coefficient is fixed at 1. The resulting anomaly coefficient of the percentage of yellow leaves is strictly limited to the range of 0 to 1. The larger the value, the more significantly the current percentage of yellow leaves deviates from the normal level.
[0096] S3123. Obtain the preset normal reference mean and normal reference standard deviation of the spatial distribution density of yellow leaves;
[0097] S3124. Based on the current spatial distribution density of yellow leaves of leafy vegetables, the preset normal reference mean and normal reference standard deviation of yellow leaf spatial distribution density, calculate the standardized deviation of yellow leaf spatial distribution density, and determine the abnormality coefficient of yellow leaf spatial distribution density according to the standardized deviation of yellow leaf spatial distribution density.
[0098] It is worth noting that, similarly, the difference between the current spatial distribution density of yellow leaves and the normal reference mean is first calculated, and this difference is divided by the normal reference standard deviation to obtain the standardized deviation of the spatial distribution density of yellow leaves. Then, the absolute value of this deviation is taken, and the same saturation mapping rule as S3122 is executed. If the absolute value does not exceed 2, the anomaly coefficient is divided by 2; if it exceeds 2, the anomaly coefficient is set to 1. The final output anomaly coefficient of the spatial distribution density of yellow leaves is between 0 and 1, reflecting the degree of anomalousness of the current spatial aggregation or dispersion of yellow leaves relative to the normal state.
[0099] S3125. Obtain the normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area;
[0100] S3126. Based on the current moisture abnormality index of the yellow leaf area of the leafy vegetable, the preset normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area, calculate the standardized deviation of the moisture abnormality index of the yellow leaf area, and determine the abnormality coefficient of the moisture abnormality index of the yellow leaf area according to the standardized deviation of the moisture abnormality index of the yellow leaf area.
[0101] It is worth noting that, similarly, firstly, the difference between the current moisture abnormality index of leafy vegetables and the normal reference mean is calculated, and then this difference is divided by the normal reference standard deviation to obtain the standardized deviation of the moisture abnormality index of the yellow leaf area. Next, the absolute value of this deviation is taken, and the unified saturation mapping rule is applied again. If the absolute value is less than or equal to 2, the abnormality coefficient is equal to the value divided by 2; if it is greater than 2, the abnormality coefficient is set to 1. The abnormality coefficient of the moisture abnormality index of the yellow leaf area obtained in this way is also in the range of 0 to 1. The higher the value, the more significant the difference in moisture between the yellow leaf area and the non-yellow leaf area, and the less consistent it is with the physiological characteristics of healthy leafy vegetables.
[0102] S313. Perform a fusion analysis on the confidence coefficient and the anomaly coefficient of each yellow leaf index to obtain the comprehensive anomaly coefficient of each yellow leaf index.
[0103] S3131. Add the confidence coefficient of the proportion of yellow leaves to the anomaly coefficient of the proportion of yellow leaves to obtain the fusion baseline value of the proportion of yellow leaves. Divide the anomaly coefficient of the proportion of yellow leaves by the fusion baseline value of the proportion of yellow leaves to obtain the anomaly weight of the proportion of yellow leaves. Multiply the anomaly weight of the proportion of yellow leaves by the anomaly coefficient of the proportion of yellow leaves. At the same time, multiply the remaining weight by the confidence coefficient of the proportion of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the proportion of yellow leaves.
[0104] S3132. Add the confidence coefficient of the spatial distribution density of yellow leaves to the anomaly coefficient of the spatial distribution density of yellow leaves to obtain the fusion benchmark value of the spatial distribution density of yellow leaves. Divide the anomaly coefficient of the spatial distribution density of yellow leaves by the fusion benchmark value of the spatial distribution density of yellow leaves to obtain the anomaly weight of the spatial distribution density of yellow leaves. Multiply the anomaly weight of the spatial distribution density of yellow leaves by the anomaly coefficient of the spatial distribution density of yellow leaves, and multiply the remaining weight by the confidence coefficient of the spatial distribution density of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the spatial distribution density of yellow leaves.
[0105] S3133. Add the confidence coefficient of the water anomaly index of the yellow leaf area to the anomaly coefficient of the water anomaly index to obtain the fusion baseline value of the water anomaly index. Divide the anomaly coefficient of the water anomaly index by the fusion baseline value of the water anomaly index to obtain the anomaly weight of the water anomaly index. Multiply the anomaly weight of the water anomaly index by the anomaly coefficient of the water anomaly index. At the same time, multiply the remaining weight by the confidence coefficient of the water anomaly index. The sum of the two is the comprehensive anomaly coefficient of the water anomaly index of the yellow leaf area.
[0106] It's worth noting that the core advantage of generating anomaly weights by dividing the anomaly coefficient by the sum of the anomaly coefficient and the confidence coefficient is that the final comprehensive anomaly coefficient reflects both the severity of the problem and avoids being swayed by unreliable data. For example, if a vegetable leaf has a high percentage of yellow leaves (i.e., a high anomaly coefficient), but the edges are very blurry and there are many gaps (i.e., a low confidence coefficient), it indicates that the high percentage might be a false positive. In this case, the anomaly weight will be small, and the final comprehensive anomaly coefficient will not be blindly inflated. Conversely, if the percentage of yellow leaves is indeed high, and the boundaries are clear and the mask is complete (i.e., a high confidence coefficient), then the anomaly weight will be larger, and the system will be more convinced that the anomaly is real, thus giving a higher comprehensive score. In other words, the anomaly weight acts as a dynamic regulator: when the data is both anomalous and reliable, the system boldly identifies the problem as serious; when the data is anomalous but unreliable, the system automatically reduces the judgment strength to avoid misjudgment. This mechanism does not require manually setting thresholds or rules, but automatically adjusts the judgment strength based on the characteristics of each sample.
[0107] It is worth further explaining that in the initial design of this invention, three core indicators were selected: the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area. These indicators serve as the basis for dynamically adjusting cleaning parameters such as water pressure, spraying time, and water flow intensity. These three indicators objectively reflect the degree of deterioration of leafy vegetables from three dimensions: the amount of yellowing area, the spatial aggregation characteristics of yellowing patches, and whether the yellowing area is accompanied by abnormal moisture conditions. They have clear physical significance and regulatory direction. However, in practical applications, relying solely on these three original indicators to directly drive the cleaning system is easily affected by factors such as image quality, causing the cleaning decision to deviate from the actual needs. Therefore, this invention further introduces the confidence coefficient, anomaly coefficient, and comprehensive anomaly coefficient corresponding to each indicator. These new parameters are not used to replace the original indicators, but rather to form a more complete and robust judgment system together with the original indicators, thereby improving the accuracy and adaptability of the dynamic adjustment of cleaning parameters.
[0108] The confidence coefficient is used to assess the reliability of the calculated results for each yellowing indicator. For example, when the edges of the yellowing area are blurred and there are many gaps in the outline, although the system may calculate a high proportion of yellow leaves, this result is likely to be affected by noise or segmentation errors, and the corresponding confidence coefficient will be low. Similarly, if the number of yellow leaf patches is too small or the local signal-to-noise ratio of the near-infrared image is poor, the confidence of the spatial distribution density or moisture anomaly index will also decrease. During dynamic adjustment, the system uses the confidence coefficient as an auxiliary reference for the reliability of the original indicators. When the confidence of an indicator is low, even if its value is high, the cleaning system will not respond blindly, but will appropriately reduce its dependence on that indicator. This mechanism effectively prevents misjudgments caused by non-realistic deterioration factors such as image artifacts, reflections, and occlusions, making the cleaning action more consistent with the actual state of the leafy vegetables.
[0109] The anomaly coefficient provides supplementary information to the original indicators from another dimension. It does not change the numerical or physical meaning of the original indicator itself, but rather characterizes the degree to which the current sample deviates from a healthy state in terms of that indicator by comparing it with the preset normal range. For example, a 10% yellow leaf ratio may be considered normal fluctuation in some leafy vegetable categories, but it is clearly abnormal in others. The anomaly coefficient is based on the historical statistical benchmark of the category characteristics, transforming the original value into a judgment signal of how abnormal it is relative to the normal level. In the adjustment of cleaning parameters, the specific value of the original indicator can be combined to determine the cleaning direction and the magnitude of the anomaly coefficient, which in turn determines the urgency of cleaning, thereby achieving a more refined response strategy. For example, when the yellow leaf ratio is the same but the anomaly coefficient is higher, it means that the value deviates more from the normal state of the category, and the system can appropriately increase the cleaning intensity. Therefore, the anomaly coefficient is not an independent decision-making basis, but works in conjunction with the original indicator to help the system understand what this value means in the current context.
[0110] The comprehensive anomaly coefficient further integrates the information from the confidence coefficient and the anomaly coefficient, forming a comprehensive judgment value that takes into account both the significance of the anomaly and the reliability of the data. Its calculation process ensures that when an indicator deviates significantly from the normal and is highly reliable, the comprehensive anomaly coefficient will be high, and the system will respond fully. When the degree of anomaly is high but the confidence is low, the comprehensive anomaly coefficient will be automatically suppressed to prevent the cleaning system from being misled by unreliable signals. It is important to emphasize that the comprehensive anomaly coefficient does not replace the original indicators, nor is it used alone for control logic. Instead, it serves as an enhanced expression of the original indicators in a specific scenario. In actual adjustments, the cleaning system can simultaneously refer to the original indicators, such as the specific percentage of yellow leaves, the anomaly coefficient indicating whether the percentage is abnormal, and the comprehensive anomaly coefficient indicating whether the anomaly is reliable. These three factors together constitute a multi-dimensional input, making the setting of cleaning parameters both consistent with physical facts and context-aware.
[0111] Overall, the original three yellowing indicators provide the physical basis for cleaning decisions, while the confidence coefficient, anomaly coefficient, and comprehensive anomaly coefficient endow them with credibility labels and contextual interpretation capabilities. Working in tandem, these four parameters enable the cleaning system not only to detect yellowing but also to determine whether the yellowing is genuine and how significant it is under the current variety and imaging conditions. This structure significantly improves the system's robustness in complex field environments. On the one hand, it reduces over-cleaning of high-quality leafy vegetables, avoiding mechanical damage and resource waste; on the other hand, it ensures that genuinely deteriorated leafy vegetables receive sufficient cleaning intensity, guaranteeing food safety. Furthermore, because the degree of anomaly of each indicator is understood within a specific context, the system can also implement multi-level, refined cleaning strategies based on the comprehensive anomaly level, better matching the processing needs of leafy vegetables of different quality grades. Therefore, introducing these collaborative parameters does not add redundancy but rather constructs an intelligent control closed loop that combines sensitivity and stability, truly achieving the efficient, accurate, and reliable dynamic cleaning control goals pursued by this invention.
[0112] S4. Based on the triple analysis results and combined with several yellow leaf indicators, the cleaning parameters of the spray cleaning machine for leafy vegetables are dynamically adjusted, and the spray cleaning machine is started to clean the leafy vegetables according to the adjustment results.
[0113] It is worth noting that in this embodiment, the three key cleaning parameters of the spray cleaning machine—water pressure, spray duration, and water flow intensity—are dynamically and adaptively adjusted using the proportion of yellow leaves, the spatial distribution density of yellow leaves, the moisture anomaly index of the yellow leaf area, and the confidence coefficient, anomaly coefficient, and comprehensive anomaly coefficient calculated for each yellow leaf indicator. Specifically, the first analysis result is processed, using the proportion of yellow leaves as a basis to determine the size of the overall yellowing area. If the proportion of yellow leaves is high, but its confidence coefficient is low (i.e., the proportion of yellow leaves is greater than the first preset threshold of 0.15 and the confidence coefficient is less than the second preset threshold of 0.6), the system will suppress the response intensity of this indicator and adjust the water pressure and spray duration accordingly. The spray duration and water flow intensity will not be adjusted upwards, maintaining a water pressure of 0.25 MPa, a spray duration of 60 seconds, and a water flow intensity of 0.4 (normalized value) to avoid blindly increasing the cleaning intensity. Conversely, if the proportion of yellow leaves is high and its anomaly coefficient is significant and the confidence coefficient is also high, then its comprehensive anomaly coefficient will be high. That is, the proportion of yellow leaves is greater than the first preset threshold of 0.15, the anomaly coefficient is greater than the third preset threshold of 0.7, the confidence coefficient is greater than or equal to the second preset threshold, and the comprehensive anomaly coefficient is greater than the fourth preset threshold of 0.75. Based on this, the system will appropriately increase the water pressure, spray duration, and water flow intensity, increasing the water pressure from the baseline value of 0.25 MPa to 120%~150% and extending the spray duration from the baseline value of 60 seconds to 130%. First, the water flow intensity was increased from the baseline value of 0.40 to 150% to ensure that large areas of yellow leaves were thoroughly rinsed. Then, the second set of analysis results was processed. The spatial distribution density of yellow leaves reflects whether the yellowing patches are concentrated or dispersed. A high density value indicates strong yellow leaf aggregation, and a high anomaly coefficient and high confidence level (i.e., the spatial distribution density of yellow leaves is greater than the fifth preset threshold of 0.35, the anomaly coefficient is greater than the third preset threshold of 0.7, and the confidence coefficient is greater than or equal to the second preset threshold) indicates that the deterioration is concentrated in a localized area. In this case, the system will not uniformly increase all parameters, but will prioritize increasing the water flow intensity and spray duration. The water flow intensity was increased from the baseline value of 0.4 to 130%, and the spray duration was increased from the baseline value of 60 seconds. The extension should not exceed 30%; the water pressure should be maintained within 90% to 110% of the baseline value of 0.25 MPa to allow for more concentrated water flow in high-density areas, while keeping the water pressure moderate to avoid impact damage; if the distribution density is low but the overall anomaly coefficient is still high, that is, the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold of 0.35 and the overall anomaly coefficient is greater than the fourth preset threshold of 0.75, it may mean that although the yellowing is scattered, it is real. The system will evenly increase the three parameters, and simultaneously increase the three key cleaning parameters of water pressure, spray duration and water flow intensity by the same preset first adjustment range, that is, set the water pressure, spray duration and water flow intensity to their respective baseline values (0.25 MPa, 60s, ...40) Increase by 20% to ensure full coverage. Next, the third analysis result, namely the moisture anomaly index of the yellow leaf area and its three auxiliary coefficients, is incorporated into the collaborative judgment. If the index shows that the moisture in the yellow leaf area is significantly lower than normal (e.g., an abnormally high near-infrared reflectance) and its comprehensive anomaly coefficient is high, it indicates that the leaves are dry and fragile. At this point, even if the proportion or distribution density of yellow leaves is high—that is, if the moisture anomaly index of the yellow leaf area is greater than the sixth preset threshold of 0.65 and the comprehensive anomaly coefficient is greater than the fourth preset threshold of 0.75, or the spatial distribution density of yellow leaves is greater than the fifth preset threshold of 0.35—the system will actively reduce water pressure, control water flow intensity, and only moderately extend the spraying time to achieve gentle moist cleaning, reducing the water pressure from the baseline value of 0.2. The pressure is lowered to below 60% of 5MPa; the water flow intensity is reduced and locked within a range not exceeding the preset lower limit of 0.30; the spraying time is extended by 20% to 40% from the baseline value of 60s. In this case, only the spraying time parameter is adjusted upward, while the water pressure and water flow intensity parameters are adjusted downward to prevent high-pressure water flow from tearing or breaking the leaves. Otherwise, in other operating conditions outside of the above judgment branches, that is, when any analysis result does not meet its corresponding threshold combination condition, the system determines that the current leafy vegetable is in the normal or slightly deteriorated range, and does not adjust the three parameters of water pressure, spraying time and water flow intensity, uniformly maintaining their respective preset baseline values of 0.25MPa, 60s and 0.40. Throughout the adjustment logic, three original yellowing leaf indicators serve as the physical basis for cleaning requirements. Each indicator's corresponding confidence coefficient is used to assess data reliability, while the anomaly coefficient characterizes the degree of deviation from the norm. The comprehensive anomaly coefficient combines the former two to form a weighted judgment signal. These three indicators do not replace the original indicators but work closely together to guide the optimal combination of water pressure, spray duration, and water flow intensity. Finally, based on the adjustment results, the determined cleaning parameter values are output and commands are sent to the execution unit of the spray-type cleaning machine to automatically initiate the cleaning process. This allows leafy vegetables to achieve efficient, precise, and low-damage intelligent processing while ensuring thorough cleaning and physical integrity. This process fully demonstrates the technical advantages of this invention—achieving dynamic, flexible, and reliable control in actual cleaning operations through multi-dimensional indicator fusion and a confidence perception mechanism.
[0114] Example 2: Figure 2 As shown, the present invention also discloses a leafy vegetable cleaning control system based on yellow leaf recognition, comprising the following modules:
[0115] Image acquisition module: used to acquire visible light and near-infrared images of leafy vegetables during transportation;
[0116] Feature fusion module: connected to the image acquisition module, used to extract color and texture features from visible light images, extract moisture distribution features from near-infrared images, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask;
[0117] Indicator Analysis Module: Connected to the Feature Fusion Module, it is used to calculate several yellow leaf indicators of the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on several yellow leaf indicators;
[0118] Cleaning Module: Connected to the index analysis module, this module dynamically adjusts the cleaning parameters of the spray cleaner for leafy vegetables based on triple analysis results and several yellowing leaf indicators. It then starts the spray cleaner to clean the leafy vegetables according to the adjustment results. If the proportion of yellow leaves is greater than the first preset threshold, the anomaly coefficient is greater than the third preset threshold, the confidence coefficient is greater than or equal to the second preset threshold, and the overall anomaly coefficient is greater than the fourth preset threshold, and / or the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold, and the overall anomaly coefficient is greater than the fourth preset threshold, the water pressure, spray duration, and water flow intensity are increased. If the spatial distribution density of yellow leaves is greater than the fifth preset threshold, the anomaly coefficient is greater than the third preset threshold, and the confidence coefficient is greater than or equal to the second preset threshold, the water flow intensity and spray duration are increased.
[0119] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0120] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0121] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for controlling the washing of leafy vegetables based on yellow leaf recognition, characterized in that, Includes the following steps: S1. Acquire visible light and near-infrared images of leafy vegetables during the transportation process; S2. Extract color and texture features from the visible light image, extract moisture distribution features from the near-infrared image, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask. S3. Calculate several yellow leaf indicators for the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on these indicators: S311. Confidence analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the water anomaly index of the yellow leaf area to obtain the confidence coefficient of each yellow leaf index. S312. Numerical deviation analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area to obtain the anomaly coefficient of each yellow leaf index. S313. Perform a fusion analysis on the confidence coefficient and the anomaly coefficient of each yellow leaf index to obtain the comprehensive anomaly coefficient of each yellow leaf index. S4. Based on the triple analysis results and combined with several yellow leaf indicators, the cleaning parameters of the spray cleaning machine for leafy vegetables are dynamically adjusted, and the spray cleaning machine is started to clean the leafy vegetables according to the adjustment results. If the proportion of yellow leaves is greater than the first preset threshold, the anomaly coefficient is greater than the third preset threshold, the confidence coefficient is greater than or equal to the second preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, and / or the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, the water pressure, spraying time and water flow intensity will be increased. If the spatial distribution density of yellow leaves is greater than the fifth preset threshold, the anomaly coefficient is greater than the third preset threshold, and the confidence coefficient is greater than or equal to the second preset threshold, the water flow intensity and spraying duration will be increased.
2. The leafy vegetable washing control method based on yellow leaf recognition according to claim 1, characterized in that, The aforementioned indicators of yellow leaves include: the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area.
3. The leafy vegetable washing control method based on yellow leaf recognition according to claim 2, characterized in that, The calculation of the current percentage of yellow leaves, spatial distribution density of yellow leaves, and moisture anomaly index of the yellow leaf area based on the yellow leaf area mask includes: S301. Count the number of all pixels marked as yellow leaves in the yellow leaf area mask, and count the total number of all leafy vegetables pixels in the yellow leaf area mask. S302. Calculate the ratio of the number of all pixels marked as yellow leaves in the yellow leaf area mask to the total number of pixels of all leafy vegetables to obtain the current percentage of yellow leaves in the leafy vegetables. S303. Divide the entire area covered by the yellow leaf area mask into several sub-regions of equal area, and count the number of yellow leaf pixels in each sub-region. S304. Calculate the standard deviation of the number of yellow leaves in all sub-regions to obtain the spatial distribution density of yellow leaves in the current leafy vegetable. S305. Locate the position of the yellow leaf area in the near-infrared image based on the yellow leaf area mask, and extract the moisture response intensity of the yellow leaf area at the current position. At the same time, locate the position of the non-yellow leaf area in the near-infrared image, and extract the moisture response intensity of the non-yellow leaf area at the current position. S306. Calculate the difference between the average water response intensity of the yellow leaf area and the average water response intensity of the non-yellow leaf area to obtain the water anomaly index of the yellow leaf area of the current leafy vegetable.
4. The leafy vegetable washing control method based on yellow leaf recognition according to claim 3, characterized in that, The confidence levels of the percentage of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index in the yellow leaf area were analyzed to obtain the confidence coefficient for each yellow leaf indicator, including: S3111. Perform edge detection on the yellow leaf region mask to obtain the set of edge pixels of the yellow leaf region mask; S3112. Based on the edge pixel set, calculate the average gradient magnitude of the edge pixels, and perform a closure analysis on the contour of the yellow leaf region mask to obtain the number of contour closure gaps. S3113. Based on the average gradient magnitude of edge pixels and the number of contour closure gaps, the confidence coefficient of the proportion of yellow leaves is calculated. S3114. Calculate the coordinates of the geometric center of each sub-region with equal area; S3115. Based on the geometric center coordinates of each sub-region, calculate the radial distance of each geometric center relative to the center point of the leaf vegetable, and calculate the standard deviation of the radial distance; S3116. Based on the number of sub-regions and the standard deviation of radial distance, the confidence coefficient of the spatial distribution density of yellow leaves is calculated. S3117. Obtain the set of near-infrared reflectance intensity values of the yellow leaf region located in the near-infrared image based on the yellow leaf region mask; S3118. Based on the set of near-infrared reflectance intensity values of the yellow leaf region, calculate the standard deviation of the near-infrared reflectance intensity. S3119. Based on the standard deviation of near-infrared reflectance intensity, the confidence coefficient of the moisture anomaly index in the yellow leaf area is calculated.
5. The leafy vegetable washing control method based on yellow leaf recognition according to claim 4, characterized in that, The numerical deviation analysis was performed on the proportion of yellow leaves, the spatial distribution density of yellow leaves, and the moisture anomaly index of the yellow leaf area to obtain the anomaly coefficient for each yellow leaf index, including: S3121. Obtain the preset normal reference mean and normal reference standard deviation of the proportion of yellow leaves; S3122. Based on the current percentage of yellow leaves in leafy vegetables, the preset normal reference mean and normal reference standard deviation of the percentage of yellow leaves, calculate the standardized deviation of the percentage of yellow leaves, and determine the abnormality coefficient of the percentage of yellow leaves based on the standardized deviation of the percentage of yellow leaves. S3123. Obtain the preset normal reference mean and normal reference standard deviation of the spatial distribution density of yellow leaves; S3124. Based on the current spatial distribution density of yellow leaves of leafy vegetables, the preset normal reference mean and normal reference standard deviation of yellow leaf spatial distribution density, calculate the standardized deviation of yellow leaf spatial distribution density, and determine the abnormality coefficient of yellow leaf spatial distribution density according to the standardized deviation of yellow leaf spatial distribution density. S3125. Obtain the normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area; S3126. Based on the moisture abnormality index of the yellow leaf area of the current leafy vegetable, the preset normal reference mean and normal reference standard deviation of the moisture abnormality index of the yellow leaf area, calculate the standardized deviation of the moisture abnormality index of the yellow leaf area, and determine the abnormality coefficient of the moisture abnormality index of the yellow leaf area according to the standardized deviation of the moisture abnormality index of the yellow leaf area.
6. The leafy vegetable washing control method based on yellow leaf recognition according to claim 5, characterized in that, The confidence coefficient and anomaly coefficient of each yellowing leaf indicator are fused and analyzed to obtain the comprehensive anomaly coefficient of each yellowing leaf indicator, including: S3131. Add the confidence coefficient of the proportion of yellow leaves to the anomaly coefficient of the proportion of yellow leaves to obtain the fusion baseline value of the proportion of yellow leaves. Divide the anomaly coefficient of the proportion of yellow leaves by the fusion baseline value of the proportion of yellow leaves to obtain the anomaly weight of the proportion of yellow leaves. Multiply the anomaly weight of the proportion of yellow leaves by the anomaly coefficient of the proportion of yellow leaves. At the same time, multiply the remaining weight by the confidence coefficient of the proportion of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the proportion of yellow leaves. S3132. Add the confidence coefficient of the spatial distribution density of yellow leaves to the anomaly coefficient of the spatial distribution density of yellow leaves to obtain the fusion benchmark value of the spatial distribution density of yellow leaves. Divide the anomaly coefficient of the spatial distribution density of yellow leaves by the fusion benchmark value of the spatial distribution density of yellow leaves to obtain the anomaly weight of the spatial distribution density of yellow leaves. Multiply the anomaly weight of the spatial distribution density of yellow leaves by the anomaly coefficient of the spatial distribution density of yellow leaves, and multiply the remaining weight by the confidence coefficient of the spatial distribution density of yellow leaves. The sum of the two is the comprehensive anomaly coefficient of the spatial distribution density of yellow leaves. S3133. Add the confidence coefficient of the moisture anomaly index of the yellow leaf area to the anomaly coefficient of the moisture anomaly index to obtain the fusion baseline value of the moisture anomaly index. Divide the anomaly coefficient of the moisture anomaly index by the fusion baseline value of the moisture anomaly index to obtain the anomaly weight of the moisture anomaly index. Multiply the anomaly weight of the moisture anomaly index by the anomaly coefficient of the moisture anomaly index. At the same time, multiply the remaining weight by the confidence coefficient of the moisture anomaly index. The sum of the two is the comprehensive anomaly coefficient of the moisture anomaly index of the yellow leaf area.
7. A leafy vegetable cleaning control system based on yellow leaf recognition, used to execute the leafy vegetable cleaning control method based on yellow leaf recognition as described in any one of claims 1-6, characterized in that, Includes the following modules: Image acquisition module: used to acquire visible light and near-infrared images of leafy vegetables during transportation; Feature fusion module: connected to the image acquisition module, used to extract color and texture features from visible light images, extract moisture distribution features from near-infrared images, and fuse the color and texture features and moisture distribution features to generate a yellow leaf region mask; Indicator Analysis Module: Connected to the Feature Fusion Module, it is used to calculate several yellow leaf indicators of the current leafy vegetable based on the yellow leaf area mask, and perform triple analysis on several yellow leaf indicators; Cleaning module: Connected to the index analysis module, it is used to dynamically adjust the cleaning parameters of the spray cleaning machine for leafy vegetables based on the triple analysis results and combined with several yellow leaf indicators, and start the spray cleaning machine to clean the leafy vegetables according to the adjustment results. If the proportion of yellow leaves is greater than the first preset threshold, the anomaly coefficient is greater than the third preset threshold, the confidence coefficient is greater than or equal to the second preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, and / or the spatial distribution density of yellow leaves is less than or equal to the fifth preset threshold and the comprehensive anomaly coefficient is greater than the fourth preset threshold, the water pressure, spraying time and water flow intensity will be increased. If the spatial distribution density of yellow leaves is greater than the fifth preset threshold, the anomaly coefficient is greater than the third preset threshold, and the confidence coefficient is greater than or equal to the second preset threshold, the water flow intensity and spraying duration will be increased.
