Citrus disease and pest cross-device generalization detection method and system

CN123016038APending Publication Date: 2026-10-30CITRUS RES INST SOUTHWEST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610616509.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0008]本发明的目的之一在于,提供柑橘病虫害跨设备泛化检测方法,能够解决传统检测模型在不同采集设备间性能退化的问题

Benefits of technology

[0018]本方案通过分别采用不同边缘设备采集图像并构建数据集,结合以叶片为基本标注单位的策略,不仅大幅提升了标注效率,还使得模型学习到的特征直接与农业生产中受害叶片率的灾情评估指标契合,增强模型在复杂田间背景下的检测鲁棒性。对训练集应用数据增强操作,有效模拟了果园非结构化环境中的各类干扰,为提升模型的泛化能力奠定了坚实的数据基础。本方案在YOLOv11基线模型中创新性地整合了坐标注意力、高频增强残差块以及多路径聚合网络三个特征增强模块,构建了YOLO-GDM模型。这种分阶段的特异性增强机制,使得模型能够在深层语义层面有效抑制复杂背景干扰,在特征提取阶段针对性地恢复因设备差异衰减的高频细节,并实现大目标与小目标多尺度特征的自适应聚合,从而跨越了异购物联网设备间的视觉域鸿沟,实现了高精度、高适应性的跨设备协同检测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016038A_ABST
    Figure CN123016038A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image recognition, and specifically discloses a citrus disease and pest cross-device generalization detection method and system, which comprises the following contents: S1, different edge devices are respectively used as image acquisition terminals to collect citrus disease and pest images, and a citrus disease and pest dataset is constructed; S2, a leaf-based labeling strategy is used to label all the collected citrus disease and pest images; S3, the citrus disease and pest dataset is divided into a training set, a verification set and a test set; S4, a data enhancement operation is applied to the training set; S5, three feature enhancement modules, namely, a coordinate attention, a high-frequency enhancement residual block and a multi-path aggregation network, are integrated with a YOLOv11n baseline model to form a citrus disease and pest detection model YOLO-GDM; and S6, the constructed citrus disease and pest detection model YOLO-GDM is trained through the training set until a preset requirement is met. The technical scheme of the present application can solve the problem of performance degradation of a traditional detection model between different acquisition devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a cross-device generalized detection method and system for citrus diseases and pests. Background Technology

[0002] The traditional pest and disease control model in the citrus industry mainly relies on regular spraying of chemical pesticides and manual field inspections. However, this model has revealed numerous limitations in practice. Over-reliance on chemical control not only increases production costs but also easily leads to a series of problems such as excessive pesticide residues, aggravated non-point source pollution, and increased pesticide resistance in pests and diseases, which contradicts my country's strategic orientation of green agricultural development. Manual inspections suffer from low efficiency and limited coverage. Furthermore, the accuracy of identification heavily depends on the professional experience and condition of the inspectors, making early detection and precise location of pests and diseases difficult, often resulting in missed opportunities for optimal control.

[0003] With rising labor costs and an aging agricultural workforce, traditional labor-intensive pest and disease control methods are no longer sustainable. Machine vision-based intelligent pest and disease detection technology is a core technological approach to improve control efficiency and accuracy. To achieve routine, automated, and intelligent monitoring of orchard pests and diseases, the introduction of fixed-position PTZ cameras (with horizontal / vertical rotation and zoom capabilities) has become essential. Compared to automated monitoring methods such as drones, PTZ cameras offer advantages such as low deployment costs, easy installation and maintenance, and strong operational stability, and have become widely used monitoring equipment in modern orchard infrastructure. PTZ cameras are typically deployed at high points in the orchard (5-8 meters above the ground), leveraging optical zoom and pan-tilt-zoom capabilities to achieve continuous, large-scale image acquisition of specific canopy areas around the clock, meeting the core needs of unattended automated monitoring in orchards. Therefore, constructing a collaborative detection system for citrus pests and diseases that integrates "close-range mobile phone diagnostics" and "long-range PTZ camera monitoring" is an inevitable direction for achieving routine and intelligent management of smart orchards. Smartphones can acquire high-resolution details of disease and pest characteristics, suitable for accurate identification and on-site control decisions; fixed-position PTZ cameras can achieve all-weather, large-area automated image acquisition, supporting long-term trend analysis and early warning of disease and pest occurrence. The two complement each other, forming a three-dimensional monitoring network for citrus diseases and pests, from "point" to "area," and from "instant" to "continuous."

[0004] However, at present, it faces two core technical challenges: cross-device generalization and lightweight deployment. The primary bottleneck is the insufficient cross-device generalization ability of the detection model: the same model struggles to effectively adapt to heterogeneous image inputs from mobile phones and PTZ cameras while maintaining stable detection performance, creating a significant device domain gap. Specifically: Scale difference: In images captured by mobile phones, the average area of ​​lesions is high, while in images captured by PTZ cameras, the lesion scale is significantly smaller, usually accounting for less than 30%; Differences in resolution and sharpness: Mobile phone images retain rich details of lesion texture, while PTZ cameras, due to their longer shooting distance, show significant loss of high-frequency information in their images; Differences in background complexity: The background of mobile phone images is relatively controllable, while PTZ camera images contain more complex and interfering backgrounds such as branches and leaves obstructing the view and ground interference. Difference in perspective: Mobile phones offer flexible shooting angles and a high degree of image perspective, while PTZ cameras are fixed in place all day and night, resulting in a limited variety of image perspectives.

[0005] These differences lead to significant distribution shifts in the visual representation of the same pest or disease across images from different devices. Models trained and optimized for deployment on a single device often exhibit a sharp drop in accuracy and an increase in false negatives / missed positives on another type of device, severely limiting the practical application value of multi-device collaborative detection systems. Another core bottleneck is the challenge of efficient model deployment on edge devices. Smartphones and network PTZ cameras are both edge computing devices, generally facing hardware constraints such as limited computing power, small memory capacity, high battery life requirements, and unstable network connections. Current detection performance models, in pursuit of high accuracy, often employ deep, wide-channel network structures, resulting in a large number of parameters and high computational complexity. Directly deploying such high-performance models to the edge can lead to slow inference speeds due to excessive computational load, failing to meet the real-time requirements of actual detection, and may also cause device lag and crashes due to excessive memory consumption.

[0006] Furthermore, in cross-device detection scenarios, lightweighting of models also needs to address the challenge of "asymmetric performance degradation": If compression is performed with the accuracy of data from a single device as the optimization goal, the compressed model may be more sensitive to device differences and experience more severe performance degradation on another type of device.

