Agricultural pest and disease early warning method and system based on big data

By obtaining crop leaf images from farmland image big data, performing regional segmentation and disease feature extraction, and combining them with pest and disease identification models, the problems of time-consuming and labor-intensive traditional pest and disease monitoring and misjudgment can be solved, dynamic monitoring and early warning can be achieved, and the accuracy and efficiency of agricultural production can be improved.

CN120339853BActive Publication Date: 2025-09-16CHENGDU PAIWO ZHITONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510839444.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-16
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

Traditional pest and disease monitoring methods are time-consuming and labor-intensive, prone to missed detections or misjudgments, and lack the ability to continuously monitor the dynamic changes of pests and diseases during crop growth, making it difficult to meet the precise and intelligent management needs of modern agriculture.

Method used

By obtaining continuously collected crop leaf images from farmland image big data, leaf area segmentation and disease feature extraction are performed, and combined with pre-trained pest and disease recognition models, pest and disease type identification and spread trend prediction data are generated, and early warning instructions with geographic positioning information are generated.

Benefits of technology

It has achieved all-round and dynamic monitoring and early warning of crop diseases and pests, can accurately identify the types of diseases and pests and predict their spread trends, provide timely and accurate basis for prevention and control decisions, reduce the impact of diseases and pests on crop growth, and improve crop yield and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339853B_ABST
    Figure CN120339853B_ABST
Patent Text Reader

Abstract

The present invention provides an agricultural pest and disease early warning method and system based on big data. First, a crop leaf image set of a target farmland area is obtained from farmland image big data, and the crop leaf image set is segmented to distinguish healthy areas from potential disease areas. Subsequently, disease features are extracted from the images of the potential disease areas to generate a key disease feature set. The key disease feature set is detected for abnormal conditions using a pre-trained pest and disease recognition model to determine the type of pest and disease and predict its spread trend. Finally, a pest and disease early warning instruction containing geographic positioning information is generated based on the pest and disease type identification and spread trend prediction data, and is sent to the farmland management system to trigger a prevention and control response operation, thereby achieving accurate monitoring and early warning of crop pests and diseases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural digital technology, and in particular to a method and system for early warning of agricultural pests and diseases based on big data. Background Art

[0002] In agricultural production, pest and disease monitoring and early warning have always been key to ensuring healthy crop growth and improving crop yield and quality. Traditional pest and disease monitoring methods rely primarily on manual inspections, which are not only time-consuming and labor-intensive, but also prone to missed detection or misjudgment of pests and diseases due to human interference, such as lack of experience and incomplete observation. This delays prevention and control efforts and causes immeasurable economic losses. With the rapid development of information technology, although some pest and disease monitoring systems based on image recognition technology have emerged, these systems are often limited to image analysis at a single point in time and lack the ability to continuously monitor the dynamic changes of pests and diseases during crop growth. This makes it difficult to accurately predict the spread of pests and diseases, and therefore cannot meet the precise and intelligent management needs of modern agriculture. Summary of the Invention

[0003] In view of the above-mentioned problems, in combination with the first aspect of the present invention, an embodiment of the present invention provides an agricultural pest and disease early warning method based on big data, the method comprising:

[0004] Acquire a crop leaf image set of a target farmland area from farmland image big data, wherein the crop leaf image set includes continuously acquired multi-time period leaf image units with position marking information;

[0005] Performing leaf region segmentation processing on the crop leaf image set to obtain a healthy region image and a potential diseased region image in each leaf image unit;

[0006] Performing disease feature extraction processing on the potential lesion area image to generate a key disease feature set including texture abnormality distribution features and color variation features;

[0007] Calling a pre-trained pest and disease recognition model to perform abnormal state detection processing on the key pest feature set, and generating pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit;

[0008] Based on the pest type identification and spread trend prediction data, a pest warning instruction containing geographic positioning information is generated, and the pest warning instruction is sent to the farmland management system to trigger a prevention and control response operation.

[0009] On the other hand, an embodiment of the present invention also provides an agricultural pest and disease early warning system based on big data, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium is connected to the processor, the machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.

[0010] Based on the above aspects, the embodiments of the present invention realize all-round and dynamic monitoring and early warning of crop diseases and pests by comprehensively using technical means such as farmland image big data collection, precise segmentation of leaf areas, deep extraction of disease features, and prediction of pest and disease identification models. It can not only efficiently extract key disease features from massive farmland images, but also accurately identify the types of pests and diseases and predict their spread trends. It also combines pest and disease early warning with geographic positioning information to generate early warning instructions with clear directionality, providing timely and accurate prevention and control decision-making basis for farmland management systems. By implementing this method, agricultural producers can quickly respond to pest and disease threats and take effective prevention and control measures, thereby significantly reducing the impact of pests and diseases on crop growth and improving crop yield and quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a schematic diagram of the execution flow of the agricultural pest and disease early warning method based on big data provided by an embodiment of the present invention.

[0012] Figure 2 Schematic diagram of exemplary hardware and software components of an agricultural pest and disease early warning system based on big data provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0013] The present invention will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of an agricultural pest and disease early warning method based on big data provided by an embodiment of the present invention. The agricultural pest and disease early warning method based on big data is introduced in detail below.

[0014] Step S110: obtaining a crop leaf image set of a target farmland area from farmland image big data, wherein the crop leaf image set includes continuously collected multi-time period leaf image units with position marking information.

[0015] In this embodiment, the farmland image big data is typically stored in a large data center. It is sourced from image acquisition devices distributed throughout the farmland. For example, multiple high-definition cameras can be installed throughout the farmland, capturing images of the entire area at preset intervals. Alternatively, drones can be used to regularly patrol the farmland and capture images from various angles and heights. The image data collected by these devices is then transmitted to the data center in real time or periodically for storage and management.

[0016] Determining the target farmland area can rely on a geographic information system (GIS). For example, by inputting the farmland's boundary coordinates and crop area demarcation information, the target farmland's boundaries can be precisely defined. When selecting crop leaf images within the target farmland area from the massive amount of farmland image data, a preliminary screening process is performed based on the crop leaf images' geolocation tags, selecting those whose locations match the target farmland area. Next, considering that crop growth is a continuous process and continuously captured crop leaf images are required, the image timestamp information is used to further select crop leaf images captured within a set time period. Furthermore, each crop leaf image is location-tagged using the image acquisition device's built-in GPS module or other positioning technology. This location tag can accurately determine the specific location of the image acquisition point within the farmland. After this screening and processing, a collection of crop leaf images is obtained, where each leaf image unit corresponds to image information of a crop leaf within the target farmland area during a specific time period.

[0017] Step S120: performing leaf region segmentation processing on the crop leaf image set to obtain a healthy region image and a potential diseased region image in each leaf image unit.

[0018] After obtaining a set of crop leaf images, leaf region segmentation processing is required. The purpose is to accurately separate the leaves from the complex background and further distinguish the healthy areas and potential diseased areas in the leaves.

[0019] Step S121: performing background noise filtering on the leaf image unit to eliminate soil background and light interference pixels to generate a pure leaf main body image.

[0020] In real-world farmland environments, leaf image units are subject to interference from a variety of factors, with soil background and illumination variations being the most common sources. The color and texture of the soil background differ significantly from the leaves, interfering with leaf segmentation. Uneven illumination can also cause areas of the image to appear overly bright or dark, affecting image clarity and the accuracy of feature extraction.

[0021] To remove the soil background, the color characteristics of the image can be utilized. In the RGB color space, the color of the soil typically falls within a specific range, while the color of the leaves differs. By setting an appropriate color threshold, each pixel in the image is judged. If the RGB value of a pixel falls within the threshold range of the soil color, it is marked as a soil background pixel. Morphological operations are then used to remove these marked pixels. Morphological operations include erosion and dilation. Erosion can reduce the boundaries of objects and remove small noise points, while dilation can expand the boundaries of objects and fill small holes within them. By alternating between erosion and dilation operations, the soil background can be effectively removed while retaining the main body of the leaves.

[0022] To eliminate pixels that interfere with light, histogram equalization or adaptive histogram equalization can be used. Histogram equalization is to adjust the grayscale histogram of the image so that the grayscale distribution of the leaf image unit is more uniform, thereby enhancing the contrast of the image. For example, the number of pixels at each grayscale level in the leaf image unit can be counted, and then these grayscale levels can be remapped to make the overall brightness of the image more balanced. Adaptive histogram equalization performs histogram equalization in a local area, which can better handle the situation of uneven lighting in the image. The image is divided into multiple small blocks, and histogram equalization is performed on each small block separately. Then, the processed small blocks are merged into a complete image by interpolation. After the above processing, a pure leaf main body image can be obtained, in which the soil background and light interference pixels are effectively eliminated.

