Inplanatable single-domain generalization method for multi-label classification of ophthalmic diseases
By employing a dual-branch input processing and feature-guided mechanism, domain-invariant features are extracted, and disease label correlations are modeled. This addresses the issues of domain generalization and multi-label diagnosis in ophthalmic disease diagnosis, achieving interpretable single-domain generalization under single-source domain data and enhancing the model's generalization ability and reliability.
Patent Information
- Application Number
- CN202511725608.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-06
AI Technical Summary
Existing technologies for diagnosing ophthalmic diseases suffer from problems such as domain generalization dependence on target domain data, insufficient multi-label diagnostic capabilities, and lack of decision interpretability. In particular, they are difficult to deploy effectively under the protection of medical data privacy and hospital data barriers. Furthermore, existing methods cannot effectively handle multi-label clinical scenarios and lack intuitive decision-making basis.
Employing a dual-branch input processing, feature guidance mechanism, domain-invariant feature filtering, and attention mechanism, this approach generates enhanced graph samples through data augmentation, extracts domain-invariant features, models the correlation between disease labels, and performs attention feature alignment to achieve interpretable single-domain generalization.
Using only single-source domain data, the model's generalization ability across different data distribution environments is significantly improved, enabling accurate identification of various ophthalmic diseases, providing interpretable decision-making support, and enhancing the model's clinical applicability and credibility.
Smart Images

