Agricultural pest early warning method and system based on big data
By obtaining crop leaf images from farmland image big data, segmenting and disease feature extraction, and combining pre-training models to detect pests and diseases, the time-consuming and labor-intensive and insufficient prediction problems of traditional pest monitoring is solved, and accurate and intelligent pest warning is achieved, and the efficiency and output of agricultural production is improved.
Patent Information
- Application Number
- CN202510839444.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-23
AI Technical Summary
Traditional pest monitoring methods rely on manual inspections, which are time-consuming and labor-intensive and prone to missed detection or misjudgment. The existing systems based on image recognition technology lack the ability to monitor the dynamic changes of pests and diseases during crop growth, and it is difficult to accurately predict the spread trend of pests and diseases, and cannot meet the precise and intelligent management needs of modern agriculture.
By obtaining continuously collected crop leaf images from farmland image big data, leaf area segmentation and disease feature extraction are performed, abnormal state detection is performed using the pre-trained pest recognition model, pest type identification and diffusion trend prediction data are generated, and early warning instructions are generated based on geolocation information.
It has achieved comprehensive and dynamic monitoring and early warning of crop diseases and pests, can accurately identify pest types and predict their diffusion trends, provide timely and accurate prevention and control decision-making basis, reduce the impact of pests and diseases on crop growth, and improve crop yield and quality.
Smart Images

