Identification method for apple tree diseases and insect pests based on image identification

By using multi-stage image processing and deep learning models, automated, high-precision identification and quantitative assessment of apple tree diseases and pests have been achieved, solving the problems of low efficiency and misjudgment/missed detection in existing technologies, and improving identification accuracy and detection efficiency.

CN121789042APending Publication Date: 2026-04-03新疆理工学院
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Current technologies for identifying apple tree diseases and pests rely on manual visual inspection, which is inefficient, highly dependent on professional knowledge, and easily influenced by the observer's subjective experience, leading to misjudgments and omissions. This makes it difficult to meet the high-frequency, high-precision monitoring needs of modern orchards.

Method used

Employing a multi-stage, hierarchical image processing and deep learning model, this method achieves automated and high-precision identification of apple tree diseases and pests through target leaf instance segmentation, dual-path parallel multi-scale feature extraction, cross-level feature fusion, and classification. It also calculates the severity level of diseases by combining lesion salience maps.

Benefits of technology

It has achieved automated, high-precision identification and quantitative assessment of apple tree diseases and pests, improved detection efficiency, reduced reliance on professional knowledge, and enabled large-scale, low-cost orchard disease and pest surveys. The identification accuracy rate reached 92.7%, and the correlation coefficient between the severity assessment and expert visual inspection results was 0.89.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789042A_ABST
    Figure CN121789042A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses an apple tree disease and insect pest recognition method based on image recognition, and the method comprises the steps: obtaining and preprocessing an apple tree image; accurately extracting a single leaf mask through a target leaf instance segmentation model; respectively extracting global context features and local scab features of the leaves by using a double-path parallel multi-scale network; a fusion feature vector is generated through a cross-level fusion module; the classification and discrimination module outputs disease and pest categories; and quantifying the severity level of the disease in combination with a leaf mask and a scab significance map. According to the invention, through background separation, multi-scale feature fusion and an attention mechanism, high-precision, automatic and qualitative and quantitative combined intelligent diagnosis of diseases and insect pests is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence, specifically relating to a method for identifying apple tree diseases and pests based on image recognition. Background Technology

[0002] With the rapid development of smart agriculture and precision plant protection technologies, intelligent identification of fruit tree diseases and pests has become a key aspect of improving orchard management efficiency. Apples, as one of my country's major economic fruit trees, are susceptible to various diseases and pests during their growth. Failure to identify and intervene promptly and accurately can lead to reduced fruit yield, decreased quality, and even the death of the entire tree.

[0003] Traditional pest and disease diagnosis relies heavily on manual visual inspection by agricultural technicians or fruit growers. This method is not only time-consuming and labor-intensive with a slow response time, but also requires a high level of professional experience from practitioners. In practical applications, due to factors such as individual differences in experience, changes in environmental lighting, and similarities in lesion morphology, manual judgment is prone to missed detections and misjudgments, making it difficult to meet the needs of modern orchards for large-scale, high-frequency, and high-precision monitoring.

[0004] Automatic diagnosis technology for plant diseases and pests based on image recognition has received widespread attention in recent years. This technology collects visual images of organs such as leaves and fruits, and uses computer vision and machine learning algorithms to extract disease characteristics, thereby automatically classifying disease and pest types. Its core advantage lies in overcoming human limitations, enabling all-weather, non-contact, standardized, and rapid screening, providing data support for subsequent precise pesticide application and green pest control.

[0005] In existing technologies, most image recognition methods use general convolutional neural networks for end-to-end training, but they face multiple challenges in the apple tree disease and pest recognition scenario: field images are often affected by uneven lighting, cluttered backgrounds, occlusion, and shooting angles, resulting in high noise levels and blurred target areas in the original images, which can easily lead to feature extraction distortion when directly input into the model; there are many types of common diseases and pests (such as brown spot, anthracnose, aphids, and spider mites), and various lesions have high similarity and intra-class differences in color, texture, and shape, making it difficult for traditional shallow features to effectively distinguish them; obtaining high-quality labeled samples is costly, and models are prone to overfitting and have insufficient generalization ability under small sample conditions.

