A rice disease image segmentation method based on frequency domain modulation and topological constraint

By employing frequency domain modulation and topological constraints, the segmentation instability problem of rice disease images under different environmental conditions was solved, achieving accurate identification and structure preservation of diseased areas. This method is suitable for agricultural applications such as field inspection and drone-based plant protection.

CN121599997BActive Publication Date: 2026-06-23ANHUI AGRICULTURAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI AGRICULTURAL UNIVERSITY
Filing Date
2025-12-08
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing rice disease image segmentation methods are unstable when faced with differences in natural lighting, shadows, humidity, shooting angle, and background environment. They are prone to blurred lesion boundaries, increased recognition difficulty, and lack explicit constraints on the topological structure of lesions, leading to structural errors in the segmentation results.

Method used

A method based on frequency domain modulation and topology constraints is adopted. The sensitivity of lesion structure features is enhanced by the frequency domain adaptive modulation module, and the morphological consistency of the segmentation results is maintained by the topology constraints. An image segmentation network is constructed, and the network parameters are optimized by combining the frequency domain adaptive modulation and topology constraint normalization modules to improve the segmentation accuracy.

Benefits of technology

It significantly improves the robustness of the model under varying illumination and background complexity, ensuring the structural stability and topological consistency of the disease image segmentation results, and is suitable for automated identification and segmentation of rice leaf diseases under different shooting conditions and regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599997B_ABST
    Figure CN121599997B_ABST
Patent Text Reader

Abstract

The application discloses a rice disease image segmentation method based on frequency domain modulation and topological constraint, which comprises the following steps: 1, frequency domain decomposition is carried out on rice disease image data to obtain amplitude spectrum and phase spectrum features; 2, a frequency domain adaptive modulation module is constructed to selectively enhance the frequency components of the structural key information; 3, the topological invariants of the image are extracted through a topological constraint module, and the reference topological structure is obtained by down-sampling the label to construct a topological consistency loss; 4, the topological consistency loss and the rice disease image segmentation loss are jointly optimized, the model training under multi-level structure constraint is realized, and a rice disease image segmentation model is constructed. The sensitivity of the model to the structure features of the rice disease lesion is enhanced through frequency domain modulation, and the morphological consistency of the segmentation result is maintained through topological constraint, so that the robustness of the model under natural conditions such as light change and background complexity difference is effectively improved, and the performance of the disease image segmentation in an open farmland scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and agricultural disease identification, specifically to a method for rice disease image segmentation based on frequency domain modulation and topological constraints. Background Technology

[0002] Rice is one of the world's most important food crops, and its yield and security directly affect regional food supply capacity and agricultural economic development. During its growth cycle, rice is susceptible to various diseases, such as rice blast, sheath blight, rice false smut, and leaf spot. These diseases are characterized by rapid spread, high destructive power, and difficulty in continuous manual monitoring. Failure to identify and treat them in a timely manner can lead to significant yield reductions or even large-scale crop failures. With the development of smart agriculture, image-based rice disease identification and segmentation technology has become an important module in farmland pest and disease monitoring systems. It can automatically locate diseased areas, providing crucial data support for precision spraying, drone inspections, and early disease warnings.

[0003] However, the actual farmland environment is significantly complex. The light intensity, reflectivity, and shaded areas of rice leaves constantly change under different time periods and weather conditions; wind causes leaf deformation and shaking; leaf surface humidity, dew, and dust all affect image quality; and differences in the shooting angle of drones or mobile phones can also cause variations in the appearance of lesions. Furthermore, the background environment (such as soil, weeds, and water reflections) in different farmland areas is complex and diverse, and the color of lesions and background textures have certain similarities, making lesion boundaries blurred and increasing the difficulty of identification. These factors result in significant differences in image style for the same disease in different scenarios, making traditional segmentation methods prone to problems such as unstable recognition, fragmented segmentation, or misidentification.

[0004] Existing rice disease image segmentation methods mostly rely on deep learning models such as convolutional neural networks, self-attention structures, and encoder-decoder architectures. Although these methods have achieved good performance in specific scenarios, they still have the following important shortcomings: (1) Sensitive to changes in image style: Traditional convolutional networks focus more on spatial domain features and are not robust to light fluctuations, background noise, and low-frequency illumination interference; (2) Overly dependent on lesion texture: Lesions change significantly with the environment in high-frequency textures, making the model prone to overfitting to a certain shooting condition; (3) Lack of structural constraints: Lesions often present as irregular sheet-like structures with connectivity and hole topological features. Existing methods often only focus on pixel-level accuracy and ignore the topological consistency of lesion structures, resulting in broken results, disappearance of holes, or generation of pseudo-regions.

[0005] To address the aforementioned issues, scholars have proposed methods such as data augmentation, attention mechanisms, image restoration, feature pyramids, and super-resolution refinement. However, these methods primarily focus on the spatial domain or network structure design, failing to adequately utilize frequency domain information. In agricultural scenarios, changes in illumination and background disturbances often correspond to the low- and mid-frequency components of images. Therefore, modulation from a frequency domain perspective can effectively suppress unstable environmental factors. Furthermore, rice lesions possess relatively stable topological structures, such as the number of connected regions, the number of pores, and local shape relationships. Without explicit topological constraints, deep models are prone to fragmentation or collapsed regions, affecting the true structural characteristics of the lesions.

