Color equivariant and frequency domain attention-based cataract classification method and system

By constructing a CFC-Mamba network and integrating color equivariance and frequency domain attention modules, the problems of inconsistent device colors and insufficient perception of high-frequency details in cataract classification are solved, achieving high-precision fine-grained cataract classification and improving the robustness and applicability of the model.

CN121640192AActive Publication Date: 2026-03-10ZHEJIANG UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing cataract classification methods suffer from reduced robustness and accuracy when faced with color inconsistencies and insufficient high-frequency detail perception across different imaging devices, making it difficult to effectively generalize and differentiate cataracts of different severities in real clinical settings.

Method used

A cataract classification method based on color variability and frequency domain attention is adopted. By constructing a CFC-Mamba network, integrating a color variability fusion module and a frequency domain channel attention module, the model extracts device-invariant features and enhances lesion boundary information, thereby improving the robustness and fine-grained classification ability of the model.

Benefits of technology

It effectively solves the problems of device color differences and insufficient high-frequency perception, significantly improves the accuracy and clinical applicability of cataract classification, and enhances the model's generalization ability across different devices and its ability to perceive the boundaries of cataract lesions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640192A_ABST
    Figure CN121640192A_ABST
Patent Text Reader

Abstract

A cataract classification method based on color equivariant and frequency domain attention belongs to the technical field of computer vision and medical artificial intelligence, uses eye images shot by a slit lamp as an input data source, and constructs a CFC-Mama classification network integrated with a color equivariant fusion module and a frequency domain channel attention module to classify cataracts. The model can effectively extract color robust features with unchanged equipment, and the high-frequency detail perception capability of the cataract lesion boundary is enhanced; a color isotropic convolution and cross attention fusion mechanism is adopted to solve the color shift problem caused by different imaging devices, and the cross-device robustness of feature extraction is ensured; through a frequency domain channel attention module, in combination with Fourier transform, high-pass filtering and a double-path channel attention strategy, high-frequency features of lesion boundaries are highlighted, and the fine-grained feature expression ability is improved. The invention further provides a cataract classification system based on color equivariant and frequency domain attention. According to the invention, high-precision classification of multi-granularity cataract is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and medical artificial intelligence technology, specifically relating to a cataract classification method and system based on color variability and frequency domain attention. This method aims to improve the model's robustness to cross-device color differences and its ability to perceive the boundaries of cataract lesions, thereby achieving high-precision, fine-grained cataract classification. Background Technology

[0002] Cataracts are the leading cause of blindness worldwide. Clinical diagnosis and classification of cataracts are crucial for developing treatment plans. However, traditional methods that rely on subjective assessment by doctors suffer from inconsistent standards and low efficiency. Therefore, achieving accurate and automated classification has become an urgent need to promote large-scale screening and tiered diagnosis and treatment.

[0003] In recent years, deep learning-based automated cataract classification methods have made significant progress. However, existing methods generally face two major challenges. First, there is device-dependent color inconsistency. Differences in hardware and parameters between different imaging devices can lead to significant color shifts in slit-lamp images. These lesion-irrelevant color variations can mislead the model, severely limiting its generalization ability and robustness in real-world clinical settings. Second, there is insufficient perception of high-frequency details. While current mainstream Transformer and Mamba architectures excel in modeling the global context of images, they exhibit a bias towards low-frequency information, often neglecting high-frequency components that characterize lesion boundaries and subtle textures. This results in insufficient discriminative power for key edges and fine-grained opacity changes when distinguishing cataracts of different severities. Summary of the Invention

[0004] To address the decline in classification accuracy and robustness caused by differences in device color and insufficient high-frequency perception in existing technologies, this invention proposes a cataract classification method and system based on color variability and frequency domain attention. This system effectively extracts device-invariant features and enhances lesion boundary information by integrating color variability learning and frequency domain channel attention.