[0023] Step S122: performing edge contour detection processing on the pure leaf main body image, extracting the main vein branch structure features of the leaf, and generating a leaf skeleton topology map based on the main vein branch structure features.

[0024] After obtaining the pure leaf main body image, in order to more deeply analyze the structural characteristics of the leaf, edge contour detection processing is required to extract the main vein branch structure characteristics of the leaf.

[0025] Step S1221: performing adaptive threshold segmentation processing on the pure leaf main body image to generate a binary leaf contour image.

[0026] Adaptive threshold segmentation is a segmentation method that determines the threshold based on the grayscale characteristics of local areas of the image. Since the illumination and grayscale distribution of different areas in the leaf image may vary, using a global threshold may not produce ideal segmentation results. Adaptive threshold segmentation divides the image into multiple small blocks, calculates statistics such as the grayscale mean or median for each small block, and then determines the threshold of the small block based on these statistics. For each pixel in the pure leaf main body image, its grayscale value is compared with the threshold of the small block. If the grayscale value is greater than the threshold, the pixel is marked as a foreground pixel (i.e., a leaf pixel); otherwise, it is marked as a background pixel. Through the above processing, the pure leaf main body image can be converted into a binary image, in which the outline of the leaf is clearly highlighted, generating a binary leaf outline image.

[0027] Step S1222: performing morphological refinement processing on the binary leaf contour image, iteratively removing redundant edge points pixel by pixel until a main vein skeleton image with a single pixel width is generated.

[0028] The goal of morphological thinning is to refine the leaf outline in the binary leaf outline image into a single-pixel skeleton. In a binary image, the leaf outline may have a certain width and contain many redundant pixels. Morphological thinning can gradually remove these redundant pixels, retaining only the central skeleton of the leaf. This process is performed iteratively, pixel by pixel. For each pixel in the image, the status of its neighboring pixels determines whether it can be removed. The specific judgment rules are based on a series of morphological operations and logical conditions, such as determining whether the pixel is a boundary pixel and the connectivity of its neighboring pixels. After multiple iterations until no more pixels can be removed, a single-pixel main vein skeleton image is generated, which clearly shows the direction and structure of the leaf's main vein.

[0029] Step S1223: Identify the node intersection positions in the main vein skeleton image, mark the main vein node and branch node coordinates, and generate the main vein branch structure features of the leaf.

[0030] After obtaining a single-pixel-wide main vein skeleton image, we need to identify the node intersections. Node intersections are key locations where the leaf's main vein branches out, including main vein nodes and branch nodes. Main vein nodes are typically located at important turning points or junctions on the main vein, while branch nodes are where branches begin on the main vein.

[0031] To identify these nodes, each pixel in the main vein skeleton image is traversed to check the connectivity of its neighboring pixels. If a pixel is connected to pixels in multiple directions, it is likely a node. The coordinates of the identified nodes are marked. By recording the coordinates of these main vein nodes and branch nodes, the main vein branch structure feature of the leaf is generated. This feature can accurately describe the branching and structural morphology of the leaf main vein.

[0032] Step S1224: Calculate the skeleton path length parameters and path bending angle parameters between adjacent nodes in the main vein branch structure feature of the blade, and generate a blade skeleton topology structure diagram including node connection relationships.

[0033] After obtaining the structural characteristics of the leaf's main vein branching, we further calculate the skeleton path length parameters and path curvature angle parameters between adjacent nodes. This calculation is achieved by counting the number of pixels along the path connecting two adjacent nodes in the main vein skeleton image. Since the main vein skeleton image is a single pixel wide, the number of pixels can approximate the path length.

[0034] The path curvature angle parameter can be calculated by analyzing the directional changes of the path between adjacent nodes. For example, the angular changes between adjacent pixels on the path can be calculated, and then these angular changes can be statistically processed, such as accumulated or averaged, to obtain the path curvature angle parameter.

[0035] Based on the calculated skeleton path length parameters, path bending angle parameters, and node coordinate information, a blade skeleton topology diagram can be constructed, including node connectivity. In this blade skeleton topology diagram, nodes represent main vein nodes and branch nodes, and edges represent the connection paths between adjacent nodes. Each edge carries attribute information such as path length and bending angle. This diagram can fully demonstrate the branching structure and topological relationships of the blade's main vein.

[0036] Step S1225: Divide the leaf region units according to the leaf skeleton topology diagram, and mark the closed regions enclosed by adjacent nodes as independent growth units.

[0037] After generating the leaf skeleton topology diagram, the leaf area units can be divided according to the leaf skeleton topology diagram. Since the leaf skeleton topology diagram clearly shows the branching structure and node connection relationship of the leaf main vein, the closed area surrounded by adjacent nodes can be regarded as the independent growth unit of the leaf. These independent growth units have a certain degree of independence in physiology and structure, which is of great significance for analyzing the growth and health of the leaf. For each closed area in the leaf skeleton topology diagram, it is marked as an independent growth unit, and the boundary information and related characteristics of the unit, such as area and circumference, are recorded. Through this division, the leaf can be analyzed and processed in more detail.

[0038] Step S123: performing region growing segmentation processing based on the leaf skeleton topology map, comparing the color similarity parameters of adjacent pixel units with a preset threshold, and generating an initial healthy region mask image.

[0039] After obtaining the leaf skeleton topology, we used region growing to generate an initial healthy region mask. Region growing is an image segmentation method based on pixel similarity. Starting from a seed point, it gradually merges adjacent pixels with similar features into the same region.

[0040] For each independent growth unit in the leaf skeleton topology, one or more seed points are selected. Seed points can be selected based on image characteristics, for example, pixels with uniform color and moderate brightness are selected as seed points. Then, for each seed point's neighboring pixel units, a color similarity parameter is calculated between the neighboring pixel units and the seed point. This color similarity parameter can be calculated by comparing the pixel's color values ​​in RGB or other color spaces, for example, by calculating the Euclidean distance between the RGB values ​​of two pixels. The calculated color similarity parameter is compared with a preset threshold. If the similarity parameter is less than the threshold, the neighboring pixel unit is considered to have similar color characteristics to the seed point and is merged into the current growth region. Next, based on the newly merged pixel unit, its neighboring pixel units are examined, repeating the comparison and merging process until no more pixel units can be merged. By performing this region growing segmentation process on each independent growth unit, the leaf can be divided into distinct regions, where regions with similar colors are merged together. Finally, pixels marked as healthy regions are used to generate an initial healthy region mask image, which can be used for subsequent processing and analysis.

[0041] Step S124: performing hole filling processing on the initial healthy area mask image to repair the incomplete leaf boundary and generate a complete leaf area image.

[0042] The initial healthy region mask image may contain some holes and incomplete boundaries due to noise during image acquisition, illumination changes, or damage to the leaf itself. To obtain a complete leaf region image, the initial healthy region mask image needs to be hole-filled.

[0043] Hole filling can be done using the dilation and filling algorithms from morphological operations. First, a dilation operation is performed on the initial healthy region mask image. This operation expands the boundaries of objects in the image and fills some small holes. Then, a filling algorithm based on connected component analysis is used to find the boundary pixels of each hole in the image and mark the pixels inside the hole as belonging to the same region as the boundary pixels. This process effectively fills the holes in the image and repairs the incomplete boundaries of the leaf. Finally, a complete leaf region image is generated, which accurately displays the entire leaf area.

[0044] Step S125: Calculate the color histogram distribution curve of the complete leaf area image, detect abnormal pixel clustering areas beyond the normal color distribution range, mark the abnormal pixel clustering areas as potential lesion area images, and mark the remaining areas as healthy area images.

[0045] For the complete leaf region image, calculate its color histogram distribution curve. A color histogram is a statistical representation of the color distribution within the complete leaf region image, reflecting the number of pixels of different colors within the complete leaf region image. In RGB color space, the color histogram distribution curves for the R, G, and B channels can be calculated separately.

[0046] By analyzing a large number of healthy leaf images, the normal color distribution range can be determined. For each pixel in the complete leaf area image, its color value is compared with the normal color distribution range. If the color value of a pixel exceeds the normal color distribution range, the pixel is marked as an abnormal pixel. Then, through the cluster analysis algorithm, adjacent abnormal pixels are clustered together to form abnormal pixel cluster areas. These abnormal pixel cluster areas are likely to be areas where the leaf has lesions, and they are marked as potential lesion area images. The remaining pixel areas within the normal color distribution range are marked as healthy area images. Through this processing, the complete leaf area image can be accurately divided into healthy area images and potential lesion area images.