[0006] In summary, existing methods for rice disease image segmentation mainly face the following challenges:

[0007] I. Differences in natural lighting, shadows, humidity, shooting angle, and background environment lead to significant changes in image style, and the model is prone to segmentation instability under different acquisition conditions;

[0008] Second, high-frequency texture features fluctuate significantly with the environment, and the model is prone to overfitting to a certain shooting condition, lacking an effective mechanism to suppress noise and unstable components from the frequency domain perspective.

[0009] Third, the lack of explicit constraints on the topological structure of lesions leads to structural errors in the segmentation results, such as breaks, loss of holes, and generation of pseudo-regions, which affect the reliable expression of lesion morphology. Summary of the Invention

[0010] This invention addresses the shortcomings of existing technologies by proposing a rice disease image segmentation method based on frequency domain modulation and topological constraints. The method aims to enhance the model's sensitivity to the structural features of rice disease lesions through frequency domain modulation and maintain the morphological consistency of the segmentation results through topological constraints. This effectively improves the robustness of the segmentation model under natural conditions such as changes in illumination and background complexity, and enhances the segmentation accuracy of rice disease images in open farmland scenarios.

[0011] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0012] The present invention provides a method for segmenting rice disease images based on frequency domain modulation and topological constraints, characterized by the following steps:

[0013] Step 1: Obtain a dataset of images of rice leaf spot disease. ,in, express The first in An image of rice leaf spot disease. and Let represent the height and width of the rice leaf spot disease image, respectively, and I represent the total number of rice leaf spot disease images; let Pixel-level labeling of the lesion area is as follows ,and , express The annotation set;

[0014] right Conduct the first Downsampling at scale yields a resolution of Tag Image ,Will Middle pixel position The label value at the location is denoted as ,when When =1, it means Middle pixel position The area is the foreground region, when =0 indicates Middle pixel position This area is the background area;

[0015] Calculate the first scale The true overall topological morphology of the lesion area Number of connected components in actual lesions Thus, the first The number of internal cavities in actual lesions at the scale ;

[0016] Step 2: Construct an image segmentation network, which consists of an encoder. decoder It consists of an output prediction layer and an output prediction layer, and is used for... The process is performed to obtain the predicted segmentation mask. ;

[0017] Step 2.1: The encoder include: There are n downsampling convolutional layers, each of which includes: a convolution module, a feature normalization module, a non-linear activation module, and a downsampling module; wherein, the nth... The downsampling convolutional layer and the first Each downsampling convolutional layer is equipped with a frequency domain adaptive modulation module and a topology constraint normalization module.

[0018] when At that time, the first Each downsampling convolutional layer Processing yields the first... Multi-channel feature maps at different scales ;in, , , The first The height, width, and number of channels of a multi-channel feature map at different scales;

[0019] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0020] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampling convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The process is carried out in the topological constraint normalization module of the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0021] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0022] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampling convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The process is carried out in the topological constraint normalization module of the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0023] Among them, for the first topology constraint normalization module introduced and the The downsampling convolutional layer, based on the _ ... Multi-channel feature maps at different scales and its downsampling label map Construct the first Topology consistency loss of topology constraint normalization module at scale ;

[0024] when At that time, the first Multi-channel feature maps at different scales Enter the first In the downsampling convolutional layer, and obtain the first... Multi-channel feature maps at different scales Thus, by the first The output of the downsampled convolutional layer is the first... Multi-channel feature maps at different scales ;

[0025] Step 2.2: The decoder include: Each upsampling convolutional layer consists of an upsampling convolutional layer and an output prediction layer. Each upsampling convolutional layer includes an upsampling module, a feature fusion module, a convolution module, a feature normalization module, and a non-linear activation module.

[0026] when At that time, Enter the first The process is performed in the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0027] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the upsampling module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales , No. The feature fusion module in each upsampling convolutional layer will and After merging, input the following in sequence: The feature is processed in the convolutional module, feature normalization module, and nonlinear activation module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales Thus, the first upsampling convolutional layer yields the multi-channel feature map at the first scale. ;

[0028] Step 2.3: Output prediction layer pairs After processing, we obtain Predictive segmentation mask ;

[0029] Step 3: Based on and Constructing segmentation loss And the topology consistency loss shown in equation (1) The total loss function is composed as shown in equation (2). :

[0030] (1)

[0031] (2)

[0032] In equation (2), This represents the weights used to balance the two types of losses; Indicates the first Topological consistency loss in each downsampled convolutional layer;

[0033] Step 4: Train the image segmentation network using gradient descent and calculate the total loss function. To optimize network parameters until the total loss function is reached. The process continues until convergence, thus obtaining the optimal image segmentation model, which is used to generate the optimal segmentation result for the input image.

[0034] The rice disease image segmentation method based on frequency domain modulation and topological constraints described in this invention is also characterized in that, in step 2.1... The frequency-domain adaptive modulation module of each downsampled convolutional layer is configured according to the following steps: Processing is performed to obtain ;

[0035] Step a, for Perform a two-dimensional fast Fourier transform to obtain In the Amplitude spectrum at different scales and phase spectrum ;