[0007] Therefore, there is a need for a cross-device generalized detection method and system for citrus diseases and pests that can solve the problem of performance degradation of traditional detection models across different acquisition devices. Summary of the Invention

[0008] One of the objectives of this invention is to provide a cross-device generalized detection method for citrus diseases and pests, which can solve the problem of performance degradation of traditional detection models across different collection devices.

[0009] To solve the above-mentioned technical problems, this application provides the following technical solution: A cross-device generalized detection method for citrus diseases and pests includes the following: S1. Collect images of citrus diseases and pests using different edge devices as image acquisition terminals, and construct a citrus disease and pests dataset. S2. A labeling strategy based on leaves as the basic labeling unit was adopted to label all collected images of citrus diseases and pests. S3. Divide the citrus disease and pest dataset into a training set, a validation set, and a test set; S4. Apply data augmentation operations to the training set; S5. YOLOv11 is used as the baseline model for the target detection task; the three feature enhancement modules, coordinate attention, high-frequency enhanced residual block and multi-path aggregation network, are integrated with the YOLOv11n baseline model to form the citrus disease and pest detection model YOLO-GDM. S6. Train the constructed citrus pest and disease detection model YOLO-GDM using the training set until it meets the preset requirements.

[0010] Furthermore, it also includes: S7. Conduct resource constraint analysis on different edge devices, and establish lightweight optimization directions based on this analysis; S8. Perform structured pruning on the YOLO-GDM model for detecting citrus diseases and pests.

[0011] Furthermore, in step S1, the edge devices include smartphones and PTZ cameras; When collecting data using a smartphone, the fixed shooting angle is perpendicular to the leaf plane. Ten distance gradients are set from 10cm to 100cm. At each distance gradient, images are collected for five typical citrus diseases and pests: canker, leaf miner, moth disease, greasy spot disease, and nutrient deficiency. When using a PTZ camera, images of the upper part of the canopy of citrus trees, 1.8-2.2 meters above the ground, are captured at a distance of 5-10 meters.

[0012] Furthermore, in step S2, when labeling at the leaf level, each complete leaf infected by pests and diseases is framed as an independent detection target, and the category label is determined based on the dominant disease type on that leaf.

[0013] Furthermore, in step S4, the data augmentation operation includes: Multi-scale random cropping, with a cropping ratio ranging from 0.7 to 1.0; Color space perturbation, HSV ±30% perturbation, saturation component ±20% perturbation; Geometric transformations, including ±15° random rotations and random horizontal flips; Noise simulation, set σ=0.05; Simulated fogging enhancement is achieved by superimposing a semi-transparent fog layer with a transparency of 0.1 to 0.3.

[0014] Furthermore, in step S5, the overall architecture of YOLOv11 includes a high-efficiency feature extraction backbone network, a multi-scale feature fusion neck network, and a dynamic anchor box detection head. The HFERB module is embedded inside Backbone's C3k2 module to enhance the model's ability to extract high-frequency details; A CA module is inserted at the end of the backbone to suppress interference from complex backgrounds at the level of deep semantic features; In the FPN upsampling path and PANet downsampling path of Neck, the MANet module is inserted at the feature fusion nodes of the three scale levels of P3, P4 and P5 to realize adaptive aggregation of multi-scale features of large targets and small targets.

[0015] Furthermore, in step S7, the constraint scenarios include: solar power consumption constraints, storage and memory constraints, and real-time and stability constraints. The lightweighting goals include parameter reduction, computational complexity optimization, cross-device performance maintenance, and deployment adaptability.

[0016] Furthermore, in step S8, the structured pruning step specifically includes: Model preparation phase: Load the trained YOLO-GDM model weights, freeze the BatchNorm layer parameters, and retain the optimal weights obtained during model training; The progressive pruning phase involves multiple iterations, each including channel importance assessment and progressive pruning. The progressive pruning rule is to remove the lowest 0.1% of channels in the current iteration. After each round of pruning, a fast validation assessment (mAP@50) is performed. When mAP@50 decreases by more than 2% after 10 consecutive rounds of pruning, early pruning is triggered. Performance recovery phase: Phase 1: Fine-tune the pruned lightweight model for 300 epochs, using only the detection task loss. To restore the basic detection performance of the model; Phase Two: Using the fine-tuned model as the student model and the fully structured YOLO-GDM as the teacher model, logistic distillation loss is introduced to improve model performance.

[0017] The second objective of this invention is to provide a cross-device generalized detection system for citrus diseases and pests, using the above-mentioned method.

[0018] This solution utilizes images acquired from different edge devices to construct datasets, combined with a leaf-based labeling strategy. This significantly improves labeling efficiency and ensures that the features learned by the model directly align with disaster assessment indicators such as the rate of damaged leaves in agricultural production, enhancing the model's robustness in complex field environments. Data augmentation operations are applied to the training set to effectively simulate various disturbances in unstructured orchard environments, laying a solid data foundation for improving the model's generalization ability. This solution innovatively integrates three feature enhancement modules—coordinate attention, high-frequency enhanced residual blocks, and a multi-path aggregation network—into the YOLOv11 baseline model, constructing a YOLO-GDM model. This phased, specific enhancement mechanism enables the model to effectively suppress complex background interference at the deep semantic level, specifically recover high-frequency details attenuated due to device differences during feature extraction, and achieve adaptive aggregation of multi-scale features for large and small targets. This bridges the visual domain gap between heterogeneous IoT devices, achieving high-precision and highly adaptable cross-device collaborative detection. Attached Figure Description

[0019] Figure 1 This is a flowchart of the cross-device generalized detection method for citrus diseases and pests, as shown in Example 1. Figure 2 This is a schematic diagram of an example of image data enhancement for citrus diseases and pests in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 3 This is a schematic diagram of the YOLO-GDM model structure in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 4 This is a schematic diagram of the CA attention module structure in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 5 This is a schematic diagram of the HFERB module structure in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 6 This is a schematic diagram of the MANet module structure in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 7 This is a schematic diagram comparing the average detection accuracy under distance gradient in the cross-device generalized detection method for citrus diseases and pests in Example 1; Figure 8 This is a flowchart of the cross-device generalized detection method for citrus diseases and pests, as shown in Example 2. Detailed Implementation

