Disease and pest epidemic prevention system based on image recognition
By combining optical and acoustic images with environmental information, the pest and disease prevention system utilizes self-attention and attention mechanisms for feature enhancement and segmentation, solving the subjectivity and environmental adaptability problems of traditional pest and disease monitoring methods, and achieving efficient and accurate pest and disease identification and early control.
Patent Information
- Application Number
- CN202511039465.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional pest and disease monitoring methods rely on manual identification, which is subject to strong subjectivity, high labor intensity, and poor identification results in complex natural environments, making it difficult to meet the needs of modern agriculture for efficient and real-time monitoring.
An image recognition-based pest and disease prevention system is adopted, which combines optical images, acoustic images and environmental information. It uses spatial self-attention mechanism and attention mechanism for feature enhancement and segmentation, and uses multilayer perceptron and neural network for pest and disease identification, so as to achieve multi-dimensional feature capture and accurate identification.
It improves the accuracy and robustness of pest and disease identification, enables real-time data collection and processing, and rapid output of identification results, providing timely pest and disease information for agricultural managers and supporting early detection and precise control.
Smart Images

Figure CN120976967A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a plant disease and pest prevention system based on image recognition. BACKGROUND
[0002] Crop disease and pest detection is an important direction in the field of machine vision with great research value and practical application significance. Traditional disease and pest monitoring methods mainly rely on insect experts or professional technicians for manual identification. Although this method can provide reliable judgment to some extent, it has obvious limitations. Manual identification is highly subjective and is easily affected by experience differences, fatigue levels and environmental conditions, resulting in unstable and inaccurate results. In addition, manual detection is extremely labor-intensive, especially in large areas of farmland or complex natural environments, where technicians need to spend a lot of time and effort to observe and record in the field, making it difficult to meet the needs of modern agriculture for efficient and real-time monitoring.
[0003] With the advancement of technology, machine vision devices with cameras and internet capabilities have gradually become popular, providing a new technical means for automatic monitoring of crop diseases and pests. The introduction of computer vision technology not only significantly improves monitoring efficiency, but also reduces reliance on manual experience, creating conditions for early detection and precise prevention and control of diseases and pests. However, in traditional machine vision-based disease and pest detection methods, traditional image processing algorithms or deep learning image processing algorithms are usually used, but these methods are difficult to achieve ideal recognition results in complex natural environments, especially in cases of light changes, weather influences and diversity of disease and pest characteristics, limiting their widespread application in actual agricultural production. SUMMARY
[0004] In view of this, the purpose of the present application is to provide a plant disease and pest prevention system based on image recognition. In the task of disease and pest detection, the present application captures multi-dimensional features to assist in identifying the type and severity of plant diseases and pests, overcoming the difficulty of achieving ideal image recognition results in complex natural environments, thereby providing strong support for early detection and precise prevention and control of plant diseases and pests.
[0005] To achieve the above-mentioned purpose of the application, the present application provides a plant disease and pest prevention system based on image recognition, which comprises:
[0006] A data acquisition and preprocessing module for acquiring optical images, acoustic images and environmental information of crops, and pre-processing the optical images, acoustic images and environmental information. After pre-processing, the optical images, acoustic images and environmental information are respectively subjected to feature extraction to obtain optical features, acoustic features and environmental features.
[0007] An image enhancement module is configured to process the sound wave features through a spatial self-attention mechanism, obtain a sound wave weight map, and enhance the optical features through the sound wave weight map to obtain an optical enhanced image.
[0008] An image segmentation module is configured to divide the optical enhanced image into regions to obtain an optical enhanced image with divided regions, introduce an attention mechanism to perform pixel-level segmentation on the optical enhanced image, and obtain a to-be-identified region map.
[0009] A pest and disease identification module is configured to encode the environmental features into an environmental weight vector through a multi-layer perception, learn a double mapping relationship between the to-be-identified region map and the environmental weight vector through a neural network, input a pre-trained pest and disease identification model, and output a pest and disease identification result map of the to-be-identified region.
[0010] Further, the optical image, the sound wave image, and the environmental information are respectively subjected to feature extraction, which specifically includes:
[0011] The sound wave image is subjected to feature extraction through a wavelet convolutional neural network, the sound wave image is decomposed into high-frequency components using a Haar wavelet, the high-frequency components are retained and further subjected to feature extraction through a CNN, and the extracted sound wave features are output;
[0012] The optical features are extracted through a deep convolutional neural network, and the optical features are output;
[0013] The environmental features are automatically learned from the environmental information through a convolutional neural network.
[0014] Further, the sound wave weight map of the sound wave features is extracted through a spatial self-attention mechanism, which specifically includes:
[0015] The sound wave features are processed through a depthwise separable convolution with different dilation rates to extract multi-scale features;
[0016] The spatial attention of the extracted multi-scale features is calculated to obtain the attention weight of each spatial position;
[0017] The sound wave features are point multiplied with the attention weight of each spatial position to obtain the sound wave weight map.
[0018] Further, the optical features are enhanced through the sound wave weight map, which specifically includes:
[0019] The resolution of the sound wave weight map is adjusted through an interpolation method with the resolution of the optical features as a target;
[0020] The sound wave weight map after the resolution processing is expanded from a single channel to a multi-channel map with the same number of channels as the optical feature map;
[0021] After feature point detection is performed on the sound wave weight map and the optical feature through a feature point detection algorithm, the feature points in the sound wave weight map and the feature points in the optical feature are matched through a feature matching algorithm;
[0022] Based on the matched feature points, a spatial transformation matrix of the sound wave weight map to the optical feature map is calculated, and the sound wave weight map is transformed into the same spatial coordinate system as the optical feature map;
[0023] The processed sound wave weight map and the optical feature map are multiplied element by element at the feature level, and normalized to obtain an optical enhancement image.
[0024] Further, the optical enhancement image is divided into regions, specifically including:
[0025] The optical enhancement image is processed through a saliency detection network to obtain a saliency map;
[0026] The pixel values in the saliency map are compared with a preset threshold, and the pixel points greater than the preset threshold are attributed to the disease and pest damage area, and the pixel points less than or equal to the preset threshold are attributed to the normal area;
[0027] Based on the pixel values, the disease and pest damage area and the normal area of the optical enhancement image are colorized to obtain the optical enhancement image.
[0028] Further, an attention mechanism is introduced to perform pixel-level segmentation on the optical enhancement image, specifically including:
[0029] A pre-trained convolutional neural network is used as an encoder to obtain high-level semantic features of the optical enhancement image through convolutional layers and pooling layers;
[0030] An attention module is added at the output end of the encoder, and after calculating the global average pooling of the encoder output to obtain the global features of each channel, two fully connected layers are used to generate channel attention weights, and the channel attention weights are multiplied element by element with the high-level semantic features to obtain an initial segmentation map;
[0031] An edge supervision mechanism is added in the decoder, and after the initial segmentation map is edge enhanced through the edge supervision mechanism, a to-be-recognized area map is output through the decoder.
[0032] Further, a dual mapping relationship between the to-be-recognized area map and the environmental weight vector is learned through a neural network, specifically including:
[0033] The flattened dimension of the to-be-recognized area map and the dimension of the environmental weight vector are added as the number of neurons in the input layer of the neural network;
[0034] According to the task requirements, multiple fully connected layers are designed in the middle layer, a nonlinear activation function is used for transformation, and the number of neurons in the output layer is set by a preset recognition category.
[0035] The environment weight vector is input into the neural network as a guide feature and a region map to be identified to automatically learn the mapping relationship between the region map to be identified and the environment weight vector.
[0036] Compared with the prior art, the present application has the following advantages:
[0037] The disease and pest prevention system based on image recognition provided by the present application can capture the characteristics of crop diseases and pests from multiple dimensions by combining optical images, acoustic images and environmental information. The image enhancement module processes the acoustic features through a spatial self-attention mechanism, generates an acoustic weight map, and enhances the optical features using the weight map to highlight the key features of the disease and pest area, thereby improving the identification accuracy of the subsequent disease and pest area. The image segmentation module performs pixel-level segmentation on the optical enhanced image by introducing an attention mechanism to accurately identify the boundaries and areas of diseases and pests and effectively solve the problem of low contrast between diseases and pests and the background. The disease and pest identification module encodes the environmental features into an environmental weight vector through a multilayer perceptron and learns the dual mapping relationship between the region map to be identified and the environmental weight vector in combination with a neural network, fully utilizes the influence of environmental information on the occurrence of diseases and pests, and further improves the accuracy and robustness of identification. The present application can collect and process data in real time, quickly output disease and pest identification results, and provide timely disease and pest information for agricultural managers. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0039] Figure 1 A structure schematic diagram of the disease and pest prevention system based on image recognition provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0040] The present application will be further described in detail below in combination with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that only the parts related to the present application are shown in the drawings for convenience of description, not all the structures.
[0041] Referring to Figure 1 , the present embodiment provides a disease and pest prevention system based on image recognition, which comprises:
[0042] The data acquisition and preprocessing module is used for acquiring optical images, acoustic images and environmental information of crops, and performing feature extraction on the optical images, acoustic images and environmental information after preprocessing the optical images, acoustic images and environmental information, to obtain optical features, acoustic features and environmental features.
[0043] In this embodiment, the data acquisition and preprocessing module is the basis of the entire pest detection system, and its core task is to acquire multi-modal data of crops, including optical images, acoustic images and environmental information, and to preprocess and extract features from these data, to provide high-quality input for subsequent pest identification.
[0044] Specifically, high-resolution cameras or multi-spectral cameras carried by unmanned aerial vehicles are used to acquire optical images of crops, which are used to capture visual features of pests, and the optical images include but are not limited to RGB images and near-infrared images. The sound wave sensor is directly attached to the plant surface or uses ultrasonic waves to capture weak acoustic signals inside or on the plant surface and convert them into acoustic images, which can capture acoustic features generated by pest activities. Environmental sensors are used to acquire environmental parameters of farmland to provide background support for the occurrence of pests, and the environmental parameters include but are not limited to light intensity, humidity and temperature.
[0045] The acquired data is preprocessed, Gaussian filtering or median filtering is used to remove noise in the optical image, histogram equalization or adaptive contrast enhancement is used to improve the contrast of the optical image, and the pest area is highlighted to assist the subsequent steps. Band-pass filtering is used to remove background noise of the acoustic signal and retain the acoustic features related to the pest, wavelet transform or short-time Fourier transform is used to extract key features of the acoustic signal to obtain the acoustic image. Remove outliers and noise in the environmental information to ensure the accuracy of the environmental information data, normalize the environmental information data to a unified numerical range for subsequent feature processing.
[0046] The optical image, acoustic image and environmental information are respectively subjected to feature extraction, which specifically includes:
[0047] Wavelet convolutional neural network is used to extract features from the acoustic image, Haar wavelet is used to decompose the acoustic image into high-frequency components, the high-frequency components are retained and further extracted by CNN to output the extracted acoustic features. Deep convolutional neural network is used to extract features from the optical image, and the optical features are output. Convolutional neural network is used to automatically learn the feature representation in the environmental information to generate the environmental features.
[0048] In this embodiment, the wave image is extracted by the wavelet convolutional neural network, which can enhance the feature representation of the wave image; the features of the optical image are extracted by the deep convolutional neural network, which can accurately extract the complex features in the optical image; and the feature representation in the environmental information is automatically learned by the convolutional neural network, which provides important background support for pest and disease identification, provides data support for subsequent image processing, and realizes comprehensive analysis and early warning of pests and diseases.
[0049] Specifically, the wave image is decomposed into high-frequency components and low-frequency components using the Haar wavelet, and the high-frequency components usually contain key features of the sound signals generated by pest and disease activities, such as high-frequency sound waves of insect wing vibration. The reserved high-frequency components are input into the CNN, and the features are further extracted through convolutional layers, pooling layers, and fully connected layers. The convolutional layer can automatically learn the local features in the wave image, the pooling layer can reduce the dimension of the features and enhance the robustness of the features, and the fully connected layer can integrate and classify the features.
[0050] The local features in the optical image, such as edges, textures, and shapes, are extracted through multiple convolutional operations. Each convolutional operation automatically learns different levels of feature representation, from simple edge features to complex semantic features. The pooling layer is inserted between the convolutional layers to reduce the dimension and abstract the features, while enhancing the robustness and generalization ability of the features. Finally, the extracted features are integrated and classified through the fully connected layer, and the optical features are output. The deep CNN can automatically learn the complex feature representation in the optical image, which can more accurately capture the visual features of pests and diseases compared to traditional image processing algorithms.
[0051] The environmental information, including light intensity, humidity, temperature, etc., is input into the convolutional neural network, and the feature representation in the environmental information is automatically learned through the convolutional layer and the fully connected layer. The convolutional layer can extract local features in the environmental information, and the fully connected layer can integrate and encode the features to generate environmental features, reflecting the influence of environmental conditions on the occurrence of pests and diseases, and providing important background information for pest and disease identification.
[0052] The image enhancement module is used to process the sound wave features through the spatial self-attention mechanism, obtain the sound wave weight map, and enhance the optical features through the sound wave weight map to obtain the optical enhanced image.
[0053] In this embodiment, the image enhancement module is a key link in the pest and disease detection system. The spatial self-attention mechanism is used to process the sound wave features, which improves the discrimination and robustness of the features. The optical features are enhanced using the sound wave weight map, and finally the pest and disease area is labeled through the neural network, which improves the accuracy of pest and disease detection. In addition, the real-time processing capability of this module can meet the demand of modern agriculture for efficient and accurate pest and disease monitoring.
[0054] The sound wave weight map of the sound wave feature is extracted through a spatial self-attention mechanism, specifically including:
[0055] The sound wave feature is processed through a depth separable convolution with a preset different expansion rate to extract multi-scale features. Specifically, multiple expansion rates are preset, such as expansion rates 1, 2, and 4. The expansion rate determines the pore size between the convolution kernels. A larger expansion rate can expand the receptive field and capture larger range features, thereby extracting multi-scale features. The sound wave feature is processed through a depth separable convolution with different expansion rates to extract feature maps containing different scale information and capture details of the sound wave feature at different spatial scales.
[0056] The extracted multi-scale features are subjected to spatial attention calculation to obtain the attention weight of each spatial position. Specifically, the extracted multi-scale feature maps are respectively mapped to query (Query), key (Key), and value (Value) spaces. The dot product attention score between the query feature map and the key feature map is calculated to obtain an attention matrix representing the correlation between different spatial positions. The attention matrix is normalized to generate the attention weight of each spatial position, reflecting the importance of each spatial position in the feature map.
[0057] The sound wave feature is multiplied by the attention weight of each spatial position to obtain a sound wave weight map. Specifically, the original sound wave feature map is multiplied by the generated attention weight map element by element to weight the sound wave feature. After the weighting operation, the sound wave weight map is generated, highlighting the key sound wave feature area related to pests and diseases while suppressing irrelevant or noise areas. The sound wave weight map provides a higher quality sound wave feature representation for subsequent steps, which helps to achieve efficient fusion of multi-modal information and further improves the comprehensive performance of pest and disease detection.
[0058] The optical feature is enhanced through the sound wave weight map, specifically including:
[0059] The resolution of the sound wave weight map is adjusted through interpolation method with the resolution of the optical feature as the target. Specifically, the resolution of the sound wave weight map is adjusted to the resolution of the optical feature through bilinear interpolation or nearest neighbor interpolation method. Figure 1 Therefore, the sound wave weight map and the optical feature map are aligned in spatial dimension to ensure that the subsequent feature fusion operation can be accurately performed. The optical feature is weighted through the sound wave weight map, which can highlight the area related to pests and diseases while suppressing background noise and other irrelevant features.
[0060] The sound wave weight map after completing the resolution processing is expanded from a single channel to a multi-channel map with the same number of channels as the optical feature map. Specifically, the weight value of the single channel is copied to other channels to ensure that the weight of each channel is consistent, so that the number of channels of the sound wave weight map is completely matched with the number of channels of the optical feature map for element-by-element operation.
[0061] After feature point detection is performed on the sound wave weight map and the optical feature by the feature point detection algorithm, the feature points in the sound wave weight map and the feature points in the optical feature are matched by the feature matching algorithm. Specifically, the feature points of the sound wave weight map and the optical feature are obtained by the feature point detection algorithm, and the feature points and descriptors of each image are obtained. The feature point detection algorithm includes but is not limited to SIFT, SURF, and ORB. The descriptors of the sound wave weight map and the optical feature map are matched by using the feature matching algorithm, and the corresponding feature points in the two images are found. In order to improve the accuracy of matching, the matching results can be screened, such as using a distance threshold or a scale test to screen out reliable matching point pairs. The feature matching algorithm includes but is not limited to brute-force matching and FLANN matching. The feature matching algorithm can handle a certain degree of illumination change, occlusion, and perspective change, and enhance the robustness of the model in complex natural environments. Through feature point detection and matching, the corresponding points in the sound wave weight map and the optical feature map can be accurately found, and the accuracy of matching can be improved.
[0062] Based on the matched feature points, a spatial transformation matrix of the sound wave weight map to the optical feature map is calculated, and the sound wave weight map is transformed into the same spatial coordinate system as the optical feature map. Specifically, the RANSAC algorithm is used to remove the mismatched points, and the transformation matrix is estimated by random sampling and model verification. The specific steps are as follows: 4 groups of matching point pairs that are not collinear are randomly selected, an initial transformation matrix is calculated, other matching points are substituted into the initial transformation matrix, errors are calculated and inliers are screened out, the above process is repeated until the optimal transformation matrix is found, and the inliers obtained by the RANSAC algorithm are used to calculate the final spatial transformation matrix by the least squares method. Through the spatial transformation matrix, the feature point coordinates of the sound wave weight map are transformed into the coordinate system of the optical feature map, and the sound wave weight map is interpolated and resampled according to the transformed coordinates to align it with the optical feature map.
[0063] The sound wave weight map and the optical feature map after completing the processing are multiplied element by element at the feature level, and normalized to obtain an optical enhancement image. Specifically, each pixel of the optical feature map is weighted according to the weight value of the sound wave weight map to highlight the region related to the sound wave feature. The normalized fused feature map enhances the stability and accuracy of subsequent processing, and finally obtains the optical enhancement image. The optical enhancement image highlights the region related to the sound wave feature on the basis of retaining the optical feature, and enhances the expression of the disease and pest feature.
[0064] In this embodiment, by applying the acoustic wave weight map to the enhancement of the optical feature, the system can comprehensively utilize the advantages of acoustic waves and optical features to improve the discrimination and robustness of the disease and pest feature.
[0065] The optical enhancement image is regionally divided, specifically including:
[0066] The optical enhancement image is processed by the saliency detection network to obtain a saliency map. Specifically, the saliency detection network is used to process the optical enhancement image to output a saliency map, where each pixel value represents the likelihood of the location belonging to the disease and pest area. The saliency detection network includes but is not limited to U-Net, MaskR-CNN or a custom convolutional neural network.
[0067] The pixel values in the saliency map are compared with a preset threshold, and the pixel points greater than the preset threshold are attributed to the disease and pest area, and the pixel points less than or equal to the preset threshold are attributed to the normal area. Specifically, a threshold is preset, such as setting the pixel threshold to 125, which is used to distinguish the disease and pest area from the normal area. Each pixel value in the saliency map is compared with the preset threshold. If the pixel value is greater than the threshold, the pixel is attributed to the disease and pest area; if the pixel value is less than or equal to the threshold, the pixel is attributed to the normal area.
[0068] The disease and pest area and the normal area of the optical enhancement image are colorized based on the pixel values to obtain an optical enhancement image. Specifically, the saliency map is colorized to mark the disease and pest area and the normal area with different colors. The disease and pest area is usually marked with red or other eye-catching colors, and the normal area can be marked with green or other colors. An optical enhancement image with color marking is generated to directly display the disease and pest area and the normal area. As another preferred embodiment, different types of diseases and pests can cause different degrees and types of damage to plants, thereby affecting the physiological state and appearance features of the plants. Different disease types can cause differences in pixel values of the disease and pest area because they exhibit differently in color, texture, etc. Therefore, based on the above analysis, different colorization expressions are given based on the differences in pixel values to provide a high-quality data basis for subsequent steps.
[0069] In this embodiment, the optical enhancement image is processed by the saliency detection network to generate a saliency map, and the disease and pest area is divided by comparing the pixel values with the threshold. Finally, an intuitive optical enhancement image is generated by colorization processing, which not only improves the accuracy and robustness of disease and pest detection, but also significantly improves the efficiency and reliability of disease and pest recognition through intuitive labeling results and efficient feature fusion, providing strong support for early detection and accurate prevention and control of diseases and pests.
[0070] An image segmentation module is configured to perform regional division on the optical enhancement image to obtain an optical enhancement image with divided regions, introduce an attention mechanism to perform pixel-level segmentation on the optical enhancement image, and obtain a to-be-identified region map.
[0071] In this embodiment, the identification accuracy of the pest and disease region is improved through accurate edge positioning and key region enhancement, the pixel-level segmentation provides detailed region information, and the detection accuracy is enhanced, and the adaptability and robustness of the model to complex environments are improved through the attention mechanism and feature fusion.
[0072] The attention mechanism is introduced to perform pixel-level segmentation on the optical enhancement image, and specifically includes:
[0073] A pre-trained convolutional neural network is used as an encoder to obtain high-level semantic features of the optical enhancement image through convolutional layers and pooling layers.
[0074] An attention module is added at the output end of the encoder, global average pooling of the encoder output is calculated to obtain global features of each channel, channel attention weights are generated through two fully connected layers, the channel attention weights are multiplied with the high-level semantic features element by element to obtain an initial segmentation map.
[0075] An edge supervision mechanism is added in the decoder, the initial segmentation map is subjected to edge enhancement through the edge supervision mechanism, and a to-be-identified region map is output through the decoder.
[0076] In this embodiment, the attention mechanism can highlight important features and suppress unimportant features to improve the discrimination and expression ability of the features, the edge supervision mechanism can enhance the edge information of the pest and disease region to improve the identification accuracy of the edge, and the combination of the attention mechanism and the edge supervision mechanism can improve the accuracy of the pixel-level segmentation and provide more accurate boundaries of the pest and disease region.
[0077] A pest and disease identification module is configured to encode environment features into an environment weight vector through a multi-layer perceptron, learn a double mapping relationship between the to-be-identified region map and the environment weight vector through a neural network, input a pre-trained pest and disease identification model, and output a pest and disease identification result map of the to-be-identified region.
[0078] In this embodiment, the pest and disease identification module encodes the environmental features into an environmental weight vector through a multi-layer perceptron, and learns the dual mapping relationship between the to-be-identified region graph and the environmental weight vector through a neural network to finally output a pest and disease identification result graph. The pest and disease identification result graph usually includes a labeled graph of a pest and disease region, a category label, a severity score, an environmental feature influence, a timestamp and location information, a prevention and control suggestion, and early warning information, etc. These output results not only help agricultural managers intuitively understand the distribution and severity of pests and diseases, but also provide scientific prevention and control suggestions and early warning information, providing strong support for early detection and precise prevention and control of pests and diseases.
[0079] The neural network learns the dual mapping relationship between the to-be-identified region graph and the environmental weight vector, specifically including:
[0080] The flattened dimension of the to-be-identified region graph is added to the dimension of the environmental weight vector as the number of input layer neurons of the neural network. Specifically, the to-be-identified region graph is flattened into a one-dimensional vector to calculate the dimension, such as HxWxC, where H is the height, W is the width, and C is the number of channels; the dimension of the environmental weight vector is obtained, such as D; the flattened dimension of the to-be-identified region graph and the dimension of the environmental weight vector are added to the number of input layer neurons, such as: HxWxC+D.
[0081] According to the task requirements, multiple fully connected layers are designed in the middle layer, a nonlinear activation function is used for transformation, and the number of neurons in the output layer is set according to the preset identification categories. Specifically, multiple fully connected layers are designed, each layer is followed by a ReLU activation function, for example, 3 hidden layers are set, and the number of neurons in each layer is gradually reduced, such as from 1024 to 512 to 256; batch normalization layers and Dropout layers are added between the hidden layers to accelerate training and improve the stability of the model, while preventing overfitting and improving the generalization ability of the model. The number of neurons in the output layer is set according to the number of preset identification categories, for example, if there are K pest and disease categories, the output layer has K neurons.
[0082] The environmental weight vector is input into the neural network as a guide feature together with the to-be-identified region graph to automatically learn the mapping relationship between the to-be-identified region graph and the environmental weight vector.
[0083] In this embodiment, the introduction of the environment weight vector makes the model have better adaptability to environmental changes and can maintain high recognition accuracy under different environmental conditions. By taking the to-be-recognized region map and the environment weight vector as the neural network input, the network is enabled to fully learn the multi-source information and more comprehensively describe the disease and pest status, wherein the image features provide visual information and the environmental features provide background information. The neural network can learn the dual mapping relationship between the image features and the environmental features, capture the complex feature representation of the disease and pests, and improve the recognition ability of the disease and pest recognition model. The input layer of the neural network usually requires a fixed-length one-dimensional vector, and flattening the two-dimensional to-be-recognized region map into a one-dimensional vector can meet this requirement, so that the image data can be processed by the neural network. The environment weight vector as one-dimensional data is convenient for splicing with the flattened image vector to form a fusion feature vector, providing more comprehensive input information for the disease and pest recognition model. In the fully connected layer, the processing of the one-dimensional vector is usually more efficient than that of the two-dimensional data, reducing the computational complexity to improve the training and inference speed. In the middle layer of the neural network, the two-dimensional structure of the one-dimensional vector can be restored by rearranging it, so that the subsequent convolutional layer or other processing modules can utilize these features for more detailed analysis. The restored two-dimensional feature map can be used to generate an attention map or other spatial feature map to assist the disease and pest recognition model in better understanding and processing image data.
[0084] The above merely describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A pest and disease prevention system based on image recognition, characterized in that, The system includes: The data acquisition and preprocessing module is used to acquire optical images, acoustic images, and environmental information of crops. After preprocessing the optical images, acoustic images, and environmental information, feature extraction is performed on the optical images, acoustic images, and environmental information to obtain optical features, acoustic features, and environmental features. The image enhancement module is used to process acoustic wave features through a spatial self-attention mechanism to obtain an acoustic wave weight map, and then enhance optical features through the acoustic wave weight map to obtain an optically enhanced image. The image segmentation module is used to divide the optically enhanced image into regions to obtain an optically enhanced image with divided regions. An attention mechanism is introduced to perform pixel-level segmentation of the optically enhanced image to obtain a region map to be identified. The pest and disease identification module is used to encode environmental features into environmental weight vectors through a multilayer perceptron. After learning the dual mapping relationship between the area to be identified and the environmental weight vector through a neural network, it is input into a pre-trained pest and disease identification model and outputs a pest and disease identification result map of the area to be identified.
2. The image recognition-based pest and disease control system according to claim 1, characterized in that, Feature extraction is performed on optical images, acoustic images, and environmental information, specifically including: Feature extraction of sound wave images is performed using wavelet convolutional neural networks. The sound wave images are decomposed into high-frequency components using Haar wavelets, and the high-frequency components are retained and further features are extracted using CNN. The extracted sound wave features are then output. The optical features are extracted from the optical image using a deep convolutional neural network and output as optical features. The convolutional neural network automatically learns the feature representations in the environmental information to generate environmental features.
3. The image recognition-based pest and disease control system according to claim 1, characterized in that, The acoustic wave weight map of acoustic wave features is extracted using a spatial self-attention mechanism, specifically including: By using depthwise separable convolutions with preset dilation rates, acoustic wave features are processed to extract multi-scale features. Spatial attention is calculated on the extracted multi-scale features to obtain the attention weight for each spatial location; The acoustic wave features are multiplied by the attention weights at each spatial location to obtain an acoustic wave weight map.
4. The image recognition-based pest and disease prevention system according to claim 1, characterized in that, Enhancing optical features through acoustic wave weighting maps specifically includes: The resolution of the acoustic weight map is adjusted by interpolation, with the resolution of optical features as the target. The acoustic weight map after resolution processing is expanded from a single channel to a multi-channel map with the same number of channels as the optical features; After feature point detection algorithms are used to detect feature points in the acoustic weight map and optical features respectively, feature matching algorithms are used to match feature points in the acoustic weight map and feature points in the optical features. Based on the matched feature points, the spatial transformation matrix from the acoustic weight map to the optical feature map is calculated, and the acoustic weight map is transformed to the same spatial coordinate system as the optical feature map. The processed acoustic weight map and optical feature map are multiplied element-wise at the feature level and then normalized to obtain the optically enhanced image.
5. The image recognition-based pest and disease control system according to claim 1, characterized in that, Region segmentation of optically enhanced images specifically includes: The optically enhanced image is processed using a saliency detection network to obtain a saliency map; The pixel values in the saliency map are compared with a preset threshold. Pixels with values greater than the preset threshold are classified as pest and disease areas, while pixels with values less than or equal to the preset threshold are classified as normal areas. The optically enhanced image is obtained by colorizing the diseased and normal areas of the optically enhanced image based on pixel values.
6. The image recognition-based pest and disease control system according to claim 1, characterized in that, An attention mechanism is introduced to perform pixel-level segmentation of optically enhanced images, specifically including: A pre-trained convolutional neural network is used as an encoder to obtain high-level semantic features of optically enhanced images through convolutional and pooling layers; An attention module is added to the output of the encoder. The global average pooling of the encoder output is calculated to obtain the global features of each channel. Then, channel attention weights are generated through two fully connected layers. The channel attention weights are multiplied element-wise with the high-level semantic features to obtain the initial segmentation map. An edge supervision mechanism is added to the decoder. After the initial segmentation map is enhanced by the edge supervision mechanism, the decoder outputs the region map to be identified.
7. The image recognition-based pest and disease control system according to claim 1, characterized in that, The neural network learns a dual mapping relationship between the region map to be identified and the environmental weight vector, specifically including: The flattened dimension of the region map to be identified plus the dimension of the environmental weight vector is used as the number of neurons in the input layer of the neural network. Based on the task requirements, multiple fully connected layers are designed in the intermediate layer, and non-linear activation functions are used for transformation. The number of neurons in the output layer is set by preset recognition categories. The environmental weight vector is used as a guiding feature and the region map to be identified is input into the neural network for training, which automatically learns the mapping relationship between the region map to be identified and the environmental weight vector.
Citation Information
Cited By
Tartary buckwheat pest and disease damage dynamic monitoring method, system, equipment and medium
CN121392762A
Unmanned aerial vehicle crop pest detection and prevention system and method based on deep learning
CN122090332A