[0006] While some studies have attempted to alleviate the data scarcity problem by introducing transfer learning, they have not optimized the network structure for the fine-grained features of apple diseases and pests, resulting in recognition accuracy and robustness that still fall short of practical deployment requirements. Therefore, there is an urgent need for an adaptive recognition method that integrates image preprocessing, feature enhancement, and an improved deep learning architecture to achieve high-precision, strong generalization, and low-dependency intelligent identification of apple tree diseases and pests. Summary of the Invention

[0007] The technical problem this invention aims to solve is to overcome the shortcomings of existing technologies that rely entirely on manual visual inspection for identifying apple tree diseases and pests, resulting in low efficiency, strong dependence on professional knowledge, and susceptibility to misjudgments and omissions due to the influence of the observer's subjective experience. To achieve automated, high-precision, and objective identification of apple tree diseases and pests, this invention provides an image recognition-based method for identifying apple tree diseases and pests.

[0008] This invention provides an image recognition-based method for identifying apple tree diseases and pests, which is implemented through a multi-stage, hierarchical image processing and deep learning model framework. First, a target leaf instance segmentation model accurately separates each individual apple tree leaf instance from a complex background. Second, a dual-path parallel multi-scale feature extraction network is constructed: one path captures the global contextual features of the entire leaf, while the other uses an attention mechanism to focus on the lesion area and extract its refined local texture features. Third, a cross-level feature fusion module is designed to deeply fuse global contextual features and local lesion features, generating a discriminative feature vector that combines macroscopic and microscopic information. Finally, a classification and discrimination module analyzes the fused feature vector, outputting the specific category of the disease or pest, and calculates the quantitative level of disease infection by combining the leaf segmentation mask and the lesion saliency map.

[0009] This invention provides a method for identifying apple tree diseases and pests based on image recognition, which includes the following steps: Obtain the raw image data of the apple tree to be identified; The original image data is preprocessed to obtain a standardized image; The standardized image is input into a pre-trained target leaf instance segmentation model to perform instance-level pixel segmentation on each apple leaf in the image, generating an independent leaf mask image corresponding to each leaf. Each of the independent leaf mask images is input into a dual-path parallel multi-scale lesion feature extraction network. The network includes a global context feature extraction branch and a local lesion feature extraction branch. The global context feature extraction branch outputs a global context feature vector, and the local lesion feature extraction branch outputs a local lesion feature vector. The global context feature vector and the local lesion feature vector are input into the cross-level feature fusion module for feature concatenation and dimensionality reduction to generate a fused feature vector. The fused feature vector is input into the classification and discrimination module. Through a fully connected network and a classification activation function, the probability distribution of the pest and disease category to which the leaf belongs is calculated and output. The category with the highest probability value is determined as the final identification result. Based on the leaf mask output by the target leaf instance segmentation model and the salience map of the lesion generated by the local lesion feature extraction branch, the ratio of the total number of pixels in the lesion area to the total number of pixels in the leaf area is calculated to obtain the quantified disease severity level.

[0010] As one embodiment of the present invention, the preprocessing of the original image data specifically includes: First, the color space of the original image data is uniformly converted from red-green-blue color space to hue, saturation, and brightness color space to reduce the impact of illumination changes on image features. Second, the image size is normalized by using a bicubic interpolation algorithm to adjust the size of all input images to a preset fixed resolution of 1024 x 1024 pixels. Finally, the image pixel values ​​are normalized by linearly mapping the integer range of pixel values ​​from 0 to 255 to the floating-point range of 0 to 1. The calculation formula is: the normalized pixel value is equal to the original pixel value divided by 255.

[0011] In one embodiment of the present invention, the target leaf instance segmentation model is a masked region convolutional neural network based on a convolutional neural network. The masked region convolutional neural network uses a residual network with a feature pyramid network as its backbone network to extract hierarchical features of the image at different scales. A region proposal network is then connected to the backbone network to generate candidate regions that may contain the leaf target. For each candidate region, a bounding box regression branch predicts the precise bounding box of the leaf, while a mask prediction branch generates a segmentation mask for the leaf at the pixel level in parallel. The model is trained using a dataset of 100,000 manually annotated apple leaf images, covering different varieties, different lighting conditions, different shooting angles, and various background interferences.

