Tobacco disease multi-scale detection method oriented to complex field environment

By improving the image preprocessing and feature fusion technology of the YOLO series models, the problems of accuracy and real-time performance in tobacco disease detection under complex field conditions were solved, and efficient tobacco disease detection on edge devices was achieved.

CN121640147APending Publication Date: 2026-03-10YUNNAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies for detecting tobacco diseases in complex field environments suffer from problems such as insufficient model generalization ability, low accuracy in detecting early and small lesions, high computational complexity, and difficulty in real-time deployment on edge devices.

Method used

An improved YOLO series model is adopted, and image preprocessing is performed by combining frequency domain homomorphic filtering, improved guided filtering and Poisson image editing. A multi-scale feature fusion network is constructed, and the MobileNetV3-Large backbone network and GhostNet module with ECA attention module are used for training, combined with CIoU loss and Focal Loss. The network is then optimized and deployed on edge devices.

Benefits of technology

It significantly improves the detection accuracy of early-stage micro-lesions, enhances the model's generalization performance in complex environments, and reduces computational complexity, enabling fast and accurate identification on edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640147A_ABST
    Figure CN121640147A_ABST
Patent Text Reader

Abstract

The invention discloses a complex field environment-oriented tobacco disease multi-scale detection method. The method comprises the following steps: S1, constructing a multi-environment tobacco disease image data set; s2, preprocessing the image, including frequency domain homomorphic filtering, guide filtering and Poisson image editing, so as to overcome complex field environment interference; s3, constructing an improved target detection model oriented to multi-scale disease features, replacing a backbone network with MobileNetV3, introducing GhostNet and ECA attention modules into a neck network, and performing weight sharing optimization on a detection head, so as to enhance the perception ability of tiny disease spots and morphological diversity; s4, training the model by using a joint loss function and a multi-scale training strategy; s5, the model is optimized and then deployed to edge computing equipment, and real-time detection is achieved. According to the method, the generalization ability in a complex field environment is enhanced, the model calculation complexity and parameter quantity are effectively reduced, and the method is suitable for field real-time disease inspection and early warning.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent detection of tobacco diseases, and more particularly to a multi-scale detection method for tobacco diseases in complex field environments. BACKGROUND

[0002] Tobacco is an important economic crop, and it is susceptible to various diseases during its growth process, such as tobacco mosaic disease, black shank disease, brown spot disease, and anthracnose disease. The outbreak and prevalence of these diseases have a serious impact on the yield and quality of tobacco leaves.

[0003] Currently, the monitoring and identification of diseases still mainly rely on manual patrols by agricultural technicians. This method is highly dependent on personal experience and has problems such as low efficiency, high labor cost, and strong subjectivity, making it difficult to achieve real-time monitoring on a large scale.

[0004] In recent years, computer vision technology has shown potential applications in the field of agricultural disease identification. In particular, target detection models based on deep learning, such as the YOLO series, have made real-time detection in the field possible. However, when applying existing general detection models directly to complex tobacco disease scenarios, there are still many serious challenges:

[0005] Interference from complex field environments: leaf reflection, dust adhesion, branch and leaf obstruction, and mottled shadows can all cause serious interference with image quality, leading to insufficient model generalization ability.

[0006] Detection difficulties of disease target characteristics: early micro-disease spots have weak features, and existing models can easily lose shallow features, leading to missed detection and false detection.

[0007] Variety and multi-scale of disease morphology: the same disease can present different forms at different stages and locations, and existing models lack adaptive ability.

[0008] Contradiction between model complexity and deployment cost: existing high-performance models have large computational and parameter quantities, making it difficult to meet the power consumption and real-time requirements on resource-constrained edge devices. SUMMARY

[0009] The present application aims to overcome the shortcomings of the prior art and provide a multi-scale detection method for tobacco diseases in complex field environments. This method significantly improves the detection accuracy of early micro-disease spots, enhances the generalization ability in complex field environments, and effectively reduces the model computational complexity and parameter quantity.