[0020] The following detailed description illustrates the specific implementation method: Example 1 like Figure 1 As shown in this embodiment, the cross-device generalization detection method for citrus diseases and pests includes the following: S1. Collect images of citrus diseases and pests, and construct a citrus disease and pest dataset covering two typical smart orchard monitoring scenarios: "manual mobile inspection" and "fixed automatic monitoring." Edge devices (smartphones) and PTZ cameras are used as image acquisition terminals, respectively. Specific acquisition schemes include: Smartphone close-up data collection (manual inspection scenario): This data collection scenario simulates fruit farmers using mobile devices to conduct detailed disease diagnosis in accessible areas of the lower and middle parts of the tree canopy.

[0021] Image characteristics: The image resolution obtained under this acquisition mode can reach 4032×3024 pixels (12.2 MP), and the average area of ​​lesions accounts for 61.2%. It can clearly present the microscopic texture of early ulcer lesions (<2 mm), the edge outline of leafminer tunnels and other details, which can meet the data quality requirements for accurate disease diagnosis and field decision-making.

[0022] Collection strategy: To ensure that the sample distribution closely resembles the real application scenario, the diversity of the field environment was emphasized during the collection process. Operators used different shooting angles, including various backgrounds such as green leaves, branches, and sky, to complete multi-view sample collection.

[0023] Sample size: A total of 2,078 original images were obtained from smartphones, accounting for approximately 80% of the total sample size of the dataset.

[0024] In this embodiment, a uniform model of smartphone was used for data acquisition, with a fixed shooting angle perpendicular to the leaf plane. Ten distance gradients were set from 10cm to 100cm. At each distance gradient, high-quality images were acquired for five typical citrus diseases and pests: canker, leaf miner, moth disease, greasy spot, and nutrient deficiency.

[0025] The distances of 10–30cm correspond to the diagnostic distance for lesion details (microscopic texture observation), 40–70cm correspond to the routine single-leaf inspection distance (rapid disease screening), and 80–100cm correspond to the rapid inspection distance for the entire orchard (disease group observation). Ten distance gradients are set at 10cm intervals. This setting covers all typical operating ranges for fruit growers' handheld inspections while also taking into account the depth-of-field limitations and image clarity requirements of the data acquisition equipment.

[0026] Long-distance data acquisition with PTZ camera (automatic monitoring scenario): This acquisition scenario targets the upper and middle areas of citrus tree canopies (the main area where new shoots grow, 1.8-2.2m above the ground), which are difficult to observe manually at close range. The PTZ camera is deployed at the highest point in the orchard (5-8m above the ground) to conduct non-contact, routine monitoring.

[0027] Image characteristics: The image resolution of the device at a long distance (5-10m) is 2688×1520 pixels (3.7MP), and the average area of ​​lesions accounts for only 13.7%; the number of pixels occupied by a single leaf in the whole image is extremely low (usually <32×32 pixels), and the pests and diseases target exhibit typical small-scale characteristics; at the same time, due to the large depth of field, the image has the characteristics of complex background (including ground weeds, shadows of branches, etc.) and relatively single shooting angle (fixed downward angle of 30°-45°).

[0028] Sample size: A total of 592 original images were acquired by the PTZ camera, accounting for approximately 20% of the total sample size of the dataset.

[0029] S2. A labeling strategy based on leaves as the basic labeling unit was adopted to perform fine-grained labeling on all 2670 collected images of citrus diseases and pests. In this embodiment, the labeling work was completed using the open-source tool X-AnyLabeling, and the output format strictly followed the YOLO standard (i.e., each image corresponds to a `.txt` labeling file, and each line contains the target category index, as well as the normalized bounding box center coordinates, width and height parameters), ensuring that the labeling results are seamlessly compatible with mainstream object detection frameworks.

[0030] To improve annotation efficiency, this embodiment uses a large segmentation model based on the Segment Anything Model for semi-automatic pre-annotation, and then the annotator makes manual corrections based on the pre-annotation results, which significantly reduces the average annotation time per image.

[0031] This embodiment adopts a labeling strategy based on leaves as the basic labeling unit, which is fundamentally different from the traditional strategy of "using lesions as the labeling unit": Lesion-level labeling: Each individual lesion on the leaf needs to be outlined one by one. This method is suitable for detailed analysis of pathological morphology, but the labeling cost is high and it is difficult to directly count the total number of affected leaves. It cannot be directly linked with the disaster assessment indicators in plant protection business, which are based on the "affected leaf rate".

[0032] Leaf-level annotation: Each complete leaf infected by pests or diseases is bounded out as an independent detection target, and the category label is determined according to the dominant disease type on that leaf. The advantages of this strategy are mainly reflected in three aspects: higher annotation efficiency, more suitable for the construction of large-scale field datasets; it can directly output "affected leaf" instances, which facilitates subsequent statistical calculation of the proportion of affected leaves and is highly consistent with the disease level quantification indicators required for agricultural decision-making; the bounding box completely covers the entire leaf, and even if part of the leaf is occluded or at the edge of the image, it can still maintain annotation consistency, which enhances the robustness of the model in complex field backgrounds.

[0033] S3. Divide the citrus disease and pest dataset into training, validation, and test sets. The original dataset in this embodiment contains 2670 high-quality images, covering five typical citrus diseases and pests: citrus canker, leaf miner, moth disease, greasy spot, and nutrient deficiency. The division process follows three basic principles and fully considers the field ecological characteristics of citrus disease and pest occurrence: Category balance principle: Ensure that the sample ratio of each type of disease is consistent in the training set, validation set and test set, and avoid insufficient sensitivity of the model to detect rare diseases (such as nutrient deficiency, which accounts for only 10.6%) due to excessively high category distribution bias (e.g., leaf miners account for 41.4% in this dataset). Device coverage principle: Ensure that images acquired by the mobile device and images acquired by the PTZ camera are distributed to the three subsets in the same ratio (approximately 8:2) to ensure that the subsequent evaluation of the model can fully reflect its cross-device generalization ability; Scene diversity principle: Ensure that the three subsets cover samples with different lighting (sunny / cloudy / shade), background (pure tree canopy / ground weeds / branch interference), shooting angle (horizontal / overhead / underhead) and disease development stage (early / middle / late stage) to ensure spatiotemporal diversity coverage.

[0034] Based on the above principles, the dataset is divided into a training set (2136 images), a validation set (267 images), and a test set (267 images) in a ratio of 8:1:1. The validation set is specifically used for hyperparameter tuning and early stopping strategies during the training process, while the test set is strictly isolated throughout the entire training process and is used only for unbiased evaluation of the final performance of the model.