[0047] Step S130: performing disease feature extraction processing on the potential lesion area image to generate a key disease feature set including texture abnormality distribution features and color variation features.

[0048] After obtaining the potential disease area image, it is necessary to extract disease features to generate a set of key disease features, including texture abnormality distribution features and color variation features. These features are important for accurately identifying the type and severity of pests and diseases.

[0049] Step S131: performing multi-scale filtering on the potential lesion area image, and using filter kernels of different sizes to extract a local texture response map of the lesion area.

[0050] Multiscale filtering is used to extract texture information from potential lesion images at different scales. Filter kernels of different sizes can capture texture features of varying sizes. Convolution operations are performed on the potential lesion image using a range of filter kernel sizes. For example, Gaussian or Laplacian filters of varying sizes, such as 3×3, 5×5, and 7×7, can be used.

[0051] For each filter kernel, it is convolved with the potential lesion area image to obtain a response map that reflects the texture characteristics of the image at that scale. By using filter kernels of different sizes for convolution, multiple local texture response maps of different scales can be obtained. These local texture response maps contain the texture information of the lesion area at different scales.

[0052] Step S132: calculating the gray level co-occurrence matrix parameters of the local texture response map, and extracting the contrast change gradient and energy distribution dispersion of the gray level co-occurrence matrix parameters as texture abnormality distribution features.

[0053] After obtaining the local texture response map, its gray-level co-occurrence matrix parameters are calculated. The gray-level co-occurrence matrix is ​​a statistical matrix used to describe image texture, reflecting the spatial distribution relationship between pixel pairs of different grayscale levels in the image. For each pixel in the local texture response map, the gray-level combinations of its neighboring pixels in different directions and distances are counted to construct the gray-level co-occurrence matrix.

[0054] The contrast change gradient and energy distribution discreteness are extracted from the gray-level co-occurrence matrix as texture abnormality distribution features. The contrast change gradient reflects the degree of change in the image texture and can be obtained by calculating the differences between different elements in the gray-level co-occurrence matrix. The energy distribution discreteness reflects the uniformity of the image texture and can be obtained by calculating the discreteness of the energy distribution of the elements in the gray-level co-occurrence matrix. By analyzing and calculating the gray-level co-occurrence matrices of multiple local texture response maps, a set of contrast change gradients and energy distribution discreteness values ​​are obtained. The above contrast change gradients and energy distribution discreteness values ​​constitute the texture abnormality distribution features and can effectively describe the texture abnormality of the lesion area.

[0055] Step S133: performing color space conversion processing on the potential lesion area image to generate an independent color component image including a hue channel image and a saturation channel image.

[0056] To more accurately analyze the color characteristics of potential lesion area images, we perform color space conversion. In the RGB color space, color representation is significantly influenced by brightness, which hinders accurate analysis of color changes. Therefore, we convert the potential lesion area images from RGB to HSV (hue, saturation, value) color space.

[0057] In the HSV color space, the hue channel image reflects the type of color, and the saturation channel image reflects the color's vividness. Through color space conversion, the potential lesion area image is decomposed into the hue channel image and the saturation channel image, generating independent color component images. These independent color component images can more clearly display the color characteristics of the potential lesion area image.

[0058] Step S134: analyzing the color difference distribution diagram between the hue channel image and the standard healthy leaf hue reference image, and calculating the mean shift of the color difference distribution diagram as a color variation feature.

[0059] After obtaining the hue channel image, it is compared with a standard healthy leaf hue reference image. The standard healthy leaf hue reference image is obtained by analyzing and counting the hue channels of a large number of healthy leaf images, which represents the hue characteristics of normal leaves.

[0060] For each pixel in the hue channel image, its hue value is compared with the hue value of the corresponding position in the hue reference image of a standard healthy leaf, and the color difference is calculated. By statistically analyzing the color differences of all pixels, a color difference distribution map is generated. This map shows the distribution of hue differences between the image of the potential diseased area and the standard healthy leaf.

[0061] The mean shift of the color difference distribution map, the average of all color differences, is calculated. This shift reflects the overall degree of hue shift in the image of the potential lesion area relative to the standard healthy leaf and is used as a color variation feature. This analysis accurately captures the color variation of the image of the potential lesion area.

[0062] Step S135: normalizing the texture abnormality distribution features and color variation features to generate a set of key disease features represented by the same scale.

[0063] Since the value ranges and dimensions of texture anomaly distribution features and color variation features may be different, they need to be standardized to facilitate subsequent processing and analysis. Standardization can convert different features to the same scale, making them comparable.

[0064] For each eigenvalue in the texture anomaly distribution feature and color variation feature, a normalization algorithm, such as Z-score normalization, is applied. For each eigenvalue, its mean and standard deviation are first calculated. The mean is then subtracted from the eigenvalue and divided by the standard deviation to obtain the normalized eigenvalue. By normalizing all eigenvalues ​​in the texture anomaly distribution feature and color variation feature, a set of key disease features with the same scale representation is generated. This set of key disease features includes the normalized values ​​of the texture anomaly distribution feature and the color variation feature, and can more accurately reflect the disease characteristics of potential disease areas.

[0065] Step S140: calling a pre-trained pest and disease recognition model to perform abnormal state detection processing on the key pest feature set, and generating pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit.

[0066] After generating a set of key disease features, a pre-trained pest and disease recognition model is used to detect abnormalities and generate pest and disease type identification and spread trend prediction data for each leaf image unit. The pre-trained pest and disease recognition model is trained on a large amount of historical data and has high accuracy and reliability.

[0067] Step S141: inputting the key disease feature set into the feature fusion layer of the disease and insect pest recognition model, performing weighted combination processing on the texture abnormal distribution features and color variation features, and generating a fused disease feature vector.

[0068] In pest and disease recognition models, the feature fusion layer plays the crucial role of integrating features from different disease types. Key disease feature sets include texture abnormality distribution and color variation, which reflect potential leaf pathology from different perspectives. To fully utilize this information, a weighted combination is required.

[0069] Different weights are assigned to texture anomaly distribution features and color variation features. These weights are determined based on extensive experimentation and data analysis to ensure a reasonable balance between the contributions of the two types of features to the final result. For example, assume that the texture anomaly distribution feature is represented by the letter A and the color variation feature is represented by the letter B. The weight assigned to the texture anomaly distribution feature is α, and the weight assigned to the color variation feature is β, where α + β = 1. When performing the weighted combination, each eigenvalue in the texture anomaly distribution feature is multiplied by the weight α; each eigenvalue in the color variation feature is multiplied by the weight β. The weighted texture anomaly distribution features and color variation features are then concatenated. These two features represent different information dimensions, and concatenation can better preserve their respective characteristic information. After this processing, a fused defect feature vector is generated, which integrates the defect feature information from both texture and color.

[0070] Step S142: performing a multi-scale spatial feature extraction operation on the fused disease feature vector, using convolution kernels of different sizes to perform parallel extraction processing of local lesion texture features and global context features on the fused disease feature vector, and generating a multi-scale disease feature map set.

[0071] After obtaining the fused disease feature vector, it is necessary to further extract multi-scale spatial features. Multi-scale spatial features can capture the characteristic information of leaf lesions at different scales, which helps to more accurately identify diseases and pests.

[0072] Convolution operations are performed on the fused disease feature vector using convolution kernels of different sizes. Convolution kernels of different sizes have different receptive fields and can extract feature information of varying sizes. For example, a small convolution kernel can focus on extracting local lesion texture features, such as subtle texture changes in the lesion area; a large convolution kernel can capture broader global contextual features, such as the relationship between the lesion area and surrounding leaf tissue.

[0073] For each convolution kernel size, a sliding convolution is performed on the fused disease feature vector. During the convolution process, the convolution kernel performs a weighted summation of the local region in the fused disease feature vector to obtain a new eigenvalue. By sliding the kernel across the entire fused disease feature vector, a feature map corresponding to the size of the convolution kernel is obtained. For convolution kernels of different sizes, the above convolution operation is repeated, ultimately generating multiple feature maps of different scales. These feature maps together constitute a multi-scale disease feature map set, which contains rich feature information of leaf lesions at different scales.

[0074] Step S143: performing feature normalization processing on the multi-scale disease feature map set to generate a standardized multi-scale feature representation.

[0075] Different feature maps in a multi-scale disease feature map set may have different value ranges and dimensions, which will affect the training and analysis results of subsequent models. Therefore, feature normalization is required.

