Tomato leaf disease detection method based on SSP-DETR model

Through the tomato leaf disease detection method based on the SSP-DETR model, the problem of complex background and low detection accuracy in the prior art is solved, and efficient and accurate disease detection is achieved.

CN119785157AActive Publication Date: 2025-04-08GUANGXI TEACHERS EDUCATION UNIV

Patent Information

Application Number
CN202411848391.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The prior art is difficult to effectively deal with complex backgrounds and small targets in the detection of tomato leaf disease, resulting in low detection accuracy.

Method used

The tomato leaf disease detection method based on the SSP-DETR model is adopted, and multi-layer feature extraction is performed through the StarNet network module, combining the attention feature extraction module, multi-scale fusion module and Decoder decoder to optimize the loss function to improve detection accuracy.

Benefits of technology

It improves the detection ability of complex backgrounds and small targets, ensures the efficiency and accuracy of the detection process, and improves the comprehensiveness and accuracy of tomato leaf disease detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785157A_ABST
    Figure CN119785157A_ABST
Patent Text Reader

Abstract

The invention discloses a tomato leaf disease detection method based on an SSP-DETR model, and the method is realized through the SSP-DETR model, and comprises the steps: obtaining a tomato leaf disease image data set, and carrying out the classification; inputting the tomato leaf disease image into a StarNet network module for feature extraction, and outputting feature maps P2, P3, P4 and P5 of different dimensions; inputting P5 into an attention feature extraction module, and outputting F5; p2, P3, P4 and F5 are input into a multi-scale fusion module for feature fusion; inputting the fused feature map into a Decoder decoder, and outputting a tomato leaf disease area prediction frame; acquiring a tomato leaf disease area prediction frame and disease area classification in the corresponding tomato leaf disease image, and performing back propagation on the optimization model by using a loss function; and inputting the tomato leaf disease image into the optimized model to obtain a disease detection result. According to the method, the tomato leaf diseases can be comprehensively detected, the detection precision is high, and the robustness is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and more specifically, to a tomato leaf disease detection method based on the SSP-DETR model. Background Art

[0002] In the process of tomato cultivation, tomato leaf disease is one of the main factors affecting crop health and yield. Common tomato leaf diseases include bacterial spot, early blight, late blight, leaf spot, etc. These diseases not only cause symptoms such as spots, yellowing, and curling on the leaves, but also affect the growth of the entire plant, thereby reducing the yield and quality of the fruit. Since the symptoms of these diseases can be very similar, such as small spots, slight color changes, etc., it is difficult to achieve early and accurate identification by naked eye observation in field cultivation or greenhouse cultivation. Once the disease spreads, the cost of prevention and control is high and the effect is poor. Therefore, timely and accurate detection of tomato leaf diseases is crucial to increasing crop yields and ensuring quality.

[0003] In recent years, with the rapid development of artificial intelligence and computer vision technology, disease detection methods based on image recognition have gradually become a research hotspot. Such methods can detect early diseases by analyzing image data of tomato leaves, helping growers take timely prevention and control measures, thereby reducing economic losses.

[0004] Due to the influence of factors such as occlusion, lighting, and shadows in complex backgrounds, disease detection becomes more complicated. Existing technologies such as YOLO, although they have high real-time performance, have weak processing capabilities for complex backgrounds, and YOLO's detection is based on a fixed grid size, resulting in low detection accuracy for small targets. Summary of the invention

[0005] An object of the present invention is to provide a tomato leaf disease detection method based on the SSP-DETR model to at least solve the above problems.