[0005] The technical solution provided by this invention is as follows: A cataract classification method based on color variability and frequency domain channel attention includes the following steps: Step 1: Construct the CFC-Mamba classification network; Build a cataract classification network model based on color variability and frequency domain channel attention enhancement, using the VMamba model as the backbone network to extract multi-scale hierarchical features from the input image; The network includes a color variability fusion module and a frequency domain channel attention module, which are used to extract device-invariant features and enhance high-frequency detail information of lesion boundaries, respectively. Step 2: Train the multi-granularity cataract classification network model, as follows: Step 2.1: Acquire slit lamp images and uniformly scale them to N×N resolution, then input them into the feature extraction network; extract discriminative features sequentially through a color variability fusion unit, a frequency domain channel attention mechanism, and a classification module; Step 2.2: Initialize model weights based on pre-trained parameters and perform multiple rounds of iterative optimization; the training uses a cosine annealing mechanism to gradually reduce the learning rate to enhance convergence stability; Step 2.3: In each iteration, calculate the objective function value based on the difference between the model prediction results and the true labels; Step 2.4: Use the AdamW optimization algorithm to continuously reduce the loss function and retain the model parameters with the best performance on the validation set during the training process; Step 3: Dataset preprocessing; Filter high-quality slit lamp images and divide the filtered slit lamp images into a set number of categories based on existing labels; Step 4: Evaluate model performance on the test set: Input the preprocessed slit lamp images into the fully trained network model, and use a combination of metrics such as precision, recall, F1 score, classification accuracy, Matthews Correlation Coefficient (MCC), and Cohen's Kappa Coefficient for quantitative evaluation. The superiority of this method in fine-grained cataract classification tasks is verified through comparative experiments with existing state-of-the-art algorithms.

[0006] Furthermore, step one includes the following steps: Step 1.1: The cataract classification network model based on color variability and frequency domain channel attention enhancement comprises a VMamba backbone network, a color variability fusion module (CEFM), a frequency domain channel attention module (FCA), and a classifier. The VMamba backbone network consists of four feature extraction stages, responsible for learning pathological features with different receptive fields from slit-lamp images. The color variability fusion module is composed of color variability convolution (CEConv) branches and cross-attention fusion layers, used to extract device-invariant feature representations. The frequency domain channel attention module is composed of Fourier transform layers, high-frequency filters, and channel attention mechanisms, used to enhance high-frequency detail information of lesion boundaries. The classifier is composed of fully connected layers, which map the enhanced features to the corresponding multi-granularity cataract categories. Step 1.2: Before inputting the slit lamp image into the VMamba backbone network, data standardization is first performed, and the size of all samples is uniformly adjusted to 224×224 pixels. Then, the image is reconstructed through a patch embedding layer. This process systematically divides the complete image into several regularly arranged image patches, providing structured input for the subsequent two-dimensional selective state space model. At the same time, the original RGB three-channel image is projected into a 96-dimensional latent space through this embedding layer, thereby improving the model's ability to distinguish subtle pathological features of cataracts. Furthermore, step one also includes the following steps: Step 1.3: Construct the VMamba backbone network of the cataract classification network model based on color equivariance and frequency domain channel attention enhancement. This network contains four feature extraction stages, named the first, second, third and fourth feature extraction stages in order of network depth. Each stage consists of multiple cascaded VSSBlocks, with the first and second stages each containing two VSSBlocks, the third stage containing nine VSSBlocks, and the fourth stage containing two VSSBlocks. All VSSBlocks maintain a consistent structure, including SS2D state space modules and MLP feedforward networks, but their internal feature dimensions gradually increase with network depth to enhance the model's ability to express complex features.

[0007] Step 1.4: Each feature extraction stage of the VMamba backbone network is equipped with a downsampling module. This downsampling module is used to reduce the spatial resolution of the feature map and simultaneously increase the feature channel dimension to achieve multi-scale feature modeling. Specifically, downsampling uses a 3×3 convolution kernel with a stride of 2, which reduces the length and width of the feature map to half of its original size, while expanding the number of channels to twice its original size, gradually increasing from 96 dimensions to 192 dimensions, 384 dimensions, and finally reaching 768 dimensions, thereby realizing the reconstruction and compression of feature dimensions.