[0036] Step b, will and The frequency domain range is uniformly divided into Amplitude subspectra { }and Phase subspectrum { } and the first Amplitude Subspectrum Its corresponding number Phase subspectrum Combining, forming the first frequency band Thus obtain Non-overlapping frequency bands },in, The number of frequency bands;

[0037] Step c: For the b-th frequency band, calculate its corresponding amplitude sub-spectrum. By applying a specific perturbation, the perturbed amplitude sub-spectrum corresponding to the b-th frequency band is obtained. ,Will Replace The The frequency band position is constructed only in the first frequency band position. The complete amplitude spectrum of each frequency band changes ;in, This indicates a frequency band replacement operation;

[0038] Step d, will and After combining, a two-dimensional inverse fast Fourier transform is performed to obtain In the Scale for the first Feature map after applying perturbation to each frequency band Thus, B perturbation-induced feature maps are obtained. ;

[0039] Step e, for Perform a two-dimensional fast Fourier transform to obtain the result on the th... Phase spectrum under individual frequency band perturbation conditions and will Follow the steps The partitioning method divides the spectrum into B perturbed phase sub-spectrums. },in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying perturbation, in the k-th frequency band The perturbated phase sub-spectrum obtained within;

[0040] Step f, in the frequency band Inside, calculation In the The first scale Phase shift of each frequency band ,in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying a disturbance, in the same... frequency band The perturbated phase sub-spectrum obtained within the first part is used to obtain all rice leaf spot disease images in the first part using equation (3). The first scale Phase-amplitude coupling :

[0041] (3)

[0042] In equation (3), It is the numerical stability constant;

[0043] Step g: Use equation (4) to obtain all samples in the first step. Scale for the first The structural frequency band persistence corresponding to the frequency band disturbance :

[0044] (4)

[0045] In equation (4), The Kullback-Leibler divergence; Indicates before the disturbance The probability distribution, Indicates after disturbance The probability distribution;

[0046] Step h, using equation (5) to construct the first The first scale Structural correlation index of each frequency band :

[0047] (5)

[0048] In equation (5), This is the balance coefficient;

[0049] Step i: Use equation (6) to obtain the first... The first scale Individual frequency band weights Thus, the first Band weight vector at scale ,in, Indicates transpose;

[0050] (6)

[0051] In equation (6), Indicates the first The first scale Structural correlation index of each frequency band;

[0052] Step j: Use equation (7) to obtain the modulated first... Amplitude Subspectrum :

[0053] (7)

[0054] In equation (7), express In the The first scale Amplitude subspectral;

[0055] Step k, will In the Scale The modulated amplitude subspectrum { } combined to obtain In the Amplitude spectrum modulated at different scales ;

[0056] Step 1, for and Combination In the Full frequency domain representation after modulation at the scale and to Performing a two-dimensional inverse fast Fourier transform yields the first... The first scale One reconstructed feature map .

[0057] Furthermore, in step 2.1... The topology constraint normalization module for each downsampled convolutional layer is performed according to the following steps: Processing yields the first... Multi-channel feature maps at different scales ;

[0058] Step I: For Perform channel-level standardization to obtain the first Standardized at scale Multi-channel feature map ;

[0059] Step II: Obtain using equation (8) In the Multi-channel feature map after scale normalization :

[0060] (8)

[0061] In equation (8), , Indicates the first Two parameters to be learned at different scales;

[0062] Step III: Obtain using equation (9) In the Foreground probability map at different scales :

[0063] (9)

[0064] In equation (9), This indicates a convolution operation with a 1×1 kernel. express Activation function;

[0065] Step IV: Use equation (10) to... Perform soft binarization to obtain In the Binary approximate foreground probability map at different scales :

[0066] (10)

[0067] In equation (10), For Gaussian blur operation, For binarization threshold, For temperature parameters;

[0068] Step V: [The sentence is incomplete and requires more context to translate accurately.] Binary approximate foreground probability map at different scales As a predictive segmentation mask for lesion regions, the predicted overall topology of the lesion regions is calculated. And predict the number of lesion connectivity components Thus obtain In the Predicting the number of internal cavities in lesions at a certain scale ;

[0069] Step VI: Construct the first equation using equation (11) Topological consistency loss in each downsampling convolutional layer :

[0070] (11)

[0071] In equation (11), These are the weighting coefficients for three topological invariants.

[0072] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor in performing the method described therein, and the processor is configured to execute the program stored in the memory.

[0073] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program is executed by a processor to perform the steps of the method described thereon.

[0074] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0075] 1. This invention proposes a frequency-domain adaptive modulation module driven by phase-amplitude coupling. It quantifies the phase-amplitude coupling by calculating the phase shift before and after the perturbation, and continuously evaluates the structural importance of each frequency band in combination with structural frequency bands, thereby identifying key frequency bands that contribute significantly to the lesion structural features. This mechanism avoids the problem of lesion structural features being damaged due to the traditional frequency domain processing method using a uniform processing strategy for different frequency components. While suppressing environment-related style features, it retains key lesion structural features, significantly enhancing the structural stability and segmentation robustness of the model under scenarios such as changes in illumination and differences in background complexity.

