A single-domain generalization adversarial data augmentation method for medical images
By constructing a parameterized adversarial perturbation model and mutual information constraints, combined with the Lyapunov exponential feedback optimization strategy, the problem of insufficient generalization ability in the field of medical imaging was solved, and stable generalization and efficient diagnosis were achieved in different medical centers.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-09
AI Technical Summary
Existing generalization methods in the field of medical imaging suffer from inaccurate generation of distributions, unstable feature learning, and limited adaptability of optimization strategies when faced with differences in data distribution across different medical centers, resulting in insufficient generalization ability of the model in unknown domains.
A parameterized adversarial perturbation model is constructed, adversarial enhancement samples are generated through semantic transformation, and the single-domain generalization performance of the model is improved by combining mutual information constraints and Lyapunov exponential feedback optimization strategies.
It effectively eliminates redundant style biases, maintains semantic consistency, improves the model's adaptability and generalization performance in unknown domains, and reduces data collection and annotation costs.
Smart Images

Figure CN122176444A_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to domain generalization, and particularly relates to a single-domain generalized adversarial data augmentation method for medical images. Background Technology
[0002] With rapid socio-economic development and a significant increase in public health awareness, the demand for high-quality medical services has exploded. However, the uneven distribution of medical resources globally, coupled with the long training period and significant shortage of professional physicians, has resulted in persistent problems such as difficulty accessing medical care and misdiagnosis / missed diagnosis. Faced with massive amounts of patient data and complex pathological features, doctors are under constant high workloads, which not only limits diagnostic efficiency but also increases the risk of human error. Therefore, utilizing computer technology to assist doctors in making efficient and accurate diagnoses has become an urgent need to alleviate medical pressure and improve the quality of public health services. In recent years, the rapid development of computer technology, especially breakthroughs in deep learning algorithms, has provided powerful solutions to these problems. Deep convolutional neural networks (CNNs), with their powerful feature extraction capabilities, end-to-end learning paradigm, and parameter sharing mechanism, have shown great potential in the field of medical image analysis. Unlike traditional methods of manually designing features, CNNs can automatically learn key information from low-level texture to high-level semantics from massive amounts of data. Currently, deep learning technology has been widely applied to the analysis of various human organs and imaging modalities. From brain MRI to lung CT, and then to fundus photography and pathological slides, artificial intelligence algorithms are assisting doctors in completing multiple tasks such as lesion identification, organ localization, and disease screening.
[0003] Domain generalization is a key technology for addressing differences in data distribution, especially important when training and application data distributions differ. Unlike domain adaptation, domain generalization assumes the target domain is completely inaccessible during training. Current research on domain generalization mainly falls into three categories: data manipulation, representation learning, and learning strategies. Data manipulation methods expand the data distribution range by transforming, enhancing, or synthesizing training data, thereby improving the model's adaptability to unknown domains. Common methods include data augmentation, style transfer, generative adversarial networks (GANs) to generate new samples, and perturbations based on the frequency domain or color space. These methods artificially construct potential domain shifts, exposing the model to more diverse data distributions during training. The advantages are relatively simple implementation, no reliance on complex model structures, and direct improvement in data diversity. The disadvantages are that the generated data distribution may differ significantly from the true target domain, and excessive data perturbation may damage the original semantic information. Representation learning methods design specific network structures or constraints to enable the model to learn feature representations with cross-domain stability. Typical methods include adversarial learning, contrastive learning, feature decoupling, and invariant risk minimization. Their goal is to extract task-relevant and domain-independent semantic features, thereby reducing distributional differences between different domains. The advantage is the ability to learn domain-invariant representations at the feature level, theoretically resulting in stronger generalization ability. However, significant drawbacks include complex model structures and training strategies, poor training stability, and sensitivity to hyperparameters. Learning strategy methods improve generalization ability by modifying the model's optimization methods or training mechanisms. For example, meta-learning strategies improve model adaptability by simulating training-test distribution differences; regularization methods limit model complexity or constrain the parameter space; and optimization strategies improve the model's convergence path by adjusting the learning rate or gradient update method. The advantages are that they do not require large amounts of additional data or complex generative models and can be directly applied to the training process. The disadvantages are that improvements often depend on the specific task and model structure, and the improvement in generalization ability is somewhat unstable. The three methods improve the cross-domain generalization ability of the model from the data layer, feature layer and optimization layer respectively, but there are still problems such as inaccurate generation distribution, unstable feature learning and limited adaptability of optimization strategy. Therefore, how to integrate multiple strategies to further improve the domain generalization performance is still an important research direction. Summary of the Invention
[0004] To address the aforementioned issues, this invention proposes a single-domain generalized adversarial data augmentation method for medical images. A parameterized adversarial perturbation model is constructed to apply semantic transformations to the images, generating adversarial augmentation samples that simulate potential domain shifts. Simultaneously, a feature-level objective function is constructed based on mutual information constraints to suppress domain style bias and maintain semantic consistency. A LEAwareSGD optimization strategy is proposed and combined with adversarial data augmentation. By dynamically adjusting the learning rate based on the Lyapunov exponent, the training process is guided to near the chaotic edge, improving the single-domain generalization performance for medical images. The network structure framework is as follows: Figure 1 As shown. The specific technical solution is as follows:
[0005] A single-domain generalized adversarial data augmentation method for medical images includes the following steps:
[0006] Step 1) Obtain a medical fundus image dataset, divide the dataset into training, validation and test sets according to the proportion, and preprocess the data to obtain initial images;
[0007] Step 2) Construct a parameterized adversarial perturbation model, apply a semantic transformation controlled by adversarial parameters to the initial image, and generate adversarial enhancement samples that simulate potential domain shifts in order to actively expose the performance vulnerabilities of the model in a single source domain.
[0008] Step 3) Input the initial image and the adversarial enhancement sample into the feature extraction network to extract the deep semantic representation of the image, and obtain the original feature map and the enhanced feature map respectively, so as to ensure that the network can capture key diagnostic information such as lesion structure or object contour;
[0009] Step 4) Construct a feature-level objective function based on the mutual information constraint mechanism. Eliminate redundant style bias by minimizing the mutual information between features and domain labels, while maximizing the semantic consistency between the enhanced feature map and the original feature map in the feature space, forming a maximum-minimum game between generative adversarial perturbation and model feature extraction.
[0010] Step 5) Employ the LEAwareSGD optimization strategy during model training: monitor the convergence of the training trajectory in real time and calculate the parameter space perturbation. The corresponding change in the Lyapunov exponent (LE) A learning rate adjustment mechanism based on LE dynamic feedback is established to guide the model parameters to evolve to a chaotic edge state that balances stability and adaptability.
[0011] Step 6) Construct a joint loss function by combining the predicted classification loss, the feature consistency constraint distance from Step 4, and the weight decay term that ensures the Hessian matrix is approximately positive definite. Use the LEAwareSGD optimization strategy described in Step 5 to supervise the training of the single-domain generalization classification model. Select the classification model with the best generalization performance on the validation set to process the test dataset and output the final medical image classification results.
[0012] Furthermore, step 1) above includes:
[0013] Step 1.1 Download the APTOS, DeepDR, Messidor, IDRID, FGADR, and RLDR medical fundus image datasets from open-source dataset websites;
[0014] Step 1.2: Each dataset is proportionally divided into a training set, a validation set, and a test set;
[0015] Step 1.3 The image resolution is uniformly scaled to 224×224 pixels. The scaled image is then cropped at the center, and pixel-level normalization is performed using the mean and standard deviation. At the same time, contrast-limited adaptive histogram equalization is used to enhance the significance of retinal blood vessels and microbleeds.
[0016] Furthermore, the semantic transformation with adversarial parameter control in step 2) specifically includes: constructing a differentiable color transformation operator to dynamically adjust the image's hue, saturation, brightness, and contrast under adversarial parameter control. Let the input image be... The color transformation process can be represented as:
[0017] (1)
[0018] Where α represents the contrast adjustment coefficient, β represents the brightness offset, and μ is the image mean. To counteract the set of parameters, contrast, brightness, saturation, and hue changes are controlled individually. This is achieved through... The dynamic updates can simulate the imaging deviations produced by different medical center acquisition equipment.
[0019] Furthermore, a frequency domain perturbation mechanism is introduced. By performing a fast Fourier transform on the image, adversarial perturbation noise is injected into the amplitude spectrum while preserving the structural information in the phase spectrum, thus generating enhanced samples with different illumination distribution patterns. These adversarial parameters are alternately updated by maximizing the prediction classification loss, thereby generating extremely difficult offset samples that simulate different equipment and illumination environments in clinical settings.
[0020] Furthermore, the specific implementation of feature extraction in step 3) is as follows: the feature extraction network uses a ResNet50 structure to perform hierarchical feature extraction on the image. The input image is first subjected to initial feature encoding through a 7×7 convolution with a stride of 2, and then sequentially extracted layer by layer through four residual stages. Each residual stage consists of multiple bottleneck residual blocks. Each bottleneck residual block consists of three convolutional layers: 1×1, 3×3, and 1×1. The first 1×1 convolution is used to reduce the channel dimension, the second 3×3 convolution is used to extract spatial features, and the third 1×1 convolution is used to restore the channel dimension. Feature fusion is achieved through residual connections. The specific mathematical representation is as follows:
[0021] (2)
[0022] (3)
[0023] (4)
[0024] (5)
[0025] in, This represents a convolution operation with a kernel size of k×k. This represents the output features of the residual block. (Original image) With adversarial enhancement images Feature encoding is performed by inputting the shared-weights feature extraction network in batches.
[0026] (6)
[0027] in This represents the ResNet50 feature extraction function. The output size in the fourth residual stage is... The deep feature map Z is then mapped to a vector representation using a global average pooling layer.
[0028] (7)
[0029] Where H and W represent the height and width of the feature map, respectively. The final result is a 2048-dimensional semantic feature vector v. , representing the original semantic vector and the enhanced semantic vector, respectively, are used for subsequent feature consistency constraints and classification decisions.
[0030] Furthermore, the feature-level objective function based on mutual information constraints in step 4) further includes: constructing a feature decoupling projector. The enhanced semantic vector z is mapped to the decoupled feature space and decomposed into category-related diagnostic features and device-specific domain-style features, as shown in the following mathematical expression:
[0031] (8)
[0032] in, Indicates diagnostic features related to the category. This indicates the domain style characteristics associated with a specific device.
[0033] Furthermore, by utilizing a mutual information estimation network, the mutual information between diagnostic features and the original semantic vector is maximized, forcing the model to anchor the core semantics of the lesion even when facing adversarial perturbations, thus maintaining the stability of classification prediction. By minimizing the mutual information between domain style features and feature maps through adversarial training, redundant style information generated by adversarial perturbations is eliminated, enabling the network to learn robust common representations with cross-center generalization ability.
[0034] Furthermore, the LEAwareSGD optimization strategy in step 5) is specifically as follows:
[0035] Step 5.1 Define the difference dynamics equations for the evolution of model parameters. Let the current iteration step be... The model parameters are The perturbation of the evolution space of the parameters under gradient update is: The average expansion rate of the local tangent space is estimated by tracking the length of the weight change vector between two consecutive iterations, thereby calculating the current Lyapunov exponent. And calculate the change in Lyapunov exponent between adjacent iteration steps. ;
[0036] Step 5.2 Based on the change Dynamically adjust the learning rate. When When this occurs, it indicates that the parameter update trajectory has entered an oscillation or chaotic range, and the learning rate is reduced exponentially according to the following formula:
[0037] (9)
[0038] in, The learning rate for the current iteration step. For the updated learning rate, is a weight parameter used to control the sensitivity of the learning rate to changes in stability.
[0039] Furthermore, conversely, when When this occurs, it indicates that the system is in a stable state or is regressing to stability. At this point, the learning rate is kept constant, i.e., set to a constant value. In order to maintain the current effective rate of exploration of the feature space.
[0040] Step 5.3 uses the dynamic feedback control mechanism based on the Lyapunov exponent to guide the model to find the flat minimum region of the loss surface in the gradient field. This mechanism forces the model optimization process to remain at the critical stable edge where the Lyapunov exponent is close to zero, so that the model can maintain the stability of its memory of the semantic features of the source domain medical images during adversarial training, and also has the ability to explore and adapt to the distribution shift of unknown target domains, thereby improving the single-domain generalization performance.
[0041] The construction of the joint loss function in step 6) specifically involves: joint loss function Classification cross-entropy loss Feature space consistency loss and weight decay regularization term The weighted composition, its overall objective function is expressed as:
[0042] (10)
[0043] in, The consistency coefficient, These are the weighting coefficients.
[0044] Furthermore, the classification cross-entropy loss The formula used to measure the deviation between the model's predicted class probability distribution and the true label is:
[0045] (11)
[0046] in, For sample batch size, The total number of categories. For the sample Category The true label, This represents the predicted probability output by the model.
[0047] Furthermore, the feature space consistency loss By calculating the original semantic vector With enhanced semantic vectors The Euclidean distance between them forces the model to ignore the adversarial parameters. Introducing noise, and focusing on medical anatomical features, the calculation formula is:
[0048] (12)
[0049] in, This represents a feature extraction network. This represents the adversarial transformation function.
[0050] Furthermore, the weight decay regularization term By constraining the model weight parameters of The norm modulus ensures that the Hessian matrix of the objective function remains approximately positive definite during the iteration process, and its formula is expressed as:
[0051] (13)
[0052] In particular, by optimizing the geometric topology of the loss surface, the Lyapunov exponent-guided optimization algorithm can be used to improve the convergence speed and inference stability of the model under complex perturbations.
[0053] After training, the model can automatically identify pathological features in medical images and output classification diagnostic results including normal, diabetic retinopathy, glaucoma, and macular degeneration. Because the joint loss function introduces exploration of distribution shifts and semantic consistency constraints during training, the model possesses the ability to generalize directly to unseen third-party medical center data.
[0054] Compared with the prior art, the present invention has the following advantages:
[0055] 1. This invention proposes a single-domain generalized adversarial data augmentation method for medical images. By constructing a parameterized adversarial perturbation model, the color attributes and frequency domain information of the image are controlled to generate augmented samples that simulate different medical center equipment and lighting conditions. This actively exposes the potential vulnerabilities of the model under single source domain training conditions and improves the model's adaptability to changes in the distribution of data in unknown domains.
[0056] 2. This invention constructs a dual-input feature learning mechanism of original image and adversarial enhancement sample, and simultaneously inputs the two types of samples into a deep convolutional network with shared weights for feature extraction. This enables the model to adapt to different data distribution changes while learning task-related semantic features, thereby improving the stability and robustness of deep feature representation.
[0057] 3. In the feature learning stage, this invention introduces a feature decoupling mechanism based on mutual information constraints. By maximizing the mutual information between diagnostic semantic features and minimizing the mutual information between domain style features, the model can effectively eliminate redundant style information caused by device differences or lighting changes, thereby learning a more stable cross-domain semantic representation.
[0058] 4. This invention introduces a LEAwareSGD optimization strategy based on Lyapunov exponential feedback during model training. By monitoring the stability of the parameter update trajectory in real time and dynamically adjusting the learning rate, the model is guided to converge in the flat minimum region of the loss function, enabling the model to have stronger exploration and generalization capabilities while maintaining training stability.
[0059] 5. This invention constructs a joint optimization objective by combining classification loss, feature consistency constraint, and weight decay regularization term, so that the model can maintain semantic consistency between the original samples and the augmented samples while ensuring classification accuracy, thereby improving the convergence stability and prediction reliability of the model under complex perturbation conditions.
[0060] 6. This invention can significantly improve the model's generalization ability on data from unknown medical centers without relying on a large amount of multi-center labeled data, effectively reducing the cost of medical image data acquisition and labeling, and providing more stable and reliable technical support for the deployment of medical image-assisted diagnostic systems in actual clinical environments. Attached Figure Description
[0061] To make the technical solution of the present invention clearer, the present invention provides the following drawings for illustration:
[0062] Figure 1 A flowchart for a single-domain generalized adversarial data augmentation method for medical images;
[0063] Figure 2 A diagram illustrating a single-domain generalized adversarial data augmentation framework for medical images;
[0064] Figure 3 A schematic diagram of the optimization strategy structure for LEAwareSGD. Detailed Implementation
[0065] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0066] A single-domain generalized adversarial data augmentation method for medical images includes the following steps:
[0067] Step 1) Download six medical fundus image datasets from open-source dataset websites: APTOS, DeepDR, Messidor, IDRID, FGADR, and RLDR. For each dataset, randomly divide it into training, validation, and test sets in a 7:1:2 ratio. Patient samples from different subsets are strictly isolated. In the experiment, a single dataset is selected as the source domain for model training, while the remaining datasets are used as the target domain for generalization performance evaluation. The original images undergo unified preprocessing; here, using the APTOS dataset as an example, the initial training images have a resolution of 224×224 and 3 channels. The scaled image is cropped at the center to remove black background noise areas at the image edges. Pixel-level normalization is performed on each channel of the image using the statistical mean and standard deviation of the dataset, mapping pixel values to a standard normal distribution and eliminating overall brightness differences between different datasets. Finally, a contrast-limited adaptive histogram equalization algorithm is used to enhance the local contrast of the normalized image. After the above preprocessing steps, the original image is transformed into a standard initialized image with a shape of 224×224×3, laying the foundation for subsequent adversarial example generation and feature extraction.
[0068] Step 2) specifically includes the semantic transformation against parameter control, which involves constructing a differentiable color transformation operator. Let the input image be... By opposing the set of parameters Dynamic semantic transformations of the image are performed by controlling contrast, brightness, saturation, and hue separately. The mathematical expression for color transformation is:
[0069] (1)
[0070] Where α represents the contrast adjustment coefficient, β represents the brightness offset, and μ is the image mean. By analyzing... The dynamic update of the parameter θ can simulate imaging deviations produced by different medical center acquisition devices. This includes common image quality variations in real-world scenarios such as overexposure, underexposure, and color temperature deviation.
[0071] A frequency domain perturbation mechanism is introduced, transforming the image from the spatial domain to the frequency domain through a Fast Fourier Transform (FFT). Adversarial perturbation noise is injected into the amplitude spectrum to alter the illumination distribution pattern and texture statistics of the image; simultaneously, the structural semantic information carried by the phase spectrum is fully preserved, ensuring that the spatial topology of the lesion region is not disrupted. An Inverse Fast Fourier Transform is then performed on the perturbated frequency domain signal to restore it to the spatial domain, yielding enhanced samples containing different illumination distribution patterns, effectively simulating domain shift phenomena under different equipment and lighting conditions in clinical settings.
[0072] By maximizing the classification prediction loss, the adversarial parameter θ is updated alternately in a gradient ascent manner to iteratively generate extremely difficult offset samples that are most challenging to the current classification model:
[0073] (2)
[0074] in, For feature extraction and classification networks, Let y be the true label and y be the cross-entropy loss for classification. The augmented samples generated through the aforementioned adversarial parameter optimization process... It can fully expose the vulnerability of the model to the dependence on the source domain distribution, and provide stronger supervision signals for subsequent learning of domain-invariant features.
[0075] The specific implementation of feature extraction in step 3) is as follows: The feature extraction network uses a ResNet50 structure to perform hierarchical feature extraction on the image. The input image is first initialized by a 7×7 convolution with a stride of 2, and then sequentially extracted layer by layer through four residual stages. Each residual stage consists of multiple bottleneck residual blocks. Each bottleneck residual block consists of three convolutional layers: 1×1, 3×3, and 1×1. The first 1×1 convolution is used to reduce the channel dimension, the second 3×3 convolution is used to extract spatial features, and the third 1×1 convolution is used to restore the channel dimension. Feature fusion is achieved through residual connections. The specific mathematical representation is as follows:
[0076] (3)
[0077] (4)
[0078] (5)
[0079] (6)
[0080] in, This represents a convolution operation with a kernel size of k×k. This represents the output features of the residual block. (Original image) With adversarial enhancement images Feature encoding is performed by inputting the shared-weights feature extraction network in batches.
[0081] (7)
[0082] in This represents the ResNet50 feature extraction function. The output size in the fourth residual stage is... The deep feature map Z is then mapped to a vector representation using a global average pooling layer.
[0083] (8)
[0084] Where H and W represent the height and width of the feature map, respectively. The final result is a 2048-dimensional semantic feature vector v. , representing the original semantic vector and the enhanced semantic vector, respectively, are used for subsequent feature consistency constraints and classification decisions.
[0085] Step 4) further includes the feature-level objective function based on mutual information constraints, which further includes: constructing a feature decoupling projector. The enhanced semantic vector z is mapped to the decoupled feature space and decomposed into category-related diagnostic features and device-specific domain-style features, as shown in the following mathematical expression:
[0086] (9)
[0087] in, Indicates diagnostic features related to the category. This indicates the domain style characteristics associated with a specific device.
[0088] By using a mutual information estimation network, the model is forced to anchor the core semantics of the lesion even when facing adversarial perturbations by maximizing the mutual information between diagnostic features and the original semantic vector, thus maintaining the stability of classification prediction. By minimizing the mutual information between domain style features and feature maps through adversarial training, redundant style information generated by adversarial perturbations is eliminated, enabling the network to learn robust common representations with cross-center generalization ability.
[0089] Step 5) Quantify the stability of the model during adversarial training from a dynamic perspective, and establish a perturbation model of parameter evolution. The core of the Lyapunov exponent is to measure the rate of evolution of model parameters to small perturbations during training. Let the model parameters at time t be... The standard stochastic gradient descent update formula can be expressed as:
[0090] (10)
[0091] in, For learning rate, Let be the loss function. To examine the sensitivity of the training trajectory to initial conditions, a very small initial perturbation is introduced into the parameter space. The perturbated parameter sequence is defined as follows: Its evolution follows the following dynamic equation:
[0092] (11)
[0093] The update rule for the perturbation term δθ in a single iteration:
[0094] (12)
[0095] Analyze the propagation characteristics of this perturbation and the gradient of the loss function. exist Perform a first-order Taylor expansion at this point:
[0096] (13)
[0097] In the formula, Let Hessian be the loss function with respect to the parameters. These are higher-order terms. Ignoring higher-order terms, the evolution of the perturbation term can be approximated as a linear transformation driven by the Hessian matrix, which can be recursively applied to obtain the propagation form of the perturbation over long-term sequences:
[0098] (14)
[0099] Step 6) Based on the perturbation dynamics model in Step 5), further derive the mathematical relationship between the Lyapunov exponent (LE) and the optimization hyperparameters, providing a core criterion for the design of the LEAwareSGD optimizer. According to the definition of a dynamic system, LE is used to quantify the average exponential divergence or convergence rate of adjacent trajectories over time:
[0100] (15)
[0101] By utilizing the submultiplicativity of matrix norms, we derive the theoretical boundaries between the model learning rate η, the Hessian matrix, and system stability:
[0102] (16)
[0103] The above inequality establishes an analytical relationship between the loss surface (LE) and the learning rate, revealing that the stability of the optimization process depends not only on the local geometric properties of the loss surface, but also directly on the learning rate. .when At that time, the system is in the chaotic divergence region; when At that time, the system is in the over-convergence region; while Corresponding to the chaotic edge of the training trajectory, in this critical state, the model simultaneously possesses the stability of memory of source domain features and the ability to explore and adapt to new distributions.
[0104] Step 7) During model training, the LEAwareSGD optimization strategy is adopted. This strategy monitors the convergence of the training trajectory in real time and adaptively adjusts the learning rate based on the dynamic feedback signal of the Lyapunov exponent, guiding the model parameters to evolve to a chaotic edge state that balances stability and adaptability.
[0105] Step 7.1 Parameter Initialization and Gradient Update. Given initial model parameters... Initial learning rate The parameters include the weight parameter β, the maximum number of iterations N, and the current iteration step t. At each iteration step t, the current parameter is first calculated. gradient of the loss function at point Perform standard parameter updates:
[0106] (17)
[0107] Step 7.2 Update the parameter space perturbation vector. After the parameters have been updated using gradients, update the space perturbation. This involves tracking the change vector of weights between two consecutive iterations. The Lyapunov exponent is calculated. By tracking the change in the length of the perturbation vector, the average expansion rate of the local tangent space of the parameter space is estimated, yielding the Lyapunov exponent for the current iteration step. This allows for the calculation of the change in the Lyapunov exponent between adjacent iteration steps. .
[0108] Step 7.3 Dynamically adjust the learning rate based on ΔLE. When When this occurs, it indicates that the parameter update trajectory has entered an oscillating or chaotic range, and the training instability increases. At this point, the learning rate is reduced exponentially according to the following formula:
[0109] (18)
[0110] in, The learning rate for the current iteration step. For the updated learning rate, is a weighting parameter used to control the sensitivity of the learning rate to changes in stability. Conversely, when When this occurs, it indicates that the system is in a stable state or is regressing to stability. At this point, the learning rate is kept constant, i.e., set to a constant value. In order to maintain the current effective rate of exploration of the feature space.
[0111] Step 7.4 determines whether all iterations have been completed. When Repeat steps 7.1 to 7.3; when the maximum number of iterations is reached, output the optimal model parameters. .
[0112] Step 8) involves constructing the joint loss function as follows: Joint Loss Function Classification cross-entropy loss Feature space consistency loss and weight decay regularization term The weighted composition, its overall objective function is expressed as:
[0113] (19)
[0114] in, The consistency coefficient, These are the weighting coefficients.
[0115] The classification cross-entropy loss The formula used to measure the deviation between the model's predicted class probability distribution and the true label is:
[0116] (20)
[0117] in, For sample batch size, The total number of categories. For the sample Category The true label, This represents the predicted probability output by the model.
[0118] The feature space consistency loss By calculating the original semantic vector With enhanced semantic vectors The Euclidean distance between them forces the model to ignore the adversarial parameters. Introducing noise, and focusing on medical anatomical features, the calculation formula is:
[0119] (twenty one)
[0120] in, This represents a feature extraction network. This represents the adversarial transformation function.
[0121] The weight decay regularization term By constraining the model weight parameters of The norm modulus ensures that the Hessian matrix of the objective function remains approximately positive definite during the iteration process, and its formula is expressed as:
[0122] (twenty two)
[0123] In particular, by optimizing the geometric topology of the loss surface, the Lyapunov exponent-guided optimization algorithm can be used to improve the convergence speed and inference stability of the model under complex perturbations.
[0124] Step 9) After training, the classification model with the best generalization effect on the validation set is selected to process the test dataset and output the final medical image classification result. For the input fundus image to be tested, normalization and contrast-limited adaptive histogram equalization are performed according to the preprocessing procedure in Step 1 to obtain a standardized input image. Then, it is input into the trained ResNet50 feature extraction network, and a 2048-dimensional semantic feature vector is extracted through a global average pooling layer. Finally, the feature vector is mapped to a 4-dimensional classification probability output through a fully connected classification head, and after Softmax normalization, the class with the highest probability is taken as the final prediction result. The proposed method achieves the best overall performance with an average AUC accuracy of 76.1%, ACC accuracy of 51.6%, and F1 accuracy of 35.1% across six datasets.
[0125] The technical content and features of the present invention have been explained through the above embodiments. However, those skilled in the art may still make equivalent substitutions or appropriate improvements based on the disclosure of the present invention. It should be noted that all changes and improvements made by those skilled in the art without departing from the basic principles of the present invention shall fall within the protection scope defined by the claims of the present invention.
Claims
1. A single-domain generalized adversarial data augmentation method for medical images, characterized in that: The method includes the following steps: Step 1) Obtain a medical fundus image dataset, divide the dataset into training, validation and test sets according to the proportion, and preprocess the data to obtain initial images; Step 2) Construct a parameterized adversarial perturbation model, apply a semantic transformation controlled by adversarial parameters to the initial image, and generate adversarial enhancement samples that simulate potential domain shifts in order to actively expose the performance vulnerabilities of the model in a single source domain. Step 3) Input the initial image and the adversarial enhancement sample into the feature extraction network to extract the deep semantic representation of the image, and obtain the original feature map and the enhanced feature map respectively, so as to ensure that the network can capture key diagnostic information such as lesion structure or object contour; Step 4) Construct a feature-level objective function based on the mutual information constraint mechanism. Eliminate redundant style bias by minimizing the mutual information between features and domain labels, while maximizing the semantic consistency between the enhanced feature map and the original feature map in the feature space, forming a maximum-minimum game between generative adversarial perturbation and model feature extraction. Step 5) Employ the LEAwareSGD optimization strategy during model training: monitor the convergence of the training trajectory in real time and calculate the parameter space perturbation. The corresponding change in the Lyapunov exponent (LE) Establish a learning rate adjustment mechanism based on LE dynamic feedback to guide the model parameters to evolve to a chaotic edge state that balances stability and adaptability; Step 6) Construct a joint loss function by combining the predicted classification loss, the feature consistency constraint distance from Step 4, and the weight decay term that ensures the Hessian matrix is approximately positive definite. Use the LEAwareSGD optimization strategy described in Step 5 to supervise the training of the single-domain generalization classification model. Select the classification model with the best generalization performance on the validation set to process the test dataset and output the final medical image classification results.
2. The single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: Step 1) further includes: Step 1.1 Download the APTOS, DeepDR, Messidor, IDRID, FGADR, and RLDR medical fundus image datasets from open-source dataset websites; Step 1.2 Each dataset is proportionally divided into training, validation, and test sets; Step 1.3 The image resolution is uniformly scaled to 224×224 pixels. The scaled image is then cropped at the center, and pixel-level normalization is performed using the mean and standard deviation. At the same time, contrast-limited adaptive histogram equalization is used to enhance the salience of retinal blood vessels and microbleeds.
3. The single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: The semantic transformation controlled by adversarial parameters in step 2) specifically includes: constructing a differentiable color transformation operator to dynamically adjust the image hue, saturation, brightness, and contrast under adversarial parameter control, simulating sensor biases of acquisition instruments in different medical centers. Simultaneously, a frequency domain perturbation mechanism is introduced. By performing a Fast Fourier Transform on the image, adversarial perturbation noise is injected into the amplitude spectrum while preserving structural information in the phase spectrum, generating enhanced samples with different illumination distribution patterns. These adversarial parameters are alternately updated by maximizing the prediction classification loss, generating extremely difficult-to-shift samples simulating different equipment and illumination environments in clinical settings.
4. The single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: The specific implementation of feature extraction in step 3) is as follows: The feature extraction network adopts a ResNet50 structure, consisting of a 7×7 convolution with a stride of 2 and four cascaded residual stages. Each residual stage contains multiple bottleneck block structures composed of 1×1, 3×3 and 1×1 convolutions. The original image and adversarial enhancement samples are input into the ResNet50 network with shared weights in batch form. High-level semantic features are extracted using the deep convolution kernels of the network. A deep feature map with a size of 7×7×2048 is output in the fourth residual stage. The deep feature map is mapped to a 2048-dimensional feature vector through a global average pooling layer, which are denoted as the original semantic vector and the enhanced semantic vector, respectively, for subsequent consistency measurement and classification decision.
5. A single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: The feature-level objective function based on mutual information constraints in step 4) further includes: constructing a feature decoupling projector to map the enhanced semantic vector to the decoupling feature space, decomposing it into category-related diagnostic features and device-specific domain style features; using a mutual information estimation network to maximize the mutual information between the diagnostic features and the original semantic vector, forcing the model to anchor the core semantics of the lesion even when facing adversarial perturbations, thus maintaining the stability of classification prediction; minimizing the mutual information between the domain style features and the feature map through adversarial training, eliminating redundant style information generated by adversarial perturbations, and enabling the network to learn robust common representations with cross-center generalization ability.
6. The single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: The LEAwareSGD optimization strategy in step 5) is as follows: Step 5.1 Define the differential dynamics equation for the evolution of model parameters. By tracking the length of the change vector of weights between two consecutive iterations, estimate the average expansion rate of the local tangent space, thereby obtaining the current Lyapunov exponent in real time. Step 5.2 When When this occurs, it indicates that the parameter update trajectory has entered an oscillation or chaotic range. The learning rate decreases exponentially, where This is a weighting parameter used to control the sensitivity of the learning rate to changes in stability. Conversely, a smaller learning rate indicates that the system is in a stable state or is regressing to stability; in this case, the learning rate is kept constant to maintain the current exploration rate. Step 5.3 Through dynamic feedback control, the model is guided to find the flat minimum region of the loss surface in the gradient field, and the model optimization process is maintained at a stable edge where the Lyapunov exponent is close to zero. This not only maintains the stability of the semantic features of the source domain, but also has the ability to explore and adapt to the distribution shift.
7. A single-domain generalized adversarial data augmentation method for medical images according to claim 1, characterized in that: The construction of the joint loss function in step 6) is as follows: The joint loss function is composed of classification cross-entropy loss, feature space consistency loss, and weight decay regularization term. Among them, classification cross-entropy loss is used to measure the deviation between the predicted category and the true label; feature space consistency loss forces the model to ignore adversarial noise and focus on anatomical structure by calculating the Euclidean distance between the original semantic vector and the enhanced semantic vector; weight decay regularization term ensures that the Hessian matrix of the objective function is approximately positive definite by constraining the weight magnitude, thereby optimizing the geometric topology of the loss surface and improving the convergence speed and inference stability of the model under complex perturbations. After training, the model can automatically identify abnormal manifestations in fundus images, output classification diagnostic results including normal, diabetic retinopathy, glaucoma and macular degeneration, and has the ability to be directly deployed on unseen third-party medical center data.