[0012] In one embodiment of the present invention, the global context feature extraction branch in the dual-path parallel multi-scale lesion feature extraction network has a lightweight convolutional neural network structure. This network consists of four sequentially connected convolutional blocks, each containing a 3x3 kernel with a stride of 2, a batch normalization layer, and a linear rectified unit activation function. This branch receives a complete independent leaf mask image as input, extracts low-frequency global information such as the overall contour, color distribution, and main vein structure of the leaf through layer-by-layer downsampling, and finally generates a 256-dimensional global context feature vector through a global average pooling layer.

[0013] In one embodiment of the present invention, the local lesion feature extraction branch in the dual-path parallel multi-scale lesion feature extraction network has a deep residual network structure, with a channel attention module embedded after each residual block. This branch also receives complete independent leaf mask images as input. The channel attention module obtains the global spatial information of each channel through a global average pooling operation, and then constructs the correlation between channels through two fully connected layers and an activation function to generate a set of channel weights.

[0014] The weights are multiplied back onto the original feature map, thereby enhancing the feature channels most relevant to lesion features and suppressing interference from irrelevant background texture information. Through this mechanism, the local lesion feature extraction branch adaptively focuses on high-frequency detail areas such as lesions, insect eggs, or signs of damage in the image, extracting their subtle texture, color, and morphological features. The network ultimately generates a 2048-dimensional local lesion feature vector through a global average pooling layer, which encodes a refined representation of the disease.

[0015] As one embodiment of the present invention, the cross-level feature fusion module specifically performs the following operations: First, the 256-dimensional global context feature vector and the 2048-dimensional local lesion feature vector are concatenated to form a 2304-dimensional original fused feature vector. Second, the original fused feature vector is input into a dimensionality reduction network consisting of two fully connected layers. The first fully connected layer maps the feature dimension from 2304 to 1024, and the second fully connected layer further maps the dimension from 1024 to 512. Each fully connected layer is followed by a linear rectified unit activation function and a regularization layer with a dropout rate of 0.5 to prevent model overfitting. Finally, a 512-dimensional, highly condensed fused feature vector is output.

[0016] In one embodiment of the present invention, the classification and discrimination module is a feedforward neural network comprising two fully connected layers. The first fully connected layer maps the 512-dimensional fused feature vector to a 256-dimensional hidden layer. The second fully connected layer maps the 256-dimensional hidden layer features to an output layer of dimension N, where N is a predefined total number of apple tree pest and disease categories, including health status. The output layer uses a flexible maximum transfer function as the activation function to convert the output vector into a probability distribution, where each element represents the probability that the input leaf image belongs to the corresponding pest or disease category.

[0017] As one embodiment of the present invention, the specific steps for quantitatively calculating the severity level of the disease are as follows: First, a saliency map of lesions is extracted from the output feature map of the last convolutional layer of the local lesion feature extraction branch. This saliency map is generated using class activation mapping technology, and the pixel brightness in the map is proportional to the contribution of that location to the final classification result. Second, the saliency map is binarized using a preset brightness threshold to generate a binary mask of the lesion region. Third, the total number of pixels with a value of 1 in the binary mask of the lesion region is counted and recorded as the total number of lesion pixels. Then, the total number of pixels with a value of 1 in the leaf mask generated by the target leaf instance segmentation model is counted and recorded as the total number of leaf pixels. Finally, the quantified percentage of disease severity is calculated using the formula (Disease severity level = Total number of lesion pixels / Total number of leaf pixels × 100%).

[0018] Compared with the prior art, the advantages and positive effects of the present invention are as follows: 1. This method introduces a target leaf instance segmentation model, which first accurately separates the leaves to be identified from the complex natural background, completely eliminating the interference of other irrelevant factors such as vegetation, soil, branches and trunks in the background on the subsequent extraction of disease features, and significantly improving the accuracy and robustness of identification.

[0019] 2. This method designs a dual-path parallel multi-scale feature extraction network, which explicitly separates and extracts global contextual features reflecting the overall health of the leaves and local lesion features representing disease details, and then fuses them. This allows the model to grasp the overall state of the leaves from a macroscopic perspective and capture the subtle differences in lesions from a microscopic perspective, effectively solving the technical problem that different diseases have similar initial symptoms and are difficult to distinguish.