[0008] Furthermore, step one also includes the following steps: Step 1.5: Construct a color equivariance fusion module, which consists of a color equivariance convolution branch and a cross-attention fusion layer. The color equivariance convolution extracts robust feature representations for device color changes. The input image is first processed by CEConv2d with a 3×3 kernel size and a stride of 2, outputting 64 channels and 3 rotational equivariance features. Then, a 1×1 convolution projects the number of channels to 192 dimensions, aligning it with the feature dimensions of the first stage of the backbone network. Finally, a cross-attention mechanism is used to deeply fuse these features with the hierarchical features extracted by the backbone network, generating enhanced feature representations. Step 1.6: Construct a frequency domain channel attention module. This module first transforms the spatial features to the frequency domain through discrete Fourier transform, applies a circular high-pass filter to retain the high-frequency components representing the lesion boundary, and sets the filter radius to 20% of the feature map size. Then, it reconstructs the spatial features through inverse Fourier transform. Finally, it combines a dual-path channel attention mechanism (using global average pooling and global max pooling simultaneously) to adaptively calibrate the weights of the feature channels, highlighting the feature information that is important for the classification task. Step 1.7: The classifier of the multi-granularity cataract classification network model consists of fully connected layers. First, the final features are processed by layer normalization. Then, the spatial dimension is compressed to 1×1 through global average pooling. Finally, the 768-dimensional features are mapped to 10 fine-grained cataract categories through fully connected layers to complete the final multi-granularity classification task.

[0009] Furthermore, in step 1.2, the mathematical relationship of the image segmentation operation is expressed as follows: convolution kernel size = segment size × segment size, where the segment size is 4, and the convolution kernel size is 4×4 accordingly.

[0010] Furthermore, in step 1.3, the input-output dimensional transformation relationship of the four feature extraction stages of the network is defined as follows: the initial spatial size of the input slit lamp image is 224 pixels × 224 pixels, and the four sequentially connected feature extraction stages follow the following dimensional recursive relationship: the output feature dimension of the first stage is 56 × 56 × 96; the output feature dimension of the second stage is 28 × 28 × 192; the output feature dimension of the third stage is 14 × 14 × 384; and the output feature dimension of the fourth stage is 7 × 7 × 768.

[0011] Furthermore, in step 1.3, each VSSBlock uses the SS2D state-space model for sequence modeling, and captures long-distance dependencies through a selective scanning mechanism. Its core calculation process is based on the following state-space equation: ; ; in, Indicates a hidden state. Given the input sequence, For the output sequence, , , , is a learnable parameter matrix.

[0012] Furthermore, in step 1.5, the execution process of color-equivariant convolution is as follows: First, the input image is processed using color-equivariant convolution, which is mathematically expressed as: ; in, For relative color rotation Learnable weights are used to ensure that the extracted features are equally variable to device-induced tone shifts; subsequently, the equally variable color features are fused with the backbone network features through a cross-attention mechanism. The calculation process is as follows: ; in, Obtained by projection from backbone network features. It is obtained by projection of color and other variable features, thus achieving an effective fusion of invariant features of the equipment and structural features.

[0013] Furthermore, in step 1.6, the execution process of the frequency domain channel attention module is as follows: Given an input feature map First, it is transformed to the frequency domain using a two-dimensional discrete Fourier transform: ; A high-pass filter was then applied. Preserve high-frequency components: ; The filtered frequency domain features are mapped back to the spatial domain using an inverse Fourier transform: ; Finally, the feature channel weights are adaptively calibrated using a channel attention mechanism. ; Where GAP and MaxP represent global average pooling and global max pooling, respectively. This is the Sigmoid function.

[0014] Furthermore, in step 1.7, the detailed process of cross-attention fusion is as follows: Given color-variable features... and FCA-enhanced skeletal features Calculated through the cross-attention fusion module: ; in, , Attn represents the standard attention computation process. This fusion mechanism effectively combines the advantages of color-robust features and detail-enhancing features.

[0015] The process of step three is as follows: Step 3.1: Screen the original slit-lamp images according to image quality criteria, focusing on the integrity of the lens structure, and remove samples with reflective occlusion or blurred key areas; Step 3.2: Perform region cropping on qualified images to ensure that the lens anatomical structure occupies the dominant area in the image; Step 3.3: For categories with a small number of samples, merge them reasonably based on the similarity of pathological features; Step 3.4: Finally, construct a standardized dataset containing ten fine-grained categories: nuclear cataract (grades II-V), cortical cataract (grades I-IV), posterior subcapsular cataract, and normal lens, and use a stratified sampling strategy to divide the dataset into training, validation, and test sets.

[0016] Furthermore, the process of step four is as follows: Step 4.1: Deploy the optimal model weights obtained from training on the test set for comprehensive performance evaluation. Quantitative analysis is performed by calculating precision, recall, F1 score, accuracy, Matthews correlation coefficient, and Cohen's Kappa coefficient. Step 4.2: For ten fine-grained categories, including nuclear cataracts (grades 2-5), cortical cataracts (grades 1-4), posterior subcapsular cataracts, and non-cataracts, calculate the classification performance index for each category, analyze the differences in model performance in different cataract severity classifications, and identify the model's strengths and weaknesses in specific categories.