[0035] S4. Citrus orchards are typical unstructured environments. Their complexity stems primarily from: light fluctuations caused by tree canopy shading, resulting in numerous dappled light areas; variable weather conditions such as morning fog and strong afternoon sunlight; unstable imaging conditions due to hand-held camera shake and changes in shooting distance; and a significant imbalance in the distribution of pest and disease data (large and prevalent leafminer samples, but scarce and rare nutrient deficiency samples). To address these issues, this step applies physically interpretable data augmentation operations to the training set. This differs from unconstrained random augmentation methods commonly used in general computer vision tasks, such as... Figure 2 As shown, each enhancement operation in this embodiment clearly corresponds to a specific physical scenario that actually exists in a citrus orchard, including: Multi-scale random cropping (cropping ratio range of 0.7-1.0): This operation simulates the shooting distance variation caused by the difference in the arm length of the operator when the fruit grower takes pictures with a hand-held collection device (shooting range of 10-100 cm), which can effectively enhance the scale invariance of the model for extracting lesion features at different scales.

[0036] Color space perturbation (HSV ±30% perturbation, saturation component addition ±20% perturbation): used to simulate the natural light gradient changes inside the canopy of citrus orchards (the difference between strong light on the periphery of the canopy and weak light inside the canopy), as well as the changes in lighting conditions at different shooting times throughout the day (low light and low color temperature in the early morning vs. high light and high color temperature at noon).

[0037] Geometric transformations (including ±15° random rotation and random horizontal flipping): simulate the natural posture changes of leaves in the tree canopy (the swaying of branches in the wind and the changes in leaf orientation caused by differences in branch angles), and avoid the model from overfitting to the fixed shooting angle of the training set.

[0038] Noise simulation (σ=0.05), where σ represents the standard deviation of the added Gaussian noise. This simulates sensor noise generated by the PTZ camera's gain increase under low illumination, as well as image compression distortion caused by mobile 4G network transmission.

[0039] Simulated fog enhancement: By superimposing a semi-transparent fog layer with a transparency of 0.1 to 0.3, a foggy citrus image scene is artificially constructed to simulate adverse weather conditions such as rain fog and morning fog that may occur in actual orchard production, thereby improving the detection stability of the model under complex weather conditions with low visibility.

[0040] All data augmentation operations were performed while maintaining the consistency of the target bounding box annotations: that is, while transforming the image, the normalized YOLO coordinates of the corresponding bounding boxes were updated simultaneously. After completing the above full augmentation process, the training set sample size increased from the original 2136 images to 6462 images, the distribution of samples in each category became more balanced, and the environmental diversity of the dataset was significantly enhanced, providing a richer and more challenging data foundation for model training.

[0041] S5. Detection Model Design. This embodiment uses YOLOv11 (v11.0.0, Ultralytics) as the baseline model for the target detection task; it integrates three feature enhancement modules—Coordinate Attention (CA), High-Frequency Enhanced Residual Block (HFERB), and Mixed Aggregation Network (MANet)—with the YOLOv11n baseline model to form YOLO-GDM (YOLO for Generalized Disease Monitoring), a citrus disease and pest detection model that is oriented towards cross-device generalization.

[0042] The overall architecture of YOLOv11 includes a high-efficiency feature extraction backbone network, a multi-scale feature fusion neck network, and a dynamic anchor box detection head. The model architecture design follows the principle of "bottleneck-specific enhancement," and the improvements in each part are as follows: Backbone (feature extraction branch): The HFERB module is embedded inside the C3k2 module of Backbone to enhance the model's ability to extract high-frequency details. Attenuated high-frequency details in the PTZ camera-acquired image can be recovered during the feature extraction stage. A CA module is inserted at the end of the Backbone (after all C3k2 modules and before the SPPF module) to suppress interference from complex backgrounds at the level of deep semantic features.

[0043] Neck (Feature Fusion Branch): In the FPN upsampling path and PANet downsampling path of Neck, MANet modules are inserted at the feature fusion nodes at the three scale levels of P3, P4 and P5 to achieve adaptive aggregation of multi-scale features of large targets acquired by mobile phones and small targets acquired by PTZ cameras.

[0044] This architecture achieves task adaptation through phased, specific enhancements: CA handles background suppression in complex scenes, HFERB restores details in degraded images, and MANet adapts to scale differences across devices. These three modules work together to address the domain gap between images from different devices. The overall model architecture is as follows: Figure 3 shown. Specifically, The core steps of the Coordinate Attention (CA) mechanism include orientation-sensitive 1D global pooling and channel-space co-encoding attention generation. This is achieved by concatenating horizontally and vertically encoded feature vectors and performing 1×1 convolution and splitting operations to generate bidirectional spatial attention weights. Let the input feature map... ,in Indicates the first Each channel is located in eigenvalues.

[0045] Horizontal pooling: Aggregates features along the width (column) direction to generate positional encodings in the vertical (height) dimension; Vertical pooling: Aggregates features along the height direction (rows) to generate positional codes in the horizontal direction (width).

[0047] By decomposing the spatial dimension to simultaneously capture position sensitivity and inter-channel dependencies, the traditional two-dimensional global pooling is decoupled into two one-dimensional pooling branches in the horizontal and vertical directions, generating direction-aware feature maps respectively. This allows the model to capture the overall leaf lesion distribution along one direction while retaining the precise location information of small lesion coordinates in the other direction. The overall structure of the CA module is as follows: Figure 4 As shown.

[0048] In citrus disease detection tasks, the directional encoding characteristics of Coordinate Attention (CA) are naturally suited to the task requirements: its horizontal pooling operation can help the model model the spatial distribution pattern of lesions at the leaf scale (such as regional yellowing lesions), and its vertical pooling operation can enhance the feature response of local small lesions, thereby assisting the detection network in focusing on high-risk lesion areas in the image.

[0049] The placement of Coordinate Attention (CA) directly determines its ability to effectively utilize spatial information in feature maps and compensate for domain differences between different devices. To investigate the impact of the CA module at different feature levels on cross-device target detection performance, this embodiment designed a hierarchical ablation experiment, embedding the CA module at three key locations in the YOLOv11n architecture: the backbone end (after the last C3k2 module and before the SPPF module); the neck start (after P3 / P4 / P5 feature output and before the first feature fusion); and the neck deep layer (in the middle of the PANet downsampling path). All experiments were conducted under the same hyperparameter settings, with mAP@50 selected as the core evaluation metric. The experimental results are shown in Table 1.

[0050] Table 1 Performance comparison experiment of CA module in different deployment locations