[0020] 3. This method integrates a channel attention mechanism in the local lesion feature extraction branch, enabling the network to adaptively learn and focus on the most discriminative lesion areas in the image, thereby enhancing the detection capability of small and irregular lesions, while suppressing the influence of noise information such as leaf texture.

[0021] 4. This method not only provides qualitative classification results of pests and diseases, but also achieves quantitative assessment of disease severity by combining segmentation mask and lesion salience map. It provides fruit growers with objective and quantitative decision-making basis for precise pesticide application, graded management and prediction of yield loss, which is something that traditional manual visual inspection methods cannot achieve.

[0022] 5. This method decomposes the complex identification task into multiple logically clear modular steps. The entire process realizes full automation from image input to output of structured diagnostic reports, which greatly improves detection efficiency, reduces reliance on the professional knowledge of agricultural technicians, and makes large-scale, low-cost orchard pest and disease surveys possible. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the overall technical solution architecture of the image recognition-based apple tree pest and disease identification method proposed in this invention; Figure 2 This is a schematic diagram of the core principle framework of the dual-path parallel multi-scale lesion feature extraction network in this invention; Figure 3 This is a logical flow diagram of the target blade instance segmentation model in this invention; Figure 4 This is a diagram of the joint processing logic framework of the cross-level feature fusion module and the classification and discrimination module in this invention; Figure 5 This is a flowchart illustrating the logical flow of the quantitative calculation of disease severity levels in this invention. Figure 6 This is a logical framework diagram of the original image preprocessing and standardization process in this invention. Detailed Implementation

[0024] Please refer to the attached document. Figures 1 to 6 This invention provides an image recognition-based method for identifying apple tree diseases and pests. Its core lies in achieving automated, high-precision, and objective identification of apple tree leaf diseases and pests through a multi-stage, hierarchical image processing and deep learning model framework. The method first accurately separates each individual apple tree leaf instance from a complex natural background. Then, it extracts the global contextual features of the entire leaf and the local texture features of the lesion area, respectively. These two features are then deeply fused to generate a discriminative feature vector, ultimately outputting the disease / pest category and its quantified severity level. The specific implementation process of this method will be detailed below, following the steps S1 to S7 explicitly specified in the invention description.

[0025] The first step of the method is to acquire raw image data of the apple tree to be identified. This raw image data is acquired by high-definition digital imaging equipment deployed on-site in the orchard. Such equipment includes, but is not limited to, smartphone cameras, visible light cameras mounted on drones, or fixed agricultural monitoring cameras. During image acquisition, the equipment must ensure it is aligned with the leaf area within the apple tree canopy to avoid excessive occlusion or motion blur. The acquired raw image data is a color image in red-green-blue color space, with a resolution of at least 1920 x 1080 pixels, a bit depth of 8 bits per channel, and a file format conforming to the Joint Image Experts Group standard or a portable web graphics format. All raw image data is stored in a local embedded storage unit or a cloud object storage service before entering subsequent processing, and is accompanied by a unique timestamp and geographic location metadata for traceability and association with the scene context.

[0026] The second step of the method is to preprocess the original image data to obtain a standardized image. This preprocessing process includes three consecutive and irreversible sub-steps. First, a color space conversion operation is performed, transforming the original image from a red-green-blue color space to a hue, saturation, and luminance color space. This conversion is achieved through a standard color space transformation matrix, aiming to decouple the luminance and chrominance components of the image, thereby significantly reducing pixel value fluctuations caused by changes in illumination intensity, shadow occlusion, or reflection interference, and improving the stability of subsequent feature extraction. Second, size normalization is performed, using a bicubic interpolation algorithm to uniformly adjust the spatial dimensions of all input images to a preset fixed resolution, i.e., 1024 x 1024 pixels. Bicubic interpolation is selected as the standard resampling method in this scheme due to its superior performance in preserving edge sharpness and suppressing jagged edges. This operation ensures that all input images have the same dimension, satisfying the mandatory requirement of deep neural networks for the consistency of input tensor shape. Finally, pixel value normalization is performed, linearly mapping the integer values ​​of each pixel channel in the image from 0 to 255 to floating-point values ​​from 0 to 1. This mapping follows the formula: the normalized pixel value equals the original pixel value divided by 255. This operation not only accelerates the convergence speed of model training but also effectively prevents gradient explosion caused by excessively large numerical values. After the above three steps, the original image is transformed into a standardized image conforming to the model input specification, with its data type being a 32-bit floating-point tensor and a shape of 1024 x 1024 x 3.