[0010] To achieve the above-mentioned purpose, the present application adopts the following technical solution: a multi-scale detection method for tobacco diseases in complex field environments, comprising the following steps:

[0011] S1, collect multiple types of tobacco disease images, and construct a tobacco disease dataset. For tobacco mosaic disease, wild fire disease, brown spot disease, anthracnose disease and other main diseases, systematically collect disease image samples containing different disease stages, multiple environmental light conditions and different shooting angles. In the collection process, the corresponding environmental metadata of each image is recorded synchronously, including collection time, geographical location, light intensity and weather conditions, and standardized verification of the collection process is implemented to ensure data quality and the reliability of subsequent model training.

[0012] S2, pre-process the tobacco disease images, and label the disease spot area in the images to obtain a training dataset.

[0013] S2 specific steps are:

[0014] S2.1 Frequency domain homomorphic filtering enhancement

[0015] To solve the problem of uneven field illumination, a frequency domain filtering method is used to realize dynamic range compression. The specific process is as follows:

[0016] In the spatial domain, the image is represented as the product of the illumination component and the reflection component:

[0017] ;

[0018] Convert to the logarithmic domain by logarithmic transformation:

[0019] ;

[0020] After applying the Fourier transform, a Gaussian homomorphic filter is used for processing:

[0021] ;

[0022] wherein, represents the distance from the center point (u, v) in the frequency domain to the center point, is the cutoff frequency, c is the control slope parameter, and control the high frequency gain and low frequency attenuation, respectively.

[0023] S2.2 Improved guided filter denoising

[0024] To denoise while preserving the edge features of the disease spots, an improved guided filter algorithm is used. Define the cost function:

[0025] ;

[0026] wherein, is the regularization parameter, is the number of pixels in the window. After solving the coefficient by linear regression, the output image is:

[0027] ;

[0028] wherein, is the pixel value of the output image at position ii, is the number of all windows containing pixel ii, , is the pixel value of the guidance image at position ii.

[0029] S2.3 Improved Poisson image editing

[0030] For the lesion area with occlusion, the improved Poisson equation is used for repair. An optimization problem is constructed:

[0031] ;

[0032] A linear system is obtained by discretization:

[0033] ;

[0034] The multigrid method is used to accelerate the solution process to ensure the natural transition of the repaired area and the surrounding texture.

[0035] After the above preprocessing is completed, a three-level annotation quality control system is established: primary annotation, cross-validation, expert review, to ensure the consistency and accuracy of the annotation data, and to provide a reliable data foundation for model training.

[0036] S3, an improved YOLO series model oriented to multi-scale disease characteristics is constructed, specifically including:

[0037] S31, the backbone network of the target detection model is replaced by MobileNetV3-Large network; the network uses depth separable convolution to build a feature extraction unit, and embeds a channel attention module based on squeezing and excitation; after replacement, the output multi-scale feature map is retained as the input of the neck network;

[0038] S32, in the feature pyramid network structure of the target detection model, a series structure of GhostNet module and ECA attention module is used to replace part of the standard convolution block; the GhostNet module generates redundant feature maps through linear operation, and the ECA attention module generates channel weights through one-dimensional convolution without dimension reduction, and adaptively calibrates the feature channels;

[0039] S33, the decoupled detection head of the target detection model is reconstructed, and in each scale of the classification and regression branch, the structure of “1x1 convolution dimension reduction + 3x3 convolution” is used to replace the original continuous standard convolution, and the detection heads of different scales share the weights of the 1x1 convolution layer, and the subsequent 3x3 convolution layer remains independent.

[0040] S4, training the multi-scale disease feature oriented target detection model using the training data set, wherein a joint loss function used in the training includes CIoU loss, Focal Loss and Distribution Focal Loss. The step S4 includes:

[0041] S41, using an adaptive momentum optimizer to train the model, wherein an initial learning rate is set to 0.01, and a cosine annealing strategy is used to dynamically adjust the learning rate, so that the learning rate is decayed from the initial value to 0.0001 with the training round;

[0042] S42, optimizing the model using a joint loss function, which is composed of three parts:

[0043] The CIoU loss is used for boundary box regression, which considers the overlapping area, center point distance and aspect ratio. The Focal Loss is used for classification task, which alleviates the class imbalance problem by adjusting the weights of difficult and easy samples. The Distribution Focal Loss is introduced for regression task to improve the positioning accuracy of the boundary box;

[0044] S43, implementing a multi-scale training strategy, wherein the scale of the input image is randomly selected in each training cycle, and the scale range is dynamically adjusted between 0.5 times and 1.5 times of the original size, so as to enhance the adaptability of the model to different scale disease features;

[0045] S44, updating the model weight using an exponential moving average strategy, wherein the model parameters are updated after each training iteration, and the formula is:

[0046]

[0047] wherein is set to 0.9999, is the current model parameter, is the smoothed model parameter;

[0048] S45, setting an early stopping mechanism, wherein when the average precision on the validation set no longer improves for 20 consecutive training cycles, the training process is automatically terminated, and the optimal model weight is preserved.

[0049] S5, deploying the trained multi-scale disease feature oriented target detection model to an edge computing device. The step S5 includes:

[0050] S51, converting the trained multi-scale disease feature oriented target detection model into an ONNX standard format; and realizing node fusion and constant folding through a computational graph optimization technique to generate an optimized version adapted to different hardware platforms; ​

[0051] S52, configure the OpenVINO inference framework for the edge device, and adapt the PyTorch Mobile inference environment for the mobile terminal; set a multi-thread parallel processing mechanism and enable an asynchronous inference mode;

[0052] S53, build a multi-thread architecture for collection-inference-post-processing; integrate a fast non-maximum suppression algorithm, set an intersection over union threshold and a confidence threshold, and ensure that the end-to-end inference delay meets the real-time detection requirement;

[0053] S54, deploy the optimized model to an embedded device, and realize accurate obstacle ranging in combination with distance sensor data; establish a performance monitoring and fault self-recovery mechanism to ensure stable operation of the system;

[0054] S55, verify the detection accuracy and inference efficiency of the model on the edge device through field tests under different environmental conditions; and optimize the system according to the test results to complete the final deployment.

[0055] Compared with the prior art, the present application has the following beneficial effects:

[0056] The beneficial effects of the present application are: through the improved model architecture and multi-scale feature fusion mechanism, high-precision detection of tobacco diseases in complex field environments is realized; through the enhanced attention mechanism and feature extraction network, the recognition ability for early-stage micro lesions is significantly improved, and the detection blind area caused by the diversity of disease morphology and the change of scale is effectively overcome; in combination with the image preprocessing technology for complex lighting conditions, the generalization performance and stability of the model in variable environments are greatly enhanced; finally, through the optimized model structure and deployment scheme, fast and accurate recognition of tobacco diseases on the edge device is realized, which provides an effective technical means for real-time monitoring and early warning of field diseases. BRIEF DESCRIPTION OF DRAWINGS

[0057] Fig. 1 is the overall flowchart of the embodiment of the present application;

[0058] Fig. 2 is the improved YOLO series model construction flowchart for multi-scale disease features. DETAILED DESCRIPTION

[0059] The specific embodiments of the present application will be further described in detail below in combination with the accompanying drawings. Figs. 1-2 The specific embodiments of the present application will be further described in detail below in combination with the accompanying drawings.

[0060] S1, System construction of multi-environment and multi-scale tobacco disease image dataset

[0061] S11, Sampling area and equipment selection: Image collection was carried out simultaneously in the Yunnan Agricultural University test base and the Yuhuang Township tobacco field in Malong District, Qujing City, Yunnan Province. Huawei Mate 60 Pro and other mainstream smartphones were selected as the collection equipment, and they were set to professional shooting mode with a resolution of 4000x3000 pixels.

[0062] S12, Collection scheme design: In the Yuhuang Township tobacco field, samples of diseases such as long-term flower leaf disease and red spot disease were collected. Image collection was carried out after the dew dissipated in the morning, during the strong light period at noon, and during the soft light period in the evening. In the Yunnan Agricultural University test base, images of the whole process of diseases such as anthracnose and wild fire were collected under different environmental conditions such as glass greenhouse, plastic greenhouse, and field.