[0076] The purpose of feature normalization is to convert all eigenvalues ​​in the multi-scale disease feature map set to the same scale so that they are comparable. A standardization algorithm, such as Z-score standardization, can be used. For each eigenvalue in the multi-scale disease feature map set, first calculate the mean and standard deviation of the feature map where the eigenvalue is located. Suppose the eigenvalue in a certain feature map is represented by the letter C, its mean is represented by μ, and its standard deviation is represented by σ. For each element in the eigenvalue C, subtract the mean μ and divide it by the standard deviation σ, that is, (C-μ) / σ, to obtain the standardized eigenvalue. By performing such a standardization process on all eigenvalues ​​in the multi-scale disease feature map set, a standardized multi-scale feature representation is generated, which can eliminate the scale differences between different feature maps.

[0077] Step S144: input the standardized multi-scale feature representation into the time series analysis unit of the pest and disease recognition model, combine the time interval information of the continuous acquisition period, calculate the regional feature vector change trajectory of the diseased area in the leaf image unit, and generate the disease feature evolution parameter.

[0078] After obtaining the standardized multi-scale feature representation, it is input into the time series analysis unit of the pest and disease recognition model. The main function of this time series analysis unit is to combine the time interval information of the continuous acquisition period to analyze the changes in the diseased area at different time periods.

[0079] Because crop leaf images are collected continuously, each leaf image unit corresponds to a specific time period. The time interval information between consecutive acquisition periods reflects the time span between two adjacent periods. The time series analysis unit processes the standardized multi-scale feature representation according to the time sequence.

[0080] First, regional feature vectors associated with the lesion region are extracted from the standardized multi-scale feature representation. Each leaf image unit in each time period has a corresponding regional feature vector. Then, the changes in these regional feature vectors over time are analyzed, and their trajectory is calculated. For example, by comparing the differences between the regional feature vectors of two adjacent time periods, the characteristic changes of the lesion region during that period can be determined.

[0081] Based on the changing trajectory of the regional feature vector, lesion feature evolution parameters are generated. These parameters can include the area change rate, shape change rate, and eigenvalue change trend of the lesion region. By analyzing the lesion feature evolution parameters, the development trend of the lesion region can be understood.

[0082] Step S145: performing diffusion trend modeling processing based on the lesion characteristic evolution parameters, calculating the predicted value of the lesion area change rate and the predicted value of the lesion center point displacement direction angle, and generating diffusion trend prediction data.

[0083] After obtaining the lesion characteristic evolution parameters, it is necessary to perform diffusion trend modeling based on these lesion characteristic evolution parameters to predict the diffusion trend of pests and diseases.

[0084] Step S1451: Obtain a set of regional feature vector change trajectories of continuous time periods corresponding to the lesion feature evolution parameters.

[0085] The lesion feature evolution parameters contain the change information of the lesion area in different time periods. Through further analysis of these parameters, the set of regional feature vector change trajectories of the corresponding continuous time periods can be obtained. This set of regional feature vector change trajectories records the changes in the feature vectors of the lesion area in multiple continuous time periods.

[0086] Step S1452: performing time series analysis on the set of regional feature vector change trajectories to extract a sequence of area values ​​of the lesion region in continuous time periods.

[0087] A time series analysis is performed on the set of regional feature vector change trajectories, focusing on changes in the lesion area. Information related to the lesion area is extracted from the set of regional feature vector change trajectories and arranged in chronological order to form a sequence of lesion area values ​​for consecutive time periods. This area value sequence reflects the changing trend of the lesion area over time.

[0088] Step S1453: Calculate the area change amount in adjacent time periods based on the area value sequence, and combine the time interval information of the continuous acquisition periods to generate the area change gradient value per unit time as the predicted value of the lesion area change rate.

[0089] For the area value sequence of the lesion area in continuous time periods, calculate the area change between two adjacent time periods. Assuming that the area of ​​the lesion area in the previous time period is S1 and the area of ​​the lesion area in the next time period is S2, the area change between adjacent time periods is S2-S1. Combined with the time interval information of the continuous acquisition period, assuming that the time interval is Δt, the area change between adjacent time periods is divided by the time interval, that is, (S2-S1) / Δt, to obtain the area change gradient value per unit time. This area change gradient value per unit time can be used as a prediction value of the lesion area change rate, reflecting the rate of increase or decrease of the lesion area over time.

[0090] Step S1454: extracting the lesion center point coordinate sequence from the set of regional feature vector change trajectories, and performing displacement vector calculation processing on the lesion center point coordinate sequence to generate displacement vectors of adjacent time periods.

[0091] The coordinate information of the lesion center point is extracted from the set of regional feature vector change trajectories and arranged in chronological order to form a lesion center point coordinate sequence. For the lesion center point coordinates of two adjacent time periods, the displacement vector between them is calculated. Assuming that the coordinates of the lesion center point in the previous time period are (x1, y1) and the coordinates of the lesion center point in the next time period are (x2, y2), the displacement vector is (x2-x1, y2-y1). Through this calculation, the displacement vectors of adjacent time periods are obtained. These vectors reflect the movement of the lesion center point in different time periods.

[0092] Step S1455: Calculate the average displacement angle deviation value based on the displacement vectors of the adjacent time periods to generate a predicted value of the displacement direction angle of the lesion center point.

[0093] For the displacement vectors of adjacent time periods, their angles are calculated. Assuming the displacement vector is (x, y), its angle can be calculated using the inverse tangent function, i.e., arctan(y / x). For the displacement vector angles of multiple adjacent time periods, their average displacement angle deviation is calculated. By analyzing and processing these angle deviations, a predicted displacement angle value for the lesion center point is generated. This predicted displacement angle value reflects the possible future movement direction of the lesion center point.

[0094] Step S1456: Fusing the predicted value of the area change rate of the lesion region and the predicted value of the displacement direction angle of the lesion center point to generate diffusion trend prediction data, which is used to describe the dynamic characteristics of spatial expansion of pests and diseases in the leaf image unit.

[0095] The predicted rate of change in the lesion area and the predicted displacement angle of the lesion center are combined to generate diffusion trend prediction data. This data combines the change in the lesion area and the movement direction of the lesion center to comprehensively describe the dynamic spatial expansion of pests and diseases within leaf image units. By analyzing this diffusion trend prediction data, the spread range and direction of pests and diseases can be predicted in advance.

[0096] Step S146: Input the standardized multi-scale feature representation into the classification output layer of the pest and disease recognition model, calculate the probability distribution of the pest and disease type corresponding to the leaf image unit through a fully connected network, and select the pest and disease category corresponding to the maximum probability as the pest and disease type identifier.

[0097] The standardized multi-scale feature representation is input into the classification output layer of the pest and disease recognition model. The classification output layer is usually composed of a fully connected network, in which each neuron is connected to all neurons in the previous layer.

[0098] In a fully connected network, the standardized multi-scale feature representation serves as input and undergoes a series of linear transformations and nonlinear activation functions. The linear transformation multiplies the input features by the network's weight matrix and adds a bias term. The nonlinear activation function introduces nonlinearity, increasing the network's expressive power. Through this processing, the probability distribution of leaf image units corresponding to different pest and disease types is calculated.

[0099] For each possible pest type, there is a corresponding probability value. The maximum value is selected from these probability values, and the pest category corresponding to the maximum value is the pest type identifier, which clearly defines the possible pest type in the leaf image unit.

[0100] Step S147: Output the pest type identification and spread trend prediction data.

[0101] After completing the identification of pest and disease types and the prediction of their spread trends, the pest and disease type identification and spread trend prediction data are output, which can provide accurate information for the farmland management system so that corresponding prevention and control measures can be taken in a timely manner.

[0102] Step S150: Generate a pest warning instruction containing geographic positioning information based on the pest type identification and spread trend prediction data, and send the pest warning instruction to the farmland management system to trigger a prevention and control response operation.

[0103] After obtaining the pest and disease type identification and spread trend prediction data, it is necessary to generate pest and disease early warning instructions containing geographic positioning information based on these data, so as to promptly notify the farmland management system to take prevention and control measures.

[0104] Step S151: parsing the preset prevention and control rule library corresponding to the pest type identifier, and extracting the associated prevention and control measure code and response level identifier.