[0027] The third step of the method involves inputting the standardized image into a pre-trained target leaf instance segmentation model. This model performs instance-level pixel segmentation on each apple leaf in the image, generating an independent leaf mask image corresponding to each leaf. The target leaf instance segmentation model employs a mask region convolutional neural network architecture, with its backbone network being a 101-layer variant of a residual network with a feature pyramid network structure. This backbone network first performs multi-scale feature extraction on the input image, generating five feature maps at different resolutions, with spatial downsampling factors of 4, 8, 16, 32, and 64, respectively. These feature maps are then fed into the feature pyramid network, where high-level semantic information and low-level spatial details are fused through top-down paths and lateral connections, outputting a set of scale-consistent and semantically rich pyramid features.

[0028] Building upon this foundation, the region proposal network utilizes these pyramid features to slide anchor boxes across multiple scales and predict the probability of each anchor box containing a leaf target and its bounding box offset. For each selected high-confidence candidate region, the model performs two tasks in parallel: the bounding box regression branch fine-tunes the candidate box coordinates through fully connected layers, outputting an accurate leaf bounding rectangle; the mask prediction branch progressively upsamples the feature map through four transposed convolutional layers, ultimately generating a binary segmentation mask at one-quarter resolution of the original input image. This mask accurately identifies the pixel positions within the candidate region that belong to the leaf foreground. The entire model is trained end-to-end on a dataset containing 100,000 manually annotated apple leaf images. This dataset covers multiple mainstream apple varieties, including Fuji, Gala, and Red Star, and encompasses different lighting conditions at different times of day, such as morning, noon, and dusk. It includes various shooting angles, such as front, side, and overhead views, and introduces complex backgrounds such as grass, soil, and other fruit tree branches and leaves as disturbance terms.

[0029] During training, cross-entropy loss is used to supervise classification and bounding box regression, while binary cross-entropy loss is used to supervise mask prediction. During model inference, the standardized input image is forward-propagated, outputting one or more independent leaf instances. Each instance consists of bounding box coordinates, a class confidence score, and a binary mask of the same size as the input image. All instances with confidence scores below a threshold of 0.7 are filtered out. The masks of the remaining instances are the independent leaf mask images, each containing only the foreground region of the complete leaf, with the rest being zero-valued background.

[0030] The fourth step of the method involves inputting each individual leaf mask image into a dual-path parallel multi-scale lesion feature extraction network. This network includes a global context feature extraction branch and a local lesion feature extraction branch, which output global context feature vectors and local lesion feature vectors, respectively. The global context feature extraction branch employs a lightweight convolutional neural network structure, consisting of four sequentially connected convolutional blocks. Each convolutional block contains a two-dimensional convolutional layer with a kernel size of 3x3 and a stride of 2, followed by a batch normalization layer and a linear rectified unit activation function.

[0031] This branch receives a complete, individual leaf mask image as input, with an image size of 1024 x 1024 pixels. After the first convolutional block, the feature map size is reduced to 512 x 512, and the number of channels increases to 32; after the second block, the size is 256 x 256, with 64 channels; after the third block, the size is 128 x 128, with 128 channels; and after the fourth block, the size is 64 x 64, with 256 channels. This branch effectively captures low-frequency global information such as the overall contour morphology of the leaf, the uniformity of leaf surface color distribution, and the direction and bifurcation pattern of the main vein through layer-by-layer downsampling. Finally, the output feature map of this branch is compressed into a vector with a spatial dimension of 1 through a global average pooling layer, generating a 256-dimensional global context feature vector, which encodes the macroscopic representation of the overall health status of the leaf.

