Crop disease double-flow collaborative identification method and system based on mask guidance
Patent Information
- Application Number
- CN202611126169.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-16
AI Technical Summary
传统空洞空间金字塔池化依赖固定空洞率并行采样和简单通道拼接,缺乏自适应筛选与动态门控,微小病斑易被背景噪声淹没而漏检,大面积连片病害则因缺乏跨尺度权重分配,产生语义断裂或孔洞;其次真实病斑边缘呈不规则拓扑结构,而现有解码器依赖双线性插值或对称方形卷积,单一感受野无法精细拟合复杂边界,造成边缘过度平滑、模糊溢出;还有田间存在泥土、强光斑等严重噪声,现有融合方式如通道拼接或逐元素相加,缺乏对无关噪声的硬性过滤机制,易将高频背景噪声误判为病害区域;最后直接分类易受背景污染,先分割后计算面积占比的两步法对分割误差极其敏感,一旦粘连则比例失真,两者缺乏特征层的端到端协同
1.本发明引入通道分流软选择卷积,在预设空洞率分支内,将输入特征按比例划分为空间感受野增强路径与逐点语义保持路径,并利用全局平均池化与Softmax函数生成双路径通道级动态权重。由此,能够根据不同尺度病斑的特征响应,自适应调节空间上下文信息与语义保持信息的贡献比例,从而提升对早期微小病斑和晚期连片病斑的表征能力,并在一定程度上降低冗余计算。
Smart Images

Figure CN122929173A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a mask-guided dual-stream collaborative identification method and system for crop diseases. Background Technology
[0002] In the fields of smart agriculture and precision plant protection, early detection and objective severity assessment of crop diseases are of great economic and ecological significance for ensuring yields and reducing pesticide overuse. Traditional manual field inspections suffer from bottlenecks such as low efficiency, large subjective errors, and a lack of expert resources. In recent years, intelligent diagnostic systems based on computer vision and deep learning have become the mainstream technical approach, widely adopting the "image segmentation + image classification" paradigm: the lesion extraction stage often uses semantic segmentation networks such as DeepLabv3+, utilizing hollow spatial pyramid pooling to extract contextual features; the disease severity assessment stage directly inputs the entire image into classification networks such as MobileNet and ResNet, or calculates the ratio of lesion area to leaf pixel area using the segmented lesion mask to map the severity level. The above technologies are feasible to a certain extent in controlled laboratory environments. However, in real field environments with variable lighting and cluttered backgrounds, existing technologies still have the following technical shortcomings: Traditional void space pyramid pooling relies on parallel sampling with a fixed void ratio and simple channel splicing, lacking adaptive filtering and dynamic gating. Small lesions are easily drowned out by background noise and missed, while large-area contiguous lesions suffer from semantic breaks or holes due to the lack of cross-scale weight allocation. Secondly, the edges of real lesions have irregular topological structures, while existing decoders rely on bilinear interpolation or symmetrical square convolution. A single receptive field cannot accurately fit complex boundaries, resulting in overly smoothed edges and blurred overflow. Furthermore, there is serious noise in the field, such as soil and strong light spots. Existing fusion methods, such as channel splicing or element-wise addition, lack a hard filtering mechanism for irrelevant noise, which easily misclassifies high-frequency background noise as disease areas. Finally, direct classification is easily contaminated by background. The two-step method of segmenting first and then calculating the area ratio is extremely sensitive to segmentation errors. Once the segments are stuck together, the proportions are distorted, and the two lack end-to-end collaboration of the feature layers. Summary of the Invention
[0003] This invention provides a method and system for dual-stream collaborative identification of crop diseases based on mask guidance.
[0004] The technical solution of this invention is as follows: A mask-guided dual-stream collaborative identification method for crop diseases includes the following steps: S1. Acquire crop leaf images, and process the crop leaf images into segmentation and classification branches respectively; In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the proportion of lesion area. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features; S2. Perform a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guiding features. Concatenate the lesion guiding features and global features along the channel dimension to obtain heterogeneous fusion features. Combine the channel-gated network to perform global average pooling on the heterogeneous fusion features to obtain channel-level gating vectors. After weighting the lesion guiding features channel-wise according to the channel-level gating vectors, fuse them with the global feature residuals to obtain the final fusion features. S3. The final fused features are subjected to average pooling to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
[0005] Furthermore, the multi-morphological edge detail aggregation process is as follows: Deep semantic features are extracted to obtain shallow and mid-level features. Convolution operations are performed on these features. The mid-level features are upsampled and then added element-wise to the convolved shallow features to obtain basic features. These basic features are then processed by convolution operations and a first irregular convolution kernel to obtain first connected features. After being connected to the residuals of the basic features, they are processed by a second irregular convolution kernel to obtain second connected features. After being connected to the residuals of the basic features, they are then processed by normalization and activation, and finally by convolution operations to obtain aggregated features.
[0006] Furthermore, the energy mutation gating process is as follows: The fourth intermediate feature contains deep high-dimensional features and shallow detail features. These are concatenated to obtain the initial feature. The initial feature undergoes dynamic residual convolution to obtain the aligned feature. After convolution and activation processing, a spatial binarization preliminary mask is generated. The feature obtained by concatenating the residual of the aligned feature with the aligned feature is then fused with the aligned feature to obtain the spatial gated feature. The feature obtained by concatenating the residual of the spatial gated feature with the aligned feature is then fused with the aligned feature and subjected to energy mutation purification to obtain the energy-enhanced feature. After smoothing processing, the fused output feature is obtained.
[0007] Furthermore, the dynamic residual convolution operation in the energy mutation gating process is as follows: The fourth intermediate feature contains deep high-dimensional features and shallow detailed features, which are concatenated to obtain the initial feature. The initial feature enters two branches. In the first branch, a convolution operation is performed to obtain the first initial feature. In the second branch, a convolution operation, normalization, and activation processing are performed to obtain the branch. The feature after dimensionality reduction and nonlinear transformation is then subjected to dimensionality increase operation. The feature obtained after mapping is then residually connected with the feature obtained after convolution operation and normalization processing of the branch feature to obtain the second initial feature. After being fused with the first initial feature, activation processing is performed to obtain the aligned feature.
[0008] Furthermore, the energy mutation purification operation in the energy mutation gating process is as follows: The abnormal mutation energy is extracted based on the spatial gating features. An energy attention map generated from the abnormal energy response is obtained by affine transformation parameters. The energy attention map is then multiplied element-wise with the spatial gating features to obtain the energy enhancement features.
[0009] Furthermore, the attention recalibration process in squeeze and stimulate attention processing is as follows: in, This represents the multi-scale fused features after 1×1 convolution dimensionality reduction; AvgPool represents the global average pooling operation. Represents the ReLU activation function; Represents the gated function; and These represent the learnable weight matrices used for channel dimensionality reduction and channel dimensionality increase, respectively. This indicates element-wise multiplication at the channel level; This indicates the output characteristics after recalibration.
[0010] Furthermore, the channel-level gating vector process is as follows: in, Represents the channel-level gate vector; GAP represents the global average pooling operation; Represents the ReLU activation function; This represents the Sigmoid gate function; and This represents the learnable parameters used internally by the channel gating mechanism to generate channel gating weights; Indicates heterogeneous fusion features The learned channel-level gating vector.
[0011] Furthermore, the lesion-guided features are shown in the following process: Global features are extracted from the classification branch, and the high-resolution mask is physically downsampled using the nearest neighbor interpolation algorithm to obtain the aligned mask. The binarized aligned lesion mask and the global features are then subjected to a pixel-by-pixel Hadamard product to obtain the lesion guiding features.
[0012] A mask-guided dual-stream collaborative identification system for crop diseases includes the following: The dual-stream parallel feature extraction module acquires crop leaf images, which are then processed in segmentation and classification branches respectively. In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the proportion of lesion area. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features; The spatial guidance and collaborative fusion module performs a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guidance features. The lesion guidance features and global features are concatenated along the channel dimension to obtain heterogeneous fusion features. The heterogeneous fusion features are then subjected to global average pooling using a channel-level gating network to obtain channel-level gating vectors. The lesion guidance features are then weighted channel-wise according to the channel-level gating vectors and fused with the residuals of the global features to obtain the final fusion features. The disease classification prediction output module performs average pooling on the final fused features to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
[0013] Furthermore, the dual-stream parallel feature extraction module includes a multi-morphological edge detail aggregation processing module. Deep semantic features are extracted to obtain shallow and mid-level features. Convolution operations are performed on these features. The mid-level features are upsampled and then added element-wise to the convolved shallow features to obtain basic features. These basic features are then processed by convolution operations and a first irregular convolution kernel to obtain first connected features. After being connected to the residuals of the basic features, they are processed by a second irregular convolution kernel to obtain second connected features. After being connected to the residuals of the basic features, they are then processed by normalization and activation, and finally by convolution operations to obtain aggregated features.
[0014] The beneficial effects of this invention are as follows: 1. This invention introduces channel-splitting soft-selection convolution. Within a branch with a preset hole rate, the input features are proportionally divided into a spatial receptive field enhancement path and a point-by-point semantic preservation path. Global average pooling and the Softmax function are then used to generate dual-path channel-level dynamic weights. This allows for adaptive adjustment of the contribution ratio of spatial context information and semantic preservation information based on the feature responses of lesions at different scales, thereby improving the representation ability of early-stage small lesions and late-stage contiguous lesions, and reducing redundant computation to some extent.
[0015] 2. This invention introduces orthogonally decoupled asymmetric irregular convolutional structures, such as 1×3 horizontal convolution and 3×1 vertical convolution, and combines them with depthwise separable convolution and residual connection mechanisms. This can more effectively capture the gradient changes of lesion edges in different directions, reduce the involvement of irrelevant background regions, thereby improving the edge blurring problem in the lesion-health boundary region and improving the continuity and detail fidelity of lesion segmentation results.
[0016] 3. This invention introduces energy mutation gating processing, where dynamic residual convolution is used to mitigate the semantic differences between deep semantic features and shallow detail features; spatially gating edge guidance is used to generate spatially gating responses, enhancing suspected lesion areas; and the energy mutation activation operation extracts abnormal energy features that deviate from normal leaf responses by calculating the mean and variance of features in the spatial dimension. Therefore, it can enhance the feature responses of real diseased areas and suppress the risk of misjudgment caused by some complex field background noise.
[0017] 4. This invention uses the lesion mask output by the segmentation branch as a spatial prior, introducing it into the hidden feature space of the classification branch. It then performs element-wise multiplication with the global original image features extracted by the classification branch to obtain lesion-guided features. This operation can explicitly suppress the background response of non-disease areas, making the classification branch focus more on diseased areas.
[0018] 5. This invention achieves collaborative reasoning for lesion segmentation, disease category identification, and severity estimation while maintaining low parameter count and computational overhead. Specifically, deep semantic purification processing with full-dimensional dynamic perception reduces redundancy in multi-scale feature extraction through channel splitting and soft selection mechanisms; multi-morphological edge detail aggregation processing improves edge representation efficiency through depthwise separable asymmetric convolution; and dual-stream feature-level masking guidance and collaborative classification processing achieves dynamic complementarity between global features and lesion-guided features through lightweight gating fusion. This invention is suitable for deployment in agricultural edge computing terminals such as smartphones, handheld inspection devices, and agricultural drones, meeting the application requirements of low power consumption, real-time operation, and portability. Attached Figure Description
[0019] Figure 1 Images of crop leaves obtained; Figure 2 This is a diagram showing the results of crop disease identification after processing by this invention. Detailed Implementation
[0020] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific embodiments. It should also be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the scope of the invention.
[0021] S1. Acquire crop leaf images, and process the crop leaf images into segmentation and classification branches respectively; In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the proportion of lesion area. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features.
[0022] In the segmentation branch, deep semantic features are extracted from the acquired crop leaf images. In this embodiment of the invention, during the feature encoding stage of the segmentation branch, a full-dimensional dynamic perception deep semantic purification process is introduced. The feature flow is decoupled into a dual path of receptive field enhancement and global semantics. The optimal receptive field is dynamically matched through a soft gating mechanism to solve the problems of missed detection of small lesions and fracture of continuous ulcers.
[0023] Existing semantic segmentation models, such as the traditional DeepLab series, often employ a hollow spatial pyramid pooling strategy with a fixed expansion rate during the encoding stage. This static strategy cannot dynamically adjust the receptive field according to the size changes of crop lesions at different disease stages, such as early small spots versus late large-area ulcers. This leads to missed detection of early small lesions, and the single segmentation scale is difficult to take into account the semantic continuity within large patches, which easily results in feature breaks.
[0024] To address the rigidity of static perception strategies, this step proposes a deep semantic purification process for full-dimensional dynamic perception. This process adaptively adjusts the receptive field based on lesion size, thereby improving the model's multi-scale lesion adaptability and perception accuracy. The main steps of the deep semantic purification process for full-dimensional dynamic perception are as follows: (1) Full-dimensional dynamic feature extraction: Extract the deep semantic features of the output and input them in parallel into a system containing... The convolutional branch, the global average pooling branch, and the four-channel split soft selection convolution (SPconv, dilatational density) are included. Parallel multi-features are obtained after processing in the hole enhancement branches set to 3, 6, 9, and 12 respectively.
[0025] Furthermore, unlike traditional dilated convolution, channel-split soft-select convolution internally decouples the input feature stream into a receptive field enhancement path and a global semantic path with a ratio of 0.5. After each branch extracts features, adaptive average pooling and the Softmax function are used to generate channel-level dynamic response weights for both paths, achieving weighted aggregation of features through soft-selection. This algorithm mechanism maintains high-dimensional semantic coherence while adaptively focusing on the receptive field branch most favorable to the current lesion size.
[0026] Specifically, the channel splitting soft selection convolution does not directly and dynamically change the dilation rate. Instead, within each branch with a preset dilation rate, the input features are divided into two sub-features in the channel dimension according to Ratio=0.5: one is the spatial receptive field enhancement path, which consists of 3×3 grouped convolutions and 1×1 point convolutions with a specified dilation rate, used to extract the local spatial context and edge response of the lesion region; the other is the point-by-point semantic preservation path, which consists of 1×1 convolutions, used to preserve deep semantic features and complete lightweight channel mapping.
[0027] The two outputs are each processed by global average pooling to obtain channel-level response descriptions. Then, a Softmax function is used to generate dynamic weights for both paths along the path dimension. Finally, a weighted aggregation is achieved through soft-selection fusion. Therefore, the adaptability of channel-splitting soft-selection convolution is mainly reflected in the dynamic selection of the contribution ratio between the spatial receptive field enhancement path and the pointwise semantic preservation path, rather than the dynamic generation of the hole rate itself.
[0028] (2) Dual Attention Feature Refinement: The feature maps output by the above multi-scale parallel branches (i.e., parallel multi-features) are concatenated along the channel dimension. To eliminate the dimensionality explosion and feature redundancy caused by concatenation, the concatenated high-dimensional features (i.e., multi-scale fused features) are first fed into... Convolution performs cross-channel information interaction and preliminary dimensionality reduction to obtain high-level semantic features, i.e., the first intermediate features.
[0029] Subsequently, to further filter complex background noise such as soil and normal leaf surfaces, the first intermediate feature is subjected to squeezed and excitation-based attention processing (SE-Block). Squeeze-based attention processing obtains the global spatial distribution through "squeeze" and then dynamically learns the nonlinear importance weights of each channel through "excitation." Finally, the obtained weights are multiplied by the feature map to complete the deep recalibration of the features, accurately locating the salient regions of lesions.
[0030] In the feature purification stage, the attention recalibration process of squeezed and stimulated attention processing can be expressed by the following process: in, This represents the multi-scale fusion feature after 1×1 convolution dimensionality reduction; AvgPool represents the global average pooling operation, used to obtain the global response description of each channel; Represents the ReLU activation function; Represents the gated function; and These represent the learnable weight matrices used for channel dimensionality reduction and channel dimensionality increase in the attention process of squeezed and excited attention processing, respectively. This indicates element-wise multiplication at the channel level; This represents the output characteristics after channel recalibration through compression and stimulation. The formula demonstrates that the attention recalibration process can achieve exponential suppression of ineffective background channel energy at a mathematical level with minimal parameter cost.
[0031] Deep semantic purification processing of full-dimensional dynamic perception can effectively improve the accuracy and morphological integrity of the perception of multi-scale crop lesions.
[0032] The features that have undergone compression and attention stimulation are then upsampled to obtain the second intermediate features.
[0033] In this embodiment of the invention, symmetrical square convolution and coarse channel splicing are abandoned in the feature cross-layer fusion and high-resolution decoding stages. Multi-morphological edge detail aggregation processing is adopted, utilizing orthogonally decoupled asymmetric irregular convolution kernel groups to finely fit the edges of the highly irregular "narrow" or "starburst" boundary regions of lesions. Based on this, the variance distribution of cross-layer features is quantified through energy mutation gating processing to extract abnormal pathological energy that deviates drastically from normal leaves, thereby hard-gating and silencing spatial high-frequency artifacts such as soil and tree branches.
[0034] In the decoding stage of traditional semantic segmentation networks, restoring image spatial resolution generally relies on symmetrical square receptive fields (such as conventional 3x3 convolutions). However, in real farmland environments, the edge topology of crop lesions is extremely complex, often exhibiting elongated, strip-like, or radial star-shaped structures. When processing such highly directional edges, symmetrical square convolutions often include a large number of irrelevant healthy leaves or soil background along the four diagonals of their receptive field. This isotropic feature aggregation inevitably introduces background noise, leading to over-smoothing of features, blurring the boundaries between diseased and healthy areas, and severely limiting the accuracy of pixel-level mask generation.
[0035] In this embodiment of the invention, to address the issues of edge smoothing and detail loss caused by traditional symmetric convolution, a multi-morphological edge detail aggregation process is introduced. This process completely abandons the conventional square decoding paradigm, instead employing orthogonally decoupled asymmetric irregular convolution, combined with a dilation rate concatenation and dense residual mechanism, to achieve sharpening and high-fidelity restoration of the topological details of disease edges with extremely low computational overhead. By introducing an asymmetric receptive field that precisely fits complex topology, the model's ability to sharpen and restore the details of disease edges is improved.
[0036] Specifically, the multi-morphic edge detail aggregation process is as follows: Deep semantic features are extracted to obtain shallow and mid-level features. Convolution operations are performed on these features. The mid-level features are upsampled and then added element-wise to the convolved shallow features to obtain basic features. These basic features are then processed by convolution operations and a first irregular convolution kernel to obtain the first connected features. After being connected to the residuals of the basic features, they are processed by a second irregular convolution kernel to obtain the second connected features. After being connected to the residuals of the basic features, they are then processed by normalization, activation functions, and convolution operations to obtain the aggregated features, i.e., the third intermediate features.
[0037] Furthermore, the main components of multi-morphological edge detail aggregation processing include: (1) Cross-scale semantic space feature alignment: First, deep semantic features are extracted, including shallow (rich in high-frequency edge details) and mid-level (rich in deep semantic localization information) features. After channel dimension compression and unification are completed using 1x1 convolution, mid-level features are upsampled using bilinear interpolation to ensure strict spatial resolution alignment with shallow features, and element-wise addition is performed. This operation constructs a basic fusion feature matrix that combines macroscopic semantic guidance and microscopic spatial details for subsequent edge purification.
[0038] (2) Orthogonally Decoupled Asymmetric Convolution: The aligned basic features are fed into a cascaded multi-shape kernel. Unlike the traditional 3x3 convolution, it innovatively uses parallel 1x3 horizontal convolution and 3x1 vertical convolution. This orthogonally decoupled asymmetric structure can decompose the anisotropic edge gradient of the lesion onto independent coordinate axes for processing, thereby accurately capturing the drastic pixel changes in a single direction of the strip-shaped lesion. More importantly, the asymmetric convolution introduces a depthwise separable convolution mechanism at the code level, with the number of groups equal to the number of channels, completely eliminating redundant calculations between channels and compressing the number of parameters and floating-point operation power of a single convolution operation to the extreme.
[0039] (3) Hole Rate Cascade and Dense Residual Guidance: To further adapt to lesion edges of different spans, the polymorphic edge detail aggregation process internally incorporates two irregular convolutional kernels with different dilation rates (Dilation is set to 2 and 3 respectively). Due to the hole expansion in both the horizontal and vertical directions, the superposition of the two forms a continuously expanding "cross-shaped dynamic receptive field" on the feature map. Compared to the square receptive field, the cross-shaped receptive field can precisely fit the extension direction of irregular lesions like a "skeleton," perfectly avoiding background interference in the diagonal region.
[0040] Meanwhile, at the output of each irregular convolutional layer, the original alignment features are introduced. Dense residual connections (i.e.) and This skip connection forces the network to retain the original high-frequency spatial details without damage in each deep transformation, effectively preventing gradient vanishing and edge blurring caused by the deepening of the network. Finally, through batch normalization and SiLU activation function, a sharp and coherent lesion feature aggregation map is output.
[0041] Multimorphic edge detail aggregation processing can effectively reduce the interference of irrelevant background noise and significantly improve the sharpness and fidelity of the lesion edges in the model output.
[0042] Furthermore, traditional models often employ rigid channel concatenation or addition operations when fusing deep global semantic features with shallow detailed features. In real-world field applications, while shallow features contain rich details of lesion edges, they are also accompanied by a large amount of high-frequency background noise such as soil and strong light spots. This crude concatenation method not only fails to bridge the semantic gap between heterogeneous features but also leads to high-frequency noise being directly introduced into the fusion network, resulting in serious segmentation misjudgments.
[0043] The above deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature, which is then concatenated with the second intermediate feature to obtain the fourth intermediate feature.
[0044] In this embodiment of the invention, to address the shortcomings of traditional feature fusion in terms of poor anti-interference capability, an energy mutation-gated fusion process is proposed. This process can not only smooth the semantic differences between heterogeneous features, but also dynamically activate abnormal regions of the disease by quantifying the energy distribution in the feature space in real time.
[0045] Specifically, the energy mutation gating process is as follows: The fourth intermediate feature contains deep high-dimensional features and shallow detail features. These are concatenated to obtain the initial feature. The initial feature undergoes dynamic residual convolution to obtain the aligned feature. After convolution and activation processing, a spatial binarization preliminary mask is generated. The feature obtained by concatenating the residual of the aligned feature with the aligned feature is then fused with the aligned feature to obtain the spatial gated feature. The feature obtained by concatenating the residual of the spatial gated feature with the aligned feature is then fused with the aligned feature and subjected to energy mutation purification to obtain the energy-enhanced feature. After smoothing processing, the fused output feature is obtained.
[0046] Furthermore, the core process of energy mutation gating is as follows: (1) Dynamic residual convolution operation, the process is as follows: The fourth intermediate feature, which contains deep high-dimensional features and shallow detailed features, is concatenated to obtain the initial feature. This initial feature then enters two branches. In the first branch, a convolution operation is performed to obtain the first initial feature. In the second branch, convolution operations, normalization, and activation processing are performed to obtain the branch feature. The features after dimensionality reduction and nonlinear transformation are then subjected to dimensionality increase, and the resulting features are then mapped and residually connected with the features obtained after convolution and normalization of the branch features to obtain the second initial features. After being fused with the first initial features, activation processing is performed to obtain the aligned features.
[0047] Specifically, the fourth intermediate feature includes deep, high-dimensional features. With shallow detail features The initial features are obtained by splicing along the channel dimension. To bridge the semantic gap, input features are first fed into Dynamic Residual Convolution (DRConv) units. Unlike static convolution, DRConv uses an internal adaptive weight generator to compute channel-level dynamic weights in real time. The algorithm formula is expressed as follows: in, Represents deep, high-dimensional semantic features; Indicates shallow detail features; This indicates a splicing operation along the channel dimension; This represents the initial fusion characteristics of the energy mutation-gated fusion process; express Intermediate features obtained after 3×3 convolution, batch normalization, and ReLU activation; Indicates global average pooling; Represents the ReLU activation function; This represents the Sigmoid gate function; and This represents the learnable weight parameters inside the DRConv weight generator; This represents the generated channel-level dynamic weights; Indicates to Residual mapping; This indicates multiplication by channel; This represents the semantic alignment features output by DRConv. This processing utilizes adaptive weights. By dynamically suppressing redundant channels during the splicing process, smooth alignment between shallow details and deep semantics is achieved.
[0048] (2) Spatial gating edge guidance: Aligned features After one floor Convolution and Sigmoid activation function generate a single-channel spatially binarized preliminary mask. By calculating the characteristics of the spatially gated output, i.e., the spatially gated features. By using residual amplification, low-confidence field background noise is hard filtered out, guiding the network to initially focus on potential disease areas.
[0049] (3) Energy mutation purification operation, the process is as follows: The abnormal mutation energy is extracted based on the spatial gating features. An energy attention map generated from the abnormal energy response is obtained by affine transformation parameters. The energy attention map is then multiplied element-wise with the spatial gating features to obtain the energy enhancement features.
[0050] This is the core of the energy mutation-gated fusion processing, designed for interference resistance and purification. Real fruit and leaf lesions often manifest as mutations in the normal leaf texture, such as pigment deposition or tissue necrosis. These mutations are represented in the feature tensor as "abnormal energy fluctuations." The energy mutation-gated fusion processing abandons traditional complex convolution calculations and instead quantifies feature energy through statistical methods.
[0051] Anomaly mutation energy is extracted based on spatial gating features. An energy attention map generated from the anomaly energy response is obtained through affine transformation parameters. The energy attention map is then multiplied element-wise with the spatial gating features to obtain the energy enhancement features. Specifically, for the features output by spatial gating, i.e., the spatial gating features... First, calculate its spatial mean across all channels. With variance Subsequently, a standardized formula was used to extract the energy of abnormal mutations that deviated from the healthy leaf surface (mean). : in, This represents the input features after spatial gating, i.e., spatially gated features; This represents the spatial mean of the c-th channel; This represents the spatial variance of the c-th channel; This represents a very small constant to prevent the denominator from being zero; This represents the normalized anomalous energy response; Through the above transformation, the response of the smooth background region is forced to normalize, while the high-frequency energy of the lesion mutation region is greatly highlighted. Finally, learnable affine transformation parameters are introduced. and The final energy attention map is generated and applied to the original features: in, and These represent the learnable scaling and bias parameters, respectively. This represents the Sigmoid gate function; This represents the energy attention map generated by the anomalous energy response; This indicates element-wise multiplication; This indicates the energy-enhanced features output by the energy mutation activation mechanism. Through this mechanism, regions with abnormal lesion energy responses can be highlighted, while redundant responses in smooth background regions can be suppressed, thereby improving the anti-interference ability of fusion features and the expression ability of lesion regions.
[0052] This process enables energy mutation-gated fusion processing to act like a "spotlight," precisely highlighting a set of pixels with abnormal, pathological energy.
[0053] Energy mutation-gated fusion processing, without introducing a large number of network parameters, achieves triple purification—from semantic alignment to background filtering, and then to highlighting abnormal lesions—through mathematical statistics and dynamic weight allocation algorithms. This greatly improves the model's segmentation robustness and feature extraction accuracy in the face of complex lighting and strong noise in the field.
[0054] Then, the energy enhancement features of the output are finally smoothed to obtain the fused output features.
[0055] Next, convolution and upsampling operations are performed on the fused output features to output a lesion mask.
[0056] Specifically, the input image is simultaneously fed into a segmentation branch and a classification branch, with the segmentation branch outputting pixel-level prediction results. And during the training phase from The probability map corresponding to the lesion category is extracted as a soft mask; during the inference stage, the lesion mask can be obtained through Argmax or thresholding operations. .
[0057] The obtained lesion mask is then downsampled to obtain a binarized aligned lesion mask. It is used to guide the feature extraction of classification branches; on the one hand, it calculates the proportion of lesion area based on the lesion mask to obtain the disease severity index.
[0058] In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features.
[0059] Specifically, the global features extracted from the classification branch With a lower spatial resolution, the high-resolution mask is then physically downsampled using the nearest neighbor interpolation algorithm to obtain an aligned mask. In particular, nearest neighbor interpolation is used instead of bilinear interpolation to strictly maintain the discrete logical state (0 or 1) of the mask during dimensionality reduction, preventing blemish boundaries from producing blurred transition states.
[0060] S2. Perform a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guiding features. Concatenate the lesion guiding features and global features along the channel dimension to obtain heterogeneous fusion features. Combine the heterogeneous fusion features with a channel-gated network to perform global average pooling to obtain channel-level gating vectors. After weighting the lesion guiding features channel-wise according to the channel-level gating vectors, fuse them with the global feature residuals to obtain the final fusion features.
[0061] In the cross-coordination stage of classification and segmentation decision-making, the traditional loosely coupled architecture based on two-dimensional morphological area calculation is abandoned, and dual-stream feature-level masking guidance and collaborative classification processing are carried out.
[0062] Existing crop disease classification systems have two main drawbacks: First, directly inputting panoramic images into the classification network makes them highly susceptible to contamination from non-leaf background noise such as soil and weeds, leading to classification decision bias. Second, the traditional two-stage loosely coupled architecture of "segmenting first and then calculating area" is problematic because area statistics are only static two-dimensional calculations. If there are slight flaws in the front-end segmentation, the back-end classification and grading will be severely distorted, lacking cross-task information complementarity and fault tolerance and correction capabilities.
[0063] In this embodiment of the invention, to address the shortcomings of classification decision-making being susceptible to contamination and system process fragmentation, an end-to-end feature-level mask-guided dual-stream collaborative mechanism is proposed. This mechanism implements physical low-level background truncation within the hidden layer feature space and achieves seamless collaboration of "segmentation-guided classification, global compatibility with local" through dynamic cross-segment dependency modeling. This step involves a deep reconstruction of the traditional classification end, and its core algorithm steps are as follows: Perform pixel-by-pixel Hadamard product in the feature hidden layer. , in, This represents the global features extracted from the classification branch; Indicates and A binarized aligned lesion mask with consistent spatial dimensions is further broadcast along the channel dimension and then multiplied element-wise with the global feature map. This indicates element-wise multiplication; This represents the local lesion features obtained by lesion masking, i.e., lesion-guided features.
[0064] Feature-level hard attention masking, as a "feature-level hard attention" mechanism, forces the activation values of the background and healthy leaf areas to zero at the physical level, thereby extracting absolutely pure lesion guidance features. .
[0065] Simple dependence This can lead to a loss of contextual awareness of the global morphology of fruit tree leaves (such as leaf shape and texture differences), resulting in cross-species classification confusion. To address this, this invention designs a lightweight convolutional fusion processing unit. The process is as follows: First, the global features extracted from the classification branch. Lactation guidance features obtained with mask guidance By splicing along the channel dimension, heterogeneous fusion features are constructed. : Subsequently, the FusionGate channel gating mechanism was introduced. This mechanism utilizes global average pooling. right Spatial dimensionality compression is performed, and the importance weights of each channel are learned using a channel-gated network. Finally, a channel-level gated vector is generated using a sigmoid function. : Wherein, GAP represents global average pooling operation; Represents the ReLU activation function; This represents the Sigmoid gate function; and This represents the learnable parameters used within the channel gating mechanism to generate channel gating weights; Indicates heterogeneous fusion features The learned channel-level gating vector.
[0066] Finally, using gated vectors Guiding features of lesions Perform channel-by-channel weighting and compare with global features Perform residual fusion to obtain the final fused features. : in, This indicates element-wise multiplication; This represents the global original image features extracted by the classification backbone network; This represents local lesion features obtained by lesion masking; Indicates by and Heterogeneous fusion features obtained by splicing; This represents the fusion representation of the output of dual-stream feature-level masking and collaborative classification processing, i.e., the final fusion feature.
[0067] Channel gating vector in this step It functions as an "information arbitrator," adaptively determining the injection intensity of local lesion information based on the joint response of global features and lesion-guided features; and The residual paths ensure that the network always retains the overall leaf morphology and global contextual information. Thus, the model can achieve dynamic complementary fusion of local disease features and global semantic features while suppressing interference from non-disease backgrounds.
[0068] S3. The final fused features are subjected to average pooling to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
[0069] Robust classification prediction head and high-dimensional space feature mapping: As the final decision-making link in the end-to-end collaborative architecture, the classification prediction head is responsible for parsing the fused high-dimensional space tensor into specific pathological diagnostic indicators. Its core algorithm mechanism and theoretical support are as follows: First, the final fused features of the previous stage output are... The input is fed into a global average pooling layer, where C represents the number of feature channels. and These represent the height and width of the fused feature map, respectively. At this stage, through cross-spatial dimensional mean aggregation, the local responses of lesions distributed across the two-dimensional feature map and the global leaf context are compressed into a single feature map of length [length missing]. One-dimensional global semantic vector Specifically, The response value of the c-th channel The specific process is as follows: in, This represents the response value of the c-th channel after global average pooling; Indicates the final fusion features The feature response at the c-th channel, i-th row, j-th column position. This operation can reduce the impact of lesion spatial location changes on the classification results and reduce the number of parameters in subsequent classifiers.
[0070] Secondly, considering the complex backgrounds and significant intra-class variations in real-world crop disease images, the classification prediction layer introduces a Dropout regularization mechanism with a dropout probability p. During training, Dropout randomly deactivates some neurons with probability p, prompting the model to learn on incomplete feature subsets, thereby reducing the model's over-reliance on specific background artifacts or single local texture features. in, represents the feature vector after Dropout regularization; p represents the probability of random neuron deactivation.
[0071] Finally, the regularized feature vectors The input is fed into a linear classifier, via a weight matrix. With bias term Perform a cross-dimensional linear mapping and combine The activation function outputs a probability distribution for each disease category (or severity level). The specific process is as follows: in, This represents the weight matrix of a linear classifier; represents the bias term; P represents the predicted probability distribution of each disease category.
[0072] Finally, the system selects the category with the highest probability as the final disease category identification result. The severity of the disease is calculated based on the ratio of the lesion area output by the segmented branch to the effective area of the leaf, and is not directly output by the classification prediction layer.
[0073] A mask-guided dual-stream collaborative identification system for crop diseases includes the following: The dual-stream parallel feature extraction module acquires crop leaf images, which are then processed in segmentation and classification branches respectively. In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the proportion of lesion area. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features; The spatial guidance and collaborative fusion module performs a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guidance features. The lesion guidance features and global features are concatenated along the channel dimension to obtain heterogeneous fusion features. The heterogeneous fusion features are then subjected to global average pooling using a channel-level gating network to obtain channel-level gating vectors. The lesion guidance features are then weighted channel-wise according to the channel-level gating vectors and fused with the residuals of the global features to obtain the final fusion features. The disease classification prediction output module performs average pooling on the final fused features to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
[0074] Reference Appendix Figure 1 The image shows a crop leaf obtained by this invention. Reference Appendix Figure 2 This is a crop disease identification image processed by the present invention.
[0075] In this embodiment of the invention, 2776 images related to seven different fruit and leaf diseases were collected: apple black rot, apple frog eye disease, apple gray spot, grape black rot and grape Escah disease, grape downy mildew, and strawberry leaf scorch. The images for apple black rot, apple frog eye disease, apple gray spot, grape black rot and grape Escah disease, and strawberry leaf scorch were obtained from the publicly available PlantVillage dataset. Downy mildew images were partly from the grape multi-disease dataset and partly collected from two experimental sites in Nanning, Guangxi—Mingyang and Duan—between April and August 2024. The training set consisted of 1949 images, the test set of 552 images, and the validation set of 275 images, as shown in Table 1.
[0076] Table 1. Crop Disease Dataset Division and Sample Size Statistics This invention conducts ablation experiments under the same dataset partitioning, training parameters, and evaluation metric settings. Based on the method of this invention, the deep semantic purification process of full-dimensional dynamic perception, the multi-morphological edge detail aggregation process, and the energy mutation gating process are removed sequentially to analyze the impact of each processing step on segmentation performance and inference efficiency.
[0077] This invention uses mIoU, IoU-Background, IoU-Leaf, IoU-Disease, parameter count, and inference time as evaluation metrics. mIoU measures the overall segmentation performance of the model across all categories; IoU-Background, IoU-Leaf, and IoU-Disease represent the intersection-over-union ratio (IoU) for background, leaf, and lesion categories, respectively. Since the subsequent disease severity calculation in this invention primarily relies on the number of pixels in the lesion region, IoU-Disease more directly reflects the segmentation ability of the proposed method for lesion regions. The ablation experiment results are shown in Table 2.
[0078] Table 2. Experimental results of ablation using the improved segmentation model From the perspective of method complexity, the final parameter count of the proposed method is 7.71M, and the inference time is 4.09ms. Considering the segmentation accuracy, lesion region intersection-union ratio, parameter count, and inference efficiency, the deep semantic purification processing, multi-morphological edge detail aggregation processing, and energy mutation gating processing designed in this invention can improve the performance of the proposed method from three aspects: multi-scale semantic enhancement, detail feature aggregation, and dynamic boundary fusion, respectively. Ablation experiments verify the effectiveness of each processing step in the lesion segmentation task of fruit crop leaves.
[0079] To further verify the effectiveness of the improved segmentation branching method of this invention in the task of leaf lesion segmentation in fruit crops, this invention selects several representative semantic segmentation models for comparative experiments. The comparative models include SegFormer and SegMAN-T based on the Transformer architecture, classic semantic segmentation models PSPNet, U-Net, and DeepLabV3+, and HRNet, which has strong high-resolution feature preservation capabilities. These models have different characteristics in terms of feature extraction methods, multi-scale information modeling, boundary recovery capabilities, and model complexity, and can comprehensively reflect the performance differences of different segmentation models in the task of leaf lesion segmentation.
[0080] To ensure fairness in the experimental comparison, all models were trained and tested using the same dataset partitioning, input image size, and evaluation metrics. The method of this invention uses mIoU, IoU-Background, IoU-Leaf, IoU-Disease, parameter count, and inference time as evaluation metrics. Here, IoU-Background represents the cross-union ratio (CUI) of background categories, IoU-Leaf represents the CUI of leaf categories, and IoU-Disease represents the CUI of lesion categories. Since the lesion region segmentation result directly affects the subsequent calculation of disease severity, IoU-Disease is one of the key metrics focused on in this invention. The experimental results of different segmentation models are shown in Table 3.
[0081] Table 3 Comparison of experimental results for different segmentation models Different segmentation models exhibit significant differences in overall segmentation accuracy, lesion region identification ability, parameter quantity, and inference efficiency. SegFormer-MiT-B1 and SegFormer-MiT-B2 have mIoU of 82.54% and 84.28%, respectively, and IoU-Disease rates of 59.24% and 62.73%, respectively, showing lower overall performance than the segmentation branch of this invention. Although SegFormer possesses strong global modeling capabilities, its ability to fine-grained characterize lesion regions is still insufficient in the lesion region segmentation task of fruit crop leaves in this invention.
[0082] The DeepLabV3+ series models exhibit varying performance across different backbone networks. DeepLabV3++Xception achieves an mIoU of 87.61% and an IoU-Disease ratio of 70.03%, outperforming lightweight backbone networks like MobileNetV2, MobileNetV3, and EfficientNet-B0. However, its computational cost is significant, with 54.84M parameters and an inference time of 12.31ms. DeepLabV3++EfficientNet-B0, with 6.60M parameters and an inference time of 2.85ms, demonstrates good efficiency, but its mIoU and IoU-Disease ratios of 86.65% and 67.84%, respectively, are still lower than those of the segmentation branch in this invention. These results indicate that while replacing the backbone network with a lightweight one can reduce model complexity, there is still room for improvement in its ability to segment lesion boundaries and small regions.
[0083] The HRNet series models perform well in leaf and background region segmentation by maintaining high-resolution features. Among them, HRNet-W32 has an mIoU of 87.63%, IoU-Leaf of 94.28%, and IoU-Disease of 69.98%, with overall performance close to the segmentation branch of this invention. However, HRNet-W32 has 29.54M parameters and an inference time of 8.83ms, making its model complexity and computational cost significantly higher than the segmentation branch of this invention. In the PSPNet series models, PSPNet-MobileNetV2 has only 2.38M parameters and an inference time of 1.65ms, demonstrating significant lightweight advantages. However, its IoU-Disease rate of 64.24% is lower than the segmentation branch of this invention, indicating that its ability to segment lesion areas with fine granularity is relatively insufficient.
[0084] U-Net+ResNet50 achieved high segmentation accuracy in this experiment, with an mIoU of 87.89% and an IoU-Disease rate of 70.39%, but the number of parameters reached 43.93M and the inference time was 5.35ms. SegMAN-T had 6.33M parameters, but the inference time was 8.19ms, and the mIoU and IoU-Disease rates were 87.47% and 69.22%, respectively. Overall, its performance was still lower than that of the segmentation branch of this invention.
[0085] The segmentation branch of this invention achieved the highest mIoU and IoU-Disease, reaching 88.04% and 70.97%, respectively. The IoU-Disease was higher than that of DeepLabV3++Xception, HRNet-W32, U-Net+ResNet50, and SegMAN-T, indicating that the segmentation branch of this invention has a stronger segmentation ability for lesion areas. Although the IoU-Background and IoU-Leaf of this invention's method are not the highest among all models, they remain at a high level, reaching 98.78% and 94.38%, respectively, which can meet the segmentation requirements of effective leaf areas and lesion areas. The number of parameters in the segmentation branch is 7.71M, and the inference time is 4.09ms, significantly lower than high-parameter models such as Xception, HRNet-W32, and U-Net+ResNet50.
[0086] In summary, the method of this invention achieves optimal overall segmentation performance and lesion region segmentation performance while maintaining low model complexity. These results demonstrate that deep semantic purification processing based on full-dimensional dynamic perception, multi-morphological edge detail aggregation processing, and energy mutation gating processing can effectively enhance the expressive ability of multi-scale lesions, fuzzy boundaries, and irregular regions, enabling the model to achieve a good balance between accuracy and efficiency in the lesion segmentation task of fruit crop leaves.
Claims
1. A mask-guided dual-stream collaborative identification method for crop diseases, characterized in that, Includes the following steps: S1. Acquire crop leaf images, and process the crop leaf images into segmentation and classification branches respectively; In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the proportion of lesion area. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features; S2. Perform a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guiding features. Concatenate the lesion guiding features and global features along the channel dimension to obtain heterogeneous fusion features. Combine the channel-gated network to perform global average pooling on the heterogeneous fusion features to obtain channel-level gating vectors. After weighting the lesion guiding features channel-wise according to the channel-level gating vectors, fuse them with the global feature residuals to obtain the final fusion features. S3. The final fused features are averaged to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
2. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 1, characterized in that, The multi-morphological edge detail aggregation process described in S1 is as follows: Deep semantic features are extracted to obtain shallow and mid-level features. Convolution operations are performed on these features. The mid-level features are upsampled and then added element-wise to the convolved shallow features to obtain basic features. These basic features are then processed by convolution operations and a first irregular convolution kernel to obtain first connected features. After being connected to the residuals of the basic features, they are processed by a second irregular convolution kernel to obtain second connected features. After being connected to the residuals of the basic features, they are then processed by normalization and activation, and finally by convolution operations to obtain aggregated features.
3. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 1, characterized in that, The energy mutation gating process described in S1 is as follows: The fourth intermediate feature contains deep high-dimensional features and shallow detail features. These are concatenated to obtain the initial feature. The initial feature undergoes dynamic residual convolution to obtain the aligned feature. After convolution and activation processing, a spatial binarization preliminary mask is generated. The feature obtained by concatenating the residual of the aligned feature with the aligned feature is then fused with the aligned feature to obtain the spatial gated feature. The feature obtained by concatenating the residual of the spatial gated feature with the aligned feature is then fused with the aligned feature and subjected to energy mutation purification to obtain the energy-enhanced feature. After smoothing processing, the fused output feature is obtained.
4. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 3, characterized in that, The dynamic residual convolution operation in the energy mutation gating process described in S1 is as follows: The fourth intermediate feature contains deep high-dimensional features and shallow detailed features, which are concatenated to obtain the initial feature. The initial feature enters two branches. In the first branch, a convolution operation is performed to obtain the first initial feature. In the second branch, a convolution operation, normalization, and activation processing are performed to obtain the branch. The feature after dimensionality reduction and nonlinear transformation is then subjected to dimensionality increase operation. The feature obtained after mapping is then residually connected with the feature obtained after convolution operation and normalization processing of the branch feature to obtain the second initial feature. After being fused with the first initial feature, activation processing is performed to obtain the aligned feature.
5. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 3, characterized in that, The energy mutation purification operation in the energy mutation gating process described in S1 is as follows: The abnormal mutation energy is extracted based on the spatial gating features. An energy attention map generated from the abnormal energy response is obtained by affine transformation parameters. The energy attention map is then multiplied element-wise with the spatial gating features to obtain the energy enhancement features.
6. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 1, characterized in that, The attention recalibration process in the squeeze and excitation attention processing described in S1 is as follows: in, This represents the multi-scale fused features after 1×1 convolution dimensionality reduction; AvgPool represents the global average pooling operation. Represents the ReLU activation function; Represents the gated function; and These represent the learnable weight matrices used for channel dimensionality reduction and channel dimensionality increase, respectively. This indicates element-wise multiplication at the channel level; This indicates the output characteristics after recalibration.
7. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 1, characterized in that, The channel-level gating vector process described in S2 is as follows: in, Represents the channel-level gate vector; GAP represents the global average pooling operation; Represents the ReLU activation function; This represents the Sigmoid gate function; and This represents the learnable parameters used internally by the channel gating mechanism to generate channel gating weights; Indicates heterogeneous fusion features The learned channel-level gating vector.
8. The method for dual-stream collaborative identification of crop diseases based on mask guidance according to claim 1, characterized in that, The lesion-guided features described in S2 are as follows: Global features are extracted from the classification branch, and the high-resolution mask is physically downsampled using the nearest neighbor interpolation algorithm to obtain the aligned mask. The binarized aligned lesion mask and the global features are then subjected to a pixel-by-pixel Hadamard product to obtain the lesion guiding features.
9. A mask-guided dual-stream collaborative identification system for crop diseases, applied to the mask-guided dual-stream collaborative identification method for crop diseases as described in claim 1, characterized in that, Includes the following: The dual-stream parallel feature extraction module acquires crop leaf images, which are then processed in segmentation and classification branches respectively. In the segmentation branch, deep semantic features are extracted from crop leaf images and input into the dilated enhancement branch for channel splitting soft selection convolution to obtain parallel multi-features. After concatenation, multi-scale fusion features are obtained and convolutional dimensionality reduction is performed to obtain the first intermediate feature. After squeezing and excitation attention processing and upsampling processing, the second intermediate feature is obtained. The deep semantic features are processed by multi-morphological edge detail aggregation to obtain the third intermediate feature. This is concatenated with the second intermediate feature to obtain the fourth intermediate feature. The fused output feature is obtained through energy mutation gating processing, and convolutional operation and upsampling processing are performed to output the lesion mask. The lesion mask is obtained by downsampling to obtain a binarized aligned lesion mask, and the severity index of the disease is obtained by calculating the lesion area ratio. In the classification branch, crop leaf images are acquired, and feature extraction is performed on the crop leaf images to obtain global features; The spatial guidance and collaborative fusion module performs a pixel-wise Hadamard product on the binarized aligned lesion mask and global features to obtain lesion guidance features. The lesion guidance features and global features are concatenated along the channel dimension to obtain heterogeneous fusion features. The heterogeneous fusion features are then subjected to global average pooling using a channel-level gating network to obtain channel-level gating vectors. The lesion guidance features are then weighted channel-wise according to the channel-level gating vectors and fused with the residuals of the global features to obtain the final fusion features. The disease classification prediction output module performs average pooling on the final fused features to obtain a global semantic vector. After regularization and discard rate judgment, the feature vector is mapped to obtain the disease category probability distribution and output the disease identification result.
10. The mask-guided dual-stream collaborative identification system for crop diseases according to claim 9, characterized in that, The dual-stream parallel feature extraction module includes a multi-morphological edge detail aggregation processing module. Deep semantic features are extracted to obtain shallow and mid-level features. Convolution operations are performed on these features. The mid-level features are upsampled and then added element-wise to the convolved shallow features to obtain basic features. These basic features are then processed by convolution operations and a first irregular convolution kernel to obtain first connected features. After being connected to the residuals of the basic features, they are processed by a second irregular convolution kernel to obtain second connected features. After being connected to the residuals of the basic features, they are then processed by normalization and activation, and finally by convolution operations to obtain aggregated features.