[0017] Step 4.3: Comparative Experiment Verification; The proposed method is compared with mainstream cataract classification algorithms under the same experimental environment, including CNN-based methods (ResNet series, VGG series), Transformer-based methods (ViT, DeiT) and Mamba-based methods (VMamba, Vim). Rigorous statistical tests are used to demonstrate the effectiveness and superiority of the proposed method in multi-granularity cataract classification scenarios.

[0018] A cataract classification system based on color variability and frequency domain channel attention includes: The CFC-Mamba network building module is used to build a color equivariance and frequency domain attention-enhanced classification network framework based on the VMamba backbone, integrating a color equivariance fusion module and a frequency domain channel attention module. The multi-granularity cataract classification network training module is used to perform the model training process, including learning rate warm-up and cosine annealing scheduling, AdamW optimizer optimization, loss function calculation and optimal weight saving; The slit lamp image preprocessing module is used to perform quality screening, uniform cropping, data augmentation, and category balancing on the input image to generate standardized data that meets the requirements of network input. The multi-granularity cataract classification test module is used to load the optimal model weights, perform forward inference calculations, output prediction results for ten fine-grained categories, and generate a detailed performance evaluation report.

[0019] The advantages of this invention are: it solves the problems of poor model generalization ability and low classification accuracy caused by color differences in imaging devices, insufficient perception of high-frequency features of lesion boundaries, and the complexity of fine-grained classification tasks in the prior art; it can effectively extract device-independent color robust features, enhance the perception of lesion boundary details, and significantly improve the accuracy and clinical applicability of fine-grained cataract classification. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the overall structural design of the CFC-Mamba cataract classification network proposed in this invention. Figure 2 This is a schematic diagram of the entire data preprocessing process used in this invention. Figure 3 This is a schematic diagram illustrating the complete workflow of the model based on the present invention during the inference phase. Figure 4 This is a schematic diagram of the overall training process and final classification process of the model of the present invention. Figure 5 This is a schematic diagram of the Color Equivalent Fusion Module (CEFM) of the present invention. Figure 6 This is a schematic diagram of the frequency-channel attention module (FCA) structure of the present invention. Detailed Implementation

[0021] The present invention will now be further described with reference to the accompanying drawings.

[0022] Reference Figures 1-6 A cataract classification method based on color equivariance and frequency domain attention is proposed. The method specifically includes four core steps: CFC-Mamba network structure design, model training process, dataset preprocessing method, and classification performance testing.

[0023] Slit-lamp imaging, a crucial tool for clinical cataract diagnosis, clearly reveals details of ocular anatomy, particularly the morphological characteristics of lens opacity. Current methods for acquiring slit-lamp images primarily utilize digital slit-lamp microscope systems. These systems integrate a specialized slit-lamp device with a high-resolution digital camera, significantly enhancing overall image contrast and spatial resolution while strengthening the visual representation of pathological features within the lens area, providing ophthalmologists with more reliable imaging evidence for disease assessment. However, in practical applications, differences in color reproduction between different imaging devices, coupled with often unclear lesion edge features, collectively limit the performance of existing deep learning models in terms of cross-device generalization ability and classification accuracy. To address these issues, this invention constructs the CFC-Mamba classification framework based on the characteristics of slit-lamp images. By introducing a color-variable feature fusion mechanism and a frequency-channel attention module, it effectively achieves fine-grained and accurate classification of cataract lesions.