[0032] Meanwhile, the local lesion feature extraction branch employs a 50-layer deep residual network architecture, embedding a channel attention module after each residual block. This branch also receives a complete, independent leaf mask image as input. The residual network alleviates the gradient vanishing problem through skip connections, enabling the extraction of deep semantic features. The working mechanism of the channel attention module is as follows: First, global average pooling is performed on the feature map output by the current residual block to obtain a one-dimensional vector with C channels. Then, this vector is passed through two fully connected layers. The first fully connected layer compresses the dimension to C divided by 16, and the second fully connected layer restores it to C dimensions. The intermediate activation function uses a linear rectified unit, and the output uses a flexible maximum transfer function to generate normalized channel weight coefficients. Finally, these weight coefficients are multiplied element-wise with the original feature map along the channel dimension to enhance critical channels and suppress irrelevant channels. Through this mechanism, the network can adaptively focus on abnormal areas in the image, such as lesions, insect eggs, feeding holes, or mold, enhancing the expression of discriminative detail features such as high-frequency texture, edge sharpness, and color anomalies (e.g., brown spots, yellowing, black spots). The final feature map output by this branch is also subjected to global average pooling to generate a 2048-dimensional local lesion feature vector, which highly condenses the microscopic pathological features of the disease.

[0033] The fifth step of the method involves inputting the global context feature vector and the local lesion feature vector into a cross-level feature fusion module for feature concatenation and dimensionality reduction to generate a fused feature vector. This module first performs a concatenation operation on the 256-dimensional global context feature vector and the 2048-dimensional local lesion feature vector to form a 2304-dimensional original fused feature vector.

[0034] Subsequently, the original fused feature vector is fed into a dimensionality reduction network consisting of two fully connected layers. The first fully connected layer contains 2304 input neurons and 1024 output neurons, followed by a linear rectified unit activation function and a regularization layer with a dropout rate of 0.5. The second fully connected layer contains 1024 input neurons and 512 output neurons, similarly followed by a linear rectified unit and a regularization layer with a dropout rate of 0.5. The dropout operation randomly sets half of the neurons' outputs to 0 during the training phase to force the network to learn redundant feature representations, significantly improving generalization ability. After processing by this dimensionality reduction network, a 512-dimensional fused feature vector is output. This vector retains both the macroscopic information of the overall leaf state and integrates the refined discriminative features of the lesion area, achieving effective synergy of multi-scale and multi-granular information.

[0035] The sixth step of the method involves inputting the fused feature vector into the classification and discrimination module. Through a fully connected network and a classification activation function, the probability distribution of the pest or disease category to which the leaf belongs is calculated and output. The category with the highest probability value is then determined as the final identification result. The classification and discrimination module is a feedforward neural network containing two fully connected layers.

[0036] The first fully connected layer maps the 512-dimensional fused feature vector to a 256-dimensional hidden layer, with a linear rectified unit (RCU) as the activation function. The second fully connected layer maps the 256-dimensional hidden layer features to an N-dimensional output layer, where N is the total number of predefined apple tree disease and pest categories, totaling fifteen categories including healthy status. These categories include: healthy, apple brown spot, apple leaf spot, apple powdery mildew, apple rust, apple anthracnose, apple ring rot, apple black spot, aphid infestation, spider mite infestation, leafroller infestation, leafminer infestation, beetle feeding, longhorn beetle borer, and other unclassified diseases. The output layer uses a flexible maximum transfer function as the activation function, its mathematical expression being: For the... class probability ,in For the first The function calculates the raw scores of each output neuron. It transforms the output vector into a strictly normalized probability distribution, where each element represents the confidence level that the input leaf image belongs to the corresponding category. The system selects the category with the highest probability value as the final recognition result and records its probability value as a confidence index for subsequent decision-making.

[0037] The seventh step of the method involves calculating the ratio of the total number of pixels in the lesion region to the total number of pixels in the leaf region based on the leaf mask output by the target leaf instance segmentation model and the lesion saliency map generated by the local lesion feature extraction branch, thereby obtaining the quantified disease severity level. This calculation process includes five deterministic operations. First, the lesion saliency map is extracted from the feature map output by the last convolutional layer of the local lesion feature extraction branch. This saliency map is generated using class activation mapping technology. Specifically, the weight vector corresponding to the predicted category in the classification and discrimination module is weighted and summed with the last convolutional feature map in the channel dimension, and then upsampled to the original leaf mask size using bilinear interpolation.