Figure CN121483560A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical artificial intelligence technology, specifically to an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases. Background Technology
[0002] Eye diseases are a major cause of vision impairment, and early screening relies on fundus image analysis. In recent years, deep learning-based computer-aided diagnostic technologies have provided doctors with reference diagnostic results by analyzing subtle lesion features in retinal images. However, existing technologies face significant challenges in practical clinical deployment.
[0003] Existing methods typically improve model generalization ability based on domain adaptation techniques, the core idea of which is to align feature distributions using data from multiple source and target domains. However, these methods require pre-acquiring target domain data during the training phase, but in medical settings, cross-institutional data sharing is extremely difficult due to patient privacy regulations and hospital data silos, making it difficult to meet the prerequisites for the application of domain adaptation methods.
[0004] Furthermore, existing technologies mostly focus on single-label classification tasks, assuming that each image corresponds to only a single disease type. However, in clinical practice, patients often suffer from multiple ophthalmic diseases simultaneously. The simplified single-label setting does not match the complex clinical reality, thus limiting the practical value of the model.
[0005] Another prominent issue is the lack of interpretability in the model's decision-making process. Current deep learning models often operate as "black boxes," making it difficult to intuitively demonstrate their judgment criteria. Doctors cannot verify whether the model's diagnosis is based on medically reasonable lesion features, leading to a cautious approach to the results. Furthermore, when model performance degrades, researchers struggle to distinguish whether errors stem from excessive focus on irrelevant features (such as image artifacts) or omission of key lesion features, resulting in unclear optimization directions. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, the present invention aims to provide an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases, so as to solve the problems of domain generalization relying on target domain data, insufficient multi-label diagnostic capabilities, and lack of decision interpretability in the prior art.
[0007] To solve the above problems, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases, comprising the following steps: By using dual-branch input processing, feature representations of the original image samples and the enhanced image samples are obtained; A feature-guided mechanism is applied, which uses interpretable signals to weight and guide features to focus on clinically relevant areas; Extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes; Model the correlation between disease labels, learn the correlation between label vectors through an attention mechanism, and calculate the probability of each label in the image; Perform attention feature alignment to constrain the consistency of attention vectors across different branches.
[0008] In some embodiments, the dual-branch input processing includes: The original input image sample is augmented to generate augmented image samples, and the original image features F are obtained through a shared feature extraction network. ori and enhanced map features F aug ; Data augmentation includes at least one of brightness adjustment, rotation, or scaling to simulate changes in different clinical environments.
[0009] In some embodiments, the feature guidance mechanism is implemented through Class Activation Map (CAM) weights, including: Generate CAM heatmaps of the original image samples and extract CAM features F. cam ; Attention weights are calculated using spatial attention and channel attention modules to obtain the CAM attention weights for different regions of interest. weights and channel weights The original image features and the enhanced image features are weighted and guided using a residual connection method to obtain the original image guided features F. guidance_ori and enhanced graph-guided features F guidance_aug ,in: F guidance_ori =F ori *(1+α*spatial weights )*(1+β*channel weights ) α and β are the weighting coefficients for spatial attention and channel attention, respectively.
[0010] In some embodiments, the extracted domain-invariant features include: Calculate the similarity matrix between the guiding features of the original image and the guiding features of the enhanced image; A binary mask is generated through thresholding, and then multiplied by the guiding feature to obtain the original image domain-invariant feature F. invariance_ori and enhanced graph-invariant features F invariance_aug ; The similarity calculation uses cosine similarity or Euclidean distance, and the threshold is dynamically adjusted based on the training data.
[0011] In some embodiments, the modeling of the associations between disease labels employs a Transformer architecture, including a self-attention layer and a cross-attention layer: The self-attention layer models disease labels as learnable vectors and learns the intrinsic correlations between labels. The cross-attention layer uses the label vector as the query and the domain-invariant features as the key and value, and outputs the attention vector for each label. Extending to multimodal scenarios, the label vectors integrate textual descriptions and / or clinical prior knowledge to enhance the semantic representation of the labels.
[0012] In some embodiments, performing attention feature alignment includes: Calculate the consistency loss between the attention vectors of the original graph branch and the augmented graph branch, using Euclidean distance or distribution metric as the loss function; Furthermore, the consistency loss and classification loss are combined through joint optimization to train the model in an end-to-end manner.
[0013] In some embodiments, the feature guidance mechanism further includes domain adaptive adjustment: It includes a lightweight adapter module that compares and aligns pre-trained CAM features with ophthalmic prior knowledge to reduce domain bias. The lightweight adapter module dynamically adjusts the CAM weights based on key areas annotated by experts, ensuring that the guiding signal converges on the actual lesion features.
[0014] In some embodiments, the modeling of label associations further includes synthetic data augmentation: It includes a label mixing generator that synthesizes pseudo-label vectors of rare combinations based on the statistical probability of disease co-occurrence and injects them into a self-attention layer for training; A focus loss function is introduced to give higher weight to rare combinations in order to balance the label distribution and improve the diagnostic accuracy of long-tail cases.
[0015] In some embodiments, the attention feature alignment further includes a dynamic domain awareness mechanism: It includes an auxiliary domain classifier that estimates the domain feature embeddings of the input image in real time and adjusts the consistency loss weights accordingly, reducing the alignment strength when the domain differences are large and strengthening the alignment when the differences are small. The alignment objective is elevated from the vector level to the distribution level, and the similarity of the attention distribution is measured using the Wasserstein distance metric.
[0016] Secondly, the present invention provides an interpretable single-domain generalization system for implementing the method described above, comprising: The dual-branch feature extraction module is used to perform dual-branch input processing, process the original image samples and the enhanced image samples in parallel, and obtain the feature representations of the original image samples and the enhanced image samples. The feature guidance module is used to apply a feature guidance mechanism, which uses interpretable signals to weight and guide features to focus on clinically relevant areas; The domain-invariant feature filtering module is used to extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes. The label association and attention module is used to model the association between disease labels. It learns the correlation between label vectors through an attention mechanism and calculates the probability of each label in the image. The feature alignment and classification module is used to perform attention feature alignment and multi-label classification, and to constrain the consistency of attention vectors in different branches.
[0017] Compared with the prior art, the present invention has at least the following beneficial effects: First, through a dual-branch architecture and domain-invariant feature filtering mechanism, the model can learn feature representations insensitive to distribution changes from single-source domain data, significantly reducing dependence on target domain data and overcoming deployment limitations imposed by medical data barriers. Second, by introducing an attention mechanism for label association modeling, the system can effectively capture coexistence relationships among multiple diseases, improving its adaptability to complex clinical scenarios. Finally, the feature guidance mechanism deeply integrates interpretability signals into the training process, ensuring that model decisions are based on clinically relevant lesion features, enhancing the credibility and traceability of the results. The organic combination of these technical aspects enables the model to achieve a synergistic enhancement effect in terms of generalization, multi-label diagnostic capabilities, and interpretability.
[0018] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0019] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases in one embodiment.
[0021] Figure 2 This is a schematic diagram of the overall process architecture of an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases in one embodiment.
[0022] Figure 3 This is a schematic diagram of the framework of an interpretable single-domain generalization system for multi-label classification of ophthalmic diseases in one embodiment. Detailed Implementation
[0023] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0025] In the description of this invention, when a specific device is described as being located between a first device and a second device, an intermediary device may or may not be present between the specific device and the first or second device. When a specific device is described as being connected to other devices, the specific device may be directly connected to the other devices without an intermediary device, or it may not be directly connected to the other devices but may have an intermediary device.
[0026] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0027] The applicant discovered: In clinical practice, the insufficient generalization ability of deep learning-based computer-aided diagnostic technologies is a core challenge. To address this issue, existing technologies primarily explore generalization techniques based on transfer learning / domain adaptation. While these have achieved some success, they still suffer from the following drawbacks in real-world clinical applications: (1) The strong dependence of domain adaptation methods on target domain data is not suitable for clinical practice. Domain adaptation methods require data from the target domain (e.g., a newly partnered hospital) to be available during the model training phase. However, in real-world medical scenarios, due to strict patient privacy regulations (such as the Personal Information Protection Law), data barriers between hospitals, and trade secrets, it is extremely difficult, or even impossible, to centrally acquire data from multiple target domains during the development phase. This makes it difficult to meet the prerequisites for the application of domain adaptation methods in reality, even though they are effective.
[0028] (2) Existing methods are mostly designed for single-label classification and cannot effectively handle common multi-label clinical scenarios. In clinical practice, a patient may have multiple eye diseases at the same time, and a single fundus image may contain multiple lesion features. However, a large number of existing studies and technical solutions focus on single-label classification (i.e., one image corresponds to only one disease). This simplified task setting does not match the complex clinical reality, resulting in the model's inability to identify and diagnose multiple coexisting diseases, which greatly limits its clinical applicability.
[0029] (3) Existing methods lack interpretability in fundus disease screening. On the one hand, due to the lack of intuitive decision-making evidence, doctors find it difficult to understand and verify the diagnostic logic of the model, leading to a crisis of clinical trust. This "black box" decision-making model makes it impossible for doctors to confirm whether the model is based on medically reasonable image features, causing them to be cautious in actual diagnosis. On the other hand, when the model's predictive performance declines, researchers cannot intuitively trace the root cause of the error, making it difficult to analyze whether the model focuses on the wrong area (such as image artifacts, noise, and other irrelevant features) or misses key lesion features. This lack of transparency in the decision-making process makes model optimization lack a clear direction.
[0030] In other words, in order to overcome the shortcomings of the prior art, the present invention aims to: (1) In response to the problem that "domain adaptation methods are strongly dependent on target domain data", the technical problem to be solved by the present invention is: under the premise of training using only a single source domain (such as ophthalmology data from a single medical institution) and without relying on any target domain data, the model can be effectively generalized to new clinical environments with different data distributions (such as fundus images from other hospitals), thereby overcoming the model deployment obstacles caused by medical data privacy barriers.
[0031] (2) In response to the problem that “existing methods cannot effectively handle multi-label clinical scenarios”, the technical problem to be solved by the present invention is to realize end-to-end multi-label fundus disease classification, so that it can accurately identify one or more diseases that may coexist in the same fundus image, and improve the classification accuracy by modeling the intrinsic correlation between disease labels, so that it is more in line with the complex clinical diagnosis reality.
[0032] (3) In view of the problem of “insufficient interpretability of existing methods”, the technical problem to be solved by the present invention is to integrate the interpretability mechanism into the model training process and generate a visual basis (such as heat map) that is highly consistent with the model decision logic. This can provide doctors with intuitive and credible decision references to enhance clinical trust, and provide researchers with a clear debugging direction to optimize the model, ensuring that the model focuses on clinically relevant lesion features.
[0033] In view of this, refer to Figure 1 and Figure 2In a first aspect, embodiments of this application propose an interpretable single-domain generalization method for multi-label classification of ophthalmic diseases, comprising the following steps: By employing dual-branch input processing, feature representations of the original image samples and the enhanced image samples are obtained; dual-branch input processing also addresses the issue of feature diversity under a single source domain. A feature-guided mechanism is applied, which uses interpretable signals to weight and guide features to focus on clinically relevant areas; Extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes; Model the correlation between disease labels, learn the correlation between label vectors through an attention mechanism, and calculate the probability of each label in the image; Perform attention feature alignment to constrain the consistency of attention vectors across different branches.
[0034] It should be noted that the original image samples and the augmented image samples are input into a feature extraction network with shared weights to generate multi-view feature representations. The feature guidance mechanism uses class activation mapping weights to spatially and channel-wise weight the features, forcing the model to focus on image regions relevant to clinical diagnosis. The domain-invariant feature filtering module generates a mask by calculating the similarity of bi-branch features to filter out feature components sensitive to domain changes, retaining feature representations with generalization capabilities. Label association modeling uses an attention mechanism to learn the intrinsic correlation between disease labels, and finally ensures the consistency of the model's decisions under different data augmentation perspectives through attention vector alignment. This series of operations synergistically solves the problems of domain shift, multi-label classification, and insufficient interpretability.
[0035] As one implementation method, dual-branch input processing includes: The original input image sample is augmented to generate augmented image samples, and the original image features F are obtained through a shared feature extraction network. ori and enhanced map features F aug ; Data augmentation includes at least one of brightness adjustment, rotation, or scaling to simulate changes in different clinical environments.
[0036] Data augmentation operations simulate imaging differences from different medical devices by adjusting brightness, rotating, or scaling, thereby enhancing the model's robustness to domain variations during the training phase. Shared weight design ensures consistency in the feature extraction network, avoiding additional bias introduced by parameter discrepancies.
[0037] As one implementation method, the feature-guided mechanism is implemented through Class Activation Map (CAM) weights, including: Generate CAM heatmaps of the original image samples and extract CAM features F. cam ; Attention weights are calculated using spatial attention and channel attention modules to obtain the CAM attention weights for different regions of interest. weights and channel weights The original image features and the enhanced image features are weighted and guided using a residual connection method to obtain the original image guided features F. guidance_ori and enhanced graph-guided features F guidance_aug ,in: F guidance_ori =F ori *(1+α*spatial weights )*(1+β*channel weights ) α and β are the weighting coefficients for spatial attention and channel attention, respectively.
[0038] Specifically, F is calculated through the spatial / channel attention modules respectively. cam Spatial attention weights weights and channel attention weights weights Both attention modules are convolutional sequence networks, containing 1x1 convolutions, ReLU activation, and a sigmoid function. The spatial attention module additionally incorporates average / max pooling to capture local context, generating pixel-level weight maps that adaptively amplify the saliency of lesion regions while suppressing background noise. The channel attention module uses adaptive average pooling to compress the spatial dimension to obtain global statistics, learn channel dependencies, thereby enhancing the weights of disease texture-sensitive channels and suppressing noisy channels. The two weights are then applied weighted to F... ori and F aug Obtain cam-guided features F guidance_ori and F guidance_aug The weighted method employs a residual join mechanism, specifically: F guidance_ori =F ori *(1+α*spatial weights )*(1+β*channel weights ) α and β are the weighting coefficients for spatial attention and channel attention, respectively. Similarly, F is calculated. guidance_aug Residual weighting adds adaptive enhancements at the spatial / channel level to the original features. While keeping the core of the original features unchanged, it introduces attention adjustment to avoid over-guiding and damaging the original features.
[0039] The class activation mapping weights are generated through a pre-trained model and refined by spatial and channel attention modules. The residual connection method, while preserving the original feature information, introduces interpretable signals to guide the process; its mathematical expression is the coordinated adjustment of weighting coefficients and features. This implementation ensures that the model's focus on lesion regions is not lost due to feature transformations.
[0040] As one implementation method, extracting domain-invariant features includes: Calculate the similarity matrix between the guiding features of the original image and the guiding features of the enhanced image; A binary mask is generated through thresholding, and then multiplied by the guiding feature to obtain the original image domain-invariant feature F. invariance_ori and enhanced graph-invariant features F invariance_aug ; The similarity calculation uses cosine similarity or Euclidean distance, and the threshold is dynamically adjusted based on the training data.
[0041] A binary mask is generated through a similarity matrix and thresholding. Cosine similarity or Euclidean distance is used to quantify the consistency between features, while the dynamic threshold is adaptively adjusted according to the distribution of training data to avoid insufficient or excessive feature filtering caused by a fixed threshold. Element-wise multiplication of the mask with the features ultimately filters out feature components that are insensitive to domain changes.
[0042] As one implementation method, the modeling of the associations between disease labels uses a Transformer architecture, including a self-attention layer and a cross-attention layer: The self-attention layer models disease labels as learnable vectors and learns the intrinsic correlations between labels. The cross-attention layer uses the label vector as the query and the domain-invariant features as the key and value, and outputs the attention vector for each label. Extending to multimodal scenarios, label vectors integrate text descriptions and / or clinical prior knowledge to enhance the semantic representation of labels.
[0043] The self-attention layer encodes disease labels into learnable vectors and captures semantic relationships between labels through attention weights. The cross-attention layer uses the label vectors as queries and domain-invariant features as keys and values to calculate the probability of each disease's presence in the image. This implementation significantly improves the accuracy of multi-label classification.
[0044] As one implementation method, the aforementioned attention feature alignment includes: Calculate the consistency loss between the attention vectors of the original graph branch and the augmented graph branch, using Euclidean distance or distribution metric as the loss function; Furthermore, the consistency loss and classification loss are combined through joint optimization to train the model in an end-to-end manner.
[0045] Attention feature alignment is achieved through a consistency loss function. Euclidean distance or a distribution metric is used to quantify the difference between the two-branch attention vectors. The joint optimization strategy combines the consistency loss with the classification loss, enabling the model to simultaneously optimize generalization ability and classification accuracy during end-to-end training.
[0046] As one implementation method, the generation of CAM heatmaps relies on a pre-trained base model, which can introduce bias because the data distribution of the pre-trained model may differ from that in the ophthalmological field, causing the guiding features to deviate from the actual lesion areas. For example, if the pre-trained model is trained on natural images, its focus may not be applicable to subtle lesions in medical images, thus undermining the reliability of interpretability. This is a subtle but crucial issue because interpretability is the foundation of clinical trust; inaccurate guiding signals can mislead the model into focusing on irrelevant features.
[0047] Therefore, in this embodiment, the feature guidance mechanism also includes domain adaptive adjustment, which combines the output of the pre-trained model with prior ophthalmic knowledge: It includes a lightweight adapter module that compares and aligns pre-trained CAM features with ophthalmic prior knowledge to reduce domain bias. The lightweight adapter module dynamically adjusts the CAM weights based on key areas annotated by experts, ensuring that the guiding signal converges on the actual lesion features.
[0048] It should be noted that a lightweight adapter module is introduced in the early stages of training. This module takes pre-trained CAM features as input and aligns them with key regions (such as vascular structures and lesion spots) annotated by ophthalmologists through contrastive learning, minimizing distribution differences. Simultaneously, the CAM weights are dynamically adjusted during training, prioritizing the weights of regions highly correlated with known lesions through a learnable attention gating mechanism. This embodiment achieves domain-specific optimization through fine-tuning the adapter.
[0049] As one implementation, the label association module learns the correlation between disease labels through self-attention. However, in clinical practice, data on rare disease combinations (such as the coexistence of glaucoma and cataracts) is sparse, which may lead to the model overfitting to common combinations and reducing the diagnostic accuracy for long-tail cases. This is a natural extension of some possible implementations, because the generalization ability of multi-label classification depends on the comprehensiveness of label relationships. Ignoring rare combinations will limit the robustness of the model in real-world scenarios.
[0050] Therefore, to overcome this problem, this embodiment also includes synthetic data augmentation in modeling label association: It includes a label mixing generator that synthesizes pseudo-label vectors of rare combinations based on the statistical probability of disease co-occurrence and injects them into a self-attention layer for training; A focus loss function is introduced to give higher weight to rare combinations in order to balance the label distribution and improve the diagnostic accuracy of long-tail cases.
[0051] Specifically, based on prior clinical knowledge (such as disease co-occurrence probability statistics), a label hybrid generator is constructed to synthesize pseudo-label vectors of rare combinations through interpolation or adversarial generation, and these vectors are injected into the training process of the self-attention layer. Simultaneously, a focus loss function is introduced to assign higher weights to rare combinations when calculating cross-attention, thus balancing the label distribution. This embodiment expands the label space without increasing data dependency and is compatible with the original Transformer architecture, enabling improved model sensitivity to marginal cases through minimal parameter adjustments.
[0052] As one implementation, the attention feature alignment module constrains the attention vectors of the original and augmented graph branches through consistency loss. However, in environments with significant domain shifts (such as differences in imaging equipment between different hospitals), perturbations in the augmented graph can cause the attention distribution to diverge, weakening the alignment effect. This is a subtle but important generalization flaw because inconsistent alignment can cause model decisions to fluctuate, affecting performance in unknown domains.
[0053] Therefore, to address this issue, this embodiment introduces a dynamic domain-aware alignment mechanism, incorporating a domain difference factor when calculating the consistency loss. Specifically, the attention feature alignment process also includes a dynamic domain-aware mechanism: It includes an auxiliary domain classifier that estimates the domain feature embeddings of the input image in real time and adjusts the consistency loss weights accordingly, reducing the alignment strength when the domain differences are large and strengthening the alignment when the differences are small. The alignment objective is elevated from the vector level to the distribution level, and the similarity of the attention distribution is measured using the Wasserstein distance metric.
[0054] It should be noted that an auxiliary domain classifier (lightweight CNN) estimates the domain feature embeddings of the input image in real time, and adjusts the weights of the consistency loss accordingly—reducing the alignment strength when domain differences are large to avoid over-constraint; and strengthening the alignment when differences are small. Simultaneously, the alignment objective is elevated from the vector level to the distribution level, using Wasserstein distance instead of simple Euclidean distance to better capture the overall similarity of the attention distribution. This embodiment is fine-tuned based on a dual-branch structure, and its adaptive capability is enhanced through a domain-aware module.
[0055] Reference Figure 3 Secondly, the present invention provides an interpretable single-domain generalization system for implementing the methods described in the above embodiments, comprising: The dual-branch feature extraction module is used to perform dual-branch input processing, process the original image samples and the enhanced image samples in parallel, and obtain the feature representations of the original image samples and the enhanced image samples. The feature guidance module is used to apply a feature guidance mechanism, which uses interpretable signals to weight and guide features to focus on clinically relevant areas; The domain-invariant feature filtering module is used to extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes. The label association and attention module is used to model the association between disease labels. It learns the correlation between label vectors through an attention mechanism and calculates the probability of each label in the image. The feature alignment and classification module is used to perform attention feature alignment and multi-label classification, and to constrain the consistency of attention vectors in different branches.
[0056] By leveraging the synergy of the dual-branch feature extraction module, feature guidance module, domain-invariant feature filtering module, label association and attention module, and feature alignment and classification module, the method described in the above embodiments is implemented, enabling a multi-label classification system that can generalize to unknown domains with only single-source domain training.
[0057] The following example illustrates the specific technical aspects: Reference Figure 2 , Figure 2 This embodiment provides an interpretable single-domain generalization system for multi-label classification of ophthalmic diseases. In this embodiment, a dual-branch parallel processing structure is adopted, including the original image branch and the enhanced image branch. Interpretable multi-label classification under single-domain generalization is achieved through three key technical steps: feature guidance, domain-invariant feature extraction, and label association modeling.
[0058] The detailed technical solution process is as follows in sequence: (1) Dual-branch feature extraction module: The input original image sample is first processed by data augmentation to generate augmented image samples, and both are then fed into a shared feature extraction network (using ResNet architecture). The original image branch obtains the original image features F. ori The augmented graph branch yields the augmented graph feature F. aug Simultaneously, a CAM heatmap of the original image samples is generated through a pre-trained base model. This heatmap is also used for CAM feature extraction to obtain the CAM feature F. cam Then, the spatial and channel attention modules are used to calculate the CAM attention weights for different regions of interest. weights and channel weights .
[0059] Among them, the dual-branch feature guidance mechanism achieves synergistic optimization of feature enhancement and interpretability guidance by parallel processing of the original graph branch and the enhanced graph branch, combined with CAM weight residual connection.
[0060] (2) Feature guidance module: The CAM weights are applied to the feature maps of the two branches through residual connections to obtain the original image guidance feature F. guidance_ori and enhanced graph-guided features F guidance_aug F guidance =F*(1+α*spatial weights )*(1+β*channel weights ), where α and β are the weighting coefficients for spatial attention and channel attention, respectively, and the degree of guidance can be manually controlled.
[0061] (3) Domain-invariant feature filtering module: This module extracts domain-invariant features through the following steps: First, calculate the similarity matrix between the guiding features of the original image and the guiding features of the enhanced image; then, generate a binary mask (set similar features to 1 and dissimilar features to 0) through thresholding; finally, multiply the mask matrix element-wise with the two guiding feature matrices to obtain the domain-invariant feature F of the original image. invariance_ori and enhanced graph-invariant features F invariance_aug .
[0062] Among them, the domain-invariant feature filtering module generates a binary mask through similarity calculation, effectively extracting feature representations that are insensitive to domain changes, and is the core technology for achieving single-domain generalization.
[0063] (4) Label Association and Attention Module: This module contains two layers of attention mechanisms: a self-attention layer, which models multiple disease labels as learnable label vectors, learns the correlation between labels through the Transformer self-attention mechanism, and outputs the associated label vectors; and a cross-attention layer, which uses the associated label vectors as the query and the domain-invariant feature F. invariance Using the Transformer cross-attention mechanism as the key and value, the probability of each label's presence in the image is calculated, and the attention vector is output.
[0064] Label association modeling: Disease labels are modeled as learnable vectors, and the intrinsic correlation between labels is explored through a self-attention mechanism to improve the accuracy of multi-label classification.
[0065] (5) Feature Alignment and Classification Module: This module performs multi-label classification by feeding the attention vectors of the two branches into the classifier to obtain the probability distribution of the predicted category and calculating the classification loss L. classification_ori and L classification_aug On the other hand, attention feature alignment is achieved by calculating the consistency loss L_consist between the attention vector of the original image and the attention vector of the enhanced image through the attention feature alignment module, so as to ensure the attention consistency of the two branches.
[0066] Attention feature alignment: Consistency loss is used to constrain the attention vectors of the original graph and the augmented graph branches to ensure the consistency of model decisions under different data perspectives.
[0067] Training and reasoning process: (1) During the training phase, the model is trained end-to-end by optimizing the three joint losses. The total loss is λ1×L. consist +λ2×L classification_ori +λ3×L classification_aug λ1, λ2, and λ3 are hyperparameters used to balance the contributions of various losses.
[0068] (2) In the inference stage, the test image of the unknown domain is input, and the model forward propagates to obtain the probability prediction of 8 types of diseases. At the same time, a CAM heat map is generated to provide doctors with decision-making basis.
[0069] In summary, compared with the prior art, the above embodiments have at least the following technical advantages: (1) Improve the generalization performance of the model in unknown domains. Through innovative domain-invariant feature filters and a two-branch consistency training mechanism, this invention demonstrates superior generalization ability on multiple external test sets when trained using only a single source domain data. Experimental results on the ODIR dataset show that the final performance score of the model in this invention reaches 78.83, which is significantly better than the baseline model's 75.45, proving its effectiveness in dealing with the domain shift problem and eliminating the dependence of traditional domain adaptation methods on target domain data.
[0070] (2) More clinically relevant multi-label diagnostic capabilities. This invention achieves accurate diagnosis of multiple coexisting fundus diseases through a Transformer architecture that models label correlation. Compared to existing single-label classification methods, this invention can simultaneously identify multiple diseases that may exist in a single fundus image, greatly improving the clinical applicability and diagnostic efficiency of the model.
[0071] (3) Deeply integrated interpretability enhances clinical credibility. This invention deeply integrates interpretable signals into the model training process, ensuring that the model focuses on clinically relevant areas through the CAM feature guidance mechanism. This not only provides doctors with intuitive and reliable decision-making basis and enhances clinical credibility, but also provides researchers with direction for analyzing model errors and making targeted improvements to the model.
[0072] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. An interpretable single-domain generalization method for multi-label classification of ophthalmic diseases, characterized in that, Includes the following steps: By using dual-branch input processing, feature representations of the original image samples and the enhanced image samples are obtained; A feature-guided mechanism is applied, using interpretable signals to weight and guide features to focus on clinically relevant areas; Extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes; Model the correlation between disease labels, learn the correlation between label vectors through an attention mechanism, and calculate the probability of each label in the image; Perform attention feature alignment to constrain the consistency of attention vectors across different branches.
2. The method as described in claim 1, characterized in that, The dual-branch input processing includes: The original input image sample is augmented to generate augmented image samples, and the original image features F are obtained through a shared feature extraction network. ori and enhanced map features F aug ; Data augmentation includes at least one of brightness adjustment, rotation, or scaling to simulate changes in different clinical environments.
3. The method as described in claim 1, characterized in that, The feature guidance mechanism is implemented through Class Activation Map (CAM) weights, including: Generate CAM heatmaps of the original image samples and extract CAM features F. cam ; Attention weights are calculated using spatial attention and channel attention modules to obtain the CAM attention weights for different regions of interest. weights and channel weights The original image features and the enhanced image features are weighted and guided using a residual connection method to obtain the original image guided features F. guidance_ori and enhanced graph-guided features F guidance_aug ,in: F guidance_ori =F ori *(1+α*spatial weights )*(1+β*channel weights ) α and β are the weighting coefficients for spatial attention and channel attention, respectively.
4. The method as described in claim 1, characterized in that, The extracted domain-invariant features include: Calculate the similarity matrix between the guiding features of the original image and the guiding features of the enhanced image; A binary mask is generated through thresholding, and then multiplied by the guiding feature to obtain the original image domain-invariant feature F. invariance_ori and enhanced graph-invariant features F invariance_aug ; The similarity calculation uses cosine similarity or Euclidean distance, and the threshold is dynamically adjusted based on the training data.
5. The method as described in claim 1, characterized in that, The modeling of the correlation between disease labels adopts a Transformer architecture, including a self-attention layer and a cross-attention layer: The self-attention layer models disease labels as learnable vectors and learns the intrinsic correlations between labels. The cross-attention layer uses the label vector as the query and the domain-invariant features as the key and value, and outputs the attention vector for each label. Extending to multimodal scenarios, the label vectors integrate textual descriptions and / or clinical prior knowledge to enhance the semantic representation of the labels.
6. The method as described in claim 1, characterized in that, The execution attention feature alignment includes: Calculate the consistency loss between the attention vectors of the original graph branch and the augmented graph branch, using Euclidean distance or distribution metric as the loss function; Furthermore, the consistency loss and classification loss are combined through joint optimization to train the model in an end-to-end manner.
7. The method as described in claim 3, characterized in that, The feature-guided mechanism also includes domain-adaptive adjustment: It includes a lightweight adapter module that compares and aligns pre-trained CAM features with ophthalmic prior knowledge to reduce domain bias. The lightweight adapter module dynamically adjusts the CAM weights based on key areas annotated by experts, ensuring that the guiding signal converges on the actual lesion features.
8. The method as described in claim 5, characterized in that, The modeling of label correlation also includes synthetic data augmentation: It includes a label mixing generator that synthesizes pseudo-label vectors of rare combinations based on the statistical probability of disease co-occurrence and injects them into a self-attention layer for training; A focus loss function is introduced to give higher weight to rare combinations in order to balance the label distribution and improve the diagnostic accuracy of long-tail cases.
9. The method as described in claim 6, characterized in that, The attention feature alignment process also includes a dynamic domain awareness mechanism: It includes an auxiliary domain classifier that estimates the domain feature embedding of the input image in real time and adjusts the consistency loss weight accordingly. When the domain difference is large, the alignment strength is reduced, and when the difference is small, the alignment is strengthened. The alignment objective is elevated from the vector level to the distribution level, and the similarity of the attention distribution is measured using the Wasserstein distance metric.
10. An interpretable single-domain generalization system for implementing the method as described in any one of claims 1-9, characterized in that, include: The dual-branch feature extraction module is used to perform dual-branch input processing, process the original image samples and the enhanced image samples in parallel, and obtain the feature representations of the original image samples and the enhanced image samples. The feature guidance module is used to apply a feature guidance mechanism, which uses interpretable signals to weight and guide features to focus on clinically relevant areas; The domain-invariant feature filtering module is used to extract domain-invariant features, generate a mask through similarity calculation, filter out domain-sensitive features, and retain feature representations that are insensitive to distribution changes. The label association and attention module is used to model the association between disease labels. It learns the correlation between label vectors through an attention mechanism and calculates the probability of each label in the image. The feature alignment and classification module is used to perform attention feature alignment and multi-label classification, and to constrain the consistency of attention vectors in different branches.