[0024] The cataract classification method based on color variability and frequency domain attention in this embodiment includes the following steps: Step 1: Construct a cataract classification network model based on color variability and frequency domain channel attention enhancement (CFC-Mamba) to enable the model to obtain robust representation and accurate discrimination ability of multi-level cataract features in slit-lamp images. The process is as follows: Step 1.1: The cataract classification network model based on color variability and frequency domain channel attention enhancement includes a VMamba backbone network, a color variability fusion module (CEFM), a frequency domain channel attention module (FCA), and a classifier. The VMamba backbone network includes four feature extraction stages for extracting multi-scale pathological feature information from slit-lamp images layer by layer. The color variability fusion module consists of a color variability convolution (CEConv) branch and a cross-attention fusion layer for extracting device-invariant feature representations. The frequency domain channel attention module consists of a Fourier transform layer, a high-pass filter, and a dual-path channel attention mechanism for enhancing high-frequency detail information at lesion boundaries. The classifier consists of fully connected layers that map the enhanced features to the corresponding multi-granularity cataract categories. Step 1.2: Before inputting the image into the VMamba backbone network, the original slit lamp image is first normalized and uniformly adjusted to 224×224 pixels. Then, a patch embedding layer is used to perform feature transformation on the image. This operation realizes the image block processing, dividing the image into regions of fixed size evenly, providing a foundation for the subsequent SS2D state space model calculation. At the same time, the original 3-channel image is mapped into a 96-dimensional feature space, thereby enhancing the network's ability to represent fine-grained features of cataracts. Step 1.3: Construct the VMamba backbone network of the cataract classification network model based on color equivariance and frequency domain channel attention enhancement. This network contains four feature extraction stages, named the first, second, third, and fourth feature extraction stages in order of network depth. Each stage consists of multiple cascaded VSSBlocks, with the first and second stages each containing two VSSBlocks, the third stage containing nine VSSBlocks, and the fourth stage containing two VSSBlocks. All VSSBlocks maintain a consistent structure, including SS2D state space modules and MLP feedforward networks, but their internal feature dimensions gradually increase with network depth to enhance the model's ability to express complex features. Step 1.4: Each feature extraction stage of the VMamba backbone network is equipped with a downsampling module. This downsampling module is used to reduce the spatial resolution of the feature map and simultaneously increase the feature channel dimension to achieve multi-scale feature step-by-step modeling. Specifically, downsampling uses a 3×3 convolution kernel with a stride of 2, which reduces the length and width of the feature map to half of its original size, while expanding the number of channels to twice its original size, gradually increasing from 96 dimensions to 192 dimensions, 384 dimensions, and finally reaching 768 dimensions, thereby achieving feature dimension reconstruction and compression. Step 1.5: Construct a color equivariant fusion module, which consists of a color equivariant convolution branch and a cross-attention fusion layer. The color equivariant convolution extracts robust feature representations for device color changes. The input image is first processed by color equivariant convolution with a 3×3 kernel and a stride of 2, outputting 64 channels and 3 rotational equivariant features. Then, a 1×1 convolution projects the number of channels to 192 dimensions, aligning it with the feature dimensions of the first stage of the backbone network. Finally, a cross-attention mechanism is used to perform deep fusion of these features with the hierarchical features extracted by the backbone network. The process of color-equivariant convolution is as follows: First, the input image is processed using color-equivariant convolution. The core idea is to use learnable weights to model relative color rotation, ensuring that the extracted features are equivariant to the hue shift caused by the device. Then, the color-equivariant features are fused with the backbone network features through a cross-attention mechanism. The query vector is obtained by projecting the backbone network features, and the key vector is obtained by projecting the color-equivariant features. The device-invariant features and structural features are effectively fused through layer normalization and residual connections. Step 1.6: Construct the frequency domain channel attention module. This module first transforms the spatial features to the frequency domain through discrete Fourier transform, applies a circular high-pass filter to retain the high-frequency components representing the lesion boundary, and sets the filter radius to 20% of the feature map size. Then, it reconstructs the spatial features through inverse Fourier transform. Finally, it adaptively calibrates the feature channel weights using a dual-path channel attention mechanism to highlight the feature information that is important for the classification task. The execution process of the frequency domain channel attention module is as follows: Given an input feature map, it is first transformed to the frequency domain through two-dimensional discrete Fourier transform. Then, a high-pass filter is applied to retain the high-frequency components. The filtered frequency domain features are mapped back to the spatial domain through inverse Fourier transform. Finally, it combines the channel attention mechanism and uses a dual-path structure of global average pooling and global max pooling, with multilayer perceptron and sigmoid function to adaptively calibrate the feature channel weights. Step 1.7: The classifier of the multi-granularity cataract classification network model consists of fully connected layers. First, the final features are processed by layer normalization. Then, the spatial dimension is compressed to 1×1 through global average pooling. Finally, the 768-dimensional features are mapped to 10 fine-grained cataract categories through fully connected layers to complete the final multi-granularity classification task. The detailed process of cross-attention fusion is as follows: Given color isovariant features and backbone features enhanced by frequency domain channel attention, the cross-attention fusion module is used for calculation. The query vector is obtained by one-dimensional convolution and flattening operation of the enhanced backbone features, and the key value vector is obtained by the same processing of color isovariant features. The effective fusion of color robust features and detail enhancement features is achieved through multi-head attention mechanism, layer normalization and residual connection. Step 2: Train the multi-granularity cataract classification network model, as follows: Step 2.1: Acquire clinical slit lamp images and preprocess them to a uniform resolution of 224×224 pixels, then input them into the feature extraction backbone network; the data flows through the color variability fusion module and the frequency domain channel attention enhancement module in sequence, and finally generates prediction results through the classifier; Step 2.2: Initialize the weights using model parameters pre-trained on large datasets such as ImageNet, and perform an end-to-end iterative training process; during the training period, the cosine annealing algorithm periodically decays the learning rate until it reaches the preset minimum threshold, thereby promoting the stable convergence of model parameters in the later stages of training; Step 2.3: Within each training iteration, the classification error is quantified using the cross-entropy loss function based on the difference between the model's predictions and the expert-annotated true labels. Step 2.4: The AdamW optimization algorithm with weight decay is used to minimize the loss function, and the performance on the validation set is continuously monitored throughout the training process. The model parameters that achieve the highest classification accuracy on the validation set are retained as the final deployment model. Step 3: Dataset preprocessing; Filter high-quality slit lamp images and divide the filtered slit lamp images into ten categories according to existing labels, as follows; Step 3.1: Perform quality screening on the acquired raw slit-lamp images. Key screening criteria include: ensuring that the anatomical structure of the lens is fully presented in the image and the image is clear; removing invalid samples that are overexposed or optically obstructed in key pathological areas of the lens due to strong light source reflection, thereby ensuring the reliable extraction of cataract-related image features. Step 3.2: Perform standardized cropping on qualified images that have passed quality screening. Adjust the image composition so that the target area of ​​the lens occupies the main visual range of the image, thereby increasing the proportion of effective features in the input. Step 3.3: To address the issue of insufficient sample size in certain categories, categories with similar lesion characteristics and adjacent severity are reasonably merged based on clinical pathology knowledge to maintain the balance of data distribution; Step 3.4: After systematic quality control and category optimization, the final dataset contains ten clinically significant fine-grained categories, specifically including: nuclear cataracts (grades II-V), cortical cataracts (grades I-IV), posterior subcapsular cataracts, and normal lens; the dataset is divided into three independent parts—training set, validation set, and test set—in a stratified random sampling method at a ratio of 6:2:2. Step 4: Cataract Test Set Testing; Input the preprocessed slit-lamp images into the trained network model, and evaluate the overall performance of the model. The process is as follows: Step 4.1: Load the optimized weight parameters into the model and perform a comprehensive performance evaluation on the independent test set. The quantitative evaluation metrics used include: precision, recall, F1 score, accuracy, Matthews correlation coefficient, and Cohen's Kappa coefficient. Step 4.2: For ten fine-grained categories, including nuclear cataracts (grades 2 to 5), cortical cataracts (grades 1 to 4), posterior subcapsular cataracts, and non-cataracts, calculate the classification performance index for each category, analyze the differences in model performance in different cataract severity classifications, and identify the model's strengths and weaknesses in specific categories. Step 4.3: Comparative Experiment Verification; The proposed method is compared with mainstream cataract classification algorithms under the same experimental environment, including CNN-based methods (ResNet series, VGG series), Transformer-based methods (ViT, DeiT) and Mamba-based methods (VMamba, Vim). Rigorous statistical tests are used to demonstrate the effectiveness and superiority of the proposed method in multi-granularity cataract classification scenarios.