[0051] Experimental results show that when the CA module is deployed at the end of the backbone network (i.e., after the last C3k2 module), the model achieves the best overall detection performance: mAP@50 increases to 90.1%, a 2 percentage point improvement compared to the baseline model, making it the optimal choice among the three candidate deployment schemes. In contrast, deploying the CA module at the beginning or deep within the Neck yields very limited performance gains.

[0052] In summary, the optimal deployment location for the CA module is determined to be after the last C3k2 module and before the SPPF module in the YOLOv11n backbone network. This location fully utilizes the strong semantic discriminative capabilities of deep features while preserving sufficient spatial resolution to leverage the directional encoding advantages of the CA module. This is the optimal topology for collaborative detection tasks involving close-up images acquired by mobile phones and distant-view images acquired by PTZ cameras.

[0053] In real orchard environments, images captured by equipment are often affected by various lighting conditions, such as overexposure, shadow occlusion, or motion blur, all of which negatively impact the effective matching of pest and disease characteristics. Furthermore, lesions from common citrus diseases (such as greasy spot and lichenification) typically exhibit localized texture abrupt changes and subtle color variations on leaves. These features are high-frequency components in images and are highly susceptible to interference from background noise and lighting changes. As the core equipment for automated orchard monitoring, PTZ cameras, due to their long shooting distance and large fluctuations in ambient light, generally suffer from high-frequency detail loss in their images, leading to blurred lesion textures and weakened edge features, further increasing the difficulty of pest and disease detection. To address the problem of high-frequency detail loss in PTZ camera images, this embodiment incorporates a High-Frequency Enhancement Residual Block (HFERB). This HFERB uses a dual-branch structure to separate and enhance the high-frequency features of lesions, mitigating feature degradation in blurred images.

[0054] HFERB employs a dual-branch collaborative working mode of Local Feature Extraction (LFE) and High Frequency Enhancement (HFE), and its structure is as follows: Figure 5 As shown, it includes: LFE branch: Divides the input feature map into sub-feature maps with C / 2 channels, and extracts local high-frequency features through 3×3 convolution and GELU activation function, which has better feature response ability for irregular edges and subtle texture changes of early lesions; HFE branch: Local maximum response enhancement is achieved by using 3×3 max pooling on the same dimension sub-feature map to strengthen the saliency features of the lesion region; then, the channels are compressed by 1×1 convolution and the high frequency response is further enhanced to improve the feature contrast between the lesion region and the background region. Feature fusion: The output of the two branches is restored to a C-channel feature map by channel splicing, and then residual connection is established with the input feature map to achieve deep fusion of high-frequency detail information and low-frequency shape information.

[0055] To verify the adaptability of different activation functions to high-frequency feature extraction tasks, this embodiment constructed a special validation set (300 images) for the scenario of "illumination interference + high-frequency detail loss". Specifically, it consisted of 100 images of blurred lesions under overexposed / shadowed conditions, 100 images of fine textures from lipophilic spot disease, and 100 images of local mutation features from moss disease. All experiments were based on the YOLOv11n baseline network structure, maintaining a completely consistent training strategy, only replacing the activation function of the HFERB module. The focus was on evaluating the model's high-frequency feature extraction capability, resistance to illumination interference, and inference efficiency under different activation functions. The results are shown in Table 2.

[0056] Table 2 Tests with different activation functions

[0057] Based on experimental data and theoretical analysis, the core reasons for choosing GELU instead of ReLU or Swish in this scheme are as follows: Adapting to the need for high-frequency detail extraction: The core identification of citrus diseases relies on local texture mutations (such as the small yellow spots of greasy spot disease) and subtle color changes (such as the blue-green hue difference of moss disease). These features are all high-frequency information that is easily lost. ReLU suffers from the "dead neuron" problem, which hard-truncates the weak high-frequency signals of blurred lesions, ultimately leading to the loss of texture details. In the experiment of this embodiment, the AP of the high-frequency feature class of ReLU was only 82.3%. In contrast, GELU has smooth non-linear activation characteristics, which can continuously fit the gray-scale gradient process of the lesion edge and completely preserve high-frequency texture information. Its high-frequency feature class AP is 3.4 percentage points higher than that of ReLU, making it more suitable for scenarios where the high-frequency details of the images acquired by the PTZ camera are insufficient. Superior resistance to lighting interference: Lighting fluctuations such as overexposure and shadows in orchard sampling scenarios can lead to a decrease in the signal-to-noise ratio of high-frequency features. GELU, combined with random regularization, can enhance high-frequency features while suppressing lighting noise interference. Experimental data shows that GELU achieved a detection rate of 89.2% in samples with lighting interference, an improvement of 3.6 and 4.1 percentage points compared to ReLU and Swish, respectively, effectively mitigating the negative impact of lighting changes on feature matching. Lightweight design to meet edge deployment requirements: While Swish has some non-linear expression capabilities, the inclusion of Sigmoid operations leads to a surge in model computational complexity (FLOPs up to 24.5 G) and inference latency as high as 8.6 ms, which cannot meet the real-time deployment requirements of edge devices such as PTZ cameras and handheld terminals. In contrast, GELU's computational complexity is close to that of ReLU (FLOPs only 20.0 G), with an inference latency increase of only 1.3 ms. It achieves improved accuracy while maintaining the lightweight nature of the module, making it suitable for the resource constraints of orchard edge devices.

[0058] When citrus disease images are acquired by different acquisition devices (close-up shots from mobile phones and distant shots from PTZ cameras), significant heterogeneity exists in the visual features of the images: close-up images from mobile phones have high resolution and clear details of lesions; distant images from PTZ cameras cover a wide range of scenes, but the lesions are small in proportion and indistinct in size. To address the feature scale mismatch problem caused by fixed downsampling operations, this embodiment sets up a Mixed Aggregation Network (MANet), which achieves adaptive extraction of features at different scales and resolutions through feature fusion of heterogeneous convolutional paths. The network structure of MANet is as follows: Figure 6 As shown, it includes: 1×1 bypass convolution: used for channel feature calibration to enhance the model's feature response to disease-related channels; 3×3 depthwise separable convolution: efficiently extracts spatial features and improves the model's ability to perceive lesion morphology features; Bottleneck module: Enhances hierarchical integration of features, fusing shallow detail information with deep semantic information. The number of stacks in this module is controlled by the hyperparameter n. n, as the number of stacks of Bottleneck modules, directly determines the feature fusion depth of MANet.

[0059] The feature maps output from multiple paths (with consistent height, width, and number of channels H, W, and C) are first concatenated to obtain a fused feature with a total of 3C channels. Then, a 1×1 convolution is performed to compress the channels back to the C dimension, thus completing the multi-path feature aggregation and dimension matching.