[0105] The preset prevention and control rule base is a database that stores prevention and control rules and measures for different types of pests and diseases. Once the pest and disease type identifier is obtained, it will be searched and matched in the preset prevention and control rule base. Each record in the preset prevention and control rule base is associated with a specific type of pest and disease, and contains the corresponding prevention and control measure code and response level identifier. The prevention and control measure code represents the specific prevention and control method recommended for that type of pest and disease, such as the use of a specific pesticide, the adoption of biological control methods, or physical isolation. The response level identifier indicates the severity of the pest and disease and the urgency of the prevention and control measures required. Different response levels correspond to different prevention and control intensity and response time requirements. By parsing the preset prevention and control rule base, records that match the pest and disease type identifier are found, and the associated prevention and control measure code and response level identifier are extracted from them.

[0106] Step S152: Calculating the azimuth angle parameter of the center point of the lesion region relative to the base point of the leaf blade according to the region expansion direction vector in the diffusion trend prediction data.

[0107] The regional expansion direction vector in the diffusion trend prediction data describes the spatial expansion direction of the lesion area. The leaf base point can be the petiole or other pre-set representative reference point. A rectangular coordinate system is established with the leaf base point as the origin. The regional expansion direction vector has a specific coordinate representation in this coordinate system, set as (x, y).

[0108] According to the principle of trigonometric function, the azimuth angle parameter θ of the center point of the lesion area relative to the base point of the blade is calculated. The azimuth angle parameter θ can be calculated by the inverse tangent function, that is, θ=arctan(y / x). During the calculation process, it is necessary to consider the coordinate quadrant of the vector, and determine the value range of the azimuth angle according to the positive and negative conditions of x and y. For example, when x>0 and y>0, the azimuth angle θ is in the first quadrant; when x<0 and y>0, the azimuth angle θ is in the second quadrant, and the calculated inverse tangent value needs to be adjusted accordingly. Through such calculation, the azimuth angle parameter of the center point of the lesion area relative to the base point of the blade is obtained, which can accurately reflect the positional relationship of the expansion direction of the lesion area relative to the blade.

[0109] Step S153: combining the position mark information, converting the azimuth angle parameter into a diffusion direction vector in the farmland geographic coordinate system.

[0110] The position mark information records the specific position of the leaf image unit in the farmland geographic coordinate system, and is usually expressed in the form of coordinates. Assume that the coordinates of the leaf image unit in the farmland geographic coordinate system are (X_0, Y_0).

[0111] Now that we have the azimuth angle parameter θ of the lesion center relative to the leaf base point, converting it to a diffusion direction vector in the field's geographic coordinate system requires considering the leaf's actual position and orientation within the field. First, we calculate the offset in the field's geographic coordinate system based on the azimuth angle parameter θ and the leaf's position (X_0, Y_0) within the field. Let the length of the diffusion direction vector be L (which can be determined based on information such as the rate of change in the lesion area from the diffusion trend prediction data). The resulting x-direction offset in the field's geographic coordinate system is ΔX = L*cos(θ), and the y-direction offset is ΔY = L*sin(θ).

[0112] Adding the offset to the coordinates of the leaf image unit yields the predicted location (X_1, Y_1) of the diseased area's center in the field's geographic coordinate system, where X_1 = X_0 + ΔX and Y_1 = Y_0 + ΔY. The resulting vector, starting with the leaf image unit's coordinates (X_0, Y_0) and ending at the predicted location (X_1, Y_1), is the diffusion direction vector in the field's geographic coordinate system. This diffusion direction vector accurately indicates the direction of pest spread within the field.

[0113] Step S154: extracting the coverage features of the diseased area in the current leaf image unit, and mapping them to the actual farmland area calculation model to generate an estimated disaster-affected area value.

[0114] In the current leaf image unit, the lesion area has certain coverage features, which may include information such as the shape of the lesion area, boundary coordinates, etc. Through image processing and analysis technology, the coverage features of the lesion area are extracted from the leaf image unit.

[0115] The actual farmland area calculation model is a mathematical model based on leaf image characteristics and the actual farmland conditions. This model takes into account factors such as the image acquisition scale and the density of leaf distribution within the field. First, the image dimensions of the lesion are converted to their actual physical dimensions based on the image acquisition scale. For example, if the image acquisition scale is 1:k and the area of ​​the lesion in the image is S_image, then its actual area, S_actual, equals S_image*k^2.

[0116] We also consider the leaf density within the field—that is, the number of leaves per unit area. Let the leaf density be ρ and the number of leaves covered by the diseased area be n. The estimated affected area is A = n / ρ * S_actual. Through this mapping and calculation, the coverage characteristics of the diseased area within the leaf image unit are converted into an estimated affected area in the actual field. This estimated affected area reflects the actual area of ​​the field that pests and diseases may affect.

[0117] Step S155: The control measure code, response level identifier, diffusion direction vector and estimated disaster-affected area value are integrated to generate a pest and disease early warning instruction containing geographic coordinate polygon vertices.

[0118] The control measure code, response level identifier, spread direction vector, and estimated affected area are combined to generate a pest warning instruction containing the vertices of a geographic coordinate polygon. First, the control measure code specifies the specific control method to be adopted for the pest, the response level identifier determines the urgency and intensity of the control, the spread direction vector indicates the spread direction of the pest, and the estimated affected area reflects the potential scope of the disaster.

[0119] Based on the location of the diseased area's center point in the field's geographic coordinate system, combined with the diffusion direction vector and the estimated affected area, the potential area affected by the pest is determined. Through a series of geometric calculations and spatial analysis, the boundaries of this area are determined, and key points on the boundary are converted into geographic coordinates. These geographic coordinates form the vertices of the geographic coordinate polygon.

[0120] By integrating control measure codes, response level identifiers, and geographic coordinate polygon vertex information, a complete pest and disease early warning instruction is formed. This instruction not only contains important information such as control measures and response levels, but also clearly defines the specific areas where pests and diseases may affect through geographic coordinate polygon vertices, allowing farmland management systems to accurately understand the pest and disease situation and take appropriate control measures.

[0121] Step S156: Send the pest warning instruction to the farmland management system to trigger a prevention and control response operation.

[0122] After the pest and disease warning instruction is generated, it will be sent to the farmland management system through the data transmission network.

[0123] After receiving a pest warning instruction, the farmland management system parses and processes it. Based on the control measure code in the instruction, it calls upon the appropriate control equipment and resources. For example, if the control measure code indicates the need for spraying a specific pesticide, the farmland management system controls the pesticide spraying equipment to spray according to preset parameters and ranges. Simultaneously, the urgency and response time of the control operation are determined based on the response level indicator. If the response level is high, the control operation is initiated immediately; if the response level is low, the control operation is scheduled within the set timeframe. This triggers the farmland management system's control response, enabling timely and effective responses to pest threats and protecting the healthy growth of crops.

[0124] Step S210: obtaining a historical farmland leaf image training sample set, wherein the historical farmland leaf image training sample set comprises multi-period leaf image units annotated with true labels of pest and disease types and true labels of diffusion trends.

[0125] The historical farmland leaf image training sample set is the basic data for training the pest and disease recognition model. These image data are obtained from the image collection and recording of farmland leaves over a period of time.

[0126] By using image acquisition devices distributed throughout the farmland, we capture images of farmland leaves at regular intervals, accumulating a large amount of image data. Each image is carefully annotated, including the true pest type label and the true spread trend label. The true pest type label identifies the type of pest infecting the leaves in the image, while the true spread trend label records the spread of the pest over different time periods, such as the direction and speed of spread. This annotation information is manually obtained by professional agricultural experts or highly trained personnel to ensure its accuracy and reliability. These annotated leaf image units from multiple time periods are combined to form a historical farmland leaf image training sample set.

[0127] Step S220: pre-processing the historical farmland leaf image training sample set, performing leaf region segmentation processing to obtain healthy region images and potential disease region images, and performing disease feature extraction processing on the potential disease region images to generate a training key disease feature set.

[0128] The purpose of preprocessing the historical farmland leaf image training sample set is to improve the effect of model training. The preprocessing operation includes leaf region segmentation and disease feature extraction.

[0129] First, leaf region segmentation is performed on each leaf image unit in the historical farmland leaf image training sample set. The processing process is similar to steps S121-S125, that is, background noise filtering is first performed to eliminate soil background and light interference pixels to generate a pure leaf main body image; then edge contour detection is performed to extract the main vein branch structure characteristics of the leaf and generate a leaf skeleton topology map; then region growing segmentation is performed based on the leaf skeleton topology map to generate an initial healthy region mask image; then hole filling is performed on the initial healthy region mask image to generate a complete leaf region image; finally, the color histogram distribution curve of the complete leaf region image is calculated to detect abnormal pixel clustering areas and mark them as potential diseased region images, while the remaining areas are marked as healthy region images.

