Weed pesticide effect automatic evaluation method and system based on image mode recognition
By using image pattern recognition technology, leaf vein structure and physiological diffusion field features are extracted from the efficacy evaluation method of miscellaneous herbs, and a comprehensive efficacy index is calculated. This solves the problem of insufficient recognition of fine-grained physiological changes in existing technologies and achieves accurate efficacy evaluation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-26
- Publication Date
- 2026-03-27
AI Technical Summary
Existing herbicide efficacy assessment techniques are unable to distinguish between fine-grained physiological changes such as "leaf necrosis and diffusion" and "tissue diffusion and degeneration," resulting in insufficient adaptability to different herbicide mechanisms and weed types. In particular, when weeds are partially necrotic, leaf veins remain, or leaves turn yellow, NDVI changes are not significant, which can easily lead to misjudgment.
Using an image pattern recognition method, remote sensing images are acquired and preprocessed to calculate the normalized vegetation index, identify vegetation patches, extract leaf vein structure and physiological diffusion field characteristics, calculate necrosis probability and damage severity, generate a comprehensive efficacy index, and determine the efficacy level of herbicides.
It significantly enhances the ability to identify fine-grained phytotoxic morphologies in weeds, improves the adaptability and stability of efficacy assessment, and provides accurate efficacy evaluation data.
Smart Images