[0025] This embodiment also provides a cataract classification system based on color variability and frequency domain attention, the system comprising: The CFC-Mamba network building module is used to build a color equivariance and frequency domain attention-enhanced classification network framework based on the VMamba backbone, integrating a color equivariance fusion module and a frequency domain channel attention module. The multi-granularity cataract classification network training module is used to perform the model training process, including cosine annealing scheduling, AdamW optimizer optimization, loss function calculation, and optimal weight saving. The slit lamp image preprocessing module is used to perform quality screening, uniform cropping, data augmentation, and category balancing on the input image to generate standardized data that meets the requirements of network input. The multi-granularity cataract classification test module is used to load the optimal model weights, perform forward inference calculations, output prediction results for ten fine-grained categories, and generate a detailed performance evaluation report.

[0026] The above technical solutions correspond to the specific implementation content of steps one to four in Embodiment 1.

[0027] The embodiments described in this specification are merely examples of implementations of the inventive concept and are for illustrative purposes only. The scope of protection of this invention should not be considered limited to the specific forms described in these embodiments; rather, it extends to equivalent technical means conceived by those skilled in the art based on the inventive concept.

Claims

1. A cataract classification method based on color isomorphism and frequency domain attention, characterized in that, The method comprises the following steps: Step one, constructing CFC-Mamba classification network, building a cataract classification network model based on color invariance and frequency channel attention enhancement, taking VMamba model as the backbone network, extracting multi-scale hierarchical features from the input image, namely device invariant features and enhanced high-frequency detail information of lesion boundary; Step two, training the multi-granularity cataract classification network model, the process is as follows: Step 2.1: Collect slit lamp images and unify them to N*N resolution, input the feature extraction network; sequentially pass through the color invariance fusion unit, the frequency domain channel attention mechanism and the classification module to extract discriminative features; Step 2.2: Initialize the model weight based on the pre-training parameter, and perform multiple rounds of iterative optimization; the training adopts the cosine annealing mechanism to gradually reduce the learning rate to enhance the convergence stability; Step 2.3: In each iteration, calculate the target function value according to the difference between the model prediction result and the real label; Step 2.4: Use the AdamW optimization algorithm to continuously reduce the loss function, and keep the model parameters with the best performance on the validation set during training; Step three, data set pre-processing; select high-quality slit lamp images, and divide the selected slit lamp images into a set number of categories according to the existing labels; Step four, evaluate the model performance on the test set: input the preprocessed slit lamp images into the trained network model, and quantitatively evaluate by comprehensively using the set indicators. 2.The cataract classification method based on color isomorphism and frequency domain attention of claim 1, wherein, The step one comprises the following steps: Step 1.1: The cataract classification network model based on color invariance and frequency channel attention enhancement comprises a VMamba backbone network, a color invariance fusion module CEFM, a frequency domain channel attention module FCA and a classifier; the VMamba backbone network comprises four feature extraction stages, which are responsible for learning pathological features with different receptive fields from slit lamp images; the color invariance fusion module is composed of a color invariance convolution CEConv branch and a cross attention fusion layer, which is used to extract device invariant feature representation; the frequency domain channel attention module is composed of a Fourier transform layer, a high-frequency filter and a channel attention mechanism, which is used to enhance the high-frequency detail information of the lesion boundary; the classifier is composed of a fully connected layer, which maps the enhanced features to the corresponding multi-granularity cataract categories; Step 1.2: Before inputting the slit lamp image into the VMamba backbone network, first perform data standardization operation, and unify the size of all samples to M*M pixels; then, the image is reconstructed through the patch embedding layer, which systematically divides the complete image into a plurality of regularly arranged image blocks, providing structured input for the subsequent two-dimensional selective state space model; at the same time, the original RGB three-channel image is projected to the hidden space through the embedding layer. 3.The cataract classification method based on color isomorphism and frequency domain attention of claim 2, wherein, The step one further comprises the following steps: Step 1.3: Construct a VMamba backbone network based on color equivariance and frequency channel attention enhanced cataract classification network model, which contains four feature extraction stages, named first, second, third and fourth feature extraction stages in order of network depth, each stage is composed of multiple cascaded VSSBlock, among them the first and second stages each contain two VSSBlock, the third stage contains nine VSSBlock, and the fourth stage contains two VSSBlock; all VSSBlock are consistent in structure and contain SS2D state space module and MLP feedforward network, but the internal feature dimension gradually increases with the network depth to enhance the model's ability to express complex features; Step 1.4: Each feature extraction stage of the VMamba backbone network is provided with a downsampling module, which is used to reduce the spatial resolution of the feature map and simultaneously increase the feature channel dimension, so as to realize the step-by-step modeling of multi-scale features.