[0006] In order to achieve the purpose and other advantages of the present invention, a tomato leaf disease detection method based on the SSP-DETR model is provided. The tomato leaf disease detection process is implemented by the SSP-DETR model. The SSP-DETR model is an improvement based on the RT-DETR model, including a StarNet network module, an attention feature extraction module, a multi-scale fusion module and a Decoder decoder. The specific steps include: S1, obtaining a tomato leaf disease image dataset, and classifying the diseased area in the tomato leaf disease image; S2, inputting the tomato leaf disease image into the StarNet network module for multi-layer feature extraction, and outputting feature maps of four different dimensions, from low dimension to high dimension. They are P2, P3, P4, and P5 in order; S3, input P5 into the attention feature extraction module for attention feature extraction, and output F5; S4, input P2, P3, P4, and F5 into the multi-scale fusion module for multi-scale feature fusion; S5, input the feature map after multi-scale fusion into the Decoder decoder, and output the tomato leaf disease area prediction frame; S6, obtain the tomato leaf disease area prediction frame and the corresponding disease area classification in the tomato leaf disease image, use the classification loss, position loss, and SIoU loss to calculate the total loss and back-propagate the optimization model; S7, input the actual tomato leaf disease image into the optimized SSP-DETR model to obtain the tomato leaf disease detection result.

[0007] Preferably, the StarNet network module includes a StemLayer layer and multiple stage layers; the StemLayer layer contains a ConvBN convolution and an activation function ReLU6, and the StemLayer layer is used to convert the number of channels of the tomato leaf disease image from 3 to 32; each stage layer includes a convolution downsampling layer and a residual block, and the multiple stage layers are used to extract the features of the 32-channel tomato leaf disease image layer by layer to generate feature maps of four different dimensions.

[0008] Preferably, the attention feature extraction module adopts the AIFI module in the RT-DETR model.

[0009] Preferably, the multi-scale fusion module (SOEP module) includes an SPDConv convolution, a CSPOMniKernel module and multiple KanC3 modules; the SPDConv module is used to obtain the feature map of P2 and divide it into four small areas, and then splice the four small areas in the channel dimension to achieve downsampling and feature information enhancement; the CSPOMniKernel module is used to obtain the P2, P3, P4, and F5 feature maps after splicing in the channel dimension, first adjust the number of channels through 1×1 convolution, then separate the channels proportionally, input some channels into the OmniKernel module to enhance the features, and finally merge and adjust the output to enhance the recognition ability of diseases of different scales; the KANs network architecture is introduced in the KanC3 module to replace the RepC3 module in the RT-DETR model, which is used to reconstruct the network parameters of the feature maps after splicing in the channel dimension to reduce the number of parameters.

[0010] Furthermore, the OmniKernel module includes three branches. The first branch uses 1×1 convolution with a stride of 1 and padding of 0 to independently adjust the features of each channel, and enhance the fine-grained feature expression within the channel without changing the spatial dimension. The second branch uses three deep convolutions: DW_13, DW_31 and DW_33 to capture features of different directions and sizes. The third branch contains FCA and SCA modules to enhance the global information expression capability of the feature map. Finally, the outputs of the three branches are concatenated in the channel dimension, processed by a ReLU activation function, and integrated by another 1×1 convolution.

[0011] Preferably, the total loss function L total =L cls +λ1L box +λ2L SIoU , where L cls is the classification loss, L box is the position loss, L SIoU is the SIoU loss, λ1 and λ2 are the weight coefficients of position loss and SIoU loss, balancing the contribution of different losses.

[0012] Preferably, the tomato leaf diseases detected include bacterial spot, early blight, late blight and leaf spot.

[0013] The present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the method as described in any one of claims 1 to 7.

[0014] The present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

[0015] The present invention further provides a computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

[0016] The present invention has at least the following beneficial effects:

[0017] The SSP-DETR model of the present invention is an improvement based on the RT-DETR model. The StarNet network module is used as the backbone network, the SEOP module replaces the CCFF module in the RT-DETR model, the KanC3 module replaces the RepC3 module in the RT-DETR model, and the SIoU loss replaces the GIoU loss in the RT-DETR model. In the entire tomato leaf disease detection task, these modules work together to improve the processing capability for complex backgrounds and ensure the efficiency and accuracy of the detection process. Among them, the StarNet network module provides basic feature extraction, covering small to large diseases; the AIFI and SOEP modules aggregate and multi-scale fuse high and low resolution features to improve the detection accuracy of disease spots of different sizes; the SPDConv and CSPOMniKernel in the SOEP module enhance feature information through feature downsampling and multi-scale convolution to ensure the balance between detection speed and accuracy; the addition of SIoU loss optimizes the shape matching of the disease spot edge, so that the model can capture complex diseases more accurately; the Decoder can decode feature information into a clear disease area, and finally realize the comprehensive detection of tomato leaf diseases.

[0018] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the overall structure of the SSP-DETR model of the present invention;

[0020] Figure 2 It is a schematic diagram of the structure of the SOEP module of the present invention;

[0021] Figure 3 It is a schematic diagram of the structure of the CSP OmniKernel module of the present invention;

[0022] Figure 4 It is a schematic diagram of the structure of the OmniKernel module of the present invention. DETAILED DESCRIPTION

[0023] The present invention is further described in detail below in conjunction with embodiments and drawings so that those skilled in the art can implement the invention with reference to the description.

[0024] It should be understood that the terms such as “having”, “including” and “comprising” used herein do not exclude the existence or addition of one or more other elements or combinations thereof.

[0025] It should be noted that the experimental methods described in the following embodiments are conventional methods unless otherwise specified, and the reagents and materials can be obtained from commercial channels unless otherwise specified.

[0026] The training platform used in the embodiment is the Ubuntu 20.04 operating system, the CPU processor Intel (R) is an 8-core 16-thread Core (TM) i7-10700F CPU @ 2.90GHz, the GPU processor is NVIDIA GeForce RTX 3090, and the video memory is 24G. The software environment mainly includes Python 3.9.10 and CUDA 12.1 versions. The experimental data used is the Tomato Leaf Disease Computer Vision Project public data set in the Roboflow official platform, and is divided into a training data set and a verification data set in a 4:1 ratio.

[0027] Example 1: Tomato leaf disease detection method

[0028] The tomato leaf disease detection process is implemented through the SSP-DETR network model. The SSP-DETR network model is an improvement based on the RT-DETR model, including the StarNet network module, the attention feature extraction module (AIFI module), the multi-scale fusion module (SEOP module) and the Decoder decoder. The overall structure of the SSP-DETR network model is as follows: Figure 1 shown.

[0029] The specific steps include:

[0030] S1. Obtain a tomato leaf disease image dataset and classify the diseased areas in the tomato leaf disease images.

[0031] Specifically, the tomato leaf disease image dataset is the public dataset of the Tomato Leaf Disease Computer Vision Project in the Roboflow official platform, and is divided into a training dataset and a validation dataset in a ratio of 4:1. Tomato leaf diseases include bacterial spot, early blight, late blight, and leaf spot.

[0032] S2. Input the tomato leaf disease image into the StarNet network module for multi-layer feature extraction and output feature maps of four different dimensions, from low dimension to high dimension, namely P2, P3, P4, and P5.

[0033] The StarNet network is a simple and effective network structure for extracting multi-scale features of input images. Convolutional layers are stacked into a star structure to obtain feature maps from low dimensions to high dimensions. Features are extracted through convolutional layers of different depths, and four feature maps of different dimensions, P2, P3, P4, and P5, are output. Among them, P2 and P3 are higher-resolution feature maps, mainly used to detect sparse and smaller spots, P4 is a medium-resolution feature map, used to detect large-area disease spots gathered on leaves, and P5 is a lower-resolution feature map, used to detect the entire leaf. In this way, StarNet can adapt to the detection needs of both minor and major diseases, and improve the comprehensiveness of detection.

[0034] Specifically, the StarNet network module includes a StemLayer layer and multiple stage layers.