[0063] S13, Standardized collection process: Each smartphone was equipped with a portable ring-shaped light supplement device to ensure uniformity of illumination. The fixed shooting distance was 30-50 cm, and the lens was kept parallel to the leaf plane. GPS positioning information, environmental temperature and humidity, and disease occurrence site metadata were recorded synchronously.

[0064] S14, Data arrangement and quality control: A double-check mechanism was established on site, with collection personnel and plant protection experts jointly checking image quality and metadata accuracy. The collected raw images were uniformly screened, and unqualified samples such as blur and overexposure were removed. The files were renamed according to the "collection date-site number-disease code-sequence number" rule, and finally a standardized disease dataset containing 4200 high-quality images was constructed, providing reliable data support for subsequent model training.

[0065] S2, Preprocessing and labeling of collected tobacco disease images of various types: This step aims to improve image quality and lay the foundation for model training

[0066] S21, Frequency domain homomorphic filtering enhancement: For uneven illumination, frequency domain homomorphic filtering is used for dynamic range compression. MATLAB R2022a image processing toolbox is used to implement frequency domain homomorphic filtering. First, the RGB image is converted to HSV color space, and the homomorphic filtering process is performed on the brightness component V: set the cutoff frequency D0=0.3, the high-frequency gain γH=1.8, the low-frequency gain γL=0.6, and the control slope parameter c=1.2. Through Fourier transform, the image is converted to the frequency domain, and a Gaussian homomorphic filter is applied to complete the illumination component suppression and reflection component enhancement. Finally, the enhanced brightness channel is reconstructed through Fourier inverse transform, combined with the chroma channel, and converted back to the RGB space.

[0067] S22, Improved guided filter denoising: To preserve the lesion edge features while denoising, an improved guided filter algorithm is adopted. The improved guided filter algorithm is implemented based on the OpenCV 4.5.5 library. The filter window radius r is set to 8, the regularization parameter ε is set to 0.1^2, and a Gaussian weighting is used instead of the traditional mean weighting to calculate the local window statistics. For the homomorphic filter enhanced image, independent guided filter processing is performed on its R, G, and B channels respectively, which effectively suppresses image noise while maintaining the sharpness of the lesion edge, especially for the common dust noise and moire interference in field collection.

[0068] S23, Improved Poisson image editing: For the occluded lesion area, an improved Poisson equation is used for image inpainting. The improved Poisson image editing is implemented using the Scikit-image 0.19.3 library of Python. For the missing lesion area caused by leaf occlusion and water droplet adhesion, the region to be repaired is first determined by Canny edge detection combined with morphological operation, the boundary condition is set as Dirichlet boundary condition, the multi-grid method is used to solve the Poisson equation, the iteration number is set to 200 times, and the convergence threshold is set to 1e-6, to ensure the natural transition of illumination and texture between the repaired region and the surrounding healthy tissue region.

[0069] S24, Establish a three-level annotation quality control system based on LabelImg 1.8.6. The primary annotation is completed by trained agronomy students, who label the rectangular box of the lesion area and identify the disease type on the preprocessed image; in the cross-validation stage, two technical personnel with more than three years of plant protection experience independently review the samples, and discuss and determine the inconsistent samples; in the expert review stage, tobacco plant protection experts are invited to make the final decision on the difficult samples.

[0070] S3, Construct a target detection model for multi-scale disease features

[0071] S31, Backbone network reconstruction: Based on the PyTorch deep learning framework, the backbone network of the original YOLO model is replaced by a deep separable convolution architecture. The specific implementation includes: using deep separable convolution instead of standard convolution to significantly enhance the model's feature extraction ability in complex field environments. In the specific implementation, a double-branch structure is established: the main branch retains the original features, and the auxiliary branch enhances the features through 1x1 convolution, 3x3 deep separable convolution, and 1x1 convolution. The calculation process of the deep separable convolution is:

[0072] ;

[0073] ;

[0074] wherein, represents the input feature map, denotes a 3x3 convolution operation, denotes a grouped feature map, denotes a 1x1 convolution operation. This design directly serves the complex environmental disease recognition needs of tobacco disease detection, while reducing the computational complexity to 1 / 8-1 / 9 of traditional convolution.

[0075] S32, neck network enhancement: for the multi-scale characteristics of tobacco diseases, a multi-scale enhancement module is introduced in the feature pyramid. A dual-path architecture is adopted: the main path uses grouped convolution to extract features, and the grouping number is 1 / 4 of the input channel number; the auxiliary path captures details through channel compression (compression ratio 0.5) and spatial convolution. This design is specifically aimed at the morphological diversity of tobacco lesions, enhancing the model's detection ability for lesions of different scales. The two paths are fused through adaptive weights:

[0076] ;

[0077] wherein, denotes the output feature of the main path, denotes the output feature of the auxiliary path, and are adaptive weight coefficients calculated by global average pooling and fully connected layers. The weight coefficients are dynamically generated by global average pooling and fully connected layers, allowing the network to adjust the fusion strategy according to the input features and improve the recognition accuracy of tobacco diseases in complex backgrounds.

[0078] S33, detection head optimization: a multi-scale detection mechanism with parameter sharing is adopted, and three detection scales (80x80, 40x40, 20x20) share the same 1x1 convolution dimension reduction layer:

[0079] ;

[0080] wherein is a shared weight matrix. This design enhances the consistency of feature representation through weight sharing, while significantly reducing the parameter amount. Each scale retains an independent 3x3 depth separable convolution layer to process features of different scales, ensuring detection accuracy for tobacco lesions of different sizes. Specifically, the 80x80 scale focuses on small lesion detection, the 40x40 scale processes medium lesions, and the 20x20 scale is responsible for large lesion recognition.

[0081] The bounding box decoding process is precisely designed for the positioning needs of tobacco lesions:

[0082]

[0083]

[0084]

[0085] ;

[0086] wherein , , , are the network predicted offsets, ( , ) are the grid coordinates, and ( , ) are the prior box sizes. This decoding method constrains the predicted values within a reasonable range through the sigmoid function and enhances the position sensitivity through scale transformation, which is suitable for the accurate position regression of tobacco disease spots.

[0087] S34, To solve the detection difficulty of tobacco disease spots in complex leaf background, a multi-scale attention module is specially designed. The channel attention mechanism enhances the response of key feature channels through the compression excitation structure:

[0088] ;

[0089] ;

[0090] wherein is the channel statistics obtained by global average pooling, and are the dimension reduction and dimension increase fully connected layer weights, is the ReLU activation function, is the Sigmoid function. This mechanism enables the model to autonomously enhance the feature channels related to tobacco diseases and suppress irrelevant background features.

[0091] The spatial attention module focuses on the spot area:

[0092] ;

[0093] wherein and are the average and maximum pooling features of the channel dimension, respectively, which capture the spatial context information through 7×7 convolution to generate a spatial attention weight map. This mechanism enables the model to accurately focus on the spot area on the tobacco leaf and effectively distinguish the spot from healthy tissue, dust and other interference factors.

[0094] S35, To meet the precision requirements of tobacco disease detection, a targeted training strategy is adopted. The weight initialization uses Kaiming normal distribution:

[0095] ;

[0096] wherein is the number of input channels. A smaller initialization variance (0.01) is set for shared weights to enhance stability, and a standard initialization variance (0.1) is set for independent convolutional layers to maintain expressiveness.

[0097] The loss function uses CIoU, which is specifically optimized for lesion positioning accuracy:

[0098] ;

[0099] wherein IoU represents the intersection over union, represents the Euclidean distance between the center points of the predicted box and the real box, is the diagonal length of the minimum circumscribed rectangle, is the weight coefficient, measures the consistency of the aspect ratio:

[0100] ;

