Corn stomatal cell detection method based on improved YOLOv11-obb and knowledge distillation
By improving the YOLOv11-obb network, combining the C3k2_AssemFormer module and the Focaler-CIoU loss function, and employing knowledge distillation technology, the problems of insufficient localization accuracy and limited multi-scale feature representation ability in maize stomatal detection were solved, achieving high-precision and robust stomatal cell detection.
Patent Information
- Application Number
- CN202610283198.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies for maize stomatal detection suffer from insufficient localization accuracy, inadequate generalization ability in complex scenarios, and limited multi-scale feature representation capabilities, especially with a significant decrease in detection accuracy in dense multicellular backgrounds.
By employing an improved YOLOv11-obb network architecture, combined with the C3k2_AssemFormer module, Focaler-CIoU loss function, and knowledge distillation technique, and through differential data augmentation strategy and multi-scale feature fusion, the regression of the rotated bounding box is optimized to achieve high-precision detection of stomatal cells.
It significantly improves detection accuracy and robustness in complex multicellular scenarios, enhances the model's ability to represent densely packed and occluded pores, and achieves higher detection accuracy and robustness.
Smart Images

Figure CN122200338A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and intelligent detection technology, and in particular relates to a method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation. Background Technology
[0002] Plant phenomics, as a crucial bridge connecting plant genotype and phenotype, has become a cutting-edge field in modern agricultural research. In this context, stomata, as the primary channel for water and gas exchange between plants and the atmosphere, directly influence photosynthetic and water use efficiency due to their density, morphology, and movement. Studies have shown that stomatal opening and closing are not only regulated by water status but also influenced by multiple factors such as light conditions, carbon metabolism, and cell wall characteristics. This makes the precise quantification of stomatal traits a vital foundation for understanding plant physiological and ecological processes.
[0003] Traditional stomatal observation methods mainly rely on manual microscopic counting or semi-automatic processing workflows based on tools such as ImageJ. These methods are not only inefficient and have limited throughput, but also have a high degree of subjectivity, severely restricting the development of large-scale plant phenotypic analysis. For example, LabelStoma developed a stomatal detection tool based on the YOLO algorithm, demonstrating the application potential of deep learning in this field. Subsequent studies, such as I3-YOLOv8s, have been specifically optimized for the detection of irregular stomata. However, most of these methods use horizontal bounding boxes, which are difficult to accurately fit stomatal cells with arbitrary orientations in nature, resulting in insufficient localization accuracy and the introduction of excessive background noise.
[0004] The rise of rotating target detection technology has provided new insights into solving this challenge. Significant progress has been made in this field, from classic CNN-based methods such as R3Det and S2A-Net to recent advanced Transformer-based methods like RQFormer and RO-DETR, as well as OriMamba utilizing state-space models. These methods have demonstrated excellent capabilities in handling targets with arbitrary orientations in tasks such as remote sensing image analysis. In particular, TSAF-Net successfully detected rotational damage caused by the rice leaf roller, demonstrating the potential of this technology in plant phenotypic analysis.
[0005] Despite the rapid development of rotational target detection technology, its direct application to stomatal microscopic images still faces three key challenges. First, it suffers from insufficient generalization ability in complex scenes. While the model performs well on simple single-cell images, its detection accuracy drops significantly in dense multi-cell backgrounds, and acquiring large amounts of high-quality rotated bounding box annotation data is costly. Second, the regression accuracy for difficult samples is limited. For densely clustered, blurred-boundary, or partially occluded stomata, traditional IoU loss functions are easily dominated by a large number of "simple" samples during training, leading to inaccurate localization of these key targets. Third, the ability to represent multi-scale features needs improvement. Stomatal cells exhibit significant scale variations, and accurate detection requires simultaneously capturing local cell edge details and global spatial context, while traditional CNN backbone networks have inherent limitations in global modeling capabilities. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention proposes a method for detecting maize stomatal cells based on an improved YOLOv11-obb and knowledge distillation, thereby resolving the issues present in the prior art.
[0007] To achieve the above objectives, this invention provides a method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation, comprising: A maize stomatal cell image dataset was acquired and constructed, the dataset including single-cell scene images and multi-cell scene images; A detection model is built based on the YOLOv11-obb network architecture. The detection model includes a backbone network, a neck network, and an OBB detection head. In the backbone network, the C3k2 module at the preset level is replaced with the C3k2_AssemFormer module. A teacher model is trained on the single-cell scene image; a student model is trained on the multi-cell scene image; during the training of the student model, the Focaler-CIoU loss function is used to optimize the regression of the rotated bounding box, and the knowledge of the teacher model is transferred to the student model through MGD knowledge distillation loss; the student model adopts the architecture of the detection model. The trained student model is used to detect maize stomatal cells in the image to be tested.
[0008] Optionally, the process of obtaining a dataset of maize stomatal cell images includes: For the single-cell scene image, at least one method is selected from rotation, multi-directional flipping, brightness adjustment, contrast adjustment, HSV color dithering, noise injection, blur filtering, cutout occlusion, and shear transformation for enhancement; The multicellular scene image is enhanced by selecting at least one method from rotation, flipping, brightness adjustment, contrast adjustment, Gaussian noise, Gaussian blur, and cutout occlusion.
[0009] Optionally, the C3k2_AssemFormer module includes an initial convolutional layer, a dual-branch processing layer, and the AssemFormer module connected in sequence. The dual-branch processing layer includes a first branch and a second branch. The first branch is an identity mapping, and the second branch contains multiple cascaded Bottleneck modules. The AssemFormer module is used to fuse local features with global context in the output features of the dual-branch processing layer.
[0010] Optionally, the AssemFormer module includes a local representation branch, a global representation branch, and a feature fusion unit; The local representation branch includes depthwise separable convolutions and point convolutions connected in sequence, used to extract local features of the input features; The global representation branch includes a Pack operation, at least one linear self-attention Transformer block, and an Unpack operation executed sequentially, used to reorganize the local features and model long-range dependencies to generate global features; The feature fusion unit concatenates the local features and the global features through channels, and after convolutional projection, it fuses them with the input features of the AssemFormer module through residual connections via a random depth mechanism.
[0011] Optionally, the Focaler-CIoU loss function is constructed based on the standard CIoU loss, and its calculation process includes: calculating the intersection-union ratio (CIU) between the predicted bounding box and the ground truth bounding box, and transforming the CIU according to a learnable upper threshold and a lower threshold; wherein, the upper threshold and the lower threshold are learnable parameters constrained within a preset range by the Sigmoid function; the transformation includes: when the CIU is greater than the upper threshold, the mapping value is 1.0; when the CIU is not less than the lower threshold and not greater than the upper threshold, the mapping value is the ratio of the CIU to the upper threshold.
[0012] Optionally, the calculation process for MGD knowledge distillation loss includes: Multiple preset-level feature maps are selected from the backbone network of the student model as student feature maps, and teacher feature maps are extracted from the corresponding levels of the teacher model. A random binary mask with a preset mask probability is generated and element-wise multiplied with the student feature maps to mask part of the feature regions. The masked student feature maps are input into a feature generator network composed of nonlinear activation functions and convolutional layers for feature transformation. The L2 norm distance between the transformed features output by the feature generator network and the teacher feature maps of the corresponding levels is calculated, and the average of the distance calculation results for all selected levels is summed to obtain the MGD knowledge distillation loss.
[0013] Optionally, during the training of the student model, the weights of the MGD knowledge distillation loss are dynamically scheduled. The dynamic scheduling process includes: During the warm-up phase, in the initial training rounds, the weights are linearly increased from the initial set value to the first weight value; during the decay phase, the weights are decayed from the first weight value to the second weight value using a cosine annealing method; during the stabilization phase, the weights remain unchanged at the second weight value.
[0014] Optionally, the C3k2_AssemFormer module is deployed at layers 2, 4, 6, and 8 of the backbone network to extract and fuse local detail features and global context features on feature maps at different scales.
[0015] Optionally, the neck network employs a bidirectional FPN-PAN structure for multi-scale feature fusion; the OBB detection head includes a DFL branch for bounding box center coordinates and width-height regression, an angle regression branch for angle prediction, and a classification branch for stomatal cell classification.
[0016] Compared with the prior art, the present invention has the following advantages and technical effects: This invention replaces the C3k2 module in the backbone network with the C3k2_AssemFormer module and combines it with differentiated data augmentation strategies designed for single-cell and multi-cell scenarios, enabling the model to simultaneously extract both local fine features and global spatial distribution patterns of stomata. This design significantly enhances the model's ability to characterize densely packed, mutually occluded, and arbitrarily rotated stomata, thereby achieving higher detection accuracy and robustness in complex multi-cell scenarios.
[0017] The Focaler-CIoU loss function proposed in this invention achieves differentiated gradient weighting for samples during rotated bounding box regression training through its adaptive threshold mechanism. This mechanism enables the model training to continuously focus on and optimize difficult samples such as those with blurred boundaries and partial occlusion, effectively alleviating the problem of inaccurate localization caused by the imbalance of sample difficulty and improving localization accuracy in challenging scenarios.
[0018] The "from simple to complex" cross-dataset MGD knowledge distillation framework employed in this invention transfers the pure feature knowledge learned by the teacher model from clear single-cell data to the student model trained on complex multi-cell data through mask-generative feature alignment. This process significantly enhances the student model's generalization and adaptability to unfamiliar complex scenes such as dense and occluded environments.
[0019] This invention constructs a highly efficient and complete detection architecture by integrating the aforementioned improved backbone network, a neck network employing a bidirectional FPN-PAN, and an OBB detection head specifically designed for rotation detection. This architecture achieves a balance between multi-scale feature fusion and accurate prediction of rotation parameters, ensuring that the system maintains high processing efficiency while achieving excellent overall detection performance. Attached Figure Description
[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a general framework diagram of an embodiment of the present invention; Figure 2 This is a schematic diagram of the original dataset and a portion of the dataset after data augmentation, as shown in an embodiment of the present invention. Figure 3 This is a diagram of the DFA-YOLO network structure according to an embodiment of the present invention; Figure 4 This is a structural diagram of C3k2_AssemFormer according to an embodiment of the present invention; Figure 5 Threshold setting for the Focaler-CIoU loss function in this embodiment of the invention; Figure 6 This is a knowledge distillation framework diagram of an embodiment of the present invention; Figure 7 Visualization of the knowledge distillation comparison experiment results of this invention embodiment; Figure 8 Visualization of comparative experimental results for the feature extraction module in this embodiment of the invention; Figure 9 Visualization of the experimental results comparing the loss functions of embodiments of the present invention; Figure 10 Visualization of the SOTA comparison experiment results of the embodiments of the present invention. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0023] Example 1 like Figure 1 As shown, this embodiment provides a method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation, including data acquisition of maize stomatal cells, phased training of the model, result visualization analysis, and application value.
[0024] (a) Data collection; First, researchers carefully wiped the back of the corn leaves with tissue paper to remove surface dust, grease, and loose particles. Next, using a nail polish brush, they applied a thin, even, one-way layer of clear nail polish to the underside of the corn leaves, about 1 square centimeter thick. After application, they allowed the nail polish to air dry for 3-8 minutes. Then, they smoothly applied adhesive tape to the dried nail polish surface and gently pressed it with their hands or an eraser to ensure the tape adhered fully to the film.
[0025] Carefully lift a corner of the tape (or directly lift the film) with pointed tweezers and peel the entire transparent tape off the sample surface. Slide the tape flat onto a glass slide to complete the preparation. Photograph the specimen using an Olympus BX53 microscope with 20x and 40x objectives. Collect 10-20 images for each treatment, ultimately obtaining 551 images of a single stoma and 502 images of multiple stomata.
[0026] (ii) Data processing; All images in the experimental dataset were manually annotated using rotated rectangular bounding boxes. Each pore was described by 5 parameters: center coordinates (x, y), width and height (w, h), and rotation angle θ ∈ [-180°, 180°].
[0027] To enhance model robustness, this invention employs differentiated data augmentation strategies. For single-stoma images, nine augmentation methods are used, including rotation (±30°), multi-directional flipping, brightness / contrast adjustment (0.7–1.3), HSV color dithering, noise injection (Gaussian / speckle / salt and pepper), blur filtering (Gaussian / median / bilateral), cutout occlusion, and shear transformation. Each image is randomly applied twice. For multi-stoma images, six conservative methods are used, including rotation (±15°), flipping, brightness / contrast adjustment (0.8–1.2), Gaussian noise, Gaussian blur, and cutout occlusion. Each image is randomly applied once to maintain the spatial relationships between stomata. This process expands the dataset from 1,053 images to 3,597 images (3.42 times). All bounding box coordinates are updated synchronously to maintain annotation accuracy. Dataset statistics are shown in Table 1, where the image unit is images; x represents the multiplier. Examples of some dataset data are shown below. Figure 2 As shown (original dataset and partial dataset after data augmentation). The dataset is divided into training, validation, and test sets in a 7:2:1 ratio.
[0028] Table 1 (III) Network Architecture; Based on the YOLOv11-OBB architecture, three technological innovations are integrated: (1) a cross-dataset knowledge distillation strategy, adopting a progressive learning paradigm from single-cell to multi-cell; (2) a Focaler-CIoU loss function, applying differential gradients to difficult samples through an adaptive threshold mechanism; and (3) a C3k2_AssemFormer module, which integrates the local inductive bias of CNN and the global context modeling capabilities of Transformer. The network architecture follows the Backbone-Neck-Head design paradigm, respectively responsible for multi-scale feature extraction, feature pyramid fusion, and bounding box prediction, constructing a DFA-YOLO network, the network structure of which is as follows. Figure 3 As shown.
[0029] The DFA-YOLO network structure is a three-stage architecture: Backbone: The C3k2_AssemFormer module combines SPPF and C2PSA to achieve multi-scale feature extraction; Neck: A dual-path C3k2 variant is fused with bidirectional FPN-PAN; OBB detection head: Localization, classification and angle prediction are achieved through DFL, depthwise separable convolution and angle regression branches. Figure 3 The right side shows the detailed structures of SPPF and C2PSA. Feature dimensions: [B,C,H,W], representing batch size, number of channels, height, and width, respectively.
[0030] (1) C3k2_AssemFormer module; Maize stomatal detection faces three major challenges: (1) the long axis of stomata rotates at arbitrary angles (-180° to 180°), requiring orientation-sensitive feature extraction; (2) in multi-cell scenarios, the dense arrangement and mutual occlusion of stomata lead to boundary confusion; and (3) fine structures such as guard cell boundaries and pore openings require precise local feature capture. The local convolution of the standard C3k2 module cannot simultaneously model the detailed features of stomata and global spatial relationships.
[0031] This invention is based on the AssembleFormer architecture and introduces the C3k2_AssemFormer module. Through a parallel dual-branch design, it simultaneously captures the local details (guard cell outlines, textures) and global arrangement patterns (dense distribution, adjacent occlusion) of stomata, achieving accurate localization and robust detection. AssemFormer is the core component of C3k2_AssemFormer, responsible for simultaneously capturing the local morphological features and global distribution patterns of stomata. This module includes a local representation branch (LocalRep), a global representation branch (GlobalRep), and feature fusion operations, connecting convolutional and Transformer operations through a Pack / Unpack mechanism.
[0032] The LocalRep branch focuses on morphological feature extraction of individual stomatal instances, consisting of 3×3 depthwise separable convolutions and 1×1 convolutions. Let the input stomatal image feature map be F. stomata ∈R B×C×H×W Where B is the batch size, C is the number of feature channels (encoding multi-dimensional information such as texture, edges, and gradients of stomata), and H×W is the spatial resolution. A depthwise separable convolution with a 3×3 receptive field captures the kidney-shaped contour curvature of guard cells, the elliptical geometry of the central pore, and microstructures such as cell wall thickening and cuticle texture. A 1×1 convolution reduces the number of stomatal feature channels from C to C / 2, outputting local stomatal features F. local ∈R B×(C / 2)×H×W While preserving key stomatal discriminative features, this design reduces subsequent computational overhead by fusing multimodal stomatal features into a compact representation through cross-channel information aggregation.
[0033] The GlobalRep branch is responsible for modeling the global spatial distribution of dense pore scenes, and its input is the local pore features F from LocalRep. local This branch first reassembles the stomatal feature map into a patch sequence P through a Pack operation. stomata = {p1,p2, ..., p N}, where N = (H / 2)×(W / 2) is the total number of patches, and each patch token p i ∈ R C / 2Local features of stomata in a 2×2 spatial neighborhood are aggregated. In the patch sequence, two cascaded Transformer blocks employ a linear self-attention mechanism to model the long-range spatial dependencies between dense stomata. Unlike standard multi-head self-attention, linear self-attention performs a global score on all stomata patches using a dimensionality-reduced query vector; the calculation formula is as follows: (1) Wherein, the query vector q stomata ∈ R 1×N A global attention score for stomata is assigned, with a scalar weight for each patch location. Softmax(q) stomata ) i This represents the attention weight (scalar, value 0-1) of the i-th patch after Softmax normalization. A value close to 1 indicates that the pores at that location are significant and have clear boundaries, while a value close to 0 indicates that the location is background or a region with blurred edges. Key matrix K stomata ∈R d×N Encode the pore feature representation of all patches (d = C / 2), K per column stomata [:,i]∈R d This describes the pore density, orientation distribution, and boundary sharpness of the i-th patch. The summation symbol Σ represents the summation of the weighted key features over all N pore patches, generating a global context vector C. stomata ∈ R d This vector encodes the stomata distribution pattern throughout the image. Value matrix V stomata ∈ R d×N It contains stomatal features to be modulated (guard cell morphology, pore geometry, local texture), and uses element-wise multiplication (⊙ operation) to weight and modulate the value features of each patch with the global context vector to achieve global consistency enhancement of stomatal features.
[0034] The core advantage of linear attention lies in reducing the computational complexity from O(N²) of standard self-attention to O(N), enabling the model to efficiently handle large-scale patch sequences generated from high-resolution stomata images (such as 1024×1024 resolution). The stomata patch sequence, processed by two Transformer blocks, is then unpacked to refold the token sequence into a spatial feature map F. global ∈R B×(C / 2)×H×WThe feature vector at each spatial location no longer contains only local stomatal information at that location, but integrates the global context of all stomata in the entire image (such as the relative position of the stoma in the dense array, the distribution density of surrounding stomata, and the degree of occlusion in the local region). It is important to note that the GlobalRep branch processes the local stomatal features output by LocalRep rather than the original input. This hierarchical processing ensures that global modeling is based on the enhanced stomatal feature representation, enabling the attention mechanism to model long-range dependencies in a "clean" stomatal feature space.
[0035] Finally, the module fuses the local and global features of pores through channel stitching and convolutional projection. Specifically, the local pore features F local (C / 2 channel) and global stomatal features F global (C / 2 channels) are concatenated into a C channel along the channel dimension, and then the optimal weighted combination of local and global stomatal features is learned through 1×1 convolutional projection (ConvProj) to generate the fused feature F. fused The entire module employs a residual connection design and introduces a random depth mechanism (drop). prob =0.1), its forward propagation process can be formalized as: (2) (3) Residual connections preserve the direct path of the original stomatal input features, ensuring that even if the AssemFormer module fails, the network can still transmit basic stomatal features through the residual path, enhancing training stability. Random depth discards the entire AssemFormer branch with a 10% probability, forcing the network to learn redundant stomatal feature paths, preventing overfitting and improving generalization ability, which is especially important for the limited sample size of the stomatal dataset.
[0036] C3k2_AssemFormer integrates the AssemFormer module on the basis of standard C3k2, forming a four-stage process: (1) the input is divided into two parallel branches by 1×1 convolution; (2) n serial Bottleneck modules (n=2 in this embodiment) progressively extract the local discriminative features of pores (double kidney contour, pore structure), and the receptive field is expanded from the initial 3×3 to 7×7; (3) the second 1×1 convolution fuses the multi-level pore features of all branches; (4) the AssemFormer module performs global context enhancement, and solves the boundary confusion and occlusion problems by modeling the long-range dependencies between dense pores through linear attention. This design combines the multi-scale extraction of CSP with the efficient global modeling of linear Transformer, taking into account both the fine boundary detection of pores and the understanding of dense scenes. Compared with standard multi-head self-attention, the linear attention mechanism achieves similar global context awareness capabilities with lower computational cost.
[0037] like Figure 3 As shown, the C3k2_AssemFormer module is deployed in four layers of Backbone: Layer 2, 4, 6, and 8, to achieve multi-scale stomatal feature enhancement. The shallow layers (Layer 2-4, 256-512 channels) capture the boundary details and local arrangement of stomata at high resolution (256×256 to 128×128). The LocalRep branch accurately extracts the morphological features of stomata, while the GlobalRep branch models the local interactions of small-scale stomatal clusters. The deep layers (Layer 6-8, 512-1024 channels) model the overall stomatal distribution pattern at low resolution (64×64 to 32×32) through linear attention. The GlobalRep branch models the stomatal spatial topology of the entire image through a global attention mechanism, providing a global prior for multi-stomatal localization in dense scenes. The shallow and deep C3k2_AssemFormer modules achieve collaborative optimization through the feature fusion path of the Neck network. The global stomatal distribution features from the deep layer are upsampled and fused with the fine stomatal boundary features from the shallow layer to provide global constraints for bounding box regression. The local stomatal discrimination features from the shallow layer are downsampled and fused with the semantic features from the deep layer to enhance the feature quality of global modeling. This multi-scale deployment strategy enables the model to simultaneously handle the microscopic morphology and macroscopic distribution of stomata, maintaining robust detection performance in both clear single-cell scenes and dense multi-cell scenes. The network architecture of the C3k2_AssemFormer module is as follows: Figure 4 As shown. Figure 4 In (a), the C3k2 dual-branch structure is used. Branch1 provides direct feature propagation, while Branch2 processes features through n cascaded Bottleneck blocks. After concatenation and convolution, the features are input into AssemFormer. Figure 4In (b), AssemFormer fuses local and global representations, LocalRep uses depthwise separable convolution to extract local patterns, GlobalRep combines Transformer and linear attention FFN to capture long-range dependencies, and ConvProj fuses multi-scale features with StochDepth (stochastic depth regularization) to enhance representation capabilities.
[0038] (2) Focaler-CIoU Loss; In maize stomatal detection, there was a clear stratification of sample difficulty, with easy samples (IoU) showing a higher stratification. stomata >0.9) represents isolated, clearly defined stomata in a single-cell scenario; difficult samples (0.5) <IoU stomata <0.8) represents stomata with blurred or partially occluded boundaries in multicellular scenes, and the range sample (IoU) represents the stomata. stomata <0.1) indicates a false positive in the background. The standard CIoU applies a uniform gradient to all stomatal samples, which leads to wasted computational resources on easy samples, insufficient optimization on difficult samples, and susceptibility to abnormal predictions in the later stages of training.
[0039] This invention introduces the Focaler-CIoU loss function and achieves stomatal sample stratification optimization through an adaptive threshold mechanism, such as... Figure 5 As shown. An upper threshold u is used. stomata =0.95, lower threshold d stomata With the configuration set to 0.00, the stomatal prediction quality is divided into two intervals and a differential gradient strategy is applied.
[0040] Figure 5 The comparison shows the standard CIoU (y=IoU, blue dashed line) and the Focaler-CIoU transform (red solid line). Focaler-CIoU reweights the loss through a nonlinear transformation, amplifying the gradient of hard samples (0.00≤IoU≤0.95, orange region) and suppressing the contribution of easy samples (IoU>0.95, green region).
[0041] The Focaler-CIoU loss function is constructed based on the standard CIoU loss. First, it calculates the basic CIoU value between the predicted stomatal frames and the true stomatal frames: Among them, IoU stomata For the intersection-union ratio, ρ²(b) stomata , b gt_stomata ) represents the squared Euclidean distance between the center point of the predicted stomatal frame and the actual stomatal frame, and c is the diagonal length of the minimum bounding rectangle; V stomata α measures the consistency of the aspect ratio of pores. stomataThis represents the dynamic weighting coefficient. Based on this, this study introduces a Focaler transformation mechanism to divide the samples into two levels according to the stomatal IoU value. When IoU... stomata When IoU > 0.95, it is considered a high-quality matched pore and mapped to 1.0; when 0 ≤ IoU stomata When the value is ≤ 0.95, the stomatal sample is considered to require optimization and linear transformation IoU. stomata / 0.95. This mapping strategy ensures that the model continuously optimizes for most stomatal samples (IoU). stomata ≤95%), while also predicting high-quality stomata (IoU). stomata (>95%) sets a strict standard. The mathematical formula is: The threshold parameter is designed to be adaptive and learnable, u stomata and d stomata Constrained within a reasonable range by the Sigmoid function (u) stomata ∈ [0.7, 1.0], d stomata (∈ [0.0, 0.3]), the formula is as follows: (7) (8) This embodiment initializes u stomata =0.95, d stomata =0.00, during training θ u_stomata and θ d_stomata It can be automatically adjusted according to the characteristics of the stomatal dataset. The final Focaler-CIoU loss function integrates the transformed IoU values of all positive sample stomata and weights them according to the stomatal target score w. i_stomata Perform a weighted average: Where, N pos_stomata This represents the total number of pores in the positive samples within a batch.
[0042] Unlike horizontal bounding box detection, this invention implements a 5-dimensional representation (x, y, w, h, θ) for vents, specifically addressing the characteristics of rotated bounding boxes, and is designed for the FocalerCIoURotatedBboxLoss class. The first four dimensions are extracted to compute the IoU space, while the fifth dimension, angle θ, is retained for vent orientation regression constraints. The loss function, combined with the Distribution Focal Loss (DFL) mechanism, further improves vent localization accuracy by modeling the probability distribution of vent bounding boxes rather than single-point prediction.
[0043] This design has three advantages: (1) It does not discard any pore samples. stomata=0 ensures that the learning signal is preserved even with low IoU prediction, which is suitable for complex stomata boundary scenarios and avoids premature abandonment of difficult samples; (2) strict high-quality standards. stomata =0.95 means only IoU stomata >95% of the predictions are considered "perfect" and optimization stops. The remaining stomatal samples continue to receive linearly weighted gradient updates, which is crucial for the accurate detection of fine stomatal boundaries; (3) Adaptive threshold adjustment. Learnable parameter θ u_stomata and θ d_stomata It can automatically optimize based on the IoU distribution of the pore dataset, and natively supports rotated bounding boxes (x, y, w, h, θ) without requiring additional angle loss design.
[0044] (3)Knowledge Distillation; Single-cell dataset per Figure 1-2 A single isolated stomata provides ideal samples for learning essential stomatal features, such as the double-kidney shape and pore structure. Multi-cell datasets, averaging about 170 stomata per image, suffer from dense arrangement and occlusion, significantly increasing detection difficulty. Direct training faces three challenges: blurred boundaries leading to feature confusion, adjacent stomata causing angle conflicts, and dual learning tasks leading to training instability. Therefore, this study proposes a "from simple to complex" cross-dataset distillation strategy: the teacher model (YOLOv11-OBB) is trained for 100 epochs on the single-cell dataset to learn "from simple to complex," while the student model (DFA-YOLO) is trained for 150 epochs on the multi-cell dataset. Distillation aligns complex scene features with clear templates, such as... Figure 6 As shown. Figure 6 Figure (a) shows the MGD masking mechanism: the student branch processes the multi-pore image to generate features Fs, which are then transformed by a random mask (λ=0.65) and a generator network (ReLU + 3×3 convolution) to produce G(Fg); the teacher branch extracts features Ft from the single-pore image. The feature difference |G(Fg) is then used to calculate the feature Ft. s )-F t |Calculate MGD loss to transfer structural knowledge. Figure 6 (b) shows the knowledge transfer mechanism between the teacher-student model. Figure 6 (c) shows the distillation weight dynamic scheduling strategy: preheating stage (0.0→1.0), decay stage (1.0→0.5), and stabilization stage (0.5).
[0045] Feature-level distillation was employed. After comparing six algorithms (MGD, CWD, AT, PKD, SKD, and ATM), MGD (Masked Generative Distillation) was selected. Its masking mechanism simulates a scenario with densely occluded vents. MGD randomly occludes 65% of the student feature region (λ=0.65), forcing the inference of complete vent features from incomplete information. The loss function is: Where M is a random mask, G i_stomata For pore feature generator, F s_stomata and F t_stomata Stomatal feature diagrams for students and teachers, respectively, N stomata This represents the total number of pore feature maps. Cosine annealing is used to dynamically adjust the distillation weights: the weight is preheated to 1.0 for the first 10 rounds, decayed to 0.5 for the next 50 rounds, and maintained at 0.5 for the final 90 rounds. The weight scheduling function is: The parameter is w init_stomata =1.0, w final_stomata =0.5, e warmup_stomata =10, e decay_stomata =50. The distillation layer selects the multi-scale feature representation of pores from layers 6, 8, and 10 of the Backbone, covering local details and global semantics of pores.
[0046] (iv) Evaluation indicators; The evaluation of the detection model of this invention is based on the matching results between the predicted bounding box and the ground truth annotation, as defined in Table 2.
[0047] Table 2 In the table: TP: True Positive; FN: False Negative; FP: False Positive; TN: TrueNegative.
[0048] This invention uses the following metrics to evaluate model performance: Precision, Recall, mAP50, FPS, Parameters, GFLOPs, and Weight. Precision: The proportion of truly positive predictions among all positive predictions, reflecting the model's ability to exclude negative samples.
[0049] (12) Recall: The proportion of all true positive samples that are successfully detected, reflecting the model's ability to cover the target.
[0050] (13) Average Precision (AP): By adjusting the confidence threshold, different Precision-Recall pairs are obtained and connected to form a PR curve. AP is defined as the area under this curve, and its value ranges from [0,1].
[0051] (14) Wherein, P(R) is the precision function with recall R as the independent variable.
[0052] mAP50 (mean Average Precision at IoU=0.5): The arithmetic mean of AP for all classes when the IoU threshold is 0.5. For single-class detection tasks, mAP50 is equivalent to AP50.
[0053] (15) Where C represents the total number of categories.
[0054] FPS (Frames Per Second): The number of image frames processed by the model per second, reflecting the inference speed. Inference time includes forward propagation and post-processing (NMS, etc.), but does not include data loading.
[0055] (16) Tinference is the average inference time (in seconds) for a single image.
[0056] Parameters: The total number of trainable parameters in the model, expressed in millions (M), reflecting storage requirements. For convolutional layers: (17) Where Cout and Cin are the number of output and input channels, respectively, K is the kernel size, and +1 is the bias term.
[0057] GFLOPs (Giga Floating Point Operations): The number of floating-point operations required for the model to complete one forward propagation, in billions (10^10) of operations. 9 The unit is denoted as (), reflecting computational complexity. For convolutional layers: (18) Where H and W are the spatial dimensions of the output feature map, and the coefficient 2 indicates that multiplication and addition are counted once each.
[0058] weight: Storage space of the model weight file, in MB.
[0059] (19) Bits_per_param represents the number of bits for each parameter. This study uses the FP32 format (32-bit), meaning each parameter occupies 4 bytes.
[0060] (v) Experiment setup; All experiments were implemented using PyTorch 2.0.0 and the Ultralytics framework, and performed on an NVIDIA RTX 3090 (24GB) graphics card. Training employed a two-stage strategy: the teacher model was trained for 100 epochs on a single-cell dataset, while the student model was trained for 150 epochs on a multi-cell dataset with simultaneous application of MGD knowledge distillation.
[0061] All experiments were conducted under a unified configuration, with specific parameters shown in Table 3.
[0062] Table 3 Results and Analysis: (1) Ablation experiment; To verify the performance of the improved model of this invention, the synergy between modules, and to comprehensively measure the improvement effect of the maize stomatal cell detection algorithm, this embodiment designed and implemented a series of ablation experiments. The baseline model is YOLOv11-obb. Based on the knowledge distillation strategy, the C3k2_AssemFormer module and the Focaler-CIoU loss function were gradually added, as shown in Table 4.
[0063] The C3k2_AssemFormer module improved mAP50 by 0.8% and precision by 1.2%, but only slightly improved recall. In its dual-branch architecture, LocalRep captures local detail features, while GlobalRep models global spatial relationships through a Transformer, collaboratively enhancing feature discrimination capabilities. However, the limited improvement in recall indicates that simple feature enhancement is insufficient to address the sample imbalance problem in dense scenes. Therefore, further optimization was performed. Focaler-CIoU was the single improvement that contributed the most, improving mAP50 by 6.5% and recall by a significant 10.9%, but decreasing precision by 5.1%. Its adaptive thresholding mechanism (u=0.95, d=0.00) applies a linearly weighted gradient to samples with IoU ≤ 0.95, ensuring sufficient optimization for difficult samples. Compared to the uniform gradient distribution of standard CIoU, this strategy effectively alleviates the sample imbalance problem in dense scenes; the decrease in precision is a trade-off between pursuing high recall.
[0064] The complete model achieved optimal performance, with an mAP50 of 94.1% and a recall of 90.0%, representing an improvement over using either the module or the loss function alone. Precision recovered from 87.2% with the loss function alone to 87.5%, achieving a better balance between precision and recall. This synergistic effect stems from two aspects: the enhanced features of C3k2_AssemFormer mitigated the aggressive prediction tendency of Focaler-CIoU, while the focus on difficult samples in Focaler-CIoU guided the module to prioritize densely modeled samples. The cumulative computational complexity reduced the FPS to 44.9, but still met the requirements for offline phenotypic analysis.
[0065] Table 4 Note: P: Precision; R: Recall; mAP50: mean Average Precision at IoU=0.5; FPS: Frames Per Second; GFLOPs: Giga Floating Point Operations.
[0066] (2) Comparative experiment; To verify the superior performance of each module of the improved model compared to other modules, and the overall improvement of the model compared to current mainstream algorithm models, this invention selected various modules and classic models for comparative experiments to ensure a comprehensive and objective evaluation of model performance.
[0067] 1) Knowledge distillation comparative experiment; Using YOLOv11-obb as a baseline, experiments were conducted using the MGD distillation method, resulting in a 0.6% improvement in mAP50, demonstrating the effectiveness of the knowledge distillation strategy. To further verify the role of different knowledge distillation strategies in cross-dataset transfer, five mainstream knowledge distillation algorithms were compared in the "single-cell to multi-cell" scenario, using complete models (C3k2_AssemFormer and Focaler-CIoU) as student networks and a pre-trained model with the same structure on a single-cell dataset as the teacher network. This was to evaluate the effectiveness of different distillation strategies in generalizing to dense stomata. The results are shown in Table 5. The MGD method achieved the best performance, with an mAP50 of 94.1% and a recall of 90.0%, significantly outperforming other distillation methods in recall. Channel-dimensional distillation in CWD is not suitable for spatially sensitive tasks, and attention map matching in AT does not adequately address samples with blurred boundaries. The advantages of MGD lie in simulating occlusion scenes through a 65% feature masking mechanism, providing stronger robustness through generative alignment strategies, and achieving effective cross-scene knowledge transfer from "pure pore features".
[0068] Table 5 Note: P: Precision; R: Recall; mAP50: mean Average Precision at IoU=0.5; FPS: Frames Per Second; GFLOPs: Giga Floating Point Operations.
[0069] 2) Comparative experiment of feature extraction modules; To explore the optimization effects of various C3k2 modules on model performance and obtain the optimal model, this study improved the C3k2 module of the original model's backbone by replacing it with four advanced CNN-Transformer hybrid modules, based on a knowledge distillation strategy. All experiments used the same training configuration, only replacing the feature extraction module in the backbone. As shown in Table 6, C3k2_AssemFormer achieved the best performance, with an mAP50 of 88.0% and a recall of 79.5%. While C2PSA_CAFM's Polarized Self-Attention is lightweight and efficient, its separation of attention results in a loss of spatial interaction capability, with an mAP50 of 87.6%. C3k2_HTB's local window mechanism limits the global receptive field, resulting in high precision but low recall. PoolFormerBlock is the lightest but has the weakest performance, indicating that pooling cannot replace the attention mechanism. C3k2_AssemFormer's dual-branch design, with LocalRep capturing local features and GlobalRep modeling globally, avoids window limitations while maintaining efficiency and effectively models dense pore distributions.
[0070] Table 6 Note: P: Precision; R: Recall; mAP50: mean Average Precision at IoU=0.5; FPS: Frames Per Second; GFLOPs: Giga Floating Point Operations.
[0071] 3) Loss function comparison experiment; To evaluate the impact of different loss functions on rotated object detection, six loss functions were compared based on the C3k2_AssemFormer module. All experiments used the same network architecture and training configuration, only the loss functions were changed. The experimental results are shown in Table 7. Focaler-CIoU achieved the best performance, with an mAP50 of 94.1% and a recall of 90.0%, representing significant improvements of 6.1% and 10.5% respectively compared to the original CIoU. While distribution matching losses such as NWD and Inner-CIoU are theoretically suitable for rotated boxes, they performed poorly in dense scenes, possibly due to insufficient handling of imbalanced samples. GWD performed the worst, with an mAP50 of only 28.4%, indicating that the Gaussian distribution assumption is unsuitable for the irregular shape of pores. Focaler-CIoU dynamically adjusts gradient weights through an adaptive threshold mechanism, effectively focusing on difficult samples, and significantly improves both mAP50 and recall compared to other loss functions.
[0072] Table 7 Note: P: Precision; R: Recall; mAP50: mean Average Precision at IoU=0.5; FPS: Frames Per Second; GFLOPs: Giga Floating Point Operations.
[0073] 4) Model comparison experiment; To comprehensively and fairly verify the superior performance of the proposed model compared to existing mainstream algorithm frameworks, several representative algorithm frameworks were selected for comparison. The results are shown in Table 8. Experimental results demonstrate that the proposed method achieves a significant improvement in detection accuracy. Compared to the YOLOv11-obb baseline model, the proposed model achieves an mAP50 of 94.1%, an improvement of 6.9%. Furthermore, the recall rate significantly increases from 78.6% to 90.0%, an improvement of 11.4%, clearly indicating that the model effectively solves the problem of missed detections in dense stomatal scenarios. Regarding the trade-off between accuracy and efficiency, although the FPS decreases to 44.9, it still meets real-time requirements, and compared to the fastest YOLOv5-obb model (FPS=143.3), the mAP50 is improved by 41.1%, demonstrating a significant accuracy advantage. In addition, the proposed method has 4.10M model parameters, an increase of 54.5% compared to the baseline, but considering the improved accuracy gained, this parameter size is acceptable for plant research scenarios. Figures 7-10 Visualize the results of different comparative experiments. Figure 7 The results of the knowledge distillation comparative experiment are shown. Figure 8 The results of the comparative experiment on the feature extraction module are shown. Figure 9 The results of the Loss comparison experiment are shown. Figure 10 The results of the SOTA comparison experiment are shown. Figures 7 to 10 The results of the four sets of comparative experiments were visualized: Figure 7 The results of the comparative experiment of knowledge distillation method are shown. Subplots (a), (b), and (c) reflect the changing trends of different distillation loss functions and the baseline model in terms of Precision, Recall, and mAP50 during the training process. Figure 8 The results of the comparative experiments on the feature extraction module are shown. Subgraphs (a), (b), and (c) compare the performance differences of various module structures in terms of Precision, Recall, and mAP50 during the early stage of training. Figure 9 The results of the comparative experiment of loss functions are shown. Subgraphs (a), (b), and (c) respectively show the training dynamics of different loss functions and the original model in terms of Precision, Recall, and mAP50. Figure 10 The results of the comparative experiments of the SOTA model are shown in subfigures (a), (b), and (c), which compare the changes in Precision, Recall, and mAP50 of various state-of-the-art detection models during the training process.
[0074] Table 8 Note: P: Precision; R: Recall; mAP50: mean Average Precision at IoU=0.5; FPS: Frames Per Second; GFLOPs: Giga Floating Point Operations.
[0075] discuss: (1) The theoretical basis of technological innovation; The performance improvement revealed by the ablation experiments stems from the targeted design of three techniques to address the inherent challenges of dense pore detection. First, the necessity of the CNN-Transformer hybrid architecture arises from the dual feature requirements of pore detection: convolution efficiently extracts local morphological features through inductive bias, while self-attention overcomes the receptive field limitations to model the spatial dependencies of densely packed pores. This complementarity is particularly crucial in dense scenes because the spatial relationships between adjacent pores (such as spacing and orientation) are important clues for distinguishing targets from the background, which pure convolutional networks struggle to effectively capture.
[0076] Secondly, Focaler-CIoU's significant contribution stems from its profound improvement to the object detection optimization process. The standard loss function treats all samples equally, leading to an imbalanced scenario with a positive-to-negative sample ratio of approximately 1:170, where easily distinguishable samples dominate the gradient direction while difficult samples are under-optimized. The adaptive threshold mechanism, through dynamic gradient weighting, essentially fine-tunes the optimization trajectory, ensuring the model's stability for easily distinguishable samples while applying a stronger learning signal to difficult samples with blurred boundaries and partial occlusion. Thirdly, the key to MGD's successful knowledge distillation lies in the generative alignment of the feature space rather than simple feature matching. This allows the student network to not only learn the teacher's discriminative ability but also inherit the prior "pure stomata features" extracted from single-cell data, thus maintaining the stability of feature representations in complex scenes.
[0077] (2) Overcoming the limitations of existing methods; The performance bottlenecks of existing YOLO methods in dense stomatal detection reveal the inherent limitations of general object detection frameworks in specific domain applications. While YOLOv11-obb employs advanced C2f modules and a decoupled head design, its architecture optimization aims for balanced performance in natural scenes, rather than extreme scenarios with dense, small objects. This leads to two core problems: First, the local receptive field of standard convolution cannot effectively model the global spatial distribution pattern of stomatals. In dense scenes with an average of 170 objects per image, the model struggles to learn the relationships between objects for auxiliary localization. Second, the standard loss function implicitly assumes that the optimization difficulty for positive and negative samples is similar, leading to systematic underfitting of difficult samples in stomatal detection with extremely imbalanced samples.
[0078] This invention overcomes these limitations through a three-pronged design paradigm of "architecture-loss-distillation." At the architectural level, the introduction of Transformer is not a simple stacking of modules, but a fundamental change to the feature extraction paradigm, enabling the model to acquire global inference capabilities. At the loss level, the adaptive gradient control mechanism addresses the sample imbalance problem from an optimization algorithm perspective, which is more direct and effective than superficial methods such as data augmentation. At the distillation level, cross-dataset knowledge transfer essentially utilizes strong priors established in simple scenarios to guide learning in complex scenarios; this "from simple to complex" learning strategy aligns with the cognitive processes of human experts. More importantly, the synergistic effect of these technologies generates superlinear gain, validating the advantages of targeted design over general solutions.
[0079] (3) The rationality of the trade-off between accuracy and efficiency; The trade-off between accuracy and efficiency is a fundamental contradiction in deep learning, but the rationality of this trade-off depends on the real-world application scenario. In plant phenotypic analysis, the cost of detection errors far outweighs the computational cost: underestimation of stomatal density due to missed detections directly affects stomatal conductance calculations and drought resistance assessments, thereby impacting the accuracy of genetic analysis and the reliability of breeding decisions. From this perspective, this method, by increasing computational complexity to improve detection accuracy, essentially trades scalable computational resources for irreversible data quality.
[0080] The O(N²) complexity introduced by Transformer may seem like an efficiency bottleneck, but its impact is significantly diluted in offline batch processing mode. More importantly, compared to the time cost of manual annotation, automatic detection still maintains a significant efficiency advantage even at a reduced speed of 44.9 FPS. This shift from labor-intensive to computationally intensive is the core value of deep learning technology. Furthermore, while knowledge distillation increases training overhead, only student models are deployed during inference. This "slow training, fast inference" paradigm is well-suited for research scenarios where models are trained once and deployed multiple times. In the future, techniques such as Linear Attention, model pruning, and INT8 quantization can further optimize inference efficiency, but the current performance level is sufficient for practical needs.
[0081] (4) System implementation and application; To facilitate the practical application of research findings, an intelligent stomatal detection and analysis platform was developed. This platform utilizes the Python and PyQt5 frameworks, integrating model inference, a visualization interface, and data analysis capabilities. Core functions include: a model management system supporting multi-model switching; real-time result visualization and statistical analysis for single-image detection; a batch detection module supporting large-scale processing at the folder level and automatically generating labeled images, JSON data, and statistical reports; and a results export system supporting multiple formats for easy downstream integration. The platform is compatible with YOLO series .pt models and supports both horizontal and rotated bounding box detection modes.
[0082] The platform has been applied in multiple maize phenotypic analysis projects, providing standardized tool support for the field of stomatal detection, lowering the application threshold of deep learning technology, and enabling researchers to complete the entire process from image import to result export through a graphical interface, thus promoting the rapid deployment and widespread application of high-precision detection methods.
[0083] in conclusion: This invention addresses the problem of rotating target detection in densely packed stomatal scenes by proposing a high-precision detection method based on an improved YOLOv11-obb. By introducing the C3k2_AssemFormer module to enhance feature representation, designing a Focaler-CIoU loss function to address sample imbalance, and employing MGD knowledge distillation to achieve cross-scene knowledge transfer, this method achieves 94.1% mAP50 and 90.0% recall on a maize stomatal detection task, representing improvements of 6.9% and 11.4% respectively compared to the YOLOv11-obb baseline, significantly outperforming existing YOLO series methods.
[0084] Experimental results validated the effectiveness and synergistic effect of each component. Ablation experiments showed that Focaler-CIoU was the single improvement that contributed the most, the dual-branch design of C3k2_AssemFormer effectively balanced local details and global modeling, and MGD knowledge distillation performed best in cross-dataset transfer. Loss function comparison experiments further confirmed that Focaler-CIoU has a significant advantage over other rotated box losses (Inner-CIoU, NWD, KLD, etc.) in dense scenes.
[0085] This invention provides a high-precision solution for automated stomatal detection in plant phenotypic analysis, possessing significant scientific research application value. The developed intelligent stomatal detection platform has been successfully applied to actual scientific research projects, verifying the method's practicality and stability. Although computational complexity has increased, it remains highly practical for offline phenotypic analysis scenarios. Future work will focus on cross-species generalization, functional expansion, lightweight deployment, and multimodal fusion to further enhance the method's versatility and application breadth, promoting the in-depth application of deep learning technology in plant science research.
[0086] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation, characterized in that, Includes the following steps: A maize stomatal cell image dataset was acquired and constructed, the dataset including single-cell scene images and multi-cell scene images; A detection model is built based on the YOLOv11-obb network architecture. The detection model includes a backbone network, a neck network, and an OBB detection head. In the backbone network, the C3k2 module at the preset level is replaced with the C3k2_AssemFormer module. A teacher model is trained on the single-cell scene image; a student model is trained on the multi-cell scene image; during the training of the student model, the Focaler-CIoU loss function is used to optimize the regression of the rotated bounding box, and the knowledge of the teacher model is transferred to the student model through MGD knowledge distillation loss; the student model adopts the architecture of the detection model. The trained student model is used to detect maize stomatal cells in the image to be tested.
2. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The process of obtaining a dataset of maize stomatal cell images includes: For the single-cell scene image, at least one method is selected from rotation, multi-directional flipping, brightness adjustment, contrast adjustment, HSV color dithering, noise injection, blur filtering, cutout occlusion, and shear transformation for enhancement; The multicellular scene image is enhanced by selecting at least one method from rotation, flipping, brightness adjustment, contrast adjustment, Gaussian noise, Gaussian blur, and cutout occlusion.
3. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The C3k2_AssemFormer module includes an initial convolutional layer, a dual-branch processing layer, and the AssemFormer module connected in sequence. The dual-branch processing layer includes a first branch and a second branch. The first branch is an identity mapping, and the second branch contains multiple cascaded Bottleneck modules. The AssemFormer module is used to fuse local features with global context in the output features of the dual-branch processing layer.
4. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 3, characterized in that, The AssemFormer module includes a local representation branch, a global representation branch, and a feature fusion unit; The local representation branch includes depthwise separable convolutions and point convolutions connected in sequence, used to extract local features of the input features; The global representation branch includes a Pack operation, at least one linear self-attention Transformer block, and an Unpack operation executed sequentially, used to reorganize the local features and model long-range dependencies to generate global features; The feature fusion unit concatenates the local features and the global features through channels, and after convolutional projection, it fuses them with the input features of the AssemFormer module through residual connections via a random depth mechanism.
5. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The Focaler-CIoU loss function is constructed based on the standard CIoU loss. Its calculation process includes: calculating the intersection-union ratio (CIU) between the predicted bounding box and the ground truth bounding box, and transforming the CIU according to a learnable upper threshold and a lower threshold; wherein, the upper threshold and the lower threshold are learnable parameters constrained within a preset range by the Sigmoid function; the transformation includes: when the CIU is greater than the upper threshold, the mapping value is 1.0; when the CIU is not less than the lower threshold and not greater than the upper threshold, the mapping value is the ratio of the CIU to the upper threshold.
6. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The calculation process for MGD knowledge distillation loss includes: Multiple preset-level feature maps are selected from the backbone network of the student model as student feature maps, and teacher feature maps are extracted from the corresponding levels of the teacher model. A random binary mask with a preset mask probability is generated and element-wise multiplied with the student feature maps to mask part of the feature regions. The masked student feature maps are input into a feature generator network composed of nonlinear activation functions and convolutional layers for feature transformation. The L2 norm distance between the transformed features output by the feature generator network and the teacher feature maps of the corresponding levels is calculated, and the average of the distance calculation results for all selected levels is summed to obtain the MGD knowledge distillation loss.
7. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, During the training of the student model, the weights of the MGD knowledge distillation loss are dynamically scheduled. The dynamic scheduling process includes: During the warm-up phase, in the initial training rounds, the weights are linearly increased from the initial set value to the first weight value; during the decay phase, the weights are decayed from the first weight value to the second weight value using a cosine annealing method; during the stabilization phase, the weights remain unchanged at the second weight value.
8. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The C3k2_AssemFormer module is deployed at layers 2, 4, 6, and 8 of the backbone network and is used to extract and fuse local detail features and global context features on feature maps at different scales.
9. The method for detecting maize stomatal cells based on improved YOLOv11-obb and knowledge distillation according to claim 1, characterized in that, The neck network uses a bidirectional FPN-PAN structure for multi-scale feature fusion; the OBB detection head includes a DFL branch for bounding box center coordinates and width-height regression, an angle regression branch for angle prediction, and a classification branch for stomatal cell classification.