[0038] In the saliency map, the brightness value of each pixel is proportional to its contribution to the final classification decision; lesion areas typically exhibit a bright response. Next, the saliency map is binarized using a preset brightness threshold, determined by maximizing the F1 score for lesion detection on the validation set, with a value of 0.4. All pixels with brightness values ​​greater than or equal to this threshold are set to 1, and the rest to 0, generating a binary mask for the lesion area. Then, all pixels in the binary mask are iterated through, and the total number of pixels with a value of 1 is counted, recorded as the total number of lesion pixels. Next, the leaf masks generated by the target leaf instance segmentation model are iterated through, and the total number of pixels with a value of 1 is counted, recorded as the total number of leaf pixels. Finally, the disease severity level is calculated using the formula: the total number of lesion pixels divided by the total number of leaf pixels multiplied by 100%, yielding a percentage value between 0 and 100.

[0039] The value is divided into four levels: 0% to 5% is mild, 5% to 15% is moderate, 15% to 30% is severe, and over 30% is extremely severe. This quantitative result, together with the pest and disease category, constitutes a structured diagnostic report, which is output to the user's terminal.

[0040] Throughout the methodology, data flow between modules strictly adheres to temporal dependencies. After preprocessing, the raw image enters the instance segmentation model, with the segmentation results driving independent analysis of each leaf. The mask image of each leaf is fed in parallel into a dual-path feature extraction network. The two feature vectors are then merged into a fusion module, which drives classification and severity calculation. All computations are performed on a CPU-GPU co-processor architecture, and model parameters are stored in non-volatile memory with 32-bit floating-point precision. During system runtime, the memory management unit dynamically allocates tensor buffers to ensure efficient data transfer between modules without redundant copying.

[0041] An anomaly handling mechanism monitors the legality of the output at each step. For example, if no leaves are detected during instance segmentation, the process terminates and returns a "no valid leaves" error code. If the maximum classification probability is below 0.6, the result is marked as "low confidence," and manual review is recommended. This method achieves end-to-end automated processing from raw images to structured diagnostic results, requiring no manual intervention throughout the entire process. The average processing time per image is no more than 3.5 seconds, the recognition accuracy reaches 92.7%, and the correlation coefficient between the severity level assessment and expert visual inspection results is 0.89, significantly outperforming traditional manual methods.

[0042] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for identifying apple tree diseases and pests based on image recognition, characterized in that, include: Obtain the raw image data of the apple tree to be identified; The original image data is preprocessed to obtain a standardized image; The standardized image is input into a pre-trained target leaf instance segmentation model to perform instance-level pixel segmentation on each apple leaf in the image, generating an independent leaf mask image corresponding to each leaf. Each of the independent leaf mask images is input into a dual-path parallel multi-scale lesion feature extraction network. The network includes a global context feature extraction branch and a local lesion feature extraction branch. The global context feature extraction branch outputs a global context feature vector, and the local lesion feature extraction branch outputs a local lesion feature vector. The global context feature vector and the local lesion feature vector are input into the cross-level feature fusion module for feature concatenation and dimensionality reduction to generate a fused feature vector. The fused feature vector is input into the classification and discrimination module. Through a fully connected network and a classification activation function, the probability distribution of the pest and disease category to which the leaf belongs is calculated and output. The category with the highest probability value is determined as the final identification result. Based on the leaf mask output by the target leaf instance segmentation model and the salience map of the lesion generated by the local lesion feature extraction branch, the ratio of the total number of pixels in the lesion area to the total number of pixels in the leaf area is calculated to obtain the quantified disease severity level.

2. The method for identifying apple tree diseases and pests based on image recognition according to claim 1, characterized in that, Preprocessing the raw image data includes: The color space of the original image data is uniformly converted from the red-green-blue color space to a hue, saturation, and brightness color space. The size of all input images is uniformly adjusted to 1024 by 1024 pixels using a bicubic interpolation algorithm. The normalized pixel value is calculated by linearly mapping the integer range of pixel values ​​from 0 to 255 to the floating-point range of 0 to 1. The formula is: the normalized pixel value is equal to the original pixel value divided by 255.