[0101] wherein, and represent the width and height of the real box, and represent the width and height of the predicted box. This loss function comprehensively considers the overlapping area, center point distance, and aspect ratio, and is particularly suitable for tobacco lesion detection with variable shapes. At the same time, Focal Loss is combined to solve the imbalance problem of positive and negative samples, ensuring the robust performance of the model in complex field environments.

[0102] S4, training a multi-scale disease feature oriented target detection model

[0103] S41, based on the PyTorch framework, a training environment is built, the training period is set to 300 epochs, and the batch size is set to 16. A cosine annealing learning rate scheduling strategy is used, the initial learning rate is set to 0.01, and the minimum learning rate is set to 0.0001. The AdamW optimizer is used, the weight decay coefficient is set to 0.05, and the β parameter is configured as (0.9, 0.999). The mixed precision training mode is enabled, and the FP16 and FP32 calculations are automatically managed by the torch.cuda.amp module.

[0104] S42, construct a combined loss function consisting of three parts: the bounding box regression adopts CIoU loss, which considers the overlap area, center point distance and aspect ratio; the classification task adopts Focal Loss, which adjusts the weights of difficult and easy samples to alleviate the class imbalance problem, where the α parameter is set to 0.25 and the γ parameter is set to 2.0; the regression task introduces DistributionFocal Loss to improve the positioning accuracy of the bounding box. In the training process, dynamic weight adjustment is performed on each loss component to ensure balanced optimization between different tasks.

[0105] S43, implement a multi-level data augmentation scheme, including two stages of basic augmentation and advanced augmentation. Basic augmentation includes random horizontal flip, random rotation, color jittering, etc. Advanced augmentation adopts Mosaic data augmentation technology, which randomly selects 4 training images for splicing in each batch. At the same time, a multi-scale training strategy is implemented, which randomly selects the scale of the input image in each training cycle, and the scale range is dynamically adjusted between 0.5 times and 1.5 times of the original size.

[0106] S44, update the model weights using the exponential moving average strategy, and set the smoothing coefficient β to 0.9999. Set the early stopping mechanism, which automatically stops training when the performance of the validation set does not improve for 20 consecutive cycles. For edge device deployment, use ONNXRuntime for model conversion, and use OpenVINO tool suite for acceleration optimization on smartphones to ensure real-time inference performance.

[0107] S5, deploy the trained multi-scale disease feature-oriented target detection model to edge computing devices

[0108] S51, convert the trained model to ONNX standard format, set the dynamic input size [1,3,640,640], enable cross-platform compatibility optimization, and ensure the portability of the model between different devices.

[0109] S52, implement node fusion and constant folding technology to eliminate redundant calculation nodes, and generate optimized versions for ARM and x86 architectures respectively, significantly improving inference efficiency.

[0110] S53, select the appropriate inference framework according to the device computing power, configure the number of threads and batch parameters, and enable asynchronous inference mode to maximize hardware utilization efficiency

[0111] S54, use OpenVINO acceleration for smartphones, deploy PyTorch Mobile on mobile devices, and achieve the best performance adaptation and resource allocation for different architecture devices.

[0112] S55, construct a multi-thread parallel architecture to realize pipeline operation of image acquisition, model inference and result post-processing, and ensure that end-to-end delay is controlled within 100 ms.

[0113] S56, establish a load sensing mechanism, dynamically adjust inference accuracy and memory usage, implement an intelligent caching strategy, and ensure long-term stable operation of the system.

[0114] S57, deploy the optimized model to an embedded system, conduct multi-scenario testing combined with sensor data, and continuously optimize to ensure actual application reliability.

[0115] The key innovation of the method is that a systematic solution is proposed for the problem of tobacco disease detection in complex field environment. The scheme effectively improves the detection rate of small lesions, the adaptability to multi-scale diseases and the overall robustness in complex environments through deep feature extraction of backbone network, multi-scale attention fusion of neck network, targeted optimization of detection head, comprehensive use of image preprocessing technology, and training and deployment strategies for actual scenarios, and realizes efficient real-time operation on edge devices.