[0076] 2. This invention innovatively introduces a topological constraint normalization module, which calculates differentiable topological invariants and constructs topological consistency loss to achieve multi-level constraints from the pixel level to the structure level. This module works in conjunction with the frequency domain modulation module, with the former enhancing the structural expression and the latter supervising the structure preservation, effectively avoiding topological structural deviations such as lesion edge breakage, hole artifacts, and connectivity errors, and ensuring that the segmentation results maintain the topological shape characteristics of real leaf lesions.

[0077] 3. The method of this invention has a lightweight structure and high computational efficiency. It does not require the introduction of an additional network and can be trained using only a single training set of data, thus avoiding the high cost and difficulty in obtaining data from multiple environments. It achieves joint optimization of style decorrelation and structural constraints without increasing network complexity, and is applicable to data differences caused by different lighting, different shooting equipment, and different leaf varieties, thus achieving stable and reliable disease segmentation.

[0078] 4. This invention is geared towards practical agricultural applications and can be widely used in the automated identification and segmentation of rice leaf disease images. For example, in scenarios such as field inspection, drone plant protection, and intelligent agricultural machinery monitoring, it can robustly segment leaf images collected under different shooting conditions and in different regional planting environments, providing reliable technical support for early disease detection, precise pesticide application, and agricultural yield protection. Attached Figure Description

[0079] Figure 1This is a flowchart of the method of the present invention. Detailed Implementation

[0080] In this embodiment, a rice disease image segmentation method based on frequency domain modulation and topological constraints is a segmentation method that simultaneously utilizes frequency domain information and topological priors to enhance the robustness of the model in the face of changes in the natural environment, more accurately characterize the structural features of rice disease areas, and improve the reliability and practicality of the automatic disease monitoring system. Specifically, as... Figure 1 As shown, the method includes the following steps:

[0081] Step 1: Obtain a dataset of images of rice leaf spot disease. ,in, express The first in An image of rice leaf spot disease. and Let represent the height and width of the rice leaf spot disease image, respectively, and I represent the total number of rice leaf spot disease images; let Pixel-level labeling of the lesion area is as follows ,and , express The annotation set;

[0082] right Conduct the first Downsampling at scale yields a resolution of Tag Image ,Will Middle pixel position The label value at the location is denoted as ,when When =1, it means Middle pixel position The area is the foreground region, when =0 indicates Middle pixel position The area is the background region; calculate the first... scale The true overall topological morphology of the lesion area Number of connected components in actual lesions Thus, the first The number of internal cavities in actual lesions at the scale ;

[0083] In actual farmland sampling scenarios, rice leaf spot images are often affected by factors such as changes in light intensity, cluttered backgrounds, and different shooting angles, resulting in significant differences in pixel-level representation of the same disease. For example, under strong light conditions, the edges of lesions may appear overexposed or shadowed, while under weak light conditions, the overall contrast of lesions decreases. Traditional segmentation methods that rely solely on texture and color features are prone to "lesion breakage," "boundaries adhering to the background," or missegmentation of non-lesion areas.

[0084] Furthermore, rice leaf spots often possess certain topological priors in their morphology: for example, lesions are mostly finitely connected regions, with a typically small number of internal pores that are clearly distributed. If only cross-entropy or Using loss to train a segmentation network makes it difficult to explicitly constrain these topological features, and the network may produce local noise or anomalous holes in details. Based on the above analysis, this invention proposes, on the basis of constructing training and label sets, to further improve the label maps at various scales. Explicit calculation of Euler features Number of connected components and the number of cavities These topological invariants are used as a reference for subsequent topological consistency loss, providing morphological and structural supervision for the model.

[0085] Step 2: Construct an image segmentation network, which consists of an encoder. decoder It consists of an output prediction layer and an output prediction layer, and is used for... The process is performed to obtain the predicted segmentation mask. ;

[0086] Step 2.1: Encoder include: There are n downsampling convolutional layers, each of which includes: a convolution module, a feature normalization module, a non-linear activation module, and a downsampling module; wherein, the nth... The downsampling convolutional layer and the first Each downsampling convolutional layer is equipped with a frequency domain adaptive modulation module and a topology constraint normalization module.

[0087] like Figure 1 As shown, this embodiment uses an encoder E with 5 downsampled convolutional blocks as an example to process rice disease image datasets. Multi-scale features are extracted sequentially from convolutional blocks 1 through 5. The figure only shows the encoder and its subsequent cascaded frequency domain modulation and topological constraint normalization modules; the decoder is omitted. Considering that shallow features emphasize texture and deep features emphasize semantics but have lower resolution, this invention improves the encoder... Two convolutional layers located at an intermediate scale are selected from the n downsampling convolutional layers as modulation layers, denoted as the nth convolutional layers. The and the first 1 downsampled convolutional layer, where 1 < < < .by Figure 1 Taking the five convolutional blocks shown as an example, the second and third convolutional blocks can be preferably used as modulation layers, that is, let =2、 =3, in other network structures and It can also be adjusted within the intermediate scale range based on the input resolution and computing resources.

[0088] when At that time, the first Each downsampling convolutional layer Processing yields the first... Multi-channel feature maps at different scales ;in, , , The first The height, width, and number of channels of a multi-channel feature map at different scales;