4. The cataract classification method based on color isomorphism and frequency domain attention of claim 3, wherein, The step one also includes the following steps: Step 1.5: Construct a color equivariance fusion module, which is composed of a color equivariance convolution branch and a cross-attention fusion layer; extract features that are robust to device color changes through color equivariance convolution, input images are first processed by CEConv2d, then the channel number is projected to a set dimension through 1×1 convolution to align with the feature dimension of the first stage of the backbone network; finally, through the cross-attention mechanism, these features are deeply fused with the hierarchical features extracted by the backbone network to generate enhanced feature representations; Step 1.6: Construct a frequency channel attention module, first convert spatial features to frequency domain through discrete Fourier transform, apply a circular high-pass filter to retain high-frequency components representing lesion boundaries, then reconstruct spatial features through inverse Fourier transform, and finally combine a double-path channel attention mechanism to adaptively calibrate feature channel weights, highlighting important feature information for classification tasks; Step 1.7: The classifier of the multi-granularity cataract classification network model is composed of fully connected layers, which first normalizes the final features, then compresses the spatial dimension to 1×1 through global average pooling, and finally maps the features to a set number of cataract fine-grained categories through fully connected layers to complete the final multi-granularity classification task.

5. The cataract classification method based on color isomorphism and frequency domain attention of claim 4, wherein, In step 1.5, the execution process of color equivariance convolution is as follows: first, use color equivariance convolution to process the input image to ensure that the extracted features are invariant to device-induced hue shifts; then, through the cross-attention mechanism, the color equivariance features are fused with the backbone network features to effectively fuse device-invariant features and structural features.