[0116] First, in terms of model architecture design, the original backbone network of YOLO architecture is replaced with MobileNetV3-Large network, which uses depth separable convolution as the basic building block and embeds channel attention mechanism based on squeeze and excitation to enhance the model's ability to extract disease features in complex backgrounds.

[0117] In the feature fusion stage, the scheme introduces a series structure of GhostNet module and ECA attention module in the feature pyramid network. GhostNet generates redundant representations of feature maps through linear operations, and ECA module adaptively calibrates channel weights through one-dimensional convolution, which together improves the network's ability to fuse multi-scale disease features.

[0118] In the detection head part, the decoupled detection head of the YOLO target detection model is reconstructed, using the structure of "1x1 convolution dimension reduction + 3x3 convolution" to replace the original continuous standard convolution, and sharing 1x1 convolution weights between different scale detection heads to enhance the model's ability to detect small lesions and multi-scale diseases. In the image preprocessing link, the scheme proposes a number of enhancement techniques for complex field lighting and noise interference. Frequency domain homomorphic filtering effectively suppresses uneven lighting through dynamic range compression; improved guided filtering preserves lesion edge sharpness while denoising; and improved Poisson image editing naturally repairs occluded areas. These techniques work together to significantly improve input image quality, providing a reliable data foundation for model training.

[0119] In terms of model training, the application adopts multiple targeted strategies: using an adaptive momentum optimizer combined with cosine annealing learning rate adjustment; introducing a joint loss function composed of CIoU loss, Focal Loss and Distribution Focal Loss to optimize boundary box regression and classification accuracy; implementing multi-scale training and exponential moving average weight update to enhance model generalization ability and stability; and avoiding overfitting through an early stopping mechanism to ensure that the model converges to an optimal state.

[0120] Finally, in the deployment phase, the application realizes efficient operation on edge devices such as smartphones through model format conversion, node fusion, multi-thread parallel processing and asynchronous reasoning technologies. Combined with load sensing and intelligent caching mechanisms, the system can maintain low latency and high stability in real-time detection performance in complex field environments, meeting the dual demands of speed and accuracy in actual agricultural applications.

[0121] In summary, the application forms a tobacco disease detection solution for complex field environments through full-link innovation from data preprocessing, model architecture design, training optimization to edge deployment, significantly improving detection accuracy and robustness in complex actual scenarios while reducing deployment costs.

[0122] The above is only the preferred embodiment of the application, and the protection scope of the application is not limited to the above examples. Any technical solution that falls within the scope of the application should be considered within the protection scope of the application. It should be noted that for ordinary technical personnel in the technical field, some improvements and refinements without departing from the principles of the application should also be considered within the protection scope of the application.

Claims

1. A tobacco disease multi-scale detection method for complex field environment, characterized in that, The method comprises the following steps: S1, collecting multiple types of tobacco disease image, and constructing a tobacco disease dataset; S2, preprocessing the tobacco disease image, and labeling the disease spot area in the image to obtain a training dataset; S3, constructing an improved target detection model for multi-scale disease characteristics, specifically comprising: S31, replacing the backbone network of the target detection model with a MobileNetV3-Large network; the network uses a depth separable convolution as a basic construction unit, and embeds a channel attention module based on squeezing and excitation; after replacement, the output multi-scale feature map is retained as the input of the neck network; S32, in the feature pyramid network structure of the target detection model, a series structure of GhostNet module and ECA attention module is used to replace part of the standard convolution block; S33, the decoupling detection head of the target detection model is reconstructed, and in each scale of the classification and regression branch, the structure of "1x1 convolution dimension reduction+3x3 convolution" is used to replace the original continuous standard convolution, and the weights of the 1x1 convolution layer are shared by the detection heads of different scales, and the subsequent 3x3 convolution layer remains independent; S4, training the improved target detection model for multi-scale disease characteristics using the training dataset, and the joint loss function used in the training includes CIoU loss, Focal Loss and Distribution Focal Loss; S5, deploying the trained target detection model for multi-scale disease characteristics to an edge computing device.