Figure CN120339853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural digitization, and more specifically, to a method and system for agricultural pest and disease early warning based on big data. Background Art
[0002] In the field of agricultural production, the monitoring and early warning of pests and diseases have always been the key links to ensure the healthy growth of crops, improve the yield and quality of agricultural products. Traditional methods for monitoring pests and diseases mainly rely on manual inspections, which are not only time-consuming and labor-intensive, but also prone to missed detections or misjudgments of pests and diseases due to human factors such as lack of experience and incomplete observations, thus delaying the prevention and control time and causing immeasurable economic losses. With the rapid development of information technology, although there have been some pest and disease monitoring systems based on image recognition technology, these systems are often limited to the image analysis at a single time point, lack the ability to continuously monitor the dynamic changes of pests and diseases during the growth process of crops, are difficult to accurately predict the spread trend of pests and diseases, and cannot meet the management needs of modern agriculture for precision and intelligence. Summary of the Invention
[0003] In view of the above-mentioned problems, in combination with the first aspect of the present invention, embodiments of the present invention provide a method for agricultural pest and disease early warning based on big data, and the method includes: Obtain a set of crop leaf images of a target farmland area from big data of farmland images, where the set of crop leaf images includes multiple time-segment leaf image units with position marking information collected continuously; Perform leaf area segmentation processing on the set of crop leaf images to obtain healthy area images and potential lesion area images in each leaf image unit; Perform disease feature extraction processing on the potential lesion area images to generate a key disease feature set including texture abnormal distribution features and color variation features; Call a pre-trained pest and disease recognition model to perform abnormal state detection processing on the key disease feature set, and generate pest and disease type identification and spread trend prediction data corresponding to the leaf image unit; Generate a pest and disease early warning instruction including geographic location information based on the pest and disease type identification and spread trend prediction data, and send the pest and disease early warning instruction to the farmland management system to trigger a prevention and control response operation.
[0004] In another aspect, embodiments of the present invention further provide an agricultural pest and disease early warning system, including a processor and a machine-readable storage medium, 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.
[0005] Based on the above aspects, the embodiments of the present invention comprehensively utilize technical means such as large - data collection of farmland images, precise segmentation of leaf areas, deep extraction of disease characteristics, and prediction of pest and disease recognition models to achieve all - round and dynamic monitoring and early warning of crop pests and diseases. It can not only efficiently extract key disease characteristics from a large number of farmland images, but also accurately identify the types of pests and diseases and predict their spread trends. Moreover, by combining pest and disease early warning with geographical location information, warning instructions with clear directivity are generated, providing a timely and accurate basis for prevention and control decisions for the farmland management system. 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 the yield and quality of agricultural crops. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 It is a schematic flowchart of the execution process of the agricultural pest and disease early warning method based on big data provided by the embodiments of the present invention.
[0007] Figure 2 It is a schematic diagram of exemplary hardware and software components of the agricultural pest and disease early warning system based on big data provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0008] The present invention will be specifically described below in conjunction with the accompanying drawings of the specification. Figure 1 It is a schematic flowchart of the 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 will be introduced in detail below.
[0009] Step S110: Obtain a set of crop leaf images of the target farmland area from the big data of farmland images, where the set of crop leaf images includes multi - period leaf image units with position - marking information collected continuously.
[0010] In this embodiment, the big data of farmland images is usually stored in a large data center and comes from image - collecting devices distributed in various corners of the farmland. For example, multiple high - definition cameras can be installed in the farmland, which can capture images of the entire farmland area at preset time intervals. Additionally, drones can be used to regularly inspect and photograph the farmland to obtain image data from different angles and heights. The image data collected by these devices is transmitted to the data center for storage and management in real - time or regularly.
[0011] For the determination of the target farmland area, it can rely on Geographic Information System (GIS). For example, by inputting the boundary coordinates of the farmland, the information on the division of the planting area, etc., the scope of the target farmland can be accurately defined. When screening the crop leaf images of the target farmland area from a large amount of big data of farmland images, first, a preliminary screening is carried out according to the geographical location tags of the crop leaf images, and the crop leaf images whose geographical locations match the target farmland area are selected. Then, considering that crop growth is a continuous process and continuous crop leaf images need to be obtained, the crop leaf images continuously collected within a set time period are further screened according to the timestamp information of the crop leaf images. Moreover, each crop leaf image is marked with position information, which is achieved through the built-in GPS module of the image acquisition device or other positioning technologies, and this position marking information can be accurate to the specific position of the image acquisition point in the farmland. After the above screening and processing, a set of crop leaf images is obtained, and each leaf image unit corresponds to the image information of the crop leaves in the target farmland area at a specific time period.
[0012] Step S120: Perform leaf area segmentation processing on the set of crop leaf images to obtain the healthy area image and the potential lesion area image in each leaf image unit.
[0013] After obtaining the set of crop leaf images, leaf area segmentation processing needs to be carried out, the purpose of which is to accurately separate the leaves from the complex background and further distinguish the healthy area and the potential lesion area in the leaves.
[0014] Step S121: Perform background noise filtering processing on the leaf image unit to eliminate the soil background and light interference pixels and generate a pure leaf main body image.
[0015] In the actual farmland environment, the leaf image unit will be interfered by various factors, among which the soil background and light changes are relatively common interference sources. The color and texture of the soil background are significantly different from those of the leaves, which will interfere with the segmentation of the leaf area; and the uneven distribution of light will cause some areas in the image to be too bright or too dark, affecting the clarity of the image and the accuracy of feature extraction.
[0016] To eliminate the soil background, the color features of the image can be utilized. In the RGB color space, the color of the soil usually has a specific range, while the color of the leaves is different. By setting appropriate color thresholds, each pixel in the image is judged. If the RGB value of a certain pixel falls within the threshold range of the soil color, it is marked as a soil background pixel. Then, morphological operations are used to remove these marked pixels. Morphological operations include erosion and dilation. Erosion can shrink the boundaries of objects and remove small noise points; dilation can expand the boundaries of objects and fill small holes inside the objects. By alternately using erosion and dilation operations multiple times, the soil background can be effectively removed while retaining the main part of the leaves.
[0017] To eliminate the light interference pixels, methods such as histogram equalization or adaptive histogram equalization can be adopted. 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 are remapped so that the overall brightness of the image is more balanced. Adaptive histogram equalization is to perform histogram equalization in local areas, which can better handle the situation of uneven illumination in the image. The image is divided into multiple small blocks, and histogram equalization is performed on each small block separately, and then the processed small blocks are merged into a complete image through 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.
[0018] Step S122: Perform edge contour detection processing on the pure leaf main body image, extract the main vein branch structure features of the leaf, and generate a leaf skeleton topology map according to the main vein branch structure features.
[0019] After obtaining the pure leaf main body image, in order to analyze the structural features of the leaf more deeply, edge contour detection processing is required to extract the main vein branch structure features of the leaf.
[0020] Step S1221: Perform adaptive threshold segmentation processing on the pure leaf main body image to generate a binary leaf contour image.
[0021] Adaptive threshold segmentation is a segmentation method that determines the threshold based on the gray - level features of local regions in an image. Since there may be differences in illumination and gray - level distribution in different regions of the leaf image, using a global threshold may not achieve an ideal segmentation effect. Adaptive threshold segmentation divides the image into multiple small blocks, calculates statistical quantities such as the gray - level mean or median for each small block respectively, and then determines the threshold for that small block based on these statistical quantities. For each pixel in the pure leaf body image, its gray - level value is compared with the threshold of the small block where it is located. If the gray - level 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 body image can be converted into a binary image, in which the contour of the leaf is clearly highlighted, generating a binary leaf contour image.
[0022] Step S1222: Perform morphological thinning processing on the binary leaf contour image, iteratively removing edge redundant points pixel by pixel until a single - pixel - width main vein skeleton image is generated.
[0023] The purpose of morphological thinning processing is to thin the leaf contour in the binary leaf contour image into a single - pixel - width skeleton. In the binary image, the leaf contour may have a certain width and contain many redundant pixel points. Through morphological thinning processing, these redundant points can be gradually removed, leaving only the central skeleton of the leaf. This processing process is carried out iteratively pixel by pixel. For each pixel in the image, it is judged whether it can be removed based on the states of its neighboring pixels. The specific judgment rules are based on a series of morphological operations and logical conditions, such as judging whether the pixel is a boundary pixel and the connection situation of its neighboring pixels. After multiple iterations until no more pixel points can be removed, a single - pixel - width main vein skeleton image is generated, which clearly shows the trend and structure of the leaf main vein.
[0024] Step S1223: Identify the node intersection positions in the main vein skeleton image, mark the coordinates of the main vein nodes and branch nodes, and generate the leaf main vein branch structure features.
[0025] After obtaining the single - pixel - width main vein skeleton image, it is necessary to identify the node intersection positions in it. The node intersection positions are the key positions of the leaf main vein branches, including main vein nodes and branch nodes. Main vein nodes are usually located at important turning points or connection points of the main vein, while branch nodes are the positions where branches start on the main vein.
[0026] To identify these nodes, each pixel in the main vein skeleton image is traversed to check the connection of its neighboring pixels. If a pixel is connected to pixels in multiple directions around it, then this pixel is likely to be a node. For the identified nodes, their coordinate positions 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, and the main vein branch structure feature of the leaf can accurately describe the branching situation and structural morphology of the main vein of the leaf.
[0027] Step S1224: Calculate the skeleton path length parameter and path bending angle parameter between adjacent nodes in the main vein branch structure feature of the leaf, and generate a leaf skeleton topology graph including node connection relationships.
[0028] After obtaining the main vein branch structure feature of the leaf, the skeleton path length parameter and path bending angle parameter between adjacent nodes are further calculated. For the calculation of the skeleton path length parameter between adjacent nodes, it can be 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 of single-pixel width, the number of pixels can approximately represent the length of the path.
[0029] For the calculation of the path bending angle parameter, it can be determined by analyzing the direction change of the path between adjacent nodes. For example, the angle change between adjacent pixels on the path can be calculated, and then statistical processing such as accumulation or averaging of these angle changes is performed to obtain the bending angle parameter of this path.
[0030] Based on the calculated skeleton path length parameter, path bending angle parameter, and the coordinate information of the nodes, a leaf skeleton topology graph including node connection relationships can be constructed. In this leaf skeleton topology graph, the nodes represent the main vein nodes and branch nodes, the edges represent the connection paths between adjacent nodes, and each edge has attribute information such as path length and bending angle. This graph can comprehensively display the branching structure and topological relationship of the main vein of the leaf.
[0031] Step S1225: Divide the leaf area unit according to the leaf skeleton topology graph, and mark the enclosed area surrounded by adjacent nodes as an independent growth unit.
[0032] 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 main vein of the leaf, the closed area surrounded by adjacent nodes can be regarded as an 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 features of the unit, such as area, perimeter, etc., are recorded. Through such division, the leaf can be analyzed and processed more carefully.
[0033] 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.
[0034] After obtaining the leaf skeleton topology map, the initial healthy region mask image is generated by region growing segmentation. Region growing segmentation is an image segmentation method based on pixel similarity, which starts from the seed point and gradually merges adjacent pixels with similar features into the same region.
[0035] For each independent growth unit in the leaf skeleton topology map, one or more seed points are selected. The selection of seed points can be based on the characteristics of the image, for example, pixels with uniform color and moderate brightness are selected as seed points. Then, for each adjacent pixel unit of the seed point, the color similarity parameter between the adjacent pixel unit and the seed point is calculated. The color similarity parameter can be calculated by comparing the color values of the pixels in the RGB color space or other color spaces, for example, 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, it is considered that the adjacent pixel unit has similar color characteristics with the seed point and is merged into the current growth area. Then, based on the newly merged pixel unit, its adjacent pixel units are continuously checked, and the above-mentioned comparison and merging process is repeated until no more pixel units can be merged. By performing such a regional growth segmentation process on each independent growth unit, the leaf can be divided into different regions, in which regions with similar colors are merged together. Finally, the pixels marked as healthy areas generate an initial healthy area mask image, which can be used for subsequent processing and analysis.
[0036] Step S124: performing hole filling processing on the initial healthy area mask image, repairing the incomplete leaf boundary, and generating a complete leaf area image.
[0037] The initial healthy region mask image may have some holes and incomplete boundaries, which are caused by noise, light changes during image acquisition, or damage to the leaves themselves. To obtain a complete leaf region image, hole filling processing needs to be performed on the initial healthy region mask image.
[0038] Hole filling processing can use the dilation and filling algorithms in morphological operations. First, perform a dilation operation on the initial healthy region mask image. The dilation operation will expand the boundaries of the objects in the image and fill some small holes. Then, use a filling algorithm based on connected region analysis. For each hole in the image, find its boundary pixels and label the pixels inside the hole as the same region as the boundary pixels. Through such processing, the holes in the image can be effectively filled and the incomplete boundaries of the leaves can be repaired. Finally, a complete leaf region image is generated, and this complete leaf region image accurately shows the complete region of the leaf.
[0039] Step S125: Calculate the color histogram distribution curve of the complete leaf region image, detect the abnormal pixel clustering regions that exceed the normal color distribution range, label the abnormal pixel clustering regions as potential lesion region images, and label the remaining regions as healthy region images.
[0040] For the complete leaf region image, calculate its color histogram distribution curve. The color histogram is a statistical representation of the color distribution in the complete leaf region image, which reflects the number of pixels of different colors in the complete leaf region image. In the RGB color space, the color histogram distribution curves of the R, G, and B channels can be calculated separately.
[0041] Through the analysis of a large number of healthy leaf images, the normal color distribution range can be determined. For each pixel in the complete leaf region image, compare its color value with the normal color distribution range. If the color value of a certain pixel exceeds the normal color distribution range, then mark this pixel as an abnormal pixel. Then, through the clustering analysis algorithm, cluster the adjacent abnormal pixels together to form abnormal pixel clustering regions. These abnormal pixel clustering regions are very likely to be the regions where the leaves are diseased, and label them as potential lesion region images. And the remaining pixel regions within the normal color distribution range are labeled as healthy region images. Through such processing, the complete leaf region image can be accurately divided into a healthy region image and a potential lesion region image.
[0042] Step S130: Perform disease feature extraction processing on the potential lesion region image to generate a key disease feature set containing texture abnormal distribution features and color variation features.
[0043] After obtaining the potential lesion area image, it is necessary to perform disease feature extraction processing on it to generate a key disease feature set containing texture abnormal distribution features and color variation features. These features are of great significance for accurately identifying the types and severity of pests and diseases.
[0044] Step S131: Perform multi-scale filtering processing on the potential lesion area image, and use filter kernels of different sizes to extract the local texture response map of the lesion area.
[0045] The multi-scale filtering processing is to extract the texture information of the potential lesion area image at different scales. Filter kernels of different sizes can capture texture features of different sizes. For the potential lesion area image, a series of filter kernels of different sizes are used for convolution operations. For example, Gaussian filters or Laplacian filters of sizes such as 3×3, 5×5, 7×7, etc. can be used.
[0046] For each filter kernel, convolve it with the potential lesion area image to obtain a response map, which reflects the texture features of the image at this scale. By performing convolution with filter kernels of different sizes, multiple local texture response maps at different scales can be obtained, and these local texture response maps contain the texture information of the lesion area at different scales.
[0047] Step S132: Calculate the gray-level co-occurrence matrix parameters of the local texture response map, and extract the contrast change gradient and energy distribution dispersion of the gray-level co-occurrence matrix parameters as texture abnormal distribution features.
[0048] After obtaining the local texture response map, calculate its gray-level co-occurrence matrix parameters. The gray-level co-occurrence matrix is a statistical matrix used to describe the texture of an image, which reflects the spatial distribution relationship of pixel pairs with different gray levels in the image. For each pixel in the local texture response map, statistically analyze the gray-level combinations with adjacent pixels in different directions and distances to construct the gray-level co-occurrence matrix.
[0049] Extract the contrast change gradient and energy distribution dispersion from the gray-level co-occurrence matrix as texture abnormal distribution features. The contrast change gradient reflects the change degree of the image texture, which can be obtained by calculating the differences between different elements in the gray-level co-occurrence matrix. The energy distribution dispersion reflects the uniformity degree of the image texture, which can be obtained by calculating the dispersion degree 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 gradient and energy distribution dispersion values are obtained. The above contrast change gradient and energy distribution dispersion values constitute the texture abnormal distribution features, which can effectively describe the texture abnormality of the lesion area.
[0050] Step S133: Perform color space conversion processing on the potential lesion area image to generate independent color component images including a hue channel image and a saturation channel image.
[0051] To more accurately analyze the color characteristics of the potential lesion area image, color space conversion processing is performed on it. In the RGB color space, the representation of color is greatly affected by brightness, which is not conducive to accurately analyzing color changes. Therefore, the potential lesion area image is converted from the RGB color space to the HSV (hue, saturation, value) color space.
[0052] In the HSV color space, the hue channel image reflects the type of color, and the saturation channel image reflects the vividness of the color. Through color space conversion processing, the potential lesion area image is decomposed into a hue channel image and a saturation channel image to generate independent color component images. These independent color component images can more clearly display the color characteristics of the potential lesion area image.
[0053] Step S134: Analyze the color difference distribution map between the hue channel image and the standard healthy leaf hue reference image, and calculate the mean offset of the color difference distribution map as the color variation feature.
[0054] After obtaining the hue channel image, it is compared with the standard healthy leaf hue reference image. The standard healthy leaf hue reference image is obtained by analyzing and statistically processing the hue channels of a large number of healthy leaf images, and it represents the hue characteristics of normal leaves.
[0055] For each pixel in the hue channel image, its hue value is compared with the hue value at the corresponding position in the standard healthy leaf hue reference image to calculate the color difference. By statistically processing the color differences of all pixels, a color difference distribution map is generated. This map reflects the difference distribution of the potential lesion area image and the standard healthy leaf in terms of hue.
[0056] Calculate the mean offset of the color difference distribution map, that is, the average value of all color differences. This mean offset reflects the overall offset degree of the potential lesion area image in terms of hue relative to the standard healthy leaf, and it is used as the color variation feature. Through such analysis, the color variation of the potential lesion area image can be accurately captured.
[0057] Step S135: Standardize the texture abnormal distribution feature and the color variation feature to generate a set of key disease features with the same scale representation.
[0058] Since the value ranges and dimensions of the texture abnormal distribution feature and the color variation feature may be different, in order to facilitate subsequent processing and analysis, they need to be standardized. Standardization can convert different features to the same scale, making them comparable.
[0059] For each eigenvalue in the texture abnormal distribution feature and the color variation feature, a standardization algorithm such as Z-score standardization is adopted. For each eigenvalue, its mean and standard deviation are first calculated, then the eigenvalue is subtracted by the mean and divided by the standard deviation to obtain the standardized eigenvalue. By standardizing all the eigenvalues in the texture abnormal distribution feature and the color variation feature, a set of key disease features with the same scale representation is generated. This set of key disease features contains the standardized values of the texture abnormal distribution feature and the color variation feature, and can more accurately reflect the disease features of the potential lesion area.
[0060] Step S140: Invoke the pre-trained pest and disease identification model to perform abnormal state detection processing on the set of key disease features, and generate the pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit.
[0061] After generating the set of key disease features, invoke the pre-trained pest and disease identification model to perform abnormal state detection processing on it, so as to generate the pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit. The pre-trained pest and disease identification model is trained through a large amount of historical data and has high accuracy and reliability.
[0062] Step S141: Input the set of key disease features into the feature fusion layer of the pest and disease identification model, and perform weighted combination processing on the texture abnormal distribution feature and the color variation feature to generate a fused disease feature vector.
[0063] In the pest and disease identification model, the feature fusion layer undertakes the important task of integrating different types of disease features. The set of key disease features contains the texture abnormal distribution feature and the color variation feature, and these two types of features reflect the situation of potential leaf lesions from different angles. In order to make full use of these feature information, it is necessary to perform weighted combination processing on them.
[0064] For the texture abnormal distribution features and color variation features, different weights will be assigned to them respectively. The determination of these weights is based on a large number of experiments and data analyses to ensure that the contributions of the two types of features to the final result can be reasonably balanced. For example, assume that the texture abnormal distribution feature is represented by the letter A, the color variation feature is represented by the letter B, the weight assigned to the texture abnormal distribution feature is α, the weight assigned to the color variation feature is β, and α + β = 1. When performing weighted combination, for each eigenvalue in the texture abnormal distribution feature, multiply it by the weight α; for each eigenvalue in the color variation feature, multiply it by the weight β. Then, splice the texture abnormal distribution feature and color variation feature after weighted processing. These two types of features represent different information dimensions, and splicing can better retain their respective feature information. After such processing, a fused disease feature vector is generated, and this fused disease feature vector synthesizes the disease feature information in terms of both texture and color.
[0065] Step S142: Perform a multi-scale spatial feature extraction operation on the fused disease feature vector, and use convolution kernels of different sizes to perform parallel extraction processing on the local lesion texture features and global context features of the fused disease feature vector to generate a multi-scale disease feature map set.
[0066] After obtaining the fused disease feature vector, it is necessary to further extract the multi-scale spatial features therein. The multi-scale spatial features can capture the feature information of leaf lesions at different scales, which helps to more accurately identify pests and diseases.
[0067] Use convolution kernels of different sizes to perform convolution operations on the fused disease feature vector. Convolution kernels of different sizes have different receptive fields and can extract feature information of different sizes. For example, small-sized convolution kernels can focus on extracting local lesion texture features, such as the subtle texture changes in the lesion area; large-sized convolution kernels can capture more extensive global context features, such as the relationship between the lesion area and the surrounding leaf tissues, etc.
[0068] For each size of convolution kernel, perform sliding convolution on the fused disease feature vector. During the convolution process, the convolution kernel will perform weighted summation on the local area in the fused disease feature vector to obtain a new eigenvalue. By sliding over the entire fused disease feature vector, a feature map corresponding to the size of the convolution kernel can be obtained. For convolution kernels of different sizes, repeat the above convolution operation, and finally generate multiple feature maps of different scales. These feature maps together constitute a multi-scale disease feature map set, and this multi-scale disease feature map set contains rich feature information of leaf lesions at different scales.
[0069] Step S143: Perform feature normalization on the multi-scale disease feature mapping set to generate a standardized multi-scale feature representation.
[0070] Different feature mappings in the multi-scale disease feature mapping set may have different value ranges and dimensions, which can affect the subsequent model training and analysis effects. Therefore, it is necessary to perform feature normalization on it.
[0071] The purpose of feature normalization is to convert all feature values in the multi-scale disease feature mapping set to the same scale, making them comparable. Standardization algorithms such as Z-score normalization can be used. For each feature value in the multi-scale disease feature mapping set, first calculate the mean and standard deviation of the feature mapping where the feature value is located. Assume that the feature values in a certain feature mapping are represented by the letter C, its mean is represented by μ, and the standard deviation is represented by σ. For each element in the feature value C, subtract the mean μ from it and then divide by the standard deviation σ, that is, (C - μ) / σ, to obtain the standardized feature value. By performing such standardization processing on all feature values in the multi-scale disease feature mapping set, a standardized multi-scale feature representation is generated, and this standardized representation can eliminate the scale differences between different feature mappings.
[0072] Step S144: Input the standardized multi-scale feature representation into the time series analysis unit of the pest and disease identification model, and combine the time interval information of consecutive acquisition periods to calculate the change trajectory of the regional feature vector of the diseased area in the leaf image unit, and generate a lesion feature evolution parameter.
[0073] After obtaining the standardized multi-scale feature representation, input it into the time series analysis unit of the pest and disease identification model. The main role of this time series analysis unit is to analyze the changes of the diseased area in different periods by combining the time interval information of consecutive acquisition periods.
[0074] Since crop leaf images are continuously acquired, each leaf image unit corresponds to a specific period. The time interval information of consecutive acquisition periods reflects the time span between two adjacent periods. For the standardized multi-scale feature representation, the time series analysis unit will process it according to the time order.
[0075] First, extract the regional feature vectors related to the diseased area from the standardized multi-scale feature representation. For each leaf image unit in each period, there is a corresponding regional feature vector. Then, analyze the changes of these regional feature vectors in different periods and calculate their change trajectories. For example, by comparing the differences between the regional feature vectors of two adjacent periods, the feature changes of the diseased area during this period can be determined.
[0076] Generate lesion feature evolution parameters according to the change trajectory of the regional feature vector. These parameters may include the area change rate of the lesion area, the shape change rate, the change trend of the eigenvalue, etc. By analyzing the lesion feature evolution parameters, the development trend of the lesion area can be understood.
[0077] Step S145: Perform diffusion trend modeling processing based on the lesion feature evolution parameters, calculate the predicted value of the area change rate of the lesion area and the predicted value of the displacement direction angle of the lesion center point, and generate diffusion trend prediction data.
[0078] After obtaining the lesion feature evolution parameters, it is necessary to perform diffusion trend modeling processing based on these parameters to predict the diffusion trend of the pests and diseases.
[0079] Step S1451: Obtain the set of change trajectories of the regional feature vectors in consecutive time periods corresponding to the lesion feature evolution parameters.
[0080] The lesion feature evolution parameters contain the change information of the lesion area in different time periods. By further analyzing these parameters, the set of change trajectories of the regional feature vectors in consecutive time periods can be obtained. This set of change trajectories of the regional feature vectors records the change of the feature vectors of the lesion area in multiple consecutive time periods.
[0081] Step S1452: Perform time series analysis processing on the set of change trajectories of the regional feature vectors, and extract the sequence of area values of the lesion area in consecutive time periods.
[0082] Perform time series analysis on the set of change trajectories of the regional feature vectors, focusing on the change of the area of the lesion area. Extract the information related to the area of the lesion area from the set of change trajectories of the regional feature vectors, and arrange them in chronological order to form the sequence of area values of the lesion area in consecutive time periods. This sequence of area values reflects the change trend of the area of the lesion area over time.
[0083] Step S1453: Calculate the area change amount between adjacent time periods based on the sequence of area values, and combine the time interval information of the consecutive acquisition time periods to generate the area change gradient value per unit time as the predicted value of the area change rate of the lesion area.
[0084] For the sequence of area values of the lesion area in consecutive time periods, calculate the change in area between two adjacent time periods. Assume that the lesion area in the previous time period is S1 and the lesion area in the next time period is S2. Then the change in area between adjacent time periods is S2 - S1. Combining the time interval information of consecutive acquisition time periods, assuming the time interval is Δt, divide the change in area between adjacent time periods by the time interval, i.e., (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 predicted value of the lesion area change rate, reflecting the growth or shrinkage rate of the lesion area over time.
[0085] Step S1454: Extract the sequence of lesion center point coordinates from the set of region feature vector change trajectories, and perform displacement vector calculation processing on the sequence of lesion center point coordinates to generate displacement vectors for adjacent time periods.
[0086] Extract the coordinate information of the lesion center point from the set of region feature vector change trajectories and arrange it in chronological order to form a sequence of lesion center point coordinates. For the coordinates of the lesion center point in two adjacent time periods, calculate the displacement vector between them. Assume 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). Then the displacement vector is (x2 - x1, y2 - y1). Through such calculations, displacement vectors for adjacent time periods are obtained, and these vectors reflect the movement of the lesion center point in different time periods.
[0087] Step S1455: Calculate the average displacement angle deviation value based on the displacement vectors for adjacent time periods to generate a predicted value of the displacement direction angle of the lesion center point.
[0088] For the displacement vectors of adjacent time periods, calculate their angles. Assume the displacement vector is (x, y), then its angle can be calculated by the arctangent function, i.e., arctan(y / x). For the angles of the displacement vectors of multiple adjacent time periods, calculate their average displacement angle deviation value. Through the analysis and processing of these angle deviation values, a predicted value of the displacement direction angle of the lesion center point is generated, and this predicted value of the displacement direction angle of the lesion center point reflects the possible future movement direction of the lesion center point.
[0089] Step S1456: Integrate the predicted value of the lesion area change rate and the predicted value of the displacement direction angle of the lesion center point to generate diffusion trend prediction data, and the diffusion trend prediction data is used to describe the spatial expansion dynamic characteristics of the pests and diseases in the leaf image unit.
[0090] Fuse the predicted value of the rate of change of the lesion area and the predicted value of the displacement direction angle of the lesion center point to generate diffusion trend prediction data. This diffusion trend prediction data combines the change in the lesion area and the movement direction information of the lesion center point, and can comprehensively describe the spatial expansion dynamic characteristics of pests and diseases in the leaf image unit. By analyzing the diffusion trend prediction data, the diffusion range and direction of pests and diseases can be predicted in advance.
[0091] 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 types 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.
[0092] Input the standardized multi-scale feature representation into the classification output layer of the pest and disease recognition model. The classification output layer is usually composed of a fully connected network, and each neuron in the fully connected network is connected to all neurons in the previous layer.
[0093] In the fully connected network, the standardized multi-scale feature representation is used as the input, and is processed through a series of linear transformations and non-linear activation functions. The linear transformation multiplies the input features by the weight matrix in the network and adds a bias term; the non-linear activation function is used to introduce non-linear factors and increase the expression ability of the network. Through such processing, the probability distribution of the leaf image unit corresponding to different pest and disease types is calculated.
[0094] For each possible pest and disease type, there is a corresponding probability value. Select the maximum value from these probability values, and the pest and disease category corresponding to this maximum value is the pest and disease type identifier, which clarifies the possible pest and disease types in the leaf image unit.
[0095] Step S147: Output the pest and disease type identifier and the diffusion trend prediction data.
[0096] After completing the identification of the pest and disease type and the prediction of the diffusion trend, output the pest and disease type identifier and the diffusion trend prediction data, which can provide accurate information for the farmland management system to take corresponding prevention and control measures in a timely manner.
[0097] Step S150: Generate a pest and disease warning instruction containing geolocation information based on the pest and disease type identifier and the diffusion trend prediction data, and send the pest and disease warning instruction to the farmland management system to trigger a prevention and control response operation.
[0098] After obtaining the pest and disease type identifier and the diffusion trend prediction data, it is necessary to generate a pest and disease warning instruction containing geolocation information based on these data to timely notify the farmland management system to take prevention and control measures.
[0099] Step S151: Analyze the preset prevention and control rule library corresponding to the pest and disease type identifier, and extract the associated prevention and control measure codes and response level identifiers.
[0100] The preset prevention and control rule library is a database that stores prevention and control rules and measures for different pest and disease types. When the pest and disease type identifier is obtained, it will be searched and matched in the preset prevention and control rule library. Each record in the preset prevention and control rule library is associated with a specific pest and disease type and contains the corresponding prevention and control measure codes and response level identifiers. The prevention and control measure codes represent the specific prevention and control methods recommended for this pest and disease type, such as using a certain specific pesticide, adopting biological control means, or performing physical isolation, etc. The response level identifier indicates the severity of the pest and disease and the urgency of taking prevention and control measures. Different response levels correspond to different prevention and control intensities and response time requirements. By analyzing the preset prevention and control rule library, find the record that matches the pest and disease type identifier, and extract the associated prevention and control measure codes and response level identifiers from it.
[0101] Step S152: According to the regional expansion direction vector in the diffusion trend prediction data, calculate the azimuth angle parameter of the center point of the diseased area relative to the leaf base point.
[0102] The regional expansion direction vector in the diffusion trend prediction data describes the expansion direction of the diseased area in space. The leaf base point can be the petiole position of the leaf or other pre-set representative reference points. Taking the leaf base point as the origin, establish a plane rectangular coordinate system. For the regional expansion direction vector, it has a certain coordinate representation in this coordinate system, denoted as (x, y).
[0103] According to the principle of trigonometric functions, calculate the azimuth angle parameter θ of the center point of the diseased area relative to the leaf base point. The azimuth angle parameter θ can be calculated by the arctangent 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 arctangent value needs to be adjusted accordingly. Through such calculations, the azimuth angle parameter of the center point of the diseased area relative to the leaf base point is obtained, and this parameter can accurately reflect the positional relationship between the expansion direction of the diseased area and the leaf.
[0104] Step S153: Combine the position marking information and convert the azimuth angle parameter into a diffusion direction vector in the farmland geographic coordinate system.
[0105] The position marking information records the specific position of the leaf image unit in the farmland geographic coordinate system, usually represented in the form of coordinates. Let the coordinates of the leaf image unit in the farmland geographic coordinate system be (X_0, Y_0).
[0106] The azimuth angle parameter θ of the center point of the diseased area relative to the leaf base point has been obtained. To convert it into the diffusion direction vector in the farmland geographic coordinate system, the actual position and direction of the leaf in the farmland need to be considered. First, according to the azimuth angle parameter θ and the position (X_0, Y_0) of the leaf in the farmland, calculate the offset in the farmland geographic coordinate system. Let the length of the diffusion direction vector be L (which can be determined according to information such as the change rate of the diseased area in the diffusion trend prediction data), then the offset in the x direction in the farmland geographic coordinate system is ΔX = L * cos(θ), and the offset in the y direction is ΔY = L * sin(θ).
[0107] Add the offset to the coordinates of the leaf image unit to obtain the predicted position (X_1, Y_1) of the center point of the diseased area in the farmland geographic coordinate system, where X_1 = X_0 + ΔX and Y_1 = Y_0 + ΔY. Taking the coordinates (X_0, Y_0) of the leaf image unit as the starting point and the predicted position (X_1, Y_1) as the ending point, the formed vector is the diffusion direction vector in the farmland geographic coordinate system, and this diffusion direction vector accurately indicates the diffusion direction of pests and diseases in the farmland.
[0108] Step S154: Extract the coverage range characteristics of the diseased area in the current leaf image unit, and map them to the actual farmland area calculation model to generate an estimated affected area value.
[0109] In the current leaf image unit, the diseased area has certain coverage range characteristics, which can include information such as the shape and boundary coordinates of the diseased area. Through image processing and analysis techniques, extract the coverage range characteristics of the diseased area from the leaf image unit.
[0110] The actual farmland area calculation model is a mathematical model established based on the leaf image characteristics and the actual situation of the farmland. This model takes into account factors such as the scale of image acquisition and the distribution density of leaves in the farmland. First, according to the scale of image acquisition, convert the size of the diseased area in the image into the actual physical size. For example, if the scale of image acquisition is 1:k and the area of the diseased area in the image is S_image, then its actual area S_actual = S_image * k^2.
[0111] Meanwhile, consider the distribution density of leaves in the farmland, that is, the number of leaves per unit area of farmland. Let the leaf distribution density be ρ and the number of leaves covered by the diseased area be n. Then the estimated affected area value A = n / ρ * S_actual. Through such mapping and calculation, the coverage range characteristics of the diseased area in the leaf image unit are converted into the estimated affected area value in the actual farmland, and this estimated affected area value can reflect the actual area size that the pests and diseases may affect in the farmland.
[0112] Step S155: Integrate the prevention and control measure code, response level identifier, diffusion direction vector, and estimated affected area value to generate a pest and disease warning instruction containing the vertices of the geographical coordinate polygon.
[0113] Integrate the prevention and control measure code, response level identifier, diffusion direction vector, and estimated affected area value to generate a pest and disease warning instruction containing the vertices of the geographical coordinate polygon. First, the prevention and control measure code clarifies the specific prevention and control methods to be taken for this pest and disease, the response level identifier determines the urgency and intensity of prevention and control, the diffusion direction vector indicates the diffusion direction of the pest and disease, and the estimated affected area value reflects the possible affected range.
[0114] Based on the position of the center point of the diseased area in the farmland geographical coordinate system, combined with the diffusion direction vector and the estimated affected area value, determine the area range that the pest and disease may affect. Through a series of geometric calculations and spatial analyses, determine the boundary of this area and convert the key points on the boundary into geographical coordinates, and these geographical coordinates form the vertices of the geographical coordinate polygon.
[0115] Integrate the prevention and control measure code, response level identifier with the geographical coordinate polygon vertex information to form a complete pest and disease warning instruction. This instruction not only contains important information such as prevention and control measures and response levels, but also clarifies the specific area range that the pest and disease may affect through the vertices of the geographical coordinate polygon, enabling the farmland management system to accurately understand the situation of the pest and disease and take corresponding prevention and control measures.
[0116] Step S156: Send the pest and disease warning instruction to the farmland management system to trigger a prevention and control response operation.
[0117] After generating the pest and disease warning instruction, it will be sent to the farmland management system through the data transmission network.
[0118] After receiving the pest and disease warning instruction, the farmland management system will parse and process the instruction. According to the prevention and control measure code in the instruction, the corresponding prevention and control equipment and resources will be called. For example, if the prevention and control measure code indicates that a certain pesticide needs to be sprayed, the farmland management system will control the pesticide spraying equipment to perform the pesticide spraying operation according to the preset parameters and scope. At the same time, according to the response level identifier, the urgency and response time of the prevention and control operation will be determined. If the response level is high, the prevention and control operation will be started immediately; if the response level is low, the prevention and control operation will be arranged within the set time range. In this way, the prevention and control response operation of the farmland management system is triggered to effectively respond to the threat of pests and diseases in a timely manner and protect the healthy growth of farmland crops.
[0119] Step S210: Obtain a historical farmland leaf image training sample set, where the historical farmland leaf image training sample set includes multi-period leaf image units with real labels of pest and disease types and real labels of diffusion trends.
[0120] 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 acquisition and recording of farmland leaves over a past period of time.
[0121] Through the image acquisition devices distributed in the farmland, the farmland leaves are photographed at regular time intervals, accumulating a large amount of image data. For each image, detailed annotations are made, including real labels of pest and disease types and real labels of diffusion trends. The real label of the pest and disease type clarifies the type of pest and disease infecting the leaves in the image, and the real label of the diffusion trend records the diffusion situation of the pest and disease at different time periods, such as the diffusion direction and diffusion speed. These annotation information are obtained through manual annotation by professional agricultural experts or strictly trained personnel to ensure their accuracy and reliability. These annotated multi-period leaf image units are combined together to form the historical farmland leaf image training sample set.
[0122] Step S220: Perform preprocessing operations on the historical farmland leaf image training sample set, execute leaf area segmentation processing to obtain a healthy area image and a potential lesion area image, and perform disease feature extraction processing on the potential lesion area image to generate a training key disease feature set.
[0123] Performing preprocessing operations on the historical farmland leaf image training sample set is to improve the effect of model training. The preprocessing operations include leaf area segmentation processing and disease feature extraction processing.
[0124] First, perform leaf area segmentation on each leaf image unit in the historical farmland leaf image training set. The processing procedure is similar to steps S121 - S125, that is, first perform background noise filtering to eliminate soil background and light interference pixels, and generate a pure leaf main body image; then perform edge contour detection to extract the main vein branch structure features of the leaf and generate a leaf skeleton topology map; then perform region growing segmentation based on the leaf skeleton topology map to generate an initial healthy area mask image; then perform hole filling on the initial healthy area mask image to generate a complete leaf area image; finally, calculate the color histogram distribution curve of the complete leaf area image, detect abnormal pixel clustering areas, mark them as potential lesion area images, and mark the remaining areas as healthy area images.
[0125] For the obtained potential lesion area images, perform disease feature extraction. The processing procedure is similar to steps S131 - S135, that is, perform multi - scale filtering on the potential lesion area images to extract texture abnormal distribution features; perform color space conversion to extract color variation features; and standardize the texture abnormal distribution features and color variation features to generate a training key disease feature set, which contains the key disease feature information of the potential lesion areas in the historical farmland leaf images.
[0126] Step S230: Initialize the pest and disease recognition model network structure, where the pest and disease recognition model network structure includes a feature fusion layer, a multi - scale spatial feature extraction unit, a temporal analysis unit, and a classification output layer.
[0127] Before model training, it is necessary to initialize the network structure of the pest and disease recognition model. The pest and disease recognition model is mainly composed of a feature fusion layer, a multi - scale spatial feature extraction unit, a temporal analysis unit, and a classification output layer.
[0128] The role of the feature fusion layer is to perform weighted combination processing on different types of input disease features to generate a fused disease feature vector. It receives the key disease feature set as input and effectively integrates the texture abnormal distribution features and color variation features therein.
[0129] The multi - scale spatial feature extraction unit uses convolution kernels of different sizes to perform convolution operations on the fused disease feature vector, extracts local lesion texture features and global context features, and generates a multi - scale disease feature map set. This multi - scale spatial feature extraction unit can capture information about disease features at different scales and improve the model's feature extraction ability.
[0130] The timing analysis unit combines the time interval information of consecutive acquisition periods, processes the normalized multi-scale feature representation, calculates the change trajectory of the regional feature vector of the lesion area, and generates lesion feature evolution parameters, which are mainly used to analyze the changes of diseases in the time dimension.
[0131] The classification output layer calculates the probability distribution of the leaf image unit corresponding to different pest and disease types through a fully connected network, and selects the pest and disease category corresponding to the maximum probability as the pest and disease type identifier. The output result of this layer is used to determine the possible pest and disease types in the leaf image.
[0132] Step S240: Input the training key disease feature set into the feature fusion layer to generate a training fused disease feature vector.
[0133] After inputting the training key disease feature set into the feature fusion layer, the feature fusion layer processes the set according to a preset weight allocation rule. Let the texture abnormal distribution feature be set A, the color variation feature be set B, the weight assigned to set A be α, the weight assigned to set B be β, and the sum of α and β is 1. For each feature element a_i in set A (i represents the index of the element in the set), multiply it by the weight α to get α*a_i; for each feature element b_j in set B (j represents the index of the element in the set), multiply it by the weight β to get β*b_j. Then, perform a concatenation operation on the weighted sets A and B. When concatenating, arrange them in the order of feature elements to form a new vector, which is the training fused disease feature vector. For example, if set A has m elements and set B has n elements, then the training fused disease feature vector contains m + n elements, which combines the disease feature information of both texture and color.
[0134] Step S250: Input the training fused disease feature vector into the multi-scale spatial feature extraction unit to generate a training multi-scale disease feature mapping set.
[0135] After the training fusion disease feature vector is input into the multi-scale spatial feature extraction unit, the multi-scale spatial feature extraction unit will perform convolution operations on it using convolution kernels of different sizes. Suppose k different sizes of convolution kernels are used, denoted as C_1, C_2, …, C_k respectively. For each convolution kernel C_l (l = 1, 2, …, k), it has a set size and parameters. During the convolution process, the convolution kernel C_l slides on the training fusion disease feature vector. Each time it slides, it will perform a weighted sum on the feature elements within the local area it covers. Specifically, let the training fusion disease feature vector be V, the feature elements within the local area covered by the convolution kernel C_l at a certain position be v_p (p represents the index of the element within the local area), and the parameter corresponding to the position of the convolution kernel C_l be c_lp. Then the convolution result at this position is the sum of the products of these v_p and c_lp. As the convolution kernel continuously slides on the training fusion disease feature vector, a series of convolution results will be obtained. Arranging these results in order forms a feature map M_l corresponding to the convolution kernel C_l. Performing such convolution operations on all k convolution kernels will finally result in k feature maps M_1, M_2, …, M_k, and these feature maps together constitute the training multi-scale disease feature map set. Convolution kernels of different sizes can capture the feature information of the training fusion disease feature vector at different scales. Small-sized convolution kernels can focus on local subtle features, while large-sized convolution kernels can obtain more macroscopic context features.
[0136] Step S260: Perform feature normalization on the training multi-scale disease feature map set to generate a training standardized multi-scale feature representation.
[0137] To make the feature maps in the training multi-scale disease feature map set comparable, it is necessary to perform feature normalization on them. For each feature map M_l (l = 1, 2, …, k) in the training multi-scale disease feature map set, first calculate its mean μ_l and standard deviation σ_l. For each element m_lq (q represents the index of the element in the feature map) in the feature map M_l, subtract its mean μ_l and then divide by the standard deviation σ_l, that is, (m_lq - μ_l) / σ_l, to obtain the normalized element. Performing such processing on all elements in the feature map M_l results in a normalized feature map M_l'. After performing normalization processing on 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, and these normalized feature maps together constitute the training standardized multi-scale feature representation. Through feature normalization processing, the influence caused by different value ranges and measurement units between different feature maps can be eliminated, enabling the model to learn feature information more stably and effectively during subsequent training.
[0138] Step S270: Input the trained standardized multi-scale feature representation into the time series analysis unit, combine the time interval information of consecutive acquisition periods, generate trained lesion feature evolution parameters, and generate trained diffusion trend prediction data based on the trained lesion feature evolution parameters.
[0139] After inputting the trained standardized multi-scale feature representation into the time series analysis unit, the time series analysis unit will analyze the change of the lesion area over time by combining the time interval information of consecutive acquisition periods. The time interval information of consecutive acquisition periods reflects the time span between two adjacent acquisition periods, denoted as Δt.
[0140] The time series analysis unit first extracts the region feature vectors related to the lesion area from the trained standardized multi-scale feature representation. For each period of the trained standardized multi-scale feature representation, there is a corresponding region feature vector. Arrange these region feature vectors in chronological order to form a region feature vector sequence. By analyzing the difference between the region feature vectors of two adjacent periods, the feature change of the lesion area during this period can be determined. For example, let the region feature vectors of two adjacent periods be R_t and R_t+1 respectively, and calculate their difference ΔR = R_t+1 - R_t. According to these differences and the time interval Δt, the feature change rate of the lesion area can be calculated.
[0141] Based on this feature change information, generate trained lesion feature evolution parameters. These parameters can include the area change rate of the lesion area, the shape change rate, the change trend of eigenvalues, etc. For example, for the area change rate of the lesion area, by comparing the area sizes of the lesion area in different periods, calculating the change amount of the area in adjacent periods, and then dividing by the time interval Δt.
[0142] According to the trained lesion feature evolution parameters, further generate trained diffusion trend prediction data. The specific process is as follows: First, obtain the set of region feature vector change trajectories of consecutive periods corresponding to the lesion feature evolution parameters. Perform time series analysis on this set, and extract the area value sequence of the lesion area in consecutive periods. Calculate the area change amount in adjacent periods based on this area value sequence, and combine the time interval Δt to generate the area change gradient value per unit time as the predicted value of the area change rate of the lesion area. At the same time, extract the sequence of lesion center point coordinates in the set of region feature vector change trajectories, perform displacement vector calculation processing on it, and generate the displacement vectors of adjacent periods. Calculate the average displacement angle deviation value based on these displacement vectors to generate the predicted value of the displacement direction angle of the lesion center point. Finally, fuse the predicted value of the area change rate of the lesion area and the predicted value of the displacement direction angle of the lesion center point to form the trained diffusion trend prediction data, which describes the diffusion trend of pests and diseases in the training data.
[0143] Step S280: Input the trained standardized multi-scale feature representation into the classification output layer to generate a trained pest and disease type identifier.
[0144] After the trained standardized multi-scale feature representation is input into the classification output layer, the fully connected network of the classification output layer processes it. The fully connected network consists of multiple neurons, and each neuron is connected to all neurons in the previous layer. The trained standardized multi-scale feature representation is used as the input and undergoes a series of linear transformations and non-linear activation function processing in the fully connected network. The linear transformation multiplies the input features by the weight matrix in the network and then adds the bias term; the non-linear activation function is used to introduce non-linearity and increase the expression ability of the network. Through such processing, the probability distribution of the trained leaf image unit corresponding to different pest and disease types is calculated. Suppose there are s possible pest and disease types, denoted as T_1, T_2, …, T_s respectively. After the calculation of the fully connected network, the probability values P_1, P_2, …, P_s corresponding to each pest and disease type are obtained. The maximum value is selected from these probability values. Suppose the maximum value is P_max, and the corresponding pest and disease type T_max is the trained pest and disease type identifier, which clarifies the possible pest and disease types in the trained leaf image unit.
[0145] Step S290: Calculate the cross-entropy loss value between the trained pest and disease type identifier and the true label of the pest and disease type, and calculate the smooth L1 loss value between the trained diffusion trend prediction data and the true label of the diffusion trend.
[0146] When calculating the cross-entropy loss value between the trained pest and disease type identifier and the true label of the pest and disease type, let the true label of the pest and disease type be a one-hot vector Y, where only the element corresponding to the true pest and disease type is 1, and the rest of the elements are 0. The probability distribution corresponding to the trained pest and disease type identifier is vector P. The calculation method of the cross-entropy loss function is to process each corresponding element of vector Y and vector P. For the element y_i in vector Y and the element p_i in vector P, calculate -y_i * log(p_i), and then add the calculation results of all elements to obtain the cross-entropy loss value L_c. The cross-entropy loss value measures the difference degree between the probability distribution of the trained pest and disease type and the true label. The smaller the loss value, the more accurate the model's prediction of the pest and disease type.
[0147] When calculating the smooth L1 loss value between the predicted data of the training diffusion trend and the true label of the diffusion trend, let the predicted data of the training diffusion trend be vector D_p and the true label of the diffusion trend be vector D_t. The smooth L1 loss function is a loss function improved on the basis of the L1 loss function. It uses the squared loss when the error is small and the linear loss when the error is large. For each corresponding element d_pi and d_ti in vector D_p and vector D_t, calculate their difference e_i = d_pi - d_ti. According to the absolute value of e_i, different calculation methods are adopted. When |e_i| is less than a certain threshold, the loss value is 0.5 * e_i^2; when |e_i| is greater than or equal to the threshold, the loss value is |e_i| - 0.5 * threshold^2. Add up the loss values of all elements to obtain the smooth L1 loss value L_s. The smooth L1 loss value measures the degree of difference between the predicted data of the diffusion trend obtained by training and the true label. The smaller the loss value, the more accurate the model's prediction of the pest and disease diffusion trend.
[0148] Step S2100: According to the difference in the error magnitudes of the classification task and the regression task, assign dynamic weight coefficients to the cross-entropy loss value and the smooth L1 loss value, generate a balanced joint optimization objective function, and use the backpropagation algorithm to optimize the weight parameters until convergence to generate a pre-trained pest and disease identification model.
[0149] Since the error magnitudes of the classification task (determining the type of pest and disease) and the regression task (predicting the pest and disease diffusion trend) may be different, it is necessary to assign dynamic weight coefficients to the cross-entropy loss value L_c and the smooth L1 loss value L_s. Let the weight coefficient assigned to the cross-entropy loss value be γ, and the weight coefficient assigned to the smooth L1 loss value be δ, and γ + δ = 1. The determination of these weight coefficients needs to be achieved through a large number of experiments and tuning to ensure that the influence of the classification task and the regression task on model training can be reasonably balanced.
[0150] Multiply the cross-entropy loss value L_c and the smooth L1 loss value L_s by their corresponding weight coefficients respectively, and then add them up to obtain the balanced joint optimization objective function L = γ * L_c + δ * L_s. This joint optimization objective function comprehensively considers the loss situations of the classification task and the regression task. The goal of model training is to make the value of this objective function as small as possible.
[0151] The backpropagation algorithm is used to optimize the weight parameters of the model. The backpropagation algorithm is an optimization algorithm based on gradient descent. It starts from the output layer, propagates the error of the loss function backward to each layer of the model, and calculates the gradient of the weight parameters of each layer. According to these gradients, the weight parameters are updated. Specifically, for each weight parameter w in the model, according to its gradient ∇L / ∇w and the learning rate η, the weight parameter is updated to w' = w - η * ∇L / ∇w. This process is repeated continuously 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 indicates that the weight parameters of the model have been adjusted to a relatively optimal state, and at this time, the pre-trained pest and disease identification model is generated.
[0152] Figure 2 FIG. shows a schematic diagram of exemplary hardware and software components of a big data-based agricultural pest and disease early warning system 100 that can implement the idea of the present application provided by some embodiments of the present application. For example, the processor 120 can be used on the big data-based agricultural pest and disease early warning system 100 and is used to execute the functions in the present application.
[0153] The big data-based agricultural pest and disease early warning system 100 can be a general-purpose server or a special-purpose server, both of which can be used to implement the big data-based agricultural pest and disease early warning method of the present application. Although only one server is shown in the present application, for convenience, the functions described in the present application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0154] For example, the big data-based agricultural pest and disease early warning system 100 can include a network port 110 connected to the network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as disks, ROM, or RAM, or any combination thereof. Exemplarily, the big data-based agricultural pest and disease early warning system 100 can also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. According to these program instructions, the method of the present application can be implemented. The big data-based agricultural pest and disease early warning system 100 also includes an I / O interface 150 between the computer and other input and output devices.
[0155] For ease of explanation, only one processor is described in the big data-based agricultural pest and disease early warning system 100. However, it should be noted that the big data-based agricultural pest and disease early warning system 100 in this application may also include multiple processors. Therefore, the steps performed by one processor described in this application can also be jointly performed or separately performed by multiple processors. For example, if the processor of the big data-based agricultural pest and disease early warning system 100 performs step A and step B, it should be understood that step A and step B can also be jointly performed by two different processors or separately performed in one processor. For example, the first processor performs step A, the second processor performs step B, or the first processor and the second processor jointly perform steps A and B.
[0156] In addition, an embodiment of the present invention further provides a readable storage medium, in which computer-executable instructions are preset. When the processor executes the computer-executable instructions, the above-described big data-based agricultural pest and disease early warning method is implemented.
[0157] It should be noted that, in order to simplify the expression of the disclosure of the present invention and thus help the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, sometimes multiple features are merged into one embodiment, drawing, or description thereof.
Claims
1. An agricultural pest and disease early warning method 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 collected multi-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 abnormal 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 and disease feature set, and generating pest and disease type identification and diffusion trend prediction data corresponding to the leaf image unit; A pest and disease warning instruction containing geographic positioning information is generated based on the pest and disease type identification and spread trend prediction data, and the pest and disease warning instruction is sent to the farmland management system to trigger a prevention and control response operation.
2. The agricultural pest and disease early warning method based on big data according to claim 1, 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, and generating a pure leaf main body image; Performing edge contour detection processing on the pure leaf main body image, extracting the main vein branch structure characteristics of the leaf, and generating a leaf skeleton topology map according to the main vein branch structure characteristics; 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; Performing hole filling processing on the initial healthy area mask image, repairing the incomplete leaf boundary, and generating a complete leaf area image; The color histogram distribution curve of the complete leaf area image is calculated, and the abnormal pixel clustering area beyond the normal color distribution range is detected, and the abnormal pixel clustering area is marked as a potential lesion area image, and the remaining area is marked as a healthy area image.
3. The agricultural pest and disease early warning method based on big data according to claim 2, wherein The step of 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; Identify the node intersection position 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; Calculating the skeleton path length parameters and path bending angle parameters between adjacent nodes in the main vein branch structure characteristics of the leaf, and generating a blade skeleton topological structure diagram including node connection relationships; The leaf region units are divided according to the leaf skeleton topological structure diagram, and the closed areas surrounded by adjacent nodes are marked as independent growth units.
4. The agricultural pest and disease early warning method based on big data according to claim 1, wherein The disease feature extraction process is performed on the potential lesion area image to generate a key disease feature set including texture abnormal distribution features and color variation features, including: Perform multi-scale filtering on the image of the potential lesion area, and use filter kernels of different sizes to extract the local texture response map of the lesion area; Calculate the gray-level co-occurrence matrix parameters of the local texture response map, and extract the contrast change gradient and energy distribution dispersion of the gray-level co-occurrence matrix parameters as texture abnormal distribution features; Perform color space conversion on the image of the potential lesion area to generate an independent color component image including a hue channel image and a saturation channel image; Analyze the color difference distribution map between the hue channel image and the hue reference image of the standard healthy leaf, and calculate the mean offset of the color difference distribution map as the color variation feature; Normalize the texture abnormal distribution feature and the color variation feature to generate a set of key disease features with the same scale representation.
5. The agricultural pest and disease early warning method based on big data according to claim 4, wherein, The analyzing the color difference distribution map between the hue channel image and the hue reference image of the standard healthy leaf, and calculating the mean offset of the color difference distribution map as the color variation feature includes: Obtain the set of hue values of each pixel point in the hue channel image and the set of reference hue values of the corresponding area of the standard healthy leaf hue reference image; Perform color difference calculation processing on each pixel point to generate the absolute value of the color difference between the hue value corresponding to the pixel point and the reference hue value matching the position of the pixel point, and obtain the color difference distribution map of the potential lesion area image; Perform statistical feature extraction processing on the color difference distribution map, and calculate the color difference mean parameter and color difference distribution dispersion parameter of the color difference distribution map; Compare the color difference mean parameter with the preset color difference reference mean of the healthy leaf to generate the first color variation component; Compare the color difference distribution dispersion parameter with the preset color difference distribution dispersion threshold of the healthy leaf to generate the second color variation component; Perform spatial clustering analysis on the color difference distribution map to identify continuous pixel regions where the color difference abnormal values exceed the preset threshold, and calculate the proportion parameter of the continuous pixel regions in the total area of the potential lesion area image to generate the third color variation component; Fuse the first color variation component, the second color variation component and the third color variation component to generate a multi-dimensional color variation feature set, and the multi-dimensional color variation feature set includes the overall color difference offset, the color difference distribution dispersion degree and the local high color difference area aggregation degree index; The 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 abnormal distribution features includes: Construct a gray-level co-occurrence matrix in multiple directions of the local texture response map, and calculate the set of contrast parameters of the gray-level co-occurrence matrix in each direction; Perform direction weighted average processing on the set of contrast parameters to generate a comprehensive contrast change gradient value; Extract the set of energy parameters of the gray-level co-occurrence matrix in each direction, and calculate the standard deviation of the set of energy parameters as the energy distribution dispersion value; Compare the comprehensive contrast change gradient value with the contrast reference value of the standard healthy leaf to generate a relative contrast offset; Fuse the relative contrast offset and the energy distribution dispersion value to generate a texture abnormal distribution feature including multi-dimensional quantization indexes.
6. The agricultural pest and disease early warning method based on big data according to claim 1, characterized in that Invoking the pre-trained pest and disease identification model to perform abnormal state detection processing on the key disease feature set, and generating the pest and disease type identifier and diffusion trend prediction data corresponding to the leaf image unit, including: Inputting the key disease feature set into the feature fusion layer of the pest and disease identification model, performing weighted combination processing on the texture abnormal distribution feature and the color variation feature, and generating a fused disease feature vector; Performing multi-scale spatial feature extraction operations on the fused disease feature vector, and using convolution kernels of different sizes to perform parallel extraction processing on the local lesion texture feature and the global context feature of the fused disease feature vector, and generating a multi-scale disease feature map set; Performing feature normalization processing on the multi-scale disease feature map set, and generating a normalized multi-scale feature representation; Inputting the normalized multi-scale feature representation into the time series analysis unit of the pest and disease identification model, combining the time interval information of consecutive acquisition periods, calculating the change trajectory of the regional feature vector of the lesion area in the leaf image unit, and generating a lesion feature evolution parameter; Performing diffusion trend modeling processing based on the lesion feature evolution parameter, calculating the predicted value of the lesion area change rate and the predicted value of the displacement direction angle of the lesion center point, and generating diffusion trend prediction data; Inputting the normalized multi-scale feature representation into the classification output layer of the pest and disease identification model, calculating the pest and disease type probability distribution 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; Outputting the pest and disease type identifier and the diffusion trend prediction data.
7. The agricultural pest and disease early warning method based on big data according to claim 6, wherein Performing diffusion trend modeling processing based on the lesion feature evolution parameter, calculating the predicted value of the lesion area change rate and the predicted value of the displacement direction angle of the lesion center point, and generating diffusion trend prediction data, including: Obtaining the change trajectory set of the regional feature vector in consecutive periods corresponding to the lesion feature evolution parameter; Performing time series analysis processing on the change trajectory set of the regional feature vector, and extracting the area value sequence of the lesion area in consecutive periods; Calculating the area change amount in adjacent periods based on the area value sequence, and combining the time interval information of consecutive acquisition periods, and generating the area change gradient value per unit time as the predicted value of the lesion area change rate; Extracting the lesion center point coordinate sequence in the change trajectory set of the regional feature vector, and performing displacement vector calculation processing on the lesion center point coordinate sequence, and generating a displacement vector in adjacent periods; Calculating the average displacement angle deviation value based on the displacement vector in adjacent periods, and generating the predicted value of the displacement direction angle of the lesion center point; Fusing the predicted value of the lesion area change rate and the predicted value of the displacement direction angle of the lesion center point, and generating diffusion trend prediction data, where the diffusion trend prediction data is used to describe the spatial expansion dynamic characteristics of pests and diseases in the leaf image unit.
8. The agricultural pest and disease early warning method based on big data according to claim 1, characterized in that The method includes: Obtaining a historical farmland leaf image training sample set, where the historical farmland leaf image training sample set contains multi-period leaf image units with labeled true labels of pest and disease types and true labels of diffusion trends; Perform preprocessing operations on the historical farmland leaf image training sample set, perform leaf area segmentation processing to obtain healthy area images and potential lesion area images, and perform disease feature extraction processing on the potential lesion area images to generate a training key disease feature set; Initialize the pest and disease identification model network structure, which includes a feature fusion layer, a multi-scale spatial feature extraction unit, a time series analysis unit, and a classification output layer; Input the training key disease feature set into the feature fusion layer to generate a training fused disease feature vector; Input the training fused disease feature vector into the multi-scale spatial feature extraction unit to generate a training multi-scale disease feature mapping set; Perform feature normalization processing on the training multi-scale disease feature mapping set to generate a training standardized multi-scale feature representation; Input the training standardized multi-scale feature representation into the time series analysis unit, combine the time interval information of consecutive acquisition periods, generate training lesion feature evolution parameters, and generate training diffusion trend prediction data based on the training lesion feature evolution parameters; Input the training standardized multi-scale feature representation into the classification output layer to generate a training pest and disease type identifier; Calculate the cross-entropy loss value between the training pest and disease type identifier and the true label of the pest and disease type, and calculate the smooth L1 loss value between the training diffusion trend prediction data and the true diffusion trend label; According to the error magnitude difference between the classification task and the regression task, assign dynamic weight coefficients to the cross-entropy loss value and the smooth L1 loss value, generate a balanced joint optimization objective function, and use the backpropagation algorithm to optimize the weight parameters until convergence to generate a pre-trained pest and disease identification model.
9. The agricultural pest and disease early warning method based on big data according to claim 1, wherein The generation of a pest and disease warning instruction including geographic location information based on the pest and disease type identifier and the diffusion trend prediction data includes: Parse the preset prevention and control rule library corresponding to the pest and disease type identifier, and extract the associated prevention and control measure codes and response level identifiers; According to the regional expansion direction vector in the diffusion trend prediction data, calculate the azimuth angle parameter of the center point of the lesion area relative to the leaf base point; Combine the position marking information to convert the azimuth angle parameter into a diffusion direction vector in the farmland geographic coordinate system; Extract the coverage range feature of the lesion area in the current leaf image unit, and map it to an actual farmland area calculation model to generate an estimated affected area value; Fuse the prevention and control measure codes, response level identifiers, diffusion direction vectors, and estimated affected area values to generate a pest and disease warning instruction including the vertices of a geographic coordinate polygon.
10. An agricultural pest and disease early warning system based on big data, characterized in that, 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 big data-based agricultural pest and disease warning method described in any one of claims 1-9 above.
Citation Information
Patent Citations
Camellia oleifera pest model training method and recognition method based on image analysis
CN110544237A
Deep learning-based tree nematode disease identification method and apparatus, and electronic device
CN118072181A
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
Cited By
Pest and disease propagation path prediction method and system
CN120612646A
AI image recognition and grading method for field crop leaf diseases and insect pests
CN120807984A
Method and system for predicting diseases and insect pests of saline-alkaline tolerant rice based on artificial intelligence
CN120832495A
Crop insect pest intelligent identification and early warning system based on multi-mode large language model
CN120931968A
Deep learning-based plant insect disease image identification method and system
CN121190893A