6. The cataract classification method based on color isomorphism and frequency domain attention of claim 4, wherein, In step 1.6, the execution process of the frequency channel attention module is as follows: Given input feature map , first convert it to the frequency domain by two-dimensional discrete Fourier transform, then apply a high-pass filter to retain high-frequency components, map the filtered frequency domain features back to the spatial domain through inverse Fourier transform, and finally combine the channel attention mechanism to adaptively calibrate the feature channel weight.

7. The cataract classification method based on color isometric and frequency domain attention according to any one of claims 1-6, wherein, The process of step three is as follows: Step 3.1: According to the image quality criteria, the original slit lamp images are screened, focusing on the integrity of the lens structure, and samples with light shielding or blurred key areas are excluded; Step 3.2: Perform region cropping on qualified images to ensure that the lens anatomical structure occupies the dominant area in the picture; Step 3.3: For categories with a small number of samples, reasonable merging is performed according to the similarity of pathological features; Step 3.4: Finally, a standardized dataset containing a set number of fine-grained categories is constructed, and a stratified sampling strategy is used to divide the training set, validation set, and test set.

8. The cataract classification method based on color isometric and frequency domain attention according to any one of claims 1-6, wherein, The process of step four is as follows: Step 4.1: The optimal model weight obtained by training is deployed on the test set for comprehensive performance evaluation, and quantitative analysis is performed by calculating precision, recall, F1 score, accuracy, Matthew correlation coefficient, and Cohen kappa coefficient; Step 4.2: For the ten fine-grained categories of nuclear cataract grades II to V, cortical cataract grades I to IV, subcapsular cataract, and non-cataract, the classification performance indicators of each category are calculated, the performance differences of the model in different severity cataract classification are analyzed, and the advantages and disadvantages of the model in specific categories are identified; Step 4.3: Comparative experiment verification; under the same experimental environment, the method is compared with existing cataract classification algorithms, including CNN-based method, Transformer-based method, and Mamba-based method, and statistical test proves the effectiveness and superiority of the method in the multi-granularity cataract classification scene.

9. A system for implementing the cataract classification method based on color isomorphism and frequency domain attention as claimed in claim 1, characterized in that, The system comprises: A CFC-Mamba network construction module for building a color isovar and frequency domain attention enhanced classification network framework based on VMamba backbone, integrating a color isovar fusion module and a frequency domain channel attention module; A multi-granularity cataract classification network training module for performing model training process, including learning rate preheating and cosine annealing scheduling, AdamW optimizer optimization, loss function calculation, and optimal weight saving; A slit lamp image preprocessing module for performing quality screening, uniform cropping, data enhancement, and class balancing processing on the input image to generate standardized data meeting the network input requirements; A multi-granularity cataract classification test module for loading the optimal model weight, performing forward inference calculation, and outputting the prediction results of ten fine-grained categories.

Citation Information

Patent Citations

  • Two-dimensional IOLmaster crystalline lens image grading method and device based on deep learning

    CN115272743A

  • Multi-granularity cataract classification method and system based on lesion perception

    CN120599331A

  • Acute leukemia classification method and system based on frequency domain attention and multi-scale fusion

    CN121304641A

  • Hybrid vision backbone architecture combining selective state space model blocks and transformer blocks

    US20250371326A1