[0060] To determine the optimal stacking number n of the Bottleneck module in MANet, this embodiment sets up four sets of control experiments with n=1, 2, 3, and 4. The experimental results are shown in Table 3 (only the core evaluation indicators are shown in the table).

[0061] Table 3 Optimal Stacking Quantity Test

[0062] Experiments show that, with Increase The improvement tends to saturate, while the number of parameters increases linearly. When The time accuracy reached its peak (90.6%). There was no further gain. Considering both accuracy and deployment efficiency, the following was selected. Its mAP@50 reaches 90.3%, and its parameter count is minimal (6.94 M), meeting the requirements of orchard edge equipment for lightweight and real-time performance, and effectively avoiding computational redundancy caused by excessive stacking.

[0063] S6. Train the constructed citrus pest and disease detection model YOLO-GDM using the training set until it meets the preset requirements.

[0064] A dataset constructed using multi-scale distance gradient images ranging from 10 cm to 100 cm was used to quantitatively evaluate the robustness of the detection model to drastic fluctuations in target scale caused by changes in shooting distance. The performance degradation trend and feature preservation ability of the detection model during the transition from "close-up macro" to "long-range surveillance" were also analyzed. Figure 7 As shown in the figure. Experimental results show that the detection accuracy of both models decreases monotonically with increasing shooting distance, but the decay rate of YOLO-GDM is significantly slower than that of the baseline model YOLOv11n, demonstrating stronger resistance to scale decay. Specifically: In the close-range segment (10-40 cm): YOLO-GDM maintained a stable accuracy advantage of 1.5%~2.5% compared to the baseline model, verifying the superiority of the model in handling rich texture details in close-range scenes; In the long-range interval (60-100 cm): YOLOv11n's mAP@50 drops to 67.4% at a distance of 100 cm, while YOLO-GDM still maintains a usable detection accuracy of 71.2%; and at a distance of 70 cm, the performance improvement of the model in this paper reaches its maximum of 4.2%. Extended Effective Working Distance: This embodiment uses 80% mAP@50 as the reliability threshold for automated field applications. The effective working distance of the baseline model YOLOv11n is limited to within 60cm, while YOLO-GDM extends this threshold to 70cm. This approximately 10cm extension in depth of field allows the PTZ camera to cover a wider canopy area at the same zoom level, effectively improving the efficiency of automated field monitoring.

[0065] The model's accuracy on cross-device data was evaluated using a constructed cross-device test set. Specifically, the detection performance on images captured by mobile phones and images captured by PTZ cameras was compared. The results are shown in Table 4. Table 4 Performance comparison of feature enhancement models on cross-device test sets

[0066] Note: Equipment performance difference rate = (Mobile mAP@50 - PTZ camera mAP@50) / Mobile mAP@50 × 100% Experimental results show that YOLO-GDM improves mAP@50 by 3.45 percentage points and Precision by 5.23 percentage points on the PTZ camera side compared to the baseline model; and improves mAP@50 by 1.42 percentage points on the mobile phone side. This result verifies that the feature enhancement module proposed in this embodiment has good adaptability to cross-device feature differences. In addition, the device performance difference rate of the model decreased from 5.74% to 3.52%, indicating that YOLO-GDM effectively narrows the performance gap between different devices and significantly improves cross-device generalization ability. The improvement in mAP@50 on the PTZ camera side is the largest among all indicators, reaching 3.45 percentage points, proving that the MANet and HFERB modules can effectively alleviate the blurring problem and background interference of PTZ camera images, thereby improving the accuracy of target localization.

[0067] In the data preprocessing stage, this embodiment employs data augmentation operations with physical interpretability, such as multi-scale random cropping, color space perturbation, and simulated fogging. These operations correspond to real physical scenarios in orchards, including changes in shooting distance, fluctuations in natural light gradients, and severe weather conditions, significantly improving the model's detection stability in low visibility and variable environments. Regarding the refined design of the model architecture, this embodiment deploys the Coordinate Attention (CA) module at the end of the backbone network, fully utilizing deep semantic discrimination capabilities while preserving sufficient spatial resolution. Simultaneously, the High Frequency Enhanced Residual Block (HFERB) combined with the GELU activation function avoids hard truncation of weak high-frequency signals, successfully overcoming the bottleneck of high-frequency detail loss in distant PTZ camera images. The Multipath Aggregation Network (MANet) achieves 90.3% mAP@50 with minimal parameter increase (only 6.94M) by setting the optimal number of Bottleneck stacks (n=1), adapting to the lightweight requirements of edge devices. The solution in this embodiment not only extends the reliable and effective working distance of field automation applications from 60cm to 70cm, greatly improving the monitoring coverage efficiency, but also significantly reduces the performance difference rate between mobile and PTZ cameras from 5.74% to 3.52%, demonstrating its huge advantage in cross-device generalized detection.

[0068] Example 2 The trained detection model contains 3.11 million (3.11 M) learnable parameters. After being exported to the general deployment format (ONNX), the model file size reaches 12.7 MB, and the computational cost per inference is 7.4 GFLOPs. The structural characteristics of this model mean that it is still subject to multi-dimensional engineering constraints in real-world edge deployment scenarios, including computing power scheduling, memory usage, and power consumption control.

[0069] like Figure 8 As shown, to clarify the necessity of lightweight model modification, the method in this embodiment also includes: Step S7, conducting resource constraint analysis on two typical edge devices in orchard scenarios—smartphones and PTZ cameras—and establishing lightweight optimization directions based on this analysis. Specifically, mainstream smartphones and PTZ cameras used in actual orchard deployments are selected as target deployment platforms, and the core hardware parameters and resource constraints of the two types of devices are determined. It should be particularly noted that edge devices in agricultural scenarios face more stringent multi-dimensional resource constraints, the intensity of which far exceeds that of general computing scenarios, including: Due to power consumption constraints from solar power, orchard monitoring equipment commonly uses solar power solutions. Mainstream commercial solar-powered PTZ cameras (such as Dahua DH-PSDW81649M-A360-D440-HL) have a minimum normal power consumption requirement of ≤12 W. Based on engineering test data and industry consensus from similar embedded deployment platforms, for every 1 GFLOPs increase in computational load for the target detection model, the corresponding power consumption increases by approximately 0.8 W. The baseline model used in this solution has an original YOLO-GDM computational load of 7.4 GFLOPs. If deployed directly, the model's own power consumption is expected to exceed the 5 W solar power safety threshold, potentially triggering power-off protection or insufficient battery life, thus failing to meet the needs of long-term unattended monitoring in orchards.

[0070] Storage and memory constraints are a significant concern. Orchard workers typically use low- to mid-range Android mobile devices with limited memory (≤8 GB) and older operating systems. Therefore, agricultural monitoring applications deployed on mobile devices must meet strict memory consumption limits. Furthermore, typical mobile AI applications, in addition to the detection model, also integrate inference engines (such as NCNN and TensorFlowLite), image processing libraries (such as OpenCV), UI frameworks, and communication modules. These basic components already consume a substantial amount of runtime memory. The original YOLO-GDM model contains 3.11 million parameters, and at a 640×640 input size, its measured peak memory usage is approximately 66 MB, accounting for 9%–13% of the maximum memory usage for a single mobile application (512–768 MB). In multi-task concurrent scenarios involving video capture, network upload, and model inference, this level of memory consumption can easily trigger system resource contention, ultimately leading to application lag or inference interruptions. Therefore, reducing memory consumption through model lightweighting is of great practical significance for ensuring the stable operation of agricultural monitoring apps in real-world field environments.

[0071] Due to real-time and stability constraints, the orchard monitoring PTZ camera needs to operate continuously 24 / 7, imposing two core requirements on the model inference: inference latency ≤12 ms and no memory leaks during long-term operation. Actual test results on the target PTZ camera hardware platform show that the original YOLO-GDM (7.4 GFLOPs) has a single-frame inference latency of 29.6 ms, failing to meet the latency requirements; furthermore, under high load conditions, this model is prone to triggering NPU throttling and frame rate jitter, making it unsuitable for long-term stable orchard monitoring.

[0072] Based on the hardware resource quantification constraints of edge devices (smartphones and edge PTZ cameras) and combined with the engineering practice requirements of model deployment, the solution in this embodiment establishes a lightweight goal from the following dimensions: Parameter compression target: Considering the storage and parameter limitations of smartphones and edge PTZ cameras, this solution sets the parameter optimization target for smartphones to ≤1.25 MB and the model volume target to ≤5 MB.

[0073] The optimization objective for computational complexity is to reduce the computational load of the model while meeting the real-time requirements of orchard monitoring, thereby reducing the model's computational power consumption and operating power on edge devices, improving the model's multi-task concurrent processing capability, and ensuring that the orchard monitoring system can achieve stable and continuous operation 24 / 7. To ensure that the model can achieve stable inference with low latency, low jitter, and low power consumption on typical edge devices such as mobile phones and Dahua PTZ cameras, and to meet the constraint that the model's accuracy will not decrease significantly in subsequent pruning experiments, this solution sets the optimization target for model computational load at ≤3.0 GFLOPs, which represents a reduction of more than 60% compared to the original model's computational load.

[0074] Cross-device performance maintenance target: Target values: PTZ camera test set: mAP@50 decreases by no more than 1 percentage point (absolute value), i.e., the final mAP@50 is no less than 0.8949 (original value is 0.9049); mobile phone test set: mAP@50 decreases by no more than 0.5 percentage points, i.e., the final mAP@50 is no less than 0.9326 (original value is 0.9376).

[0075] The asymmetric threshold setting is based on the following: images acquired by mobile devices have higher feature quality (resolution ≥ 4000×3000, clear texture), and the impact of model lightweighting on its detection performance is smaller; images acquired by PTZ cameras have lower feature quality (resolution 2688×1520, with issues such as small targets and blurred details), and are more sensitive to the model's feature extraction capabilities. Therefore, a greater performance degradation is allowed, but a detection accuracy of over 90% must still be maintained to meet the practical requirements of field scenarios; in addition, the difference in detection performance between different devices must be controlled within 3 percentage points to ensure the consistency of the collaborative detection system.

[0076] Deployment and adaptation targets: Mobile devices: Supports the TFLite framework, compatible with GPU / NPU delegates acceleration, and offline inference single-frame response time ≤100ms; PTZ camera: Supports NPU INT8 quantization acceleration, with CPU utilization ≤30% when running concurrently with video encoding and decoding tasks, and no memory leaks during operation.

[0077] S8, LAMP-based structured pruning.

[0078] To address the asymmetric performance degradation caused by structured pruning in cross-device scenarios, this embodiment employs Layer-adaptive Magnitude-based Pruning (LAMP) to achieve model compression. Unlike traditional pruning methods that rely solely on local weight magnitudes to determine importance, LAMP corrects for pruning imbalances between different layers through global channel importance scoring. The specific steps are as follows: Model preparation phase: Load the weights of the trained YOLO-GDM model, freeze the parameters of the batch normalization (BatchNorm) layer, and retain the optimal weights obtained during model training.

[0079] The progressive pruning phase involves multiple iterations, each including two key steps: channel importance assessment and progressive pruning. The progressive pruning rule is as follows: remove the lowest 0.1% of channels in the current iteration; after each pruning round, perform rapid validation to assess mAP@50; when mAP@50 cumulatively decreases by more than 2% after 10 consecutive pruning rounds, early pruning is triggered.

[0080] Performance Recovery Phase: Because no intermediate fine-tuning was performed during the progressive pruning process, the model performance will significantly decrease after pruning (mAP@50 drops from 0.912 to 0.100 in this example). Therefore, this solution designs a two-stage performance recovery strategy: Phase 1 (Baseline Fine-tuning): Fine-tuning the pruned lightweight model for 300 epochs using only the detection task loss. To restore the basic detection performance of the model.

[0081] Phase Two (Knowledge Distillation): The fine-tuned model is used as the student model, and the fully structured YOLO-GDM is used as the teacher model. Logistic distillation loss is introduced to further improve model performance.

[0082] To verify the effectiveness of the lightweight process, this embodiment also compares the core performance indicators of the original model, the pruned model, and the knowledge distillation model. The results are shown in Table 5. Table 5 Comparison of Lightweight Model Performance in Three Stages

[0083] The YOLO-GDM model constructed with structural enhancement significantly outperformed the baseline YOLOv11 in detection performance on both mobile phones and PTZ cameras, verifying the effectiveness of the CA attention module, HFERB feature reconstruction module, and MANet multi-scale alignment module in improving the model's cross-device generalization ability.

[0084] Based on the high-precision model mentioned above, this solution adopts the LAMP structured pruning strategy, which successfully reduces the number of model parameters and computational cost by about 68% and 61%, respectively. However, pruning and compression inevitably cause a loss in detection performance, which is particularly evident on PTZ cameras with weak feature extraction capabilities.

[0085] Ultimately, this solution employs logical knowledge distillation to restore the model's performance after pruning: the mAP@50 on the PTZ camera significantly improved from 84.1 to 89.8, and the mAP@50 on the mobile device also recovered to 91.8. This strategy ensures high detection accuracy and performance consistency across different devices, laying a solid foundation for subsequent practical engineering deployments.

[0086] To evaluate the performance differences of the lightweight model on mobile phones and PTZ cameras, and to verify whether the cross-device generalization ability of the model is preserved after pruning and distillation, relevant experiments were conducted in this embodiment. The results are shown in Table 6: Table 6. Cross-device performance comparison of the lightweight model.

[0087] The difference in mAP@50 between the lightweight model and mobile phone and PTZ camera devices is 2 percentage points, which is significantly smaller than the 5.3 percentage points of the original model, indicating that the lightweighting process did not exacerbate the performance imbalance between devices; The recall rate of the PTZ camera decreased by 7.07 percentage points, which was higher than the decrease of other indicators. This was mainly because small targets in the images acquired by the PTZ camera have weak feature representation capabilities, and the model's ability to capture subtle features decreased slightly after pruning. However, the model still maintained a recall rate of 82.11%, which meets the actual detection needs in the field. For diseases such as ulcers and nutrient deficiencies that rely on morphological features for identification, the detection accuracy on the PTZ camera is close to that on the mobile phone, proving that the multi-path feature aggregation capability of the MANet module is still effectively retained after the weight reduction.

[0088] The lightweight model proposed in this solution is compared with other mainstream lightweight target detection models to verify the overall competitiveness of the model. The comparison results are shown in Table 7. Table 7 Performance Comparison of Mainstream Lightweight Models (Citrus Disease and Pest Dataset)

[0089] The model has only 38.8% of the parameters of YOLOv11n and only 46.0% of the GFLOPs, but its mAP@50 is 2.3 percentage points higher than that of YOLOv11n. In terms of inference speed, the model achieves 23.8 FPS on mobile devices and 8.7 FPS on PTZ cameras, both of which outperform all the comparison models. Considering the overall accuracy-efficiency trade-off, the model proposed in this solution has significant advantages in the deployment of agricultural edge devices.

[0090] The above are merely embodiments of the present invention. The invention is not limited to the fields covered by these embodiments. Commonly known structures and characteristics in the solutions are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are able to access all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. A method for cross-equipment generalized detection of citrus diseases and pests, characterized in that, Includes the following: S1. Collect images of citrus diseases and pests using different edge devices as image acquisition terminals, and construct a citrus disease and pests dataset. S2. A labeling strategy based on leaves as the basic labeling unit was adopted to label all collected images of citrus diseases and pests. S3. Divide the citrus disease and pest dataset into a training set, a validation set, and a test set; S4. Apply data augmentation operations to the training set; S5. YOLOv11 is used as the baseline model for the target detection task; the three feature enhancement modules, coordinate attention, high-frequency enhanced residual block and multi-path aggregation network, are integrated with the YOLOv11n baseline model to form the citrus disease and pest detection model YOLO-GDM. S6. Train the constructed citrus pest and disease detection model YOLO-GDM using the training set until it meets the preset requirements.

2. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 1, characterized in that: Also includes: S7. Conduct resource constraint analysis on different edge devices, and establish lightweight optimization directions based on this analysis; S8. Perform structured pruning on the YOLO-GDM model for detecting citrus diseases and pests.

3. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 2, characterized in that: In step S1, the edge devices include smartphones and PTZ cameras; When collecting data using a smartphone, the fixed shooting angle is perpendicular to the leaf plane. Ten distance gradients are set from 10cm to 100cm. At each distance gradient, images are collected for five typical citrus diseases and pests: canker, leaf miner, moth disease, greasy spot disease, and nutrient deficiency. When using a PTZ camera, images of the upper part of the canopy of citrus trees, 1.8-2.2 meters above the ground, are captured at a distance of 5-10 meters.

4. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 3, characterized in that: In step S2, when labeling at the leaf level, each complete leaf infected by pests and diseases is framed as an independent detection target, and the category label is determined based on the dominant disease type on that leaf.

5. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 4, characterized in that: In step S4, the data augmentation operation includes: Multi-scale random cropping, with a cropping ratio ranging from 0.7 to 1.0; Color space perturbation, HSV ±30% perturbation, saturation component ±20% perturbation; Geometric transformations, including ±15° random rotations and random horizontal flips; Noise simulation, set σ=0.05; Simulated fogging enhancement is achieved by superimposing a semi-transparent fog layer with a transparency of 0.1 to 0.

3.

6. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 5, characterized in that: In step S5, the overall architecture of YOLOv11 includes a high-efficiency feature extraction backbone network, a multi-scale feature fusion neck network, and a dynamic anchor box detection head. The HFERB module is embedded inside Backbone's C3k2 module to enhance the model's ability to extract high-frequency details; A CA module is inserted at the end of the backbone to suppress interference from complex backgrounds at the level of deep semantic features; In the FPN upsampling path and PANet downsampling path of Neck, the MANet module is inserted at the feature fusion nodes of the three scale levels of P3, P4 and P5 to realize adaptive aggregation of multi-scale features of large targets and small targets.

7. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 6, characterized in that: In step S7, the constraint scenarios include: solar power consumption constraints, storage and memory constraints, and real-time and stability constraints. The lightweighting goals include parameter reduction, computational complexity optimization, cross-device performance maintenance, and deployment adaptability.

8. The method for cross-equipment generalization detection of citrus diseases and pests according to claim 7, characterized in that: In step S8, the structured pruning step specifically includes: Model preparation phase: Load the trained YOLO-GDM model weights, freeze the BatchNorm layer parameters, and retain the optimal weights obtained during model training; The progressive pruning phase involves multiple iterations, each including channel importance assessment and progressive pruning. The progressive pruning rule is to remove the lowest 0.1% of channels in the current iteration. After each round of pruning, a fast validation assessment (mAP@50) is performed. When mAP@50 decreases by more than 2% after 10 consecutive rounds of pruning, early pruning is triggered. Performance recovery phase: Phase 1: Fine-tune the pruned lightweight model for 300 epochs, using only the detection task loss. To restore the basic detection performance of the model; Phase Two: Using the fine-tuned model as the student model and the fully structured YOLO-GDM as the teacher model, logistic distillation loss is introduced to improve model performance.

9. A cross-equipment generalized detection system for citrus diseases and pests, characterized in that, Use the method described in any one of claims 1-8.