[0035] The StemLayer layer usually contains a ConvBN convolution and an activation function ReLU6. ConvBN contains a convolution with a size of 3x3, a stride of 2, a padding of 1, an input channel number of 3, and an output channel number of self.in_channel, plus a batch normalization layer. The StemLayer layer changes the number of input image channels from 3 (RGB) to self.in_channel, that is, the number of channels becomes 32. The function of the StemLayer layer is to extract preliminary features from the input image, help the model recognize and capture the basic shape, edge and texture information of the image, and provide richer feature representations for subsequent deep networks.

[0036] Each stage layer includes a convolutional downsampling layer and a residual block. The convolutional downsampling layer contains a convolution of size 3x3, stride 2, padding 1, input channels self.in_channel, and output channels embed_dim. The purpose of this layer is to reduce the spatial dimensions (i.e. width and height) of the feature map, while possibly increasing the expressiveness of the features. The residual block includes 2 depthwise separable convolutional layers (DWConv), which are composed of ConvBN. The input and output dimensions of this convolutional layer are dim, the convolution size is 7, the stride is 1, the padding is 3, the number of groups is equal to the number of dimensions, and it contains batch normalization, as well as 3 1x1 convolutional layers, which are composed of ConvBN, control the number of channels, do not contain batch normalization, and a ReLU6 activation function to introduce nonlinearity so that the network can learn and fit complex nonlinear relationships, and create a DropPath layer to randomly drop certain paths in the network. The stage layer first downsamples the input tensor, and the downsampled tensor is passed as input to the residual block, and finally outputs the result processed by the residual block.

[0037] S3, input P5 into the AIFI module for attention feature extraction and output F5.

[0038] The AIFI module focuses on processing high-level image features through a self-attention mechanism, thereby improving the model's performance in object detection and recognition while reducing unnecessary computational consumption.

[0039] S4, input P2, P3, P4, and F5 into the SEOP module for multi-scale feature fusion. The structure of the SEOP module is as follows: Figure 2 shown.

[0040] Specifically, the SEOP module includes an SPDConv convolution, a CSPOMniKernel module and multiple KanC3 modules, which are used to perform deep feature fusion between different channels of the P2, P3, P4 and F5 feature maps, so that the information of the feature maps at different resolutions can be interacted and integrated, enhancing the expressive ability of the features, so that the model can effectively capture the detailed features of diseases at different scales, especially for tiny spots on leaves and large areas of lesions. It can make accurate responses.

[0041] When performing multi-scale feature fusion, the SEOP module first receives the F5 feature map output by the AIFI module, upsamples the F5 feature map to adjust the tensor width and height and convolves it with the P4 feature map. Figure 1The convolution operation is repeated, and two tensors are copied, one is the Q tensor, and the other is merged with the P4 feature map after convolution according to the channel direction. The merged tensor passes through the KANC3 module and the convolution module and then copies two tensors, one is the R tensor, and the other is upsampled to expand the width and height of the tensor and the P3 feature map. Figure 1 The width and height of the P2 feature map are adjusted to be consistent with the feature map of P3 through SPDConv. The three feature maps are merged in the channel direction, and the merged tensor enters the CSPOMniKernel module. The tensor is first adjusted through convolution in the CSPOMniKernel, and the tensor is divided into two parts in a ratio of 1:3 according to the channel direction. The part with fewer channels is processed by the OmniKernel module, and the part with more channels remains unchanged. Subsequently, the two parts of the tensor are merged and adjusted to the same number of channels as the input through convolution, and the output tensor is processed by the KANC3 module and copied into two copies. One is directly input into the Decoder, and the other is merged with the R tensor through convolution. Then, two copies of the tensor are copied through a KANC3 module, one is directly input into the Decoder, and the other is merged with the Q tensor after convolution and input into the Decoder through the KANC3 module. Among them,

[0042] The SPDConv module is used to obtain the feature map of P2 and divide it into four small areas (upper left, upper right, lower left, and lower right). The four small areas are then spliced ​​in the channel dimension to achieve downsampling and feature information enhancement, providing a more compact feature expression for subsequent convolution operations. The SPDConv module enhances feature extraction capabilities through special spatial rearrangement and convolution operations, while reducing resolution and improving computational efficiency. Specifically,