[0089] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0090] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampling convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The process is carried out in the topological constraint normalization module of the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0091] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0092] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampling convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The process is carried out in the topological constraint normalization module of the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0093] Among them, for the first topology constraint normalization module introduced and the The downsampling convolutional layer, based on the _ ... Multi-channel feature maps at different scales and its downsampling label map Construct the first Topology consistency loss of topology constraint normalization module at scale ;

[0094] when At that time, the first Multi-channel feature maps at different scales Enter the first In the downsampling convolutional layer, and obtain the first... Multi-channel feature maps at different scales Thus, by the first The output of the downsampled convolutional layer is the first... Multi-channel feature maps at different scales ;

[0095] In specific implementation, step 2.1... The frequency-domain adaptive modulation module of each downsampled convolutional layer is configured according to the following steps: Processing is performed to obtain ;

[0096] Step a, for Perform a two-dimensional fast Fourier transform to obtain In the Amplitude spectrum at different scales and phase spectrum ;

[0097] in, It reflects the intensity of local textures and the overall style distribution, while This describes the boundary, shape, and structural information;

[0098] Step b, will and The frequency domain range is uniformly divided into Amplitude subspectra { }and Phase subspectrum { } and the first Amplitude Subspectrum Its corresponding number Phase subspectrum Combining, forming the first frequency band Thus obtain Non-overlapping frequency bands },in, The number of frequency bands;

[0099] In this embodiment, B is preferably 8 or 16 to control computational overhead while capturing sufficiently fine frequency partitions; for higher resolution inputs, the value of B can also be appropriately increased. Those skilled in the art can flexibly choose the size of B according to hardware conditions and task requirements;

[0100] Step c: For the b-th frequency band, calculate its corresponding amplitude sub-spectrum. By applying a specific perturbation, the perturbed amplitude sub-spectrum corresponding to the b-th frequency band is obtained. ,Will Replace with the original amplitude spectrum The The frequency band position is constructed only in the first frequency band position. The complete amplitude spectrum of each frequency band changes ;in, This indicates a frequency band replacement operation.

[0101] Step d, will and After combining, a two-dimensional inverse fast Fourier transform is performed to obtain In the Scale for the first Feature map after applying perturbation to each frequency band Thus, B perturbation-induced feature maps are obtained. ;

[0102] Step e, for Perform a two-dimensional fast Fourier transform to obtain the result on the th... Phase spectrum under individual frequency band perturbation conditions and will Follow the steps The partitioning method divides the spectrum into B perturbed phase sub-spectrums. },in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying perturbation, in the k-th frequency band The perturbated phase sub-spectrum obtained within;

[0103] Step f, in the frequency band Inside, calculation In the The first scale Phase shift of each frequency band ,in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying a disturbance, in the same... frequency band The perturbated phase sub-spectrum obtained within the first part is used to obtain all rice leaf spot disease images in the first part using equation (3). The first scale Phase-amplitude coupling :

[0104] (3)

[0105] In equation (3), It is the numerical stability constant;

[0106] This step quantifies the sensitivity of phase to amplitude changes through amplitude perturbation operations, characterizing the degree of coupling between structural and style information in different frequency bands. When a small perturbation to the amplitude of a frequency band can lead to a significant change in phase structure, it indicates that the frequency band is highly coupled with structural information. The higher the PAC value, the greater the impact of amplitude changes on phase structure in that frequency band, and the more important its contribution to lesion structure features.

[0107] Step g: Use equation (4) to obtain all samples in the first step. Scale for the first The structural frequency band persistence corresponding to the frequency band disturbance :

[0108] (4)

[0109] In equation (4), The Kullback-Leibler divergence; Indicates before the disturbance The probability distribution, Indicates after disturbance The probability distribution;

[0110] Step h, using equation (5) to construct the first The first scale Structural correlation index of each frequency band :

[0111] (5)

[0112] In equation (5), This is the balance coefficient;

[0113] Step i: Use equation (6) to obtain the first... The first scale Individual frequency band weights Thus, the first Band weight vector at scale ,in, Indicates transpose;

[0114] (6)

[0115] In equation (6), Indicates the first The first scale Structural correlation index of each frequency band;

[0116] Step j: Use equation (7) to obtain the modulated first... Amplitude Subspectrum :

[0117] (7)

[0118] In equation (7), express In the The first scale Amplitude subspectral;

[0119] Step k, will In the Scale The modulated amplitude subspectrum { } combined to obtain In the Amplitude spectrum modulated at different scales ;

[0120] Step 1, for and Combination In the Full frequency domain representation after modulation at the scale and to Performing a two-dimensional inverse fast Fourier transform yields the first... The first scale One reconstructed feature map .

[0121] After the above modulation, style adaptation at the frequency domain level can be achieved without changing the phase structure, enabling the model to continuously enhance its stable representation ability of lesion structures during training. However, relying solely on frequency domain modulation is insufficient to fully guarantee the rationality of the segmentation results at the morphological level. Rice disease image segmentation not only requires pixel-level accurate identification of lesion regions but also needs to maintain morphological consistency such as lesion shape, boundary continuity, and overall structural features of the affected area. To this end, this invention further introduces a topological constraint normalization module to supervise feature learning from an overall structural perspective, ensuring that the model can maintain topological stability and morphological consistency when representing lesion regions, thereby obtaining more reliable disease segmentation results.