3. The method for identifying apple tree diseases and pests based on image recognition according to claim 2, characterized in that, The target leaf instance segmentation model is a mask region convolutional neural network based on a convolutional neural network; the mask region convolutional neural network uses a residual network with a feature pyramid network as its backbone network; the backbone network is then connected to a region proposal network; for each candidate region, the bounding box regression branch is used to predict the precise bounding box of the leaf, while the mask prediction branch generates the segmentation mask of the leaf in parallel at the pixel level.

4. The method for identifying apple tree diseases and pests based on image recognition according to claim 3, characterized in that, The global context feature extraction branch consists of four sequentially connected convolutional blocks. Each convolutional block contains a two-dimensional convolutional layer with a kernel size of 3x3 and a stride of 2, a batch normalization layer, and a linear rectified unit activation function. This branch receives a complete independent leaf mask image as input and extracts low-frequency global information such as the overall contour, color distribution, and main vein structure of the leaf through layer-by-layer downsampling. Finally, a 256-dimensional global context feature vector is generated through a global average pooling layer.

5. The method for identifying apple tree diseases and pests based on image recognition according to claim 4, characterized in that, The local lesion feature extraction branch is a deep residual network, with a channel attention module embedded after each residual block. The channel attention module obtains the global spatial information of each channel through global average pooling, and then constructs the correlation between channels through two fully connected layers and activation functions to generate a set of channel weights. These weights are multiplied back onto the original feature map, thereby enhancing the feature channels most relevant to the lesion features. The local lesion feature extraction branch adaptively focuses on high-frequency detail areas such as lesions, insect eggs, or grazing marks in the image through this mechanism, and extracts their subtle texture, color, and morphological features. The network finally generates a 2048-dimensional local lesion feature vector through a global average pooling layer.

6. The method for identifying apple tree diseases and pests based on image recognition according to claim 5, characterized in that, The cross-level feature fusion module performs the following operations: The 256-dimensional global context feature vector and the 2048-dimensional local lesion feature vector are concatenated in terms of feature dimension to form a 2304-dimensional original fused feature vector. The original fused feature vector is input into a dimensionality reduction network consisting of two fully connected layers. The first fully connected layer maps the feature dimension from 2304 to 1024, and the second fully connected layer further maps the dimension from 1024 to 512. Each fully connected layer is followed by a linear rectified unit activation function and a regularization layer with a dropout rate of 0.

5. The final output is a 512-dimensional fused feature vector.

7. The method for identifying apple tree diseases and pests based on image recognition according to claim 6, characterized in that, The classification and discrimination module is a feedforward neural network containing two fully connected layers; the first fully connected layer maps the 512-dimensional fused feature vector to a 256-dimensional hidden layer; the second fully connected layer maps the 256-dimensional hidden layer features to an output layer of dimension N, where N is the predefined total number of apple tree pest and disease categories, including health status; the output layer uses a flexible maximum transfer function as the activation function to convert the output vector into a probability distribution.

8. The method for identifying apple tree diseases and pests based on image recognition according to claim 7, characterized in that, The specific steps for quantifying the severity level of the disease are as follows: The salience map is extracted from the output feature map of the last convolutional layer of the local lesion feature extraction branch, and the salience map is generated by class activation mapping technique; The saliency map is binarized using a preset brightness threshold to generate a binary mask for the lesion region. The total number of pixels with a value of 1 in the binary mask of the lesion area is counted and recorded as the total number of lesion pixels; The total number of pixels with a value of 1 in the leaf mask generated by the target leaf instance segmentation model is counted and recorded as the total number of leaf pixels. The percentage of disease severity level can be calculated using the formula: Disease severity level = Total number of lesion pixels / Total number of leaf pixels × 100%.

9. The method for identifying apple tree diseases and pests based on image recognition according to claim 8, characterized in that, The process of generating the salience map of the lesion includes: weighting and summing the weight vector corresponding to the predicted category in the classification and discrimination module with the last layer of convolutional feature map in the channel dimension, and then upsampling to the original leaf mask size through bilinear interpolation.

10. The method for identifying apple tree diseases and pests based on image recognition according to claim 9, characterized in that, The brightness threshold is 0.4, which is determined by maximizing the lesion detection F1 score on the validation set.

Citation Information

Cited By

  • System and method for determining suitable prevention and control period of grape smooth foot distance bark beetles based on image recognition

    CN122067115A