[0043] Y=Conv(concat(X[...,::2,::2],X[...,1::2,::2],X[...,::2,1::2],X[...,1::2,1::2]))

[0044] In the formula, x[...,::2,::2] and the other three parts represent small blocks taken from different positions of P2, representing pixels extracted from the upper left, upper right, lower left, and lower right regions, respectively. X is the input tensor, and Y is the tensor after "stacking". After the SPDConv module, the output tensor size is: (batch, channels*4, height / 2, width / 2), that is, the number of channels is 4 times the input tensor, and the height and width of the image are 1 / 2 of the input tensor respectively.

[0045] The structure of the CSPOmniKernel module is as follows Figure 3As shown in the figure, it includes an OmniKernel convolutional neural network module, which realizes multi-scale feature enhancement through multi-scale convolution, frequency domain attention (FCA) and spatial attention (SCA), while reducing the amount of calculation and memory consumption and improving network efficiency. CSPOmniKernel first adjusts the number of channels through a convolution with a size of 1x 1, a stride of 1, and a padding of 0. Then, the input tensor x is separated by a ratio of 0.25 and input into the OmniKernel module to enhance the features. The channel number tensor separated by another ratio of 0.75 (the original features are retained) is spliced ​​with the tensor through the OmniKernel in the channel dimension. Finally, the number of channels is adjusted through a convolution with a size of 1x1, a stride of 1, and a padding of 0, keeping the number of channels of the input and output the same. CSPOmniKernel enhances the recognition ability of diseases of different scales. When detecting diseases of complex shapes and distributions on leaves, CSP OmniKernel provides powerful feature enhancement capabilities, enabling the model to more keenly capture the subtle features of different lesions while maintaining high computational efficiency.

[0046] The structure of OmniKernel is as follows Figure 4 As shown, it includes three branches, which capture features of different scales respectively to achieve multi-scale feature enhancement. Among them, the first branch (Local Branch) uses a 1×1 convolution with a stride of 1 and a padding of 0 to independently adjust the features of each channel, and enhance the fine-grained feature expression within the channel without changing the spatial dimension. It is suitable for extracting local information and detecting subtle and sparse small lesions; the second branch (Large Branch) uses 3 deep convolutions: DW_13, DW_31 and DW_33, which capture features of different directions and sizes, suitable for extracting wide-area feature information, especially suitable for modeling the overall contour of larger lesions; the third branch (Global Branch) contains FCA and SCA modules to enhance the global information expression ability of the feature map, which is suitable for detecting unevenly distributed or complex-shaped diseases; finally, the outputs of the three branches are spliced ​​in the channel dimension, processed by a ReLU activation function, and the results are integrated by another 1×1 convolution. Specifically,

[0047] The convolution size of DW_13 is 1×31, that is, it only captures long-distance features in the horizontal direction (width direction), while the kernel size in the vertical direction is 1, and 15 is padded in the width direction to make the output width consistent with the input. DW_13 focuses on capturing long-distance features in the horizontal direction, helping the model to obtain contextual information in the width direction; the convolution size of DW_31 is 31×1, that is, it only captures long-distance features in the vertical direction (height direction), while the kernel size in the horizontal direction is 1, and 15 is padded in the height direction to make the output height consistent with the input. DW_31 focuses on capturing long-distance features in the vertical direction, which helps the model to obtain contextual information in the height direction; DW_33, the convolution size is 31×31, has a large receptive field in both width and height directions, and 15 is padded to keep the spatial size of the input and output consistent. DW_33 can capture a wide range of contextual information in space and obtain more global spatial features; FCA is mainly based on the frequency domain attention mechanism, which uses the frequency domain information of the input features to adjust the weights of the feature channels and AdaptiveAvgPool2 on the input features. d operation to obtain global channel statistics, generate channel attention weights through a 1×1 convolution (fac_conv), perform 2D Fourier transform on the input feature out, convert it to the frequency domain, and apply the generated channel weight x_att to the frequency domain feature to emphasize or suppress the specific channel. The adjusted frequency domain feature is returned to the spatial domain through the inverse Fourier transform, and its amplitude is taken to obtain the enhanced feature. SCA first performs AdaptiveAvgPool2d operation on the input feature to obtain global spatial statistics, and then generates the weight of each channel through a 1×1 convolution (conv). The generated weight x_att is applied to the input feature x_fca to weight the feature of each channel. The SCA result is further processed by the FGM module (a convolution mechanism based on the frequency domain) to further enhance the feature. FGM realizes feature enhancement under the guidance of the frequency domain. First, the feature x2 is Fourier transformed, and then the transformed feature is multiplied element by element with x1. Finally, it is returned to the spatial domain through the inverse Fourier transform to complete the adjustment of the input feature.