[0130] For the obtained potential lesion area image, disease feature extraction processing is performed, and the processing process is similar to steps S131-S135, that is, multi-scale filtering processing is performed on the potential lesion area image to extract texture abnormality distribution features; color space conversion processing is performed to extract color variation features; and texture abnormality distribution features and color variation features are standardized to generate a training key disease feature set, which contains key disease feature information of potential lesion areas in historical farmland leaf images.

[0131] Step S230: Initializing the pest and disease identification model network structure, wherein the pest and disease identification model network structure includes a feature fusion layer, a multi-scale spatial feature extraction unit, a time series analysis unit, and a classification output layer.

[0132] Before model training, the network structure of the pest and disease recognition model needs to be initialized. The pest and disease recognition model mainly consists of a feature fusion layer, a multi-scale spatial feature extraction unit, a time series analysis unit, and a classification output layer.

[0133] The function of the feature fusion layer is to perform weighted combination processing on the input disease features of different types to generate a fused disease feature vector. It receives the key disease feature set as input and effectively integrates the texture abnormality distribution features and color variation features.

[0134] The multi-scale spatial feature extraction unit uses convolution kernels of different sizes to perform convolution operations on the fused disease feature vector, extracting local lesion texture features and global context features, and generating a set of multi-scale disease feature maps. This multi-scale spatial feature extraction unit can capture information about disease features at different scales, improving the model's feature extraction capabilities.

[0135] The time series analysis unit combines the time interval information of continuous acquisition periods, processes the standardized multi-scale feature representation, calculates the change trajectory of the regional feature vector of the lesion area, and generates the lesion feature evolution parameters, which are mainly used to analyze the changes of the disease in the time dimension.

[0136] The classification output layer uses a fully connected network to calculate the probability distribution of different pest and disease types corresponding to leaf image units. The pest and disease category corresponding to the maximum probability is selected as the pest and disease type identifier. The output of this layer is used to determine the possible pest and disease types present in the leaf image.

[0137] Step S240: inputting the training key disease feature set into the feature fusion layer to generate a training fusion disease feature vector.

[0138] After the training key defect feature set is input into the feature fusion layer, it processes the set according to a preset weighting rule. Let Set A contain texture anomaly distribution features and Set B contain color variation features. Set A is assigned a weight α, and Set B is assigned a weight β, with the sum of α and β being 1. For each feature element a_i (i represents the element's index in the set), it is multiplied by the weight α to obtain α*a_i; for each feature element b_j (j represents the element's index in the set) in Set B, it is multiplied by the weight β to obtain β*b_j. The weighted sets A and B are then concatenated. During concatenation, the feature elements are arranged in order to form a new vector, which is the training fused defect feature vector. For example, if Set A has m elements and Set B has n elements, the training fused defect feature vector will contain m+n elements, integrating both texture and color defect feature information.

[0139] Step S250: inputting the training fusion disease feature vector into the multi-scale spatial feature extraction unit to generate a training multi-scale disease feature map set.

[0140] When the training fused defect feature vector is input into the multi-scale spatial feature extraction unit, it performs a convolution operation on it using convolution kernels of different sizes. Assume that k convolution kernels of different sizes are used, denoted as C_1, C_2, …, C_k. Each convolution kernel C_l (l = 1, 2, …, k) has a set size and parameters. During the convolution process, the convolution kernel C_l slides over the training fused defect feature vector, and each slide performs a weighted summation of the feature elements in the local area covered by it. Specifically, let the training fused defect feature vector be V, the feature element in the local area covered by the convolution kernel C_l at a certain position be v_p (p represents the index of the element in the local area), and the parameter of the convolution kernel C_l at the corresponding position be c_lp. The convolution result at that position is the sum of the products of these v_p and c_lp. As the convolution kernel continuously slides over the training fusion defect feature vector, a series of convolution results are obtained. These results are arranged in sequence to form the feature map M_l corresponding to the convolution kernel C_l. This convolution operation is performed on all k convolution kernels, ultimately resulting in k feature maps M_1, M_2, …, M_k. These feature maps together constitute the set of training multi-scale defect feature maps. Convolution kernels of different sizes can capture the characteristic information of the training fusion defect feature vector at different scales. Small convolution kernels can focus on subtle local features, while large convolution kernels can capture more macro-contextual features.

[0141] Step S260: performing feature normalization processing on the training multi-scale disease feature map set to generate a training standardized multi-scale feature representation.