Figure CN121746937A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of agricultural remote sensing, and in particular to a weed efficacy automatic evaluation method and system based on image pattern recognition. BACKGROUND
[0002] With the rapid development of precision agriculture and intelligent plant protection technology, the quantitative evaluation of herbicide application effect gradually shifts from the traditional manual field investigation mode to the automatic evaluation mode based on remote sensing perception and image intelligent analysis. The weed monitoring and efficacy discrimination in farmland often use multispectral remote sensing, unmanned aerial survey, ground close-range imaging and other ways to obtain vegetation growth information, and use vegetation index (such as NDVI, GNDVI, etc.) or spectral reflection characteristics to characterize the physiological state of crops and weeds.
[0003] The existing weed efficacy evaluation technology still has significant limitations. Most methods only make efficacy judgments based on the change amplitude of a single vegetation index (such as NDVI). Although it can reflect the overall vigor attenuation trend of vegetation, it is difficult to distinguish fine-grained physiological changes such as "leaf necrosis spread" and "tissue diffuse degeneration", resulting in insufficient adaptability to different herbicide action mechanisms and weed types. Especially in the stage of partial necrosis of weeds, residual leaf veins or leaf yellowing, the change of NDVI is not significant, which is easy to cause misjudgment. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a weed efficacy automatic evaluation method and system based on image pattern recognition, which solves the problem that most methods only make efficacy judgments based on the change amplitude of a single vegetation index (such as NDVI). Although it can reflect the overall vigor attenuation trend of vegetation, it is difficult to distinguish fine-grained physiological changes such as "leaf necrosis spread" and "tissue diffuse degeneration", resulting in insufficient adaptability to different herbicide action mechanisms and weed types. Especially in the stage of partial necrosis of weeds, residual leaf veins or leaf yellowing, the change of NDVI is not significant, which is easy to cause misjudgment.
[0006] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a weed efficacy automatic evaluation method based on image pattern recognition, which comprises the following steps: Collecting remote sensing images of the target farmland area and performing preprocessing, performing radiation calibration and atmospheric correction on the multispectral remote sensing images to obtain reflectance images, and taking the reference time image as the reference, performing spatial registration on the observation time image, calculating the normalized vegetation index, and generating the initial vegetation binary mask; Identify independent vegetation patches, construct fixed observation units, screen candidate samples of drug efficacy response, perform grayscale processing on candidate samples of drug efficacy response, calculate Hessian matrix and extract leaf vein structure enhancement feature map, calculate gradient magnitude of grayscale image, extract physiological diffusion field feature map, normalize and fuse leaf vein structure enhancement feature map and physiological diffusion field feature map, calculate necrosis probability map, and perform binarization segmentation on necrosis probability map; Morphological reconstruction of candidate necrotic masks was performed, the necrotic area ratio factor was calculated, and the damage severity enhancement factor was calculated in combination with physiological diffusion field characteristics. The comprehensive efficacy index was calculated to determine the efficacy level of the herbicide.
[0007] As a preferred embodiment of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition described in this invention, the step of obtaining a reflectance image by performing radiometric calibration and atmospheric correction on a multispectral remote sensing image, and spatially registering the observation time image with a reference image, calculating a normalized vegetation index, and generating an initial binary vegetation mask includes: Radiometric calibration of remote sensing images yields apparent radiance images. Dark pixel method is used to convert apparent radiance into true surface reflectance, yielding reflectance images. Using the reflectance image at the reference time as the reference image and the reflectance image at the observation time after drug application as the image to be registered, the scale-invariant feature transform algorithm is used to extract key points and feature descriptors on the reference image and the image to be registered, respectively. The feature descriptors of the two images are matched to obtain the registered reflectance image. Based on the registered reflectance image, the Normalized Difference Vegetation Index (NDVI) is calculated. A segmentation threshold is set, and the NDVI is binarized to obtain the initial binary vegetation mask.
[0008] As a preferred embodiment of the automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition described in this invention, the steps of identifying independent vegetation patches, constructing fixed observation units, and screening candidate samples for efficacy responses include: Morphological connected component labeling is performed on the initial binary vegetation mask at the reference time, and each connected component is identified as a surface vegetation patch. For each vegetation patch, the morphological centroid coordinates are calculated as the spatial anchor point of the patch. A square geographic region with a side length of W pixels is defined with the anchor point as the center as the fixed observation unit of the patch. Based on the geographic coordinate range of a fixed observation unit, corresponding image patches are cropped from the registered reflectance image to obtain multispectral image patches; Calculate the relative decay of the average NDVI of the effective vegetation area within the fixed observation unit from the baseline time to each observation time. Set an NDVI decay threshold. If the relative decay of the fixed observation unit is greater than or equal to the decay threshold at any observation time, the weeds corresponding to the fixed observation unit are determined to be candidate samples for efficacy response. Otherwise, the weeds corresponding to the fixed observation unit are determined to be complete response samples.
[0009] As a preferred embodiment of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition described in this invention, the steps of grayscale processing of candidate samples for efficacy response, calculating the Hessian matrix and extracting leaf vein structure enhancement feature maps, calculating the gradient magnitude of the grayscale image, and extracting physiological diffusion field feature maps include: Convert the multispectral image patches corresponding to the drug efficacy response candidate samples into grayscale images; The multispectral image patch is converted into a grayscale image, and the grayscale image is smoothed at multiple scales using a Gaussian kernel function to obtain a smoothed image. The Hessian matrix of the smoothed image is then calculated at each pixel. Solve for the eigenvalues of the Hessian matrix, calculate the tubular structure response value for each pixel to obtain the response map, and perform a pixel-wise maximum value operation on the response maps at all scales to obtain the leaf vein structure enhancement feature map. Calculate the approximate values of the first derivative of the image in the horizontal and vertical directions respectively, and calculate the gradient magnitude of each pixel; The gradient magnitude is used as the signal change quantity to calculate the local Weber contrast. The local contrast attenuation of each pixel from the reference time to each observation time is calculated to obtain the attenuation coefficient map. The grayscale image at the current time is used as the guide image, and the attenuation coefficient map is used as the image to be filtered. Guided filtering is used to obtain the physiological diffusion field feature map. Calculate the average coefficient of the local neighborhood window, and combine the average coefficient with the guide image to calculate the final filtered output value.
[0010] As a preferred embodiment of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition described in this invention, the step of normalizing and fusing the leaf vein structure enhancement feature map and the physiological diffusion field feature map, calculating the necrosis probability map, and performing binarization segmentation on the necrosis probability map includes: The leaf vein structure enhancement feature map and physiological diffusion field feature map were normalized to obtain the normalized leaf vein structure intensity and physiological diffusion degree. The probability of necrosis was calculated using the Sigmoid function. By setting a probability threshold, the probability of necrosis is binarized to obtain candidate necrosis masks.
[0011] As a preferred embodiment of the automatic herbicide efficacy evaluation method based on image pattern recognition described in this invention, the steps of morphological reconstruction of candidate necrotic masks, calculation of necrotic area proportion factor, calculation of damage severity enhancement factor in conjunction with physiological diffusion field characteristics, calculation of comprehensive efficacy index, and determination of herbicide efficacy level include: The candidate necrosis mask is used as the labeled image. Morphological dilation is performed on the labeled image to obtain the binarized necrosis region mask after morphological reconstruction and optimization. The necrosis area proportion factor is calculated. By combining the final filtered output value with the initial vegetation binary mask, the average diffusion value within the necrotic area is calculated, and the damage severity enhancement factor is calculated through linear mapping. The comprehensive efficacy index is obtained by multiplying the necrotic area ratio factor and the damage severity enhancement factor, and the mean value is calculated. Set inefficiency thresholds and efficiency thresholds. When the average comprehensive efficacy index is greater than or equal to the efficiency threshold, it is judged as efficient. When the inefficiency threshold is less than or equal to the average comprehensive efficacy index, and the average comprehensive efficacy index is less than the efficiency threshold, it is judged as moderate, and monitoring continues. When the average comprehensive efficacy index is less than the inefficiency threshold, it is judged as inefficient.
[0012] As a preferred embodiment of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition described in this invention, the step of acquiring and preprocessing remote sensing images of the target farmland area includes: Remote sensing images of the target farmland area were collected by multispectral UAV at the baseline time before herbicide application and the observation time after herbicide application, and then denoised and standardized. The remote sensing images include red light band, green light band, blue light band, and near-infrared band.
[0013] Secondly, the present invention provides an automatic evaluation system for the efficacy of herbal medicines based on image pattern recognition, comprising: The data acquisition and processing module is used to acquire remote sensing images of the target farmland area at the reference time before herbicide application and the observation time after application, and to perform noise reduction and standardization processing. The calibration and pairing module is used to obtain true reflectance data through radiometric calibration and dark pixel correction, and to achieve precise spatial alignment between the post-application image and the reference image using SIFT matching and affine transformation. It also calculates the normalized vegetation index pixel by pixel and performs binarization segmentation. A screening module was constructed to build weed sample units based on connected components and fixed observation units, and to screen candidate samples for drug efficacy response by calculating the relative decay rate of normalized vegetation index. The probability fusion module is used to extract leaf vein structure enhancement features and physiological diffusion field features, and fuse them to generate pixel-level necrosis probability and necrosis mask; The index assessment module is used to calculate the comprehensive efficacy index based on the proportion of necrotic area and the damage severity enhancement factor, and to determine the efficacy level of the herbicide.
[0014] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in the first aspect of the present invention.
[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in the first aspect of the present invention.
[0016] The beneficial effects of this invention are as follows: By combining leaf vein structure enhancement features with physiological diffusion field features, this invention introduces a joint characterization of the integrity of the internal structure of vegetation and the degree of tissue degradation. While maintaining the advantage of vegetation index in reflecting overall vitality changes, it significantly enhances the ability to identify fine-grained phytotoxicity morphologies such as partial necrosis of weeds, leaf vein remnants, and leaf yellowing. This improves the adaptability and discrimination stability of efficacy determination for different herbicide mechanisms and weed types. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition in Example 1.
[0019] Figure 2 The flowchart for calculating the necrosis probability map in Example 1.
[0020] Figure 3 This is a schematic diagram of the automatic evaluation system for the efficacy of miscellaneous herbs based on image pattern recognition in Example 2. Detailed Implementation
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0022] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0023] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0024] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides an automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition, including the following steps: S1. Collect remote sensing images of the target farmland area and preprocess them. Perform radiometric calibration and atmospheric correction on the multispectral remote sensing images to obtain reflectance images. Use the reference image at the time of observation as a reference to perform spatial registration on the images at the time of observation, calculate the normalized vegetation index, and generate an initial binary vegetation mask. Specifically, remote sensing images of the target farmland area are acquired and preprocessed, including: Multispectral drones were used to collect data on the target farmland area at a baseline time before herbicide application. The remote sensing images were obtained at the time of application and observation, and were denoised and standardized. Each image was stored in the form of a digital number (DN) matrix, including red, green, blue and near-infrared bands.
[0025] Using multispectral UAVs for real-time monitoring of farmland areas can acquire high-definition, high-precision remote sensing images, avoiding the potential time lag and human error in traditional ground survey methods. Denoising and standardization processes ensure that the signal-to-noise ratio (SNR) of the images is effectively improved, eliminating image noise caused by meteorological conditions or sensor characteristics, and ensuring the reliability and stability of subsequent analysis results.
[0026] Furthermore, radiometric calibration and atmospheric correction are performed on the multispectral remote sensing images to obtain reflectance images. Using the reference image at the observation time, spatial registration is performed on the images at the observation time, the normalized vegetation index is calculated, and an initial binary vegetation mask is generated, including: Radiometric calibration is performed on the remote sensing image (digital quantization value) to obtain the apparent radiance image. Based on the radiometric calibration coefficients provided by the UAV multispectral sensor, the digital quantization values (DN values) of each band at each time point are converted into apparent radiance using the following formula: ,in For pixel (i,j) at band b and time... The apparent radiance of the top layer of the atmosphere is the total radiant signal received by the sensor, including ground reflections and atmospheric path radiation. and The radiation calibration gain and radiation calibration bias coefficients for band b are calibrated in the laboratory by the sensor manufacturer and provided with the equipment. For pixel (i,j) at band b and time... The digital quantization value; The apparent radiance is converted into the true surface reflectance using the dark pixel method to obtain a reflectance image. The effects of atmospheric scattering and absorption are eliminated. A reliable deep water body or dense shadow area is selected in the apparent radiance image as a dark target. The minimum pixel value in this area is calculated and estimated as the atmospheric path radiance value of this band. The surface reflectance of each pixel is then approximately calculated. Using the reflectance image at the reference time as the reference image and the reflectance image at the observation time after drug application as the image to be registered, the scale-invariant feature transform algorithm is used to extract key points and feature descriptors on the reference image and the image to be registered, respectively. The nearest neighbor distance ratio matching method is used to match the feature descriptors of the two images, and the random sampling consensus algorithm is used to remove mismatched point pairs to obtain matching point pairs. Based on matching point pairs, the parameters of an affine transformation model are solved using the least squares method. The affine transformation model describes the spatial mapping relationship from the coordinates of the image to be registered to the coordinates of the reference image. The parameters of an affine transformation model are solved by least squares estimation. The affine transformation model describes the spatial mapping relationship from the coordinates of the image to be registered to the coordinates of the reference image. Using the solved affine transformation parameters, the image to be registered is resampled by bilinear interpolation to generate a reflectance image that is completely aligned with the spatial resolution and coordinate system of the reference image, thus obtaining the registered reflectance image. Based on the registered reflectance image, the normalized vegetation index is calculated pixel-by-pixel using the sum of the near-infrared and red reflectance bands after alignment. The formula is as follows: ,in For a moment Normalized Difference Vegetation Index (NDVI) and The reflectance values for the near-infrared and red light bands after registration; The segmentation threshold is automatically determined by the maximum inter-class variance method. By traversing all possible thresholds, the inter-class variance of the two classes of pixels, namely foreground (vegetation) and background (non-vegetation), is calculated. The threshold that maximizes the inter-class variance is selected as the optimal segmentation threshold. The normalized vegetation index is binarized for segmentation (the normalized vegetation index greater than or equal to the segmentation threshold is 1, otherwise it is 0. Pixel areas with a value of 1 are identified as vegetation-covered areas, and areas with a value of 0 are non-vegetation backgrounds), thus obtaining the initial vegetation binary mask.
[0027] Digital quantization values (DN values) of different bands are converted into apparent radiance through calibration coefficients, and then converted into surface reflectance through the dark pixel method. This ensures that data from different sensors and time points can be compared laterally. Through feature point matching and affine transformation, remote sensing images taken at different times can be spatially aligned accurately, providing a precise spatial benchmark for subsequent difference analysis and vegetation change monitoring. NDVI has high sensitivity to vegetation changes, especially when there is a significant difference in reflectance between the red and near-infrared bands. NDVI can effectively distinguish between vegetated and non-vegetated areas, making it suitable for various farmland environments and improving the accuracy of vegetation area extraction. Especially in the presence of complex backgrounds or shadows, it can accurately separate vegetated areas, providing basic data support for agricultural resource management.
[0028] S2. Identify independent vegetation patches, construct fixed observation units, screen candidate samples for drug efficacy response, perform grayscale processing on candidate samples for drug efficacy response, calculate the Hessian matrix and extract leaf vein structure enhancement feature map, calculate the gradient magnitude of grayscale image, extract physiological diffusion field feature map, normalize and fuse leaf vein structure enhancement feature map and physiological diffusion field feature map, calculate necrosis probability map, and perform binarization segmentation on necrosis probability map; Specifically, this involves identifying independent vegetation patches, constructing fixed observation units, and screening candidate samples for drug efficacy responses, including: Morphological connected component labeling is performed on the initial binary vegetation mask at the reference time, and each connected component is identified as an independent surface vegetation patch. For each vegetation patch, the morphological centroid coordinates of the pixel set are calculated and used as the spatial anchor point of the patch. A square geographic region with a side length of W pixels is defined with the anchor point as the center, which serves as the fixed observation unit for the patch. The side length W is a constant preset according to the image spatial resolution. The principle for its value is to ensure that the fixed observation unit can completely cover the projection range of the patch at the reference time and include an appropriate amount of adjacent buffer area (for example, when the spatial resolution is 1 cm / pixel, W can be set to 128, corresponding to a physical size of 1.28 m × 1.28 m). Based on the geographic coordinate range of a fixed observation unit, corresponding image patches are cropped from the registered reflectance image to obtain multispectral image patches; For each fixed observation unit at each time, the NDVI value is calculated using the reflectance of the near-infrared and red bands in the multispectral image patch. This calculation is limited to the pixels that are identified as vegetation at the reference time, i.e., the set of pixels that satisfy the value of 1 in the mask. The average NDVI value of all pixels in this set is calculated. The relative attenuation of the average NDVI of the effective vegetation area within a fixed observation unit from the reference time to each observation time is calculated using the following formula: ,in For observation unit i at time... The relative attenuation rate of NDVI, and For observation unit i at time... and reference time The average NDVI value, It is a very small constant used to prevent the denominator from being zero; An NDVI attenuation threshold is set. If the relative attenuation of a fixed observation unit is greater than or equal to the attenuation threshold at any observation time, the weeds corresponding to the fixed observation unit are determined to be candidate samples for efficacy response. Otherwise, the weeds corresponding to the fixed observation unit are determined to be complete response samples, and the corresponding efficacy will be directly recorded as the maximum value (i.e., the efficacy index EPI is 1.0) in subsequent evaluations. The NDVI attenuation threshold can be preset based on the target weed species, herbicide characteristics, and agronomic experience. It can be set to 0.30 to initially screen out significant response targets with an NDVI decrease of more than 30%.
[0029] By using morphological connectivity markers and centroid calculations, the monitoring area of each vegetation patch is ensured to be free from interference from adjacent areas, enhancing the accuracy and reliability of the monitoring data. Fixed observation units not only help to accurately monitor the plant's efficacy response, but also identify efficacy response samples through NDVI attenuation thresholds, providing an effective means to quickly screen and identify the effects of pesticide damage.
[0030] Furthermore, the candidate samples of drug efficacy response are grayscaled, the Hessian matrix is calculated and the leaf vein structure enhancement feature map is extracted, the gradient magnitude of the grayscale image is calculated, and the physiological diffusion field feature map is extracted, including: Convert the multispectral image patches corresponding to the drug efficacy response candidate samples into grayscale images; Multispectral image blocks are converted into grayscale images. A weighted average method is used to synthesize the intensity values of the red, green, and blue channels into a single-channel grayscale value based on the human eye's sensitivity to different wavelengths. The brightness weighting coefficient based on the ITU-R BT.601 standard reflects the physiological characteristics of the human eye, which is most sensitive to green light, followed by red light, and least sensitive to blue light. A Gaussian kernel function is used to perform multi-scale smoothing on a grayscale image to obtain a smoothed image. A discrete set of scales is defined. ,in The standard deviation representing the Gaussian kernel is defined using a linear spatial sampling method, for example... These parameters are preset based on the typical width (in pixels) of the target weed veins, for each scale. The original grayscale image is convolved with a Gaussian kernel of this scale in two dimensions to obtain a smoothed image. The convolution operation is implemented in the frequency domain or spatial domain, suppressing high-frequency noise in a linear filtering manner, while blurring image details to different degrees according to the scale. The formula for calculating the Hessian matrix of a smoothed image at each pixel is: ,in Let Hessian matrix be the matrix at each pixel (x,y). Let be the second-order partial derivatives along the x and y directions. The mixed second-order partial derivatives of the smoothed image are obtained by convolving the smoothed image with a Gaussian second-order derivative kernel. For the scale is Smooth images; at scale Below, the second derivative information of the image is used to detect and enhance tubular (linear) structures. The second partial derivative is obtained by using the scaling... The corresponding Gaussian second derivative kernel is used for convolution to approximate the calculation; Perform eigenvalue decomposition on the Hessian matrix to find its eigenvalues. and (satisfy ), calculate the tubular structure response value for each pixel to obtain the response map, using the following formula: ,in In order to scale The tubular structure response value of the next pixel (x, y). and The eigenvalues of the Hessian matrix represent the principal direction and intensity of the image curvature at that point. The eigenvalue ratio is used to distinguish tubular structures. with speckled structure , The eigenvalue norm measures the overall strength or significance of the structure at that point. The constant parameter for controlling the discrimination sensitivity of tubular structures is set by the 95th percentile of the eigenvalue ratio in the healthy vegetation area at the reference time. c is the constant parameter for noise suppression capability, set by the 70th percentile of the eigenvalue norm in the healthy vegetation area at the reference time. The enhanced response function is achieved through the first term. Punishing non-tubular structures, through the second term The response value is enhanced for structures with high curvature (i.e., significant curvature) if and only if the structure is tubular and sufficiently significant. It's only close to 1; The maximum value operation is performed pixel-by-pixel on the response maps at all scales to obtain the leaf vein structure enhancement feature map; The pixel-wise maximum value operation can preserve the most significant tubular structure response of each pixel at all scales, thereby simultaneously enhancing features at different scales from veinlets to main veins. The Scharr operator is used to calculate the approximate first derivative values of the image in the horizontal and vertical directions, respectively. The gradient magnitude of each pixel is calculated by convolving with the Scharr convolution kernel. The Scharr operator is robust to image noise. The gradient magnitude reflects the rate of change of brightness at that point in the image. The larger the value, the sharper the edge or the clearer the texture. Healthy plant leaves usually have a high local gradient due to their clear cell structure and veins. For each pixel (x, y), the gradient magnitude is taken as the signal change, and the average gray value within a local neighborhood window (e.g., a 5×5 window) in the grayscale image is taken as the reference background. The local Weber contrast is calculated using the following formula: ,in For sample i at time... Local Weber contrast at position (x,y) For sample i at time... The gradient magnitude at position (x, y) is the grayscale image gradient magnitude calculated through convolution using the Scharr operator. The average gray value within a local neighborhood window centered at (x,y); The size of the local neighborhood window can be set according to the spatial resolution of the input image and the typical size of the target weed tissue to ensure the robustness of the local brightness estimation; Calculate each pixel from the reference time to The degree of local contrast attenuation is determined to obtain the attenuation coefficient map, and the formula is: ,in For sample i at time... The attenuation coefficient at position (x,y) Let be the local Weber contrast of sample i at the reference time and position (x,y). To prevent the division into zero small constants; Use the grayscale image at the current moment as the guide image. Using the attenuation coefficient map as the image to be filtered, guided filtering is used to obtain a smooth edge-preserving output, namely the physiological diffusion field feature map. The coefficients of the local neighborhood window are calculated using the following formula: in Within a local neighborhood window centered at pixel k, the slope coefficient of the filtered output relative to the guiding image. The intercept coefficients of the filtered output are defined within a local neighborhood window centered at pixel k. To measure the covariance between the guiding image I and the image p to be filtered within a local neighborhood window, and to assess the degree of linear correlation between the two within the window, To guide the variance of all pixel values within a local neighborhood window of image I, this measures the degree of grayscale variation within that window. and The arithmetic mean of all pixel values in the local neighborhood window of the guiding image I and the image to be filtered p; Calculate the average coefficient corresponding to all pixels o within the local neighborhood window. Combining the average coefficient and the guide image, calculate the final filtered output value of pixel o. The formula is as follows: ,in For sample i at time... ,Location The physiological diffusion degree, i.e., the pixel values of the final output feature map, To guide the grayscale value of image I at pixel o, and This is the average coefficient corresponding to pixel o.
[0031] The Hessian matrix can accurately extract structural information of leaf veins, enhancing the details of plant leaves. Especially during pesticide damage, changes in leaf veins can provide crucial health assessment data. By calculating local Weber contrast and attenuation coefficients, the health status of plants can be assessed in real time. In particular, it can detect the physiological degradation process caused by pesticide damage, further enhancing dynamic monitoring capabilities. The physiological diffusion field feature map can accurately reflect the physiological state of plant leaves. Especially after being affected by pesticide damage, the physiological changes in leaves can be effectively quantified through this feature map, providing a more accurate numerical basis for pesticide efficacy assessment.
[0032] Furthermore, the enhanced feature map of leaf vein structure and the physiological diffusion field feature map are normalized and fused to calculate the necrosis probability map. The necrosis probability map is then binarized and segmented, including: Normalization was performed on the enhanced feature map of leaf vein structure and the feature map of physiological diffusion field to obtain normalized leaf vein structure intensity and physiological diffusion degree. In order to simulate the continuous transition state of plant tissue from healthy to necrotic under the influence of pesticide damage, and to integrate the evidence from the two channels, the Sigmoid function was used as the probabilistic generation model. This function maps the linear combination of the two normalized features into a necrotic probability value between 0 and 1. The probability of necrosis is calculated using the Sigmoid function, as shown in the formula: ,in For sample i at time... The probability that the pixel at position (x,y) is identified as dead. The linear discriminant value of the decision function. and To normalize the leaf vein structure strength and physiological diffusion degree, and The decision thresholds for leaf vein structure strength and physiological diffusion degree are: The weighting coefficients of leaf vein structure features in decision-making. To assign weights to physiological diffusion features in decision-making, a set of image patches containing healthy and necrotic leaf regions, along with their corresponding normalized vein structure intensity and physiological diffusion degree, are collected. Each pixel is labeled with a binary label (0 for healthy, 1 for necrotic). These features and labels are then input into a logistic regression model for training. By maximizing the likelihood function (usually solved using gradient descent), the optimal parameter estimates can be obtained. These trained parameters are then used for the decision calculation in this step. It is a natural exponential function; Using a fixed threshold method to set a probability threshold, the probability of necrosis is binarized and segmented (the probability of necrosis greater than or equal to the probability threshold is 1, otherwise it is 0), thus obtaining candidate necrosis masks.
[0033] By using a probabilistic generation model based on the Sigmoid function, information on leaf vein structure and physiological diffusion can be combined to generate a necrosis probability map, accurately distinguishing between healthy and necrotic areas of the plant. By integrating multiple features (leaf vein structure and physiological diffusion field), it can avoid the bias that may be caused by a single feature and enhance the comprehensive assessment ability of the impact of pesticide damage or other external factors on plants.
[0034] S3. Morphological reconstruction of candidate necrotic masks, calculation of necrotic area ratio factor, and calculation of damage severity enhancement factor in combination with physiological diffusion field characteristics, calculation of comprehensive efficacy index, and determination of herbicide efficacy level. Specifically, morphological reconstruction of candidate necrotic masks is performed, the necrotic area ratio factor is calculated, and the damage severity enhancement factor is calculated in conjunction with physiological diffusion field characteristics. A comprehensive efficacy index is then calculated to determine the herbicide's efficacy level, including: The candidate necrotic mask is used as the marker image. A morphological dilation operation is performed on the marker image to obtain the mask image. (The dilation operation uses a small structuring element (e.g., a disk-shaped structuring element with a radius of 2 pixels) to slightly enlarge the foreground region in the marker image, defining a maximum allowable space range for subsequent reconstruction.) With the labeled image as the initial state, in each iteration, it is first dilated according to standard, and then the dilation result is logically ANDed with the mask image to restrict the result to the range of the mask image until the iteration result no longer changes, thus obtaining the binarized necrotic region mask after morphological reconstruction optimization. This process is equivalent to "growing" all connected foreground regions in the marked image to their maximum extent within the space defined by the mask image. The effect is to fill in the small holes and breaks in the marked image and to remove isolated noise points that cannot be connected to the main foreground region by growth (because they are limited to the local area of the mask image and cannot grow indefinitely), thus obtaining a smooth, connected final necrotic region. The necrotic area proportion factor (the ratio of the area of the optimized necrotic mask to the original total vegetation area of the weed at the baseline time) is calculated using the following formula: ,in For sample i (corresponding to a single weed) at time t The necrotic area percentage factor at location (x,y), where 0 indicates no necrosis and 1 indicates complete necrosis. For sample i at time... Optimized dead mask at position (x,y) Let i be the initial binary vegetation mask for sample i at reference time 1. For sample i, the square geographical region is defined as a set of spatial coordinates, specifically a square region with a side length of W pixels centered at the reference time anchor point. To sum the pixel values of the initial vegetation binary mask within the observation window at the reference time; For pixels within the necrotic region, calculate the average value of the physiological diffusion field feature map and linearly map the average value to a... The range is used as a weighted enhancement of the area proportion; Calculate the average diffusion value within the necrotic area, and then calculate the damage severity enhancement factor through linear mapping, using the following formula: in For sample i at time... The average physiological diffusion value within the necrotic area, For sample i at time... Damage severity enhancement factor; The comprehensive efficacy index is obtained by multiplying the necrotic area ratio factor and the damage severity enhancement factor, and the mean value is calculated. Collect historical plot datasets, which contain samples that have been field-verified by agronomic experts and independently labeled as "inefficient" or "efficient". Use percentile method to calculate 75% of the mean comprehensive efficacy index of inefficient samples and set an inefficient threshold. Calculate 25% of the mean comprehensive efficacy index of efficient samples and set an efficient threshold. When the average comprehensive efficacy index is greater than or equal to the high-efficiency threshold, it is judged as high-efficiency. When the low-efficiency threshold is less than or equal to the average comprehensive efficacy index, and the average comprehensive efficacy index is less than the high-efficiency threshold, it is judged as medium-efficiency, and monitoring continues. When the average comprehensive efficacy index is less than the low-efficiency threshold, it is judged as low-efficiency.
[0035] By calculating the ratio of the necrotic cover area to the original vegetation area, the degree of plant damage at different time points can be quantified, providing a scientific basis for efficacy evaluation. By weighting physiological diffusion characteristics, severely damaged areas can be highlighted in the efficacy index, making the final efficacy evaluation more sensitive and accurate. By calculating the damage severity enhancement factor, the degree of plant damage under different pesticide effects can be accurately determined, so that the efficacy evaluation is not limited to surface damage, but also takes into account the plant's internal physiological changes. By calculating the comprehensive efficacy index, the efficacy response can be divided into three levels: high efficiency, medium efficiency, and low efficiency, providing agricultural managers with accurate efficacy evaluation data.
[0036] Example 2, refer to Figure 3 As a second embodiment of the present invention, an automatic evaluation system for the efficacy of herbal medicines based on image pattern recognition includes: The data acquisition and processing module is used to acquire remote sensing images of the target farmland area at the reference time before herbicide application and the observation time after application, and to perform noise reduction and standardization processing. The calibration and pairing module is used to obtain true reflectance data through radiometric calibration and dark pixel correction, and to achieve precise spatial alignment between the post-application image and the reference image using SIFT matching and affine transformation. It also calculates the normalized vegetation index pixel by pixel and performs binarization segmentation. A screening module was constructed to build weed sample units based on connected components and fixed observation units, and to screen candidate samples for drug efficacy response by calculating the relative decay rate of normalized vegetation index. The probability fusion module is used to extract leaf vein structure enhancement features and physiological diffusion field features, and fuse them to generate pixel-level necrosis probability and necrosis mask; The index assessment module is used to calculate the comprehensive efficacy index based on the proportion of necrotic area and the damage severity enhancement factor, and to determine the efficacy level of the herbicide.
[0037] This embodiment also provides a computer device applicable to the automatic evaluation method of herbal efficacy based on image pattern recognition, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the automatic evaluation method of herbal efficacy based on image pattern recognition as proposed in the above embodiment.
[0038] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0039] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0040] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition, characterized in that: Includes the following steps: Remote sensing images of the target farmland area were acquired and preprocessed. Radiometric calibration and atmospheric correction were performed on the multispectral remote sensing images to obtain reflectance images. Spatial registration was performed on the observation time images with the reference image as a reference, the normalized vegetation index was calculated, and an initial binary vegetation mask was generated. Identify independent vegetation patches, construct fixed observation units, screen candidate samples of drug efficacy response, perform grayscale processing on candidate samples of drug efficacy response, calculate Hessian matrix and extract leaf vein structure enhancement feature map, calculate gradient magnitude of grayscale image, extract physiological diffusion field feature map, normalize and fuse leaf vein structure enhancement feature map and physiological diffusion field feature map, calculate necrosis probability map, and perform binarization segmentation on necrosis probability map; Morphological reconstruction of candidate necrotic masks was performed, the necrotic area ratio factor was calculated, and the damage severity enhancement factor was calculated in combination with physiological diffusion field characteristics. The comprehensive efficacy index was calculated to determine the efficacy level of the herbicide.
2. The automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in claim 1, characterized in that: The process involves radiometric calibration and atmospheric correction of multispectral remote sensing images to obtain reflectance images, spatial registration of observation time images using a reference image, calculation of normalized vegetation index, and generation of an initial binary vegetation mask, including: Radiometric calibration of remote sensing images yields apparent radiance images. Dark pixel method is used to convert apparent radiance into true surface reflectance, yielding reflectance images. Using the reflectance image at the reference time as the reference image and the reflectance image at the observation time after drug application as the image to be registered, the scale-invariant feature transform algorithm is used to extract key points and feature descriptors on the reference image and the image to be registered, respectively. The feature descriptors of the two images are matched to obtain the registered reflectance image. Based on the registered reflectance image, the Normalized Difference Vegetation Index (NDVI) is calculated, a segmentation threshold is set, and the NDVI is binarized to obtain the initial vegetation binary mask.
3. The automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in claim 2, characterized in that: The process of identifying independent vegetation patches, constructing fixed observation units, and screening candidate samples for drug efficacy responses includes: Morphological connected component labeling is performed on the initial binary vegetation mask at the reference time, and each connected component is identified as a surface vegetation patch. For each vegetation patch, the morphological centroid coordinates are calculated as the spatial anchor point of the patch. A square geographic region with a side length of W pixels is defined with the anchor point as the center as the fixed observation unit of the patch. Based on the geographic coordinate range of a fixed observation unit, corresponding image patches are cropped from the registered reflectance image to obtain multispectral image patches; Calculate the relative decay of the average NDVI of the effective vegetation area within the fixed observation unit from the baseline time to each observation time. Set an NDVI decay threshold. If the relative decay of the fixed observation unit is greater than or equal to the decay threshold at any observation time, the weeds corresponding to the fixed observation unit are determined to be candidate samples for efficacy response. Otherwise, the weeds corresponding to the fixed observation unit are determined to be complete response samples.
4. The automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in claim 3, characterized in that: The process of converting candidate drug response samples to grayscale, calculating the Hessian matrix and extracting leaf vein structure enhancement feature maps, calculating the gradient magnitude of the grayscale image, and extracting physiological diffusion field feature maps includes: Convert the multispectral image patches corresponding to the drug efficacy response candidate samples into grayscale images; The multispectral image patch is converted into a grayscale image, and the grayscale image is smoothed at multiple scales using a Gaussian kernel function to obtain a smoothed image. The Hessian matrix of the smoothed image is then calculated at each pixel. Solve for the eigenvalues of the Hessian matrix, calculate the tubular structure response value for each pixel to obtain the response map, and perform a pixel-wise maximum value operation on the response maps at all scales to obtain the leaf vein structure enhancement feature map. Calculate the approximate values of the first derivative of the image in the horizontal and vertical directions respectively, and calculate the gradient magnitude of each pixel; The gradient magnitude is used as the signal change quantity to calculate the local Weber contrast. The local contrast attenuation of each pixel from the reference time to each observation time is calculated to obtain the attenuation coefficient map. The grayscale image at the current time is used as the guide image, and the attenuation coefficient map is used as the image to be filtered. Guided filtering is used to obtain the physiological diffusion field feature map. Calculate the average coefficient of the local neighborhood window, and combine the average coefficient with the guide image to calculate the final filtered output value.
5. The automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in claim 4, characterized in that: The normalization and fusion of the leaf vein structure enhancement feature map and the physiological diffusion field feature map, the calculation of the necrosis probability map, and the binarization segmentation of the necrosis probability map include: The leaf vein structure enhancement feature map and physiological diffusion field feature map were normalized to obtain the normalized leaf vein structure intensity and physiological diffusion degree. The probability of necrosis was calculated using the Sigmoid function. By setting a probability threshold, the probability of necrosis is binarized to obtain candidate necrosis masks.
6. The automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in claim 5, characterized in that: The process of morphological reconstruction of candidate necrotic masks, calculation of necrotic area proportion factor, calculation of damage severity enhancement factor in conjunction with physiological diffusion field characteristics, calculation of comprehensive efficacy index, and determination of herbicide efficacy level includes: The candidate necrosis mask is used as the labeled image. Morphological dilation is performed on the labeled image to obtain the binarized necrosis region mask after morphological reconstruction and optimization. The necrosis area proportion factor is calculated. By combining the final filtered output value with the initial vegetation binary mask, the average diffusion value within the necrotic area is calculated, and the damage severity enhancement factor is calculated through linear mapping. The comprehensive efficacy index is obtained by multiplying the necrotic area ratio factor and the damage severity enhancement factor, and the mean value is calculated. Set inefficiency thresholds and efficiency thresholds. When the average comprehensive efficacy index is greater than or equal to the efficiency threshold, it is judged as efficient. When the inefficiency threshold is less than or equal to the average comprehensive efficacy index, and the average comprehensive efficacy index is less than the efficiency threshold, it is judged as moderate, and monitoring continues. When the average comprehensive efficacy index is less than the inefficiency threshold, it is judged as inefficient.
7. The method for automatic evaluation of the efficacy of herbal medicines based on image pattern recognition as described in claim 1, characterized in that: The process of acquiring and preprocessing remote sensing images of the target farmland area includes: Remote sensing images of the target farmland area were collected by multispectral UAV at the baseline time before herbicide application and the observation time after herbicide application, and then denoised and standardized. The remote sensing images include red light band, green light band, blue light band, and near-infrared band.
8. An automatic evaluation system for the efficacy of miscellaneous herbs based on image pattern recognition, used to implement the automatic evaluation method for the efficacy of miscellaneous herbs based on image pattern recognition as described in any one of claims 1 to 7, characterized in that: include: The data acquisition and processing module is used to acquire remote sensing images of the target farmland area at the reference time before herbicide application and the observation time after application, and to perform noise reduction and standardization processing. The calibration and pairing module is used to obtain true reflectance data through radiometric calibration and dark pixel correction, and to achieve precise spatial alignment between the post-application image and the reference image using SIFT matching and affine transformation. It also calculates the normalized vegetation index pixel by pixel and performs binarization segmentation. A screening module was constructed to build weed sample units based on connected components and fixed observation units, and to screen candidate samples for drug efficacy response by calculating the relative decay rate of normalized vegetation index. The probability fusion module is used to extract leaf vein structure enhancement features and physiological diffusion field features, and fuse them to generate pixel-level necrosis probability and necrosis mask; The index assessment module is used to calculate the comprehensive efficacy index based on the proportion of necrotic area and the damage severity enhancement factor, and to determine the efficacy level of the herbicide.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the automatic evaluation method for the efficacy of herbal medicines based on image pattern recognition as described in any one of claims 1 to 7.