[0048] The KanC3 module introduces the KANs network architecture to replace the RepC3 module in the RT-DETR model. This module uses spline functions to parameterize the activation function, reducing the dependence on linear weights, thereby reducing the number of model parameters and improving the efficiency of overall model training and reasoning.

[0049] S5. Input the multi-scale fused feature map into the Decoder layer and output the predicted frame of the tomato leaf disease area.

[0050] The decoder layer uses the existing decoder layer in the RT-DETR model and will not be described here.

[0051] S6. Obtain the predicted box of the tomato leaf disease area and the corresponding classification of the disease area (true box) in the tomato leaf disease image, calculate the total loss using the classification loss, position loss, and SIoU loss, and back-propagate the optimization model.

[0052] Specifically, the total loss function L total =L cls +λ1L box +λ2L SIoU , where L cls is the classification loss, L box is the position loss, L SIoU is the SIoU loss, λ1 and λ2 are the weight coefficients of position loss and SIoU loss, balancing the contribution of different losses; SIoU loss L SIoU =1-IoU+distance shape +0.5×Ω shape , where IoU (Intersection over Union) is the intersection over union ratio between the predicted box and the real box, which measures the proportion of the overlapping area between the two. shape is the shape distance, which takes into account the distance between the center point of the predicted box and the real box, and performs weighted calculation according to the shape of the real box. shape It is a shape difference term, which measures the difference between the predicted box and the true box in width and height.

[0053] The SIoU loss is used to replace the GIoU loss in the RT-DETR model for shape matching in target detection. SIoU not only considers the overlapping area between the two, but also introduces the shape and scale factors of the bounding box itself, which can better match irregularly shaped targets. SLoU effectively reduces the matching error caused by irregular shapes or complex boundaries by optimizing the accuracy of the edges and shapes of the lesions, so that the model can maintain good geometric shape and boundary prediction even in the case of high IoU. In tomato leaf disease detection, SIoU helps the model better handle diseased areas with complex boundaries, making the prediction box more consistent with the actual shape of the lesions, and improving the accuracy and robustness of the overall detection.

[0054] S7. Input the actually obtained tomato leaf disease image into the optimized SSP-DETR model to obtain the tomato leaf disease detection result.

[0055] In order to further prove the effectiveness of the method, the present invention conducted relevant ablation experiments, A is the RT-DETR model, B uses the KanC3 module based on the A model, C uses the Starnet network module on the basis of the A model, D uses the SOEP module based on the A model, and E is the SSP-DETR model.

[0056] As can be seen from Table 1, the use of KanC3 and Starnet modules greatly reduces the training parameters of the model and the computational complexity of the model, and can also partially improve mAP50. Using the SOEP module, mAP50 can be improved by 2.0%, and the model parameters are reduced by 51.61%. Compared with RT-DETR, the SSP-DETR model parameters are reduced by 54.35%, the model complexity is also reduced by 72.38%, and the mAP50 is improved by 2.2%. It can be further explained that the SOEP module and the Starnet network module have better effects on the extraction and fusion of small target features, and the KanC3 module can effectively reduce the overall network parameters and model complexity.

[0057] Table 1: Ablation experiments of SSP-DETR

[0058]

[0059] At the same time, the SSP-DETR proposed in Table 2 is compared with the current mainstream one-stage, two-stage and target detection networks based on the DETR framework.

[0060] Compared with YOLOv5-L / YOLOv8-L / YOLOv10-L in the series, SSP-DETR has improved mAP50 by 2.4%, 0.8%, and 1.1%, respectively, and the number of network parameters has been reduced by 57.83%, 55.21%, and 19.92%, respectively.

[0061] Table 2: Comparative experiments of mainstream models

[0062]

[0063] Table 3 shows the difference between using SIoU (Shape-aware Intersection over Union) loss function and multiple commonly used loss functions. Based on the SSP-DETR model, GIoU (Generalized Intersection over Union) is used as the F model, based on the F model, DIoU (Distance Intersection over Union) is used as the J model, based on the F model, EIoU (Efficient Intersection over Union) is used as the H model, based on the F model, CIoU (Polar Intersection over Union) is used as the I model, and based on the F model, SIoU (Shape-aware Intersection over Union) is used as the G model.

[0064] Table 3: Comparison experiment of commonly used loss functions

[0065]

[0066] Because tomato leaf spots are usually small, traditional GIoU is not stable enough when dealing with small targets. From Table 3, it can be seen that SIoU is more suitable for small target detection tasks in natural scenes. SIoU introduces a shape perception mechanism, which has a good shape alignment effect and is particularly suitable for detecting irregular shaped spots on tomato leaves.

[0067] According to the task characteristics of tomato leaf disease, this paper proposes a small target detection model SSP-DETR network model for lightweight real-time target detection. The use of Starnet network module and the proposed optimized SOEP network module can improve the detection accuracy of the model for small targets and reduce the number of network parameters. Through the above experiments, it can be seen that the SSP-DETR network is more suitable for the task of detecting small targets than the mainstream target detection network.

[0068] The tomato leaf disease detection method proposed in the present invention effectively improves the shortcomings of the prior art, such as high model complexity and low detection accuracy.

[0069] In addition, the present invention also provides an electronic device, which is a device including a processor (CPU / MCU / SOC) and a memory (ROM / RAM), such as a drone, a portable computer, a smart camera, etc. In particular, a computer program is stored in the memory, and when the processor loads and executes the computer program, all or part of the steps of the above-mentioned tomato leaf disease detection method based on the SSP-DETR model are implemented.

[0070] The present invention also provides a computer-readable medium, which includes: various media that can store program codes, such as ROM, RAM, magnetic disk or optical disk, wherein a computer program is stored. When the computer program is loaded and executed by a processor, all or part of the steps of the above-mentioned tomato leaf disease detection method based on the SSP-DETR model are implemented.

[0071] The present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements all or part of the steps of the above-mentioned tomato leaf disease detection method based on the SSP-DETR model.

[0072] The number of devices and processing scales described here are used to simplify the description of the present invention. The application, modification and variation of the tomato leaf disease detection method based on the SSP-DETR model of the present invention are obvious to those skilled in the art.

[0073] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A tomato leaf disease detection method based on the SSP-DETR model, characterized in that: The tomato leaf disease detection process is implemented by the SSP-DETR model, which is an improvement based on the RT-DETR model, including the StarNet network module, the attention feature extraction module, the multi-scale fusion module and the Decoder decoder. The specific steps include: S1. Obtain a tomato leaf disease image dataset and classify the diseased areas in the tomato leaf disease images; S2, input the tomato leaf disease image into the StarNet network module for multi-layer feature extraction, and output feature maps of four different dimensions, from low dimension to high dimension, namely P2, P3, P4, and P5; S3, input P5 into the attention feature extraction module to extract attention features, and output F5; S4, input P2, P3, P4, and F5 into the multi-scale fusion module for multi-scale feature fusion; S5, input the multi-scale fused feature map into the decoder, and output the predicted frame of the tomato leaf disease area; S6. Obtain the prediction frame of the tomato leaf disease area and the classification of the disease area in the corresponding tomato leaf disease image, calculate the total loss using the classification loss, position loss and SIoU loss, and back-propagate the optimization model; S7. Input the actually obtained tomato leaf disease image into the optimized SSP-DETR model to obtain the tomato leaf disease detection result.

2. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 1, characterized in that: The StarNet network module includes a StemLayer layer and multiple stage layers; the StemLayer layer contains a ConvBN convolution and an activation function ReLU6, and the StemLayer layer is used to convert the number of channels of the tomato leaf disease image from 3 to 32; each stage layer includes a convolution downsampling layer and a residual block, and the multiple stage layers are used to extract the features of the 32-channel tomato leaf disease image layer by layer to generate feature maps of four different dimensions.

3. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 1, characterized in that: The attention feature extraction module adopts the AIFI module in the RT-DETR model.

4. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 1, characterized in that: The multi-scale fusion module includes an SPDConv convolution, a CSPOMniKernel module and multiple KanC3 modules; the SPDConv module is used to obtain the feature map of P2 and divide it into four small areas, and then splice the four small areas in the channel dimension to achieve downsampling and feature information enhancement; the CSPOMniKernel module is used to obtain the P2, P3, P4, and F5 feature maps after splicing in the channel dimension, first adjust the number of channels through 1×1 convolution, then separate the channels proportionally, input some channels into the OmniKernel module to enhance the features, and finally merge and adjust the output to enhance the recognition ability of diseases of different scales; the KANs network architecture is introduced in the KanC3 module to replace the RepC3 module in the RT-DETR model, which is used to reconstruct the network parameters of the feature maps after splicing in the channel dimension to reduce the number of parameters.

5. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 4, characterized in that: The OmniKernel module includes three branches. The first branch uses 1×1 convolution with a stride of 1 and padding of 0 to independently adjust the features of each channel, and enhance the fine-grained feature expression within the channel without changing the spatial dimension. The second branch uses three deep convolutions: DW_13, DW_31 and DW_33 to capture features of different directions and sizes. The third branch contains FCA and SCA modules to enhance the global information expression capability of the feature map. Finally, the outputs of the three branches are concatenated in the channel dimension, processed by a ReLU activation function, and integrated by another 1×1 convolution.

6. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 1, characterized in that: The total loss function L total =L cls +λ1L box +λ2L SIoU , where L cls is the classification loss, L box is the position loss, L SIoU is the SIoU loss, λ1 and λ2 are the weight coefficients of position loss and SIoU loss, balancing the contribution of different losses.

7. The tomato leaf disease detection method based on the SSP-DETR model as claimed in claim 1, characterized in that: Tomato leaf diseases tested include bacterial spot, early blight, late blight and leaf spot.

8. An electronic device, characterized in that include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the method as described in any one of claims 1 to 7.

9. A computer readable medium having a computer program stored thereon, characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. Computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, it is the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Tomato disease detection method based on improved YOLOv5

    CN114973240A

  • Method for detecting plant diseases and insect pests of tomato leaves based on improved YOLOv5s

    CN116994056A

  • Grape leaf disease detection method

    CN118864401A

  • Systems, methods, and devices for capturing images

    WO2021109936A1

Cited By

  • Tomato leaf disease identification method, system and equipment and storage medium

    CN120339734A

  • Grape leaf disease real-time detection method based on improved RTDETR model

    CN120912852A

  • Grape leaf disease real-time detection method based on improved RTDETR model

    CN120912852B

  • A method for detecting the maturity of greenhouse cherry tomatoes

    CN122510888A

  • A method for detecting the maturity of greenhouse cherry tomatoes

    CN122510888B