[0142] To make the feature maps in the training multi-scale disease feature map set comparable, feature normalization is required. For each feature map M_l (l = 1, 2, …, k) in the training multi-scale disease feature map set, its mean μ_l and standard deviation σ_l are first calculated. For each element m_lq (q represents the element's index in the feature map) in feature map M_l, the mean μ_l is subtracted and the standard deviation σ_l is divided by the value ((m_lq - μ_l) / σ_l)) to obtain the normalized element. This process is repeated for all elements in feature map M_l, resulting in a normalized feature map M_l'. After normalization of all feature maps in the training multi-scale disease feature map set, a set of normalized feature maps M_1', M_2', …, M_k' is obtained. These normalized feature maps together constitute the training standardized multi-scale feature representation. Through feature normalization, the influence of different feature maps due to different value ranges and dimensions can be eliminated, so that the model can learn feature information more stably and effectively in the subsequent training process.

[0143] Step S270: Input the training standardized multi-scale feature representation into the time series analysis unit, combine the time interval information of the continuous acquisition period, generate training lesion feature evolution parameters, and generate training diffusion trend prediction data based on the training lesion feature evolution parameters.

[0144] After the trained standardized multi-scale feature representation is input into the time series analysis unit, it combines the time interval information of consecutive acquisition periods to analyze the changes in the lesion area over time. The time interval information of consecutive acquisition periods reflects the time span between two adjacent acquisition periods, which is set as Δt.

[0145] The time series analysis unit first extracts the regional feature vector related to the lesion area from the trained standardized multi-scale feature representation. For each time period of the trained standardized multi-scale feature representation, there is a corresponding regional feature vector. These regional feature vectors are arranged in chronological order to form a sequence of regional feature vectors. By analyzing the difference between the regional feature vectors of two adjacent time periods, the feature changes of the lesion area during this period are determined. For example, suppose the regional feature vectors of two adjacent time periods are R_t and R_t+1, and their difference ΔR=R_t+1-R_t is calculated. Based on these differences and the time interval Δt, the feature change rate of the lesion area can be calculated.

[0146] Based on this feature change information, training lesion feature evolution parameters are generated. These parameters may include the area change rate of the lesion region, the shape change rate, and the trend of feature value changes. For example, the area change rate of the lesion region is calculated by comparing the area size of the lesion region at different time periods, calculating the area change between adjacent time periods, and then dividing it by the time interval Δt.

[0147] Based on the training lesion feature evolution parameters, training diffusion trend prediction data is further generated. The specific process is as follows: First, a set of regional feature vector change trajectories corresponding to the lesion feature evolution parameters in continuous time periods is obtained. A time series sequence analysis is performed on the set to extract the area value sequence of the lesion area in continuous time periods. Based on the area value sequence, the area change in adjacent time periods is calculated, and the area change gradient value per unit time is generated in combination with the time interval Δt as the predicted value of the lesion area change rate. At the same time, the lesion center point coordinate sequence in the regional feature vector change trajectory set is extracted, and the displacement vector calculation process is performed on it to generate the displacement vector of the adjacent time periods. Based on these displacement vectors, the average displacement angle deviation value is calculated to generate the lesion center point displacement direction angle prediction value. Finally, the lesion area area change rate prediction value and the lesion center point displacement direction angle prediction value are fused to form the training diffusion trend prediction data, which describes the diffusion trend of pests and diseases in the training data.

[0148] Step S280: inputting the training standardized multi-scale feature representation into the classification output layer to generate a training pest and disease type identifier.

[0149] After the trained standardized multi-scale feature representation is input to the classification output layer, it is processed by the fully connected network in the classification output layer. A fully connected network consists of multiple neurons, each connected to all neurons in the previous layer. The trained standardized multi-scale feature representation, as input, undergoes a series of linear transformations and nonlinear activation functions within the fully connected network. Linear transformations multiply the input features by the network's weight matrix and add a bias term; nonlinear activation functions introduce nonlinearity to increase the network's expressive power. This process calculates the probability distribution of different pest and disease types for each training leaf image unit. Assume there are s possible pest and disease types, denoted as T_1, T_2, …, T_s. After calculations within the fully connected network, the probability values ​​P_1, P_2, …, P_s for each pest and disease type are obtained. The maximum value among these probabilities, assuming it is P_max, is selected. The pest and disease type T_max corresponding to this value is the training pest and disease type identifier, which identifies the possible pest and disease type in the training leaf image unit.

[0150] Step S290: Calculate the cross entropy loss value between the training pest and disease type identifier and the true pest and disease type label, and calculate the smoothed L1 loss value between the training diffusion trend prediction data and the diffusion trend true label.

[0151] To calculate the cross-entropy loss between the training pest type identifiers and the true pest type labels, assume the true pest type labels are a one-hot vector Y, where only the elements corresponding to the true pest type are 1, and all other elements are 0. The probability distribution corresponding to the training pest type identifiers is a vector P. The cross-entropy loss function is calculated by processing each corresponding element of vectors Y and P. For each element y_i in vector Y and p_i in vector P, -y_i*log(p_i) is calculated, and the calculated results for all elements are summed to obtain the cross-entropy loss value L_c. The cross-entropy loss value measures the degree of difference between the trained pest type probability distribution and the true label. A smaller loss value indicates a more accurate prediction of the pest type by the model.

[0152] To calculate the smoothed L1 loss between the training diffusion trend prediction data and the true diffusion trend labels, assume that the training diffusion trend prediction data is vector D_p and the true diffusion trend labels are vector D_t. The smoothed L1 loss function is an improvement on the L1 loss function, using a squared loss for small errors and a linear loss for large errors. For each corresponding element d_pi and d_ti in vectors D_p and D_t, the difference e_i = d_pi - d_ti is calculated. Different calculation methods are used depending on the absolute value of e_i. When |e_i| is less than a threshold, the loss is 0.5*e_i^2; when |e_i| is greater than or equal to the threshold, the loss is |e_i| - 0.5*threshold^2. The loss values ​​of all elements are summed to obtain the smoothed L1 loss value L_s. The smoothed L1 loss value measures the degree of difference between the training diffusion trend prediction data and the true diffusion trend labels. The smaller the loss value, the more accurate the model's prediction of the pest and disease diffusion trend.

[0153] Step S2100: According to the difference in error magnitude between the classification task and the regression task, dynamic weight coefficients are assigned to the cross entropy loss value and the smoothed L1 loss value to generate a balanced joint optimization objective function, and the back propagation algorithm is used to optimize the weight parameters until convergence to generate a pre-trained pest and disease recognition model.

[0154] Because the error magnitudes for the classification task (determining pest type) and the regression task (predicting pest spread trends) may differ, dynamic weighting coefficients need to be assigned to the cross-entropy loss L_c and the smoothed L1 loss L_s. The weighting coefficient assigned to the cross-entropy loss is γ, and the weighting coefficient assigned to the smoothed L1 loss is δ, with γ + δ = 1. Determining these weighting coefficients requires extensive experimentation and fine-tuning to ensure a reasonable balance between the impact of the classification and regression tasks on model training.

[0155] Multiply the cross entropy loss value L_c and the smoothed L1 loss value L_s by the corresponding weight coefficients respectively, and then add them together to obtain the balanced joint optimization objective function L=γ*L_c+δ*L_s. This joint optimization objective function comprehensively considers the loss of classification tasks and regression tasks. The goal of model training is to make the value of this objective function as small as possible.

[0156] The backpropagation algorithm is used to optimize the model's weight parameters. The backpropagation algorithm is a gradient descent-based optimization algorithm that starts from the output layer and propagates the error of the loss function back to each layer of the model, calculating the gradient of the weight parameters of each layer. Based on these gradients, the weight parameters are updated. Specifically, for each weight parameter w in the model, based on its gradient ∇L / ∇w and the learning rate η, the weight parameter is updated to w'=w-η*∇L / ∇w. This process is repeated until the value of the joint optimization objective function converges to a stable state. When the value of the objective function no longer decreases significantly, it means that the model's weight parameters have been adjusted to a more optimal state, and a pre-trained pest and disease recognition model is generated.

[0157] Figure 2 A schematic diagram illustrates exemplary hardware and software components of a big data-based agricultural pest warning system 100 that can implement the concepts of the present application, as provided in some embodiments of the present application. For example, a processor 120 can be used in the big data-based agricultural pest warning system 100 to perform the functions described in the present application.

[0158] The agricultural pest early warning system 100 based on big data can be a general-purpose server or a special-purpose server, both of which can be used to implement the agricultural pest early warning method based on big data of the present application. Although only one server is shown in this application, for convenience, the functions described in this application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.

[0159] For example, the agricultural pest early warning system 100 based on big data may include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and storage media 140 in different forms, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the agricultural pest early warning system 100 based on big data may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The agricultural pest early warning system 100 based on big data also includes an I / O interface 150 between the computer and other input and output devices.

[0160] For ease of explanation, only one processor is described in the agricultural pest and disease early warning system 100 based on big data. However, it should be noted that the agricultural pest and disease early warning system 100 based on big data in the present application may also include multiple processors, so the steps performed by one processor described in the present application may also be performed jointly or individually by multiple processors. For example, if the processor of the agricultural pest and disease early warning system 100 based on big data executes step A and step B, it should be understood that step A and step B may also be performed jointly by two different processors or individually in one processor. For example, the first processor executes step A, the second processor executes step B, or the first processor and the second processor execute steps A and B together.

[0161] In addition, an embodiment of the present invention also provides a readable storage medium, in which computer-executable instructions are preset. When the processor executes the computer-executable instructions, the above-mentioned agricultural pest and disease early warning method based on big data is implemented.

[0162] It should be noted that in order to simplify the description of the present invention and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, multiple features are sometimes combined into one embodiment, figure or description thereof.

Claims

1. A method for early warning of agricultural pests and diseases based on big data, characterized in that: The method comprises: Acquire a crop leaf image set of a target farmland area from farmland image big data, wherein the crop leaf image set includes continuously acquired multi-time period leaf image units with position marking information; Performing leaf region segmentation processing on the crop leaf image set to obtain a healthy region image and a potential diseased region image in each leaf image unit; Performing disease feature extraction processing on the potential lesion area image to generate a key disease feature set including texture abnormality distribution features and color variation features; Calling a pre-trained pest and disease recognition model to perform abnormal state detection processing on the key pest feature set, and generating pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit; Generate a pest warning instruction containing geographic location information based on the pest type identification and spread trend prediction data, and send the pest warning instruction to the farmland management system to trigger a prevention and control response operation; The generating of the pest warning instruction containing geographic location information based on the pest type identification and spread trend prediction data includes: Parsing the preset prevention and control rule library corresponding to the pest type identification, and extracting the associated prevention and control measure code and response level identification; Calculating the azimuth angle parameter of the center point of the lesion area relative to the base point of the leaf blade according to the regional expansion direction vector in the diffusion trend prediction data; In combination with the position mark information, the azimuth angle parameter is converted into a diffusion direction vector in the farmland geographic coordinate system; Extracting coverage features of the diseased area in the current leaf image unit and mapping them to an actual farmland area calculation model to generate an estimated disaster-affected area value; The prevention and control measure codes, response level identifiers, diffusion direction vectors and estimated disaster-affected area values ​​are integrated to generate pest and disease early warning instructions containing geographic coordinate polygon vertices.

2. The agricultural pest and disease early warning method based on big data according to claim 1 is characterized in that: The performing leaf region segmentation processing on the crop leaf image set to obtain a healthy region image and a potential diseased region image in each leaf image unit includes: Performing background noise filtering on the leaf image unit to eliminate soil background and light interference pixels to generate a pure leaf main body image; Performing edge contour detection processing on the pure leaf main body image, extracting the main vein branch structure features of the leaf, and generating a leaf skeleton topology map based on the main vein branch structure features; Performing region growing segmentation processing based on the leaf skeleton topology map, comparing the color similarity parameters of adjacent pixel units with a preset threshold, and generating an initial healthy area mask image; Performing hole filling processing on the initial healthy area mask image to repair the damaged leaf boundary and generate a complete leaf area image; The color histogram distribution curve of the complete leaf area image is calculated, and abnormal pixel clustering areas beyond the normal color distribution range are detected. The abnormal pixel clustering areas are marked as potential lesion area images, and the remaining areas are marked as healthy area images.

3. The agricultural pest early warning method based on big data according to claim 2 is characterized in that: The performing edge contour detection processing on the pure leaf main body image, extracting the main vein branch structure features of the leaf, and generating a leaf skeleton topology map according to the main vein branch structure features, includes: Performing adaptive threshold segmentation processing on the pure leaf main body image to generate a binary leaf contour image; Performing morphological refinement processing on the binary leaf contour image, iteratively removing redundant edge points pixel by pixel until a main vein skeleton image with a single pixel width is generated; Identifying node intersection positions in the main vein skeleton image, marking main vein node and branch node coordinates, and generating leaf main vein branch structure features; Calculating the skeleton path length parameters and path bending angle parameters between adjacent nodes in the main vein branch structure characteristics of the leaf to generate a blade skeleton topological structure diagram including node connection relationships; The blade region units are divided according to the blade skeleton topological structure diagram, and the closed regions enclosed by adjacent nodes are marked as independent growth units.

4. The agricultural pest early warning method based on big data according to claim 1, characterized in that: The disease feature extraction process is performed on the potential lesion area image to generate a key disease feature set including texture abnormality distribution features and color variation features, including: Performing multi-scale filtering on the potential lesion area image, and extracting a local texture response map of the lesion area using filter kernels of different sizes; Calculating gray level co-occurrence matrix parameters of the local texture response map, and extracting contrast change gradient and energy distribution dispersion of the gray level co-occurrence matrix parameters as texture abnormality distribution features; Performing color space conversion processing on the potential lesion area image to generate an independent color component image including a hue channel image and a saturation channel image; Analyzing a color difference distribution map between the hue channel image and a standard healthy leaf hue reference image, and calculating a mean shift of the color difference distribution map as a color variation feature; The texture abnormality distribution features and color variation features are standardized to generate a set of key disease features represented by the same scale.

5. The agricultural pest and disease early warning method based on big data according to claim 4 is characterized in that: The analyzing the color difference distribution map between the hue channel image and the standard healthy leaf hue reference image, and calculating the mean shift of the color difference distribution map as a color variation feature, includes: Acquire a hue value set for each pixel in the hue channel image and a reference hue value set for a corresponding area of ​​the standard healthy leaf hue reference image; Performing color difference calculation processing on each pixel point to generate an absolute value of the color difference between the hue value corresponding to the pixel point and a reference hue value matching the pixel point position, thereby obtaining a color difference distribution map of the potential lesion area image; Performing statistical feature extraction processing on the color difference distribution map, and calculating a color difference mean parameter and a color difference distribution dispersion parameter of the color difference distribution map; Comparing the color difference mean parameter with a preset healthy leaf color difference benchmark mean to generate a first color variation component; Comparing the color difference distribution dispersion parameter with a preset healthy leaf color difference distribution dispersion threshold to generate a second color variation component; Performing spatial cluster analysis on the color difference distribution map to identify continuous pixel regions whose color difference abnormality exceeds a preset threshold, calculating a ratio parameter of the continuous pixel region to the total area of ​​the potential lesion region image, and generating a third color variation component; fusing the first color variation component, the second color variation component, and the third color variation component to generate a multidimensional color variation feature set, wherein the multidimensional color variation feature set includes an overall color difference offset, a degree of color difference distribution dispersion, and an index of local high color difference region aggregation; The step of calculating the gray level co-occurrence matrix parameters of the local texture response map and extracting the contrast change gradient and energy distribution dispersion of the gray level co-occurrence matrix parameters as texture abnormality distribution features includes: constructing gray-level co-occurrence matrices in multiple directions of the local texture response map, and calculating a contrast parameter set of the gray-level co-occurrence matrix in each direction; Performing directional weighted averaging processing on the contrast parameter set to generate a comprehensive contrast change gradient value; Extract the energy parameter set of the gray-level co-occurrence matrix in each direction, and calculate the standard deviation of the energy parameter set as the energy distribution dispersion value; Comparing the comprehensive contrast change gradient value with a standard healthy leaf contrast reference value to generate a relative contrast offset; The relative contrast offset and the energy distribution dispersion value are fused to generate a texture abnormality distribution feature containing multi-dimensional quantitative indicators.

6. The agricultural pest and disease early warning method based on big data according to claim 1 is characterized in that: The calling of the pre-trained pest and disease recognition model to perform abnormal state detection processing on the key pest feature set to generate pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit includes: Inputting the key disease feature set into the feature fusion layer of the disease and insect pest recognition model, performing weighted combination processing on the texture abnormal distribution feature and the color variation feature to generate a fused disease feature vector; Performing a multi-scale spatial feature extraction operation on the fused disease feature vector, using convolution kernels of different sizes to perform parallel extraction processing of local lesion texture features and global context features on the fused disease feature vector to generate a multi-scale disease feature map set; Performing feature normalization processing on the multi-scale disease feature map set to generate a standardized multi-scale feature representation; Inputting the standardized multi-scale feature representation into the time series analysis unit of the pest and disease recognition model, combining the time interval information of the continuous acquisition period, calculating the change trajectory of the regional feature vector of the lesion area in the leaf image unit, and generating the lesion feature evolution parameter; Performing diffusion trend modeling based on the lesion characteristic evolution parameters, calculating the predicted value of the lesion area change rate and the predicted value of the lesion center point displacement direction angle, and generating diffusion trend prediction data; Inputting the standardized multi-scale feature representation into the classification output layer of the pest and disease recognition model, calculating the probability distribution of the pest and disease type corresponding to the leaf image unit through a fully connected network, and selecting the pest and disease category corresponding to the maximum probability as the pest and disease type identifier; Output the pest type identification and spread trend prediction data.

7. The agricultural pest early warning method based on big data according to claim 6 is characterized in that: The step of performing diffusion trend modeling based on the lesion characteristic evolution parameters, calculating a predicted value of the lesion area change rate and a predicted value of the lesion center point displacement direction angle, and generating diffusion trend prediction data includes: Obtaining a set of regional feature vector change trajectories corresponding to the lesion feature evolution parameters in consecutive time periods; Performing time series analysis on the set of regional feature vector change trajectories to extract a sequence of area values ​​of the lesion region in consecutive time periods; Calculate the area change amount in adjacent time periods based on the area value sequence, and generate the area change gradient value per unit time as the predicted value of the area change rate of the lesion area in combination with the time interval information of the continuous acquisition period; Extracting a lesion center point coordinate sequence from the set of regional feature vector change trajectories, and performing displacement vector calculation processing on the lesion center point coordinate sequence to generate displacement vectors of adjacent time periods; Calculating an average displacement angle deviation value based on the displacement vectors of the adjacent time periods to generate a predicted displacement direction angle value of the lesion center point; The predicted value of the area change rate of the lesion region and the predicted value of the displacement direction angle of the lesion center point are integrated to generate diffusion trend prediction data, which is used to describe the spatial expansion dynamic characteristics of pests and diseases in the leaf image unit.

8. The agricultural pest early warning method based on big data according to claim 1 is characterized in that: The method comprises: Acquire a historical farmland leaf image training sample set, wherein the historical farmland leaf image training sample set includes multi-time period leaf image units marked with true labels of pest and disease types and true labels of diffusion trends; Performing a preprocessing operation on the historical farmland leaf image training sample set, performing leaf region segmentation processing to obtain healthy area images and potential disease area images, and performing disease feature extraction processing on the potential disease area images to generate a training key disease feature set; Initializing a pest and disease identification model network structure, wherein the pest and disease identification model network structure includes a feature fusion layer, a multi-scale spatial feature extraction unit, a time series analysis unit, and a classification output layer; Inputting the training key disease feature set into the feature fusion layer to generate a training fusion disease feature vector; Inputting the training fusion disease feature vector into the multi-scale spatial feature extraction unit to generate a training multi-scale disease feature map set; Performing feature normalization processing on the training multi-scale disease feature map set to generate a training standardized multi-scale feature representation; Inputting the training standardized multi-scale feature representation into the time series analysis unit, generating training lesion feature evolution parameters in combination with time interval information of continuous acquisition periods, and generating training diffusion trend prediction data based on the training lesion feature evolution parameters; Inputting the training standardized multi-scale feature representation into the classification output layer to generate a training pest and disease type identifier; Calculating the cross entropy loss value between the training pest and disease type identifier and the true pest and disease type label, and calculating the smoothed L1 loss value between the training diffusion trend prediction data and the diffusion trend true label; According to the difference in error magnitude between the classification task and the regression task, dynamic weight coefficients are assigned to the cross entropy loss value and the smoothed L1 loss value to generate a balanced joint optimization objective function, and the back propagation algorithm is used to optimize the weight parameters until convergence to generate a pre-trained pest and disease recognition model.

9. An agricultural pest and disease early warning system based on big data, characterized by: It includes a processor and a memory, the memory is connected to the processor, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the agricultural pest and disease early warning method based on big data as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Green plant disease identification and early warning management system and method

    CN120126003A

  • Rice disease and pest identification method and system based on machine vision technology

    CN120219861A