2. The tobacco disease multi-scale detection method for complex field environment according to claim 1, characterized in that, The step S2 specifically comprises: S2.1, frequency domain homomorphic filtering enhances the problem of uneven field illumination, and adopts a frequency domain filtering method to realize dynamic range compression, and the specific process is as follows: In the spatial domain, the image is represented as the product of the illumination component and the reflection component: ; Through logarithmic transformation, it is converted to the logarithmic domain: ; After applying the Fourier transform, a Gaussian homomorphic filter is used for processing: ; wherein, represents the distance from the point (u, v) in the frequency domain to the center point, is the cut-off frequency, c is the control slope parameter, and control the high frequency gain and low frequency attenuation, respectively; S2.2, improved guided filtering denoising is used to remove noise while preserving the edge features of the disease spot area, and an improved guided filtering algorithm is used to define a cost function: ; wherein, is a regularization parameter, is the number of pixels in the window, the output image is obtained by solving the coefficients through linear regression. ; wherein, is the pixel value of the output image at position ii, is the number of all windows containing pixel ii, , is the pixel value of the guidance image at position ii; S2.3, improved Poisson image editing is used to repair the disease spot area with occlusion by constructing an optimization problem: ; Through discretization, a linear system is obtained: ; A multi-grid method is used to accelerate the solving process to ensure the natural transition of the repaired area and the surrounding texture. After the above preprocessing is completed, a three-level annotation quality control system is established: primary annotation, cross-validation, and expert review, to ensure the consistency and accuracy of the annotation data, and to provide a reliable data basis for model training.

3. The tobacco disease multi-scale detection method for complex field environment according to claim 1, characterized in that: In the step S32, the GhostNet module generates redundant feature maps through linear operation, and the ECA attention module generates channel weights through one-dimensional convolution without dimension reduction, and adaptively calibrates the feature channels.

4. The tobacco disease multi-scale detection method for complex field environment according to claim 1, characterized in that, The S4 step comprises: S41, using an adaptive momentum optimizer for model training, setting the initial learning rate to 0.01, and dynamically adjusting the learning rate with a cosine annealing strategy, so that the learning rate decays from the initial value to 0.0001 during the training process; S42, the model is optimized using a joint loss function composed of three parts: CIoU loss is used for bounding box regression, which considers the overlap area, center distance and aspect ratio; Focal Loss is used for classification task to alleviate the class imbalance problem by adjusting the weights of difficult and easy samples; DistributionFocal Loss is introduced for regression task to improve the positioning accuracy of bounding box; S43, a multi-scale training strategy is implemented, which randomly selects the scale of input images in each training cycle, and the scale range is dynamically adjusted between 0.5 and 1.5 times of the original size, to enhance the model's adaptability to different scale disease characteristics; S44, the exponential moving average strategy is used to update the model weight, and the model parameters are updated after each training iteration, the formula is: ; wherein is set to 0.9999, is the current model parameter, is the smoothed model parameter; S45, set early stop mechanism, when the average precision on the validation set no longer improves in the last 20 training cycles, automatically terminate the training process, and keep the optimal model weight.

5. The tobacco disease multi-scale detection method for complex field environment according to claim 1, characterized in that, The S5 step includes: S51, convert the target detection model trained for multi-scale disease characteristics into ONNX standard format; realize node fusion and constant folding through computational graph optimization technology to generate optimized versions adapted to different hardware platforms; S52, configure OpenVINO inference framework for edge devices, and adapt PyTorch Mobile inference environment for mobile terminals; set multi-thread parallel processing mechanism and enable asynchronous inference mode; S53, build a multi-thread architecture of acquisition-inference-post-processing; integrate fast non-maximum suppression algorithm, set intersection over union threshold and confidence threshold to ensure that the end-to-end inference delay meets the real-time detection requirements; S54, deploy the optimized model to embedded devices, and realize accurate obstacle ranging combined with distance sensor data; establish performance monitoring and fault self-recovery mechanism to ensure stable operation of the system; S55, through field tests under different environmental conditions, verify the detection accuracy and inference efficiency of the model on edge devices; according to the test results, optimize the system and complete the final deployment.