[0122] In this embodiment, step 2.1... The topology constraint normalization module for each downsampled convolutional layer is performed according to the following steps: Processing yields the first... Multi-channel feature maps at different scales ;

[0123] Step I: For Perform channel-level standardization to obtain the first Standardized at scale Multi-channel feature map ;

[0124] Step II: Obtain using equation (8) In the Multi-channel feature map after scale normalization :

[0125] (8)

[0126] In equation (8), , Indicates the first Two parameters to be learned at different scales;

[0127] This step enables the model to adaptively adjust the feature distribution through learnable normalization parameters, providing stable input for subsequent topology calculations.

[0128] Step III: Obtain using equation (9) In the Foreground probability map at different scales :

[0129] (9)

[0130] In equation (9), This indicates a convolution operation with a 1×1 kernel. express Activation function;

[0131] Step IV: Use equation (10) to... Perform soft binarization to obtain In the Binary approximate foreground probability map at different scales :

[0132] (10)

[0133] In equation (10), For Gaussian blur operation, For binarization threshold, For temperature parameters;

[0134] Traditional hard binarization is non-differentiable and cannot perform gradient backpropagation. By introducing Gaussian blur and a temperature-parameter-controlled sigmoid function, this soft binarization method provides smooth gradients while maintaining approximate binarization results, allowing the computation of topological invariants to be embedded end-to-end into the training process.

[0135] Step V: [The sentence is incomplete and requires more context to translate accurately.] Binary approximate foreground probability map at different scales As a predictive segmentation mask for lesion regions, the predicted overall topology of the lesion regions is calculated. And predict the number of lesion connectivity components Thus obtain In the Predicting the number of internal cavities in lesions at a certain scale ;

[0136] In the specific calculations, this embodiment employs a soft topology calculation method based on Euler's formula, ensuring that the topological features remain continuously differentiable during network training. Euler characteristic number and The numbers satisfy the following relation: To avoid the non-differentiability problem caused by binarization, this embodiment uses a foreground probability map... The above uses soft Euler calculation, that is, it uses local neighborhood relations to calculate... Perform continuous estimation;

[0137]

[0138] In this formula, the first term corresponds to the foreground pixel, the second term corresponds to the horizontal / vertical adjacency, and the third term corresponds to the diagonal adjacency. Using the soft Euler formula described above, continuous Euler eigenvalues ​​can be obtained without performing discrete connected component analysis. And based on this, calculate the number of cavities inside the lesion: - This method satisfies both differentiability and topological consistency requirements, facilitating stable optimization during the training phase.

[0139] Step VI: Construct the first equation using equation (11) Topological consistency loss in each downsampling convolutional layer :

[0140] (11)

[0141] In equation (11), These are the weighting coefficients for three topological invariants.

[0142] This module complements the frequency domain modulation module: the former enhances the structural features of lesions, while the latter supervises the stable maintenance of the structure. The two work together to improve the robustness and stability of the model under different natural environmental conditions.

[0143] Step 2.2: Decoder include: Each upsampling convolutional layer consists of an upsampling convolutional layer and an output prediction layer. Each upsampling convolutional layer includes an upsampling module, a feature fusion module, a convolution module, a feature normalization module, and a non-linear activation module.

[0144] In this embodiment, the decoder A multi-layer upsampling convolutional structure, roughly symmetrical to the encoder structure, is employed, and skip connections are used to connect the first... The i-th upsampling convolutional layer and the corresponding i-th in the encoder Multichannel feature maps output by each downsampling convolutional layer To integrate.

[0145] when At that time, Enter the first The process is performed in the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ;

[0146] when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the upsampling module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales , No. The feature fusion module in each upsampling convolutional layer will and After merging, input the following in sequence: The feature is processed in the convolutional module, feature normalization module, and nonlinear activation module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales Thus, the first upsampling convolutional layer yields the multi-channel feature map at the first scale. ;

[0147] Step 2.3: Output prediction layer pairs After processing, we obtain Predictive segmentation mask ;

[0148] Step 3: Based on and Constructing segmentation loss And the topology consistency loss shown in equation (1) The total loss function is composed as shown in equation (2). :

[0149] (1)

[0150] (2)

[0151] In equation (2), This represents the weights used to balance the two types of losses; Indicates the first Topological consistency loss in each downsampled convolutional layer;

[0152] Step 4: Train the image segmentation network using gradient descent and calculate the total loss function. To optimize network parameters until the total loss function is reached. The process continues until convergence, thus obtaining the optimal image segmentation model, which is used to generate the optimal segmentation result for the input image.

[0153] In this embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to invoke instructions stored in the memory to execute the image segmentation method.

[0154] In this embodiment, a computer-readable storage medium stores instructions thereon, characterized in that, when executed by a processor, the instructions cause the processor to execute the program of the image segmentation method.

[0155] As can be seen from the above, this invention innovatively combines phase-amplitude coupling-driven frequency domain modulation with topological constraint normalization, which effectively enhances the model's ability to express lesion structures and improves the segmentation reliability of the model on rice leaf images collected under different natural environmental conditions.

[0156] This invention identifies key frequency bands that contribute significantly to the structural features of lesions by calculating phase-amplitude coupling and structural band persistence in the frequency domain adaptive modulation module, thus achieving targeted frequency domain adaptive modulation. This mechanism suppresses environmentally relevant style features without destroying the phase structure, avoiding the structural detail damage caused by the uniform processing of traditional methods, and significantly improving the stability of the model under different natural shooting conditions.

[0157] This invention introduces differentiable topological invariant constraints in the constraint normalization module to supervise the model from the perspective of overall morphological structure, ensuring that the segmentation results remain reasonable at the geometric level; and achieves end-to-end topological consistency optimization through a soft binarization strategy, effectively avoiding topological errors such as breaks and abnormal holes in the lesion area, and ensuring that the segmentation results conform to the morphological priors of rice diseases.

[0158] Furthermore, this invention employs a joint loss function, combining pixel-level segmentation loss with topological consistency loss, to achieve multi-level constraints from pixel level to structure level; the frequency domain modulation module and the topological constraint normalization module work together, with the former enhancing the ability to express lesion structures and the latter supervising the stability of the structure, jointly improving the segmentation performance and robustness of the model under different shooting conditions and farmland environments.

Claims

1. A method for rice disease image segmentation based on frequency domain modulation and topological constraints, characterized in that, Includes the following steps: Step 1: Obtain the first Image of rice leaf spot disease ,make Pixel-level labeling of the lesion area is as follows ; Step 2: Construct an image segmentation network, which consists of an encoder. decoder It consists of an output prediction layer and an output prediction layer, and is used for... The process is performed to obtain the predicted segmentation mask. ; Step 2.1: The encoder include: The downsampling convolutional layer, where the first... The downsampling convolutional layer and the first Each downsampling convolutional layer is equipped with a frequency domain adaptive modulation module and a topology constraint normalization module. when At that time, the first Each downsampling convolutional layer Processing yields the first... Multi-channel feature maps at different scales ; when When and when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampled convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The topological constraint normalization module of the downsampling convolutional layer is used for processing to obtain the first... Multi-channel feature maps at different scales ; Thus by the first The output of the i-th downsampled convolutional layer Multi-channel feature maps at different scales ; In step 2.1 The frequency-domain adaptive modulation module of each downsampled convolutional layer is configured according to the following steps: Processing is performed to obtain ; Step a, for Perform a two-dimensional fast Fourier transform to obtain In the Amplitude spectrum at different scales and phase spectrum ; Step b, will and The frequency domain range is uniformly divided into: Amplitude subspectra { }and Phase subspectrum { } and the first Amplitude Subspectrum Its corresponding number Phase subspectrum Combining, forming the first frequency band Thus obtain Non-overlapping frequency bands },in, The number of frequency bands; Step c: For the b-th frequency band, calculate its corresponding amplitude sub-spectrum. By applying a specific perturbation, the perturbed amplitude sub-spectrum corresponding to the b-th frequency band is obtained. ,Will Replace The The frequency band position is constructed only in the first frequency band position. The complete amplitude spectrum of each frequency band changes ;in, This indicates a frequency band replacement operation; Step d, will and After combining, a two-dimensional inverse fast Fourier transform is performed to obtain In the Scale for the first Feature map after applying perturbation to each frequency band Thus, B perturbation-induced feature maps are obtained. ; Step e, for Perform a two-dimensional fast Fourier transform to obtain the result on the th... Phase spectrum under individual frequency band perturbation conditions and will Follow the steps The partitioning method divides the spectrum into B perturbed phase sub-spectrums. },in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying perturbation, in the k-th frequency band The perturbated phase sub-spectrum obtained within; Step f, in the frequency band Inside, calculation In the The first scale Phase shift of each frequency band ,in, Indicates only for the first The amplitude subspectrum corresponding to each frequency band Under the condition of applying a disturbance, in the same... frequency band The perturbed phase sub-spectrum obtained within the interval is used to obtain all rice leaf spot disease images in the first interval using equation (3). The first scale Phase-amplitude coupling : (3) In equation (3), It is the numerical stability constant; Step g: Use equation (4) to obtain all samples in the first step. Scale for the first The structural frequency band persistence corresponding to the frequency band disturbance : (4) In equation (4), The Kullback-Leibler divergence; Indicates before the disturbance The probability distribution, Indicates after disturbance The probability distribution; Step h, using equation (5) to construct the first The first scale Structural correlation index of each frequency band : (5) In equation (5), This is the balance coefficient; Step i: Use equation (6) to obtain the first... The first scale Individual frequency band weights Thus, the first Band weight vector at scale ,in, Indicates transpose; (6) In equation (6), Indicates the first The first scale Structural correlation index of each frequency band; Step j: Use equation (7) to obtain the modulated first... Amplitude Subspectrum : (7) In equation (7), express In the The first scale Amplitude subspectral; Step k, will In the Scale The modulated amplitude subspectrum { } combined to obtain In the Amplitude spectrum modulated at different scales ; Step 1, for and Combination In the Full frequency domain representation after modulation at the scale and to Performing a two-dimensional inverse fast Fourier transform yields the first... The first scale One reconstructed feature map ; In step 2.1 The topology constraint normalization module for each downsampled convolutional layer is performed according to the following steps: Processing yields the first... Multi-channel feature maps at different scales ; Step I: For Perform channel-level standardization to obtain the first Standardized at scale Multi-channel feature map ; Step II: Obtain using equation (8) In the Multi-channel feature map after scale normalization : (8) In equation (8), , Indicates the first Two parameters to be learned at different scales; Step III: Obtain using equation (9) In the Foreground probability map at different scales : (9) In equation (9), This indicates a convolution operation with a 1×1 kernel. express Activation function; Step IV: Use equation (10) to... Perform soft binarization to obtain In the Binary approximate foreground probability map at different scales : (10) In equation (10), For Gaussian blur operation, For binarization threshold, For temperature parameters; Step V: [The sentence is incomplete and requires more context to translate accurately.] Binary approximate foreground probability map at different scales As a predictive segmentation mask for lesion regions, the predicted overall topology of the lesion regions is calculated. And predict the number of lesion connectivity components Thus obtain In the Predicting the number of internal cavities in lesions at a certain scale ; Step VI: Construct the first equation using equation (11) Topological consistency loss in each downsampling convolutional layer : (11) In equation (11), These are the weighting coefficients for the three topological invariants; Indicates the first scale The true overall topological morphology of the lesion area; Indicates the first scale The actual number of connected components in the lesion area; Indicates the first The number of internal cavities in actual lesions at the scale; Step 2.2: The decoder and output prediction layer sequentially After processing, we obtain Predictive segmentation mask ; Step 3: Based on and Constructing segmentation loss and topology consistency loss The total loss function : Step 4: Train the image segmentation network using gradient descent and calculate the total loss function. To optimize network parameters until the total loss function is reached. The process continues until convergence, thus obtaining the optimal image segmentation model, which is used to generate the optimal segmentation result for the input image.

2. The rice disease image segmentation method based on frequency domain modulation and topological constraints according to claim 1, characterized in that, Step 1 involves acquiring a set of image data related to rice leaf spot disease. ,in, express The first in An image of rice leaf spot disease. and Let represent the height and width of the rice leaf spot disease image, respectively, and I represent the total number of rice leaf spot disease images; let Pixel-level labeling of the lesion area is as follows ,and , express The annotation set; right Conduct the first Downsampling at scale yields a resolution of Tag Image ,Will Middle pixel position The label value at the location is denoted as ,when When =1, it means Middle pixel position The area is the foreground region, when =0 indicates Middle pixel position This area is the background area; Calculate the first scale The true overall topological morphology of the lesion area Number of connected components in actual lesions Thus, the first The number of internal cavities in actual lesions at the scale .

3. The rice disease image segmentation method based on frequency domain modulation and topological constraints according to claim 2, characterized in that, The encoder in step 2.1 Each downsampling convolutional layer in the model includes: a convolution module, a feature normalization module, a non-linear activation module, and a downsampling module; when At that time, the first Each downsampling convolutional layer Processing yields the first... Multi-channel feature maps at different scales ;in, , , The first The height, width, and number of channels of a multi-channel feature map at different scales; when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ; when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampled convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The topological constraint normalization module of the downsampling convolutional layer is used for processing to obtain the first... Multi-channel feature maps at different scales ; when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ; when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the convolutional module of the downsampling convolutional layer to obtain the first... Intermediate feature map at different scales ;Will Enter the first The process is performed in the frequency domain adaptive modulation module of the downsampled convolutional layer to obtain the first... Reconstructed feature maps at different scales ;Will Enter the first The process is carried out in the topological constraint normalization module of the downsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ; Among them, for the first topology constraint normalization module introduced and the The downsampling convolutional layer, based on the... Multi-channel feature maps at different scales and its downsampling label map Construct the first Topology consistency loss of topology constraint normalization module at scale ; when At that time, the first Multi-channel feature maps at different scales Enter the first In the downsampling convolutional layer, and obtain the first... Multi-channel feature maps at different scales Thus, by the first The output of the i-th downsampled convolutional layer Multi-channel feature maps at different scales ; Step 2.2: The decoder include: Each upsampling convolutional layer consists of an upsampling convolutional layer and an output prediction layer. Each upsampling convolutional layer includes an upsampling module, a feature fusion module, a convolution module, a feature normalization module, and a non-linear activation module. when At that time, Enter the first The process is performed in the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales ; when At that time, the first Multi-channel feature maps at different scales Enter the first The process is performed in the upsampling module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales , No. The feature fusion module in each upsampling convolutional layer will and After merging, input the following in sequence: The feature is processed in the convolutional module, feature normalization module, and nonlinear activation module of the upsampling convolutional layer to obtain the first... Multi-channel feature maps at different scales Thus, the first upsampling convolutional layer yields the multi-channel feature map at the first scale. ; Step 2.3: Output prediction layer pairs After processing, we obtain Predictive segmentation mask .

4. The rice disease image segmentation method based on frequency domain modulation and topological constraints according to claim 3, characterized in that, In step 3, the topology consistency loss is constructed using equation (1). Thus, the total loss function can be constructed using equation (2). : (1) (2) In equation (2), This represents the weights used to balance the two types of losses; Indicates the first Topological consistency loss in downsampled convolutional layers.

5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports a processor in executing the method of any one of claims 1-4, the processor being configured to execute the program stored in the memory.

6. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by the processor to perform the steps of the method according to any one of claims 1-4.