A synthetic outlier-based medical image out-of-distribution detection system and method

By generating high-quality synthetic outliers and constrained optimization training, the problem of scarce real data in out-of-distribution detection of medical images is solved, improving out-of-distribution detection performance while maintaining in-distribution accuracy, and is applicable to a variety of medical image data.

CN121010833BActive Publication Date: 2026-02-17SHANGHAI-CHONGQING ARTIFICIAL INTELLIGENCE RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511537742.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-02-17
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Existing technologies struggle to obtain real out-of-distribution data in medical image out-of-distribution detection, leading to difficulties in model training, poor detection performance, and insufficient diversity and realism in the generated synthetic samples. This makes it difficult to improve out-of-distribution detection performance while maintaining high in-distribution classification accuracy.

Method used

By generating high-quality synthetic outliers, a deep learning model is trained using a hybrid synthetic outlier generation module and a constraint optimization training module, combined with various image synthesis techniques and energy functions. This generates structurally diverse and semantically relevant synthetic out-of-distribution samples. An augmented Lagrangian method is used to optimize the objective function, ensuring that the model's out-of-distribution detection capability is improved without degrading its in-distribution performance.

Benefits of technology

It significantly improves out-of-distribution detection performance without relying on real out-of-distribution data, while maintaining or improving in-distribution classification accuracy, enhancing the model's robustness and feature discrimination ability in clinical settings, and is applicable to a variety of medical imaging data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010833B_ABST
    Figure CN121010833B_ABST
Patent Text Reader

Abstract

The application discloses a medical image out-of-distribution detection system and method based on synthetic outliers, and belongs to the cross technical field of artificial intelligence and medical image analysis. The system mainly comprises: a hybrid synthetic outlier generation module which transforms in-distribution medical images to generate diversified out-of-distribution samples by integrating multiple image synthesis technologies; a constrained optimization training module which constructs an optimization problem with the minimum synthetic outlier misjudgment loss as the optimization objective and the in-distribution false positive rate and in-distribution classification accuracy as the constraint conditions, and solves the optimization problem by using the augmented Lagrange method to train a deep learning model; and an out-of-distribution detection and decision module which calculates the energy score of a to-be-detected image by using the trained model, and completes out-of-distribution determination by comparing with a threshold value. The application can be trained without real out-of-distribution data, effectively improves the recognition ability of the model for unknown or rare outliers, and enhances the robustness of the model in a clinically relevant environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of artificial intelligence and medical image analysis, and in particular to a system and method for detecting outliers in medical images based on synthetic outliers. Background Technology

[0002] In recent years, deep learning has made significant progress in the field of medical image analysis, such as disease diagnosis, organ segmentation, and assisted clinical decision-making. However, the performance of these models heavily relies on a core assumption: that the test data and training data follow the same distribution. In real clinical settings, this assumption often fails. Models may encounter out-of-distribution samples generated by unseen diseases, atypical lesions, or different imaging devices and protocols. When models fail to recognize these out-of-distribution samples, it can lead to serious diagnostic errors, such as misdiagnosing malignant tumors as benign, or delaying treatment for critical conditions, posing a significant threat to patient safety. To address this issue, existing technologies have mainly explored the following directions:

[0003] Uncertainty quantification methods: These methods identify out-of-distribution samples by assessing the uncertainty of model predictions. Common techniques include Monte Carlo Dropout, ensemble learning, and methods that directly predict the distribution of uncertainty. However, in the field of medical imaging, the differences between normal and abnormal samples can be extremely subtle (such as the subtle differences between normal anatomical variations and early pathological abnormalities), resulting in unclear uncertainty signals generated by the model. This makes these methods insufficiently sensitive to out-of-distribution samples and have limited discriminative ability.

[0004] Methods relying on real out-of-distribution samples: Some advanced frameworks are trained by mixing in-distribution data and real out-of-distribution data to learn a more discriminative decision boundary. However, in the medical field, obtaining diverse and sufficient real out-of-distribution samples is extremely difficult or even impossible due to data privacy, high annotation costs, and the rarity of certain diseases. Using data from unrelated domains, such as natural images (e.g., ImageNet), as substitutes fails to capture subtle features of clinical abnormalities, causing the discriminative boundary learned by the model to deviate from clinical reality.

[0005] Synthetic anomaly generation methods: These methods create pseudo-abnormal samples by transforming normal images. For example, the generated anomaly samples may be too simplistic or detached from clinical reality, failing to effectively guide the model to learn the key features that distinguish real clinical abnormalities.

[0006] Energy modeling approach: This method uses the energy function of the model to distinguish between in-distribution and out-of-distribution data. However, in the medical field, where data distribution is complex and poorly defined, the discriminative performance of the energy function faces significant challenges and is prone to producing a large number of misclassifications.

[0007] In summary, existing technologies generally suffer from the following drawbacks when applied to out-of-distribution detection in medical images:

[0008] 1. It is difficult to obtain real out-of-distribution data for training, which renders the method infeasible;

[0009] 2. Traditional methods perform poorly when processing medical images where there are subtle differences between normal and abnormal samples;

[0010] 3. Existing synthetic methods generate samples with insufficient diversity and realism, making it difficult to simulate real clinical abnormalities;

[0011] 4. The model needs to strike a balance between three competing objectives: high in-distribution classification accuracy, high out-of-distribution detection rate, and low in-distribution false alarm rate. Existing technologies struggle to achieve all three simultaneously.

[0012] Therefore, there is an urgent need for an innovative solution that can generate high-quality, diverse synthetic anomalies and utilize scientific training mechanisms to achieve both high in-distribution classification accuracy and high out-of-distribution detection performance without relying on real out-of-distribution data. Summary of the Invention

[0013] The purpose of this invention is to solve the aforementioned problems faced by existing technologies in out-of-distribution detection of medical images, particularly overcoming the shortcomings of model training difficulties and poor detection performance due to the lack of real out-of-distribution data. This invention provides a medical image out-of-distribution detection system and method based on synthetic outliers. This system and method do not rely on real out-of-distribution data, but effectively train the out-of-distribution detector by generating high-quality synthetic outliers. This enables the detector to significantly improve its ability to identify unknown or rare anomalies while maintaining high in-distribution classification accuracy, thereby enhancing the robustness of the model in safety-critical clinical environments.

[0014] The objective of this invention is achieved through the following technical solution:

[0015] Firstly, a medical image out-of-distribution detection system based on synthetic outliers is provided, comprising:

[0016] The data acquisition module is used to acquire a set of medical image samples within a distribution.

[0017] The hybrid synthetic outlier generation module is used to process the in-distribution medical image sample set and generate a synthetic out-of-distribution sample set with diverse structures and semantic relevance by randomly selecting and combining multiple image synthesis techniques.

[0018] A constrained optimization training module is used to receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and to train a deep learning model. The training of the deep learning model includes:

[0019] The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved based on the augmented Lagrangian method. The deep learning model uses an energy function as an out-of-distribution scoring mechanism.

[0020] The out-of-distribution detection and decision module is used to calculate the energy score of the medical image to be detected using the trained deep learning model, and to determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.

[0021] In some embodiments, the image synthesis technique includes at least global adjustment technique, local perturbation technique, and seamless fusion technique.

[0022] In some embodiments, the global adjustment technique generates out-of-distribution samples by linear interpolating two or more in-distribution images; the local perturbation technique simulates local anomalies by cropping and pasting tiles within an image or between different images; and the seamless fusion technique extracts tiles from in-distribution medical image samples and fuses the tiles to random locations in out-of-distribution sample images.

[0023] In some embodiments, the hybrid synthetic outlier generation module is further configured to utilize image enhancement techniques to assist in the generation of out-of-distribution sample sets.

[0024] In some embodiments, the constraints during the training of the deep learning model include:

[0025] Ensure that the false alarm rate of the model for medical image samples within the distribution is lower than a first preset threshold, and ensure that the classification error rate of the model for medical image samples within the distribution is lower than a second preset threshold.

[0026] In some embodiments, the loss function used by the constrained optimization training module is:

[0027]

[0028] in, Represents the total loss function. Indicates model parameters, Indicates a multiplier. This represents the penalty coefficient, and m represents the total number of data points. This represents the binary cross-entropy loss using the sigmoid function. Indicates out-of-distribution samples, Indicates an off-distribution detector. This represents the augmented Lagrange penalty function for detecting medical image samples within a given distribution. This represents the first component of the penalty coefficient. This represents a function that measures the false alarm rate of the model for medical image samples within the distribution. Indicates the first component of the multiplier. This represents the second component of the penalty coefficient. This represents a function that measures the model's classification error rate for medical image samples within a given distribution. This represents the augmented Lagrange penalty function for classifying medical image samples within a given distribution. This represents the second component of the multiplier.

[0029] Secondly, a method for detecting out-of-distribution patterns in medical images based on synthetic outliers is provided for use in the medical image out-of-distribution detection system described in the first aspect, comprising the following steps:

[0030] S1. Obtain a distributed medical image sample set through the data acquisition module;

[0031] S2. The in-distribution medical image sample set is processed using a hybrid synthetic outlier generation module. By randomly selecting and combining multiple image synthesis techniques, a synthetic out-of-distribution sample set with diverse structures and semantic relevance is generated.

[0032] S3. Using a constrained optimization training module, receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and train a deep learning model. The training of the deep learning model includes:

[0033] The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved based on the augmented Lagrangian method. The deep learning model uses an energy function as an out-of-distribution scoring mechanism.

[0034] S4. Input the medical image to be detected into the trained deep learning model, use the out-of-distribution detection and decision module to calculate the energy score of the medical image to be detected, and determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.

[0035] It should be further noted that the technical features corresponding to the above-mentioned embodiments can be combined or substituted with each other to form new technical solutions without conflict.

[0036] Compared with the prior art, the beneficial effects of the present invention are:

[0037] 1. No need to rely on real out-of-distribution data: This invention integrates multiple image synthesis techniques to transform in-distribution medical images and generate diverse synthetic out-of-distribution samples. It can effectively train out-of-distribution detectors without any real out-of-distribution data. By generating high-quality synthetic outliers as proxies, it solves the core pain point of the scarcity of real out-of-distribution data in the medical field and has extremely high practical feasibility and application value.

[0038] 2. Significantly Improved Out-of-Distribution Detection Performance: Experimental results show that the out-of-distribution detection performance (measured by AUROC) of this invention consistently outperforms various mainstream and advanced methods, including MSP, Mahalanobis, EDL, and MX-ERNN, on four publicly available medical datasets: ISIC 2019, Kvasir-Capsule, OCT, and DermaMNIST. For example, on the ISIC 2019 dataset, the AUROC score of this method reaches 82.05, significantly better than the baseline model's 68.15 and the strongest comparison method's 76.34.

[0039] 3. Without sacrificing in-distribution classification accuracy: Through a constrained optimization framework, this invention can effectively maintain or even slightly improve the classification performance (such as precision, recall and F1 score) of in-distribution samples while improving out-of-distribution detection capabilities, successfully balancing multiple competing performance objectives.

[0040] 4. Enhanced Feature Discriminative Ability of the Model: By introducing synthetic outliers for adversarial training, this invention forces the model to learn a more compact and discriminative representation of in-distribution data features. t-SNE feature visualization analysis shows that the model trained using this invention exhibits higher separation between in-distribution and true out-of-distribution samples in the feature space, and clearer decision boundaries.

[0041] Universality and Flexibility: The framework of this invention has good versatility. Its hybrid synthetic anomaly generation module and constraint optimization framework can be combined with different backbone networks (such as ResNet) and different modalities of medical imaging data (such as dermoscopy images, capsule endoscopy images, and OCT images), demonstrating broad applicability. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of a medical image out-of-distribution detection system based on synthetic outliers, as shown in this invention.

[0043] Figure 2 This is a schematic diagram illustrating a method for detecting out-of-distribution medical images based on synthetic outliers, as shown in this invention.

[0044] Figure 3This is a visualization result of T-SNE after feature extraction from the model shown in this invention. Detailed Implementation

[0045] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. 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.

[0046] It should be noted that the defects in the solutions in the prior art are all the results of the inventors' practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of this application in the following text should be the inventors' contributions to this application in the process of invention and creation, and should not be understood as technical content known to those skilled in the art.

[0047] In view of the technical problems pointed out in the background art, the present invention provides the following embodiments:

[0048] In one exemplary embodiment, a medical image out-of-distribution detection system based on synthetic outliers is provided, such as... Figure 1 As shown, it includes:

[0049] The data acquisition module is used to acquire a set of medical image samples within a distribution.

[0050] The hybrid synthetic outlier generation module is used to process the in-distribution medical image sample set and generate a synthetic out-of-distribution sample set with diverse structures and semantic relevance by randomly selecting and combining multiple image synthesis techniques.

[0051] A constrained optimization training module is used to receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and to train a deep learning model. The training of the deep learning model includes:

[0052] The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved based on the augmented Lagrangian method. The deep learning model uses an energy function as an out-of-distribution scoring mechanism.

[0053] The out-of-distribution detection and decision module is used to calculate the energy score of the medical image to be detected using the trained deep learning model, and to determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.

[0054] The data acquisition module provides a dataset that contains only medical image samples within the distribution and their labels.

[0055] For example, the hybrid synthetic outlier generation module is responsible for generating structurally diverse and semantically relevant pseudo-out-of-distribution samples as effective proxies for real out-of-distribution data. It integrates multiple complementary image synthesis techniques, including:

[0056] Global adjustment techniques (such as Mixup) generate synthetic samples with global and diffuse variations by linearly interpolating two or more distributed images, thereby challenging the model's texture and contextual understanding capabilities.

[0057] Local perturbation techniques (such as CutPaste and CutMix) simulate local anomalies such as small lesions, polyps, or imaging artifacts by pasting tiles from that image or other images at random locations in an image.

[0058] Seamless fusion techniques (such as Poisson fusion) extract patches from a source image and seamlessly fuse them into random locations in a target image by solving the Poisson equation, generating visually more natural local anomalies.

[0059] This module creates a rich and diverse set of synthetic out-of-distribution samples by randomly selecting and combining the above techniques, and supplementing them with image enhancement methods such as color jitter.

[0060] For example, the constrained optimization training module is responsible for end-to-end training of the deep learning model using a generated synthetic out-of-distribution sample set and the original in-distribution medical image sample set, in the absence of real out-of-distribution data. Its core is a constrained optimization problem, the goal of which is to minimize the model's recognition loss for synthetic out-of-distribution samples while satisfying specific constraints. This optimization problem is specifically defined as:

[0061] Optimization objective: Minimize the model's ability to synthesize out-of-distribution samples. Expected loss for misidentification as in-distribution medical image samples:

[0062] ,in For distributed off-site detectors, Let E represent the probability distribution of the out-of-distribution samples. The expectation of misidentification as an in-distribution medical image sample. This indicates that by adjusting the parameters To minimize the expected value E, the out-of-distribution detector is implemented based on an energy function. Its criterion is: if the energy value of the input sample is low, it is classified as in-distribution; otherwise, it is classified as out-of-distribution. This process of minimizing the expected loss is implemented using a gradient descent-like algorithm, thereby obtaining a deep learning model with optimal parameters.

[0063] Constraints:

[0064] In-distribution false alarm rate constraint: Ensure that the model correctly identifies in-distribution medical image samples. The proportion of samples incorrectly identified as out-of-distribution samples is less than a preset first threshold. ;

[0065] In-distribution classification accuracy constraint: Ensure that the model's classification error rate on the in-distribution medical image sample dataset is below a preset second threshold. .

[0066] This module uses an energy function as an out-of-distribution scoring mechanism, where the energy value... Where K represents the number of categories, Indicates the classifier in category The logit output, where each component represents the corresponding output value, shows that the lower the energy value, the closer the sample is to the in-distribution. For classifying medical image sample data within a distribution, ResNet or Vision Transformer can be used.

[0067] To solve this constrained optimization problem, this module employs the augmented Lagrange method, transforming the constrained problem into an unconstrained composite objective function, and then iteratively optimizing it through the principal update of the model parameters and the dual update of the Lagrange multipliers.

[0068] For example, the out-of-distribution detection and decision module uses a model trained with constraints optimization to infer new input images. For any input image, the module calculates its energy score. By comparing it with a preset energy threshold (e.g., a decision boundary determined through training), it determines whether the image is an in-distribution or out-of-distribution sample and outputs the final classification or detection result.

[0069] In another exemplary embodiment, based on the above system, a method for detecting out-of-distribution patterns in medical images based on synthetic outliers is provided, used in the medical image out-of-distribution detection system described in the first aspect, comprising the following steps:

[0070] S1. Obtain a distributed medical image sample set through the data acquisition module;

[0071] S2. The in-distribution medical image sample set is processed using a hybrid synthetic outlier generation module. By randomly selecting and combining multiple image synthesis techniques, a synthetic out-of-distribution sample set with diverse structures and semantic relevance is generated.

[0072] S3. Using a constrained optimization training module, receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and train a deep learning model. The training of the deep learning model includes:

[0073] The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved based on the augmented Lagrangian method. The deep learning model uses an energy function as an out-of-distribution scoring mechanism.

[0074] S4. Input the medical image to be detected into the trained deep learning model, use the out-of-distribution detection and decision module to calculate the energy score of the medical image to be detected, and determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.

[0075] like Figure 2 As shown, the main principle of this method is as follows: First, a hybrid synthetic outlier generation module utilizes various image processing methods to generate diverse pseudo-out-of-distribution samples. Second, a constrained optimization training module combines in-distribution samples with synthetic outlier samples, employing energy functions and augmented Lagrangian methods for model training, thereby improving out-of-distribution detection capabilities while maintaining in-distribution performance. Finally, an out-of-distribution detection and decision module calculates the energy score of new medical images and determines whether they belong to the in-distribution or out-of-distribution category based on the decision boundary, thus achieving reliable detection.

[0076] For example, this embodiment uses the out-of-distribution detection task of the ISIC 2019 dermoscopy image dataset as an example to illustrate the specific implementation process of the present invention.

[0077] 1. Dataset preparation and setup:

[0078] The ISIC 2019 dataset was used. This dataset contains images of skin lesions in 8 categories.

[0079] In-distribution data: Six categories with larger sample sizes (such as melanoma MEL, basal cell carcinoma BCC, etc.) were selected as in-distribution data.

[0080] Out-of-distribution data: Dermatofibroma (DF) and vascular lesion (VASC), which have very small sample sizes, are considered out-of-distribution data and are only used for final performance evaluation. They do not participate in any training process.

[0081] 2. Synthetic outlier generation:

[0082] Images are randomly sampled from the training data within the distribution.

[0083] Activate the hybrid synthetic outlier generation module. This module randomly selects one of the following methods with equal probability to process the sampled in-distribution image and generate synthetic out-of-distribution samples:

[0084] Mixup: Randomly selects two images within a given distribution. and ,pass Generate new samples, where Sample from the Beta distribution.

[0085] CutPaste: From a distributed image Randomly crop a rectangular area Then paste it back. Another random location: .

[0086] CutMix: From Images Middle cropping area and use it to replace the image The corresponding area in: ,in Indicates the region mask. This is element-wise multiplication.

[0087] Poisson blending: Randomly cropped circular patches and smoothly blend them into another image using Poisson image editing techniques to simulate more natural anomalies. ,in To randomly crop circular tiles.

[0088] The process of synthesizing a certain abnormal image is as follows: Figure 2 As shown, the original image undergoes CutPaste, CutMix, Mixup, and Poisson fusion in one pass. ).

[0089] 3. Model and training parameters:

[0090] Backbone network: adopts ResNet-34 architecture.

[0091] Optimizer: The AdamW optimizer was used for in-distribution classification pre-training, and the stochastic gradient descent (SGD) optimizer was used for constrained optimization training in the out-of-distribution detection phase.

[0092] Hyperparameter settings: Learning rate set to The batch size is 64. The constraint optimization parameters are set to... =0.05, and τ is set to twice the loss of the pre-trained model. The interval parameter in the energy function is empirically set to 0 because a compact decision boundary works best for synthetic data.

[0093] 4. Constrained optimization training:

[0094] Input the in-distribution data and the generated synthetic out-of-distribution data into the constraint optimization training module.

[0095] Within each training epoch, the main update is performed multiple times, using the SGD optimizer to update the model parameters. To minimize the Lagrange function.

[0096] At the end of each cycle, a dual update is performed, adjusting the Lagrange multipliers via gradient ascent to dynamically penalize violations of constraints.

[0097] set up Indicates model parameters, A classifier for distributed medical image sample data. Let represent an out-of-distribution detector. This constrained programming can be transformed into an augmented Lagrangian function:

[0098]

[0099] in, Represents the total loss function. Indicates model parameters, Indicates a multiplier. This represents the penalty coefficient, and m represents the total number of data points. This represents the binary cross-entropy loss using the sigmoid function. Indicates out-of-distribution samples, Indicates an off-distribution detector. This represents the augmented Lagrange penalty function for detecting medical image samples within a given distribution. This represents the first component of the penalty coefficient. This represents a function that measures the false alarm rate of the model for medical image samples within the distribution. Indicates the first component of the multiplier. This represents the second component of the penalty coefficient. This represents a function that measures the model's classification error rate for medical image samples within a given distribution. This represents the augmented Lagrange penalty function for classifying medical image samples within a given distribution. This represents the second component of the multiplier.

[0100] The loss for measuring whether the model classifies in-distribution medical image samples as out-of-distribution is less than a threshold. That is, to control the false alarm rate.

[0101] This measures whether the classification error on medical image samples within the distribution is less than a threshold. This ensures classification accuracy. The cross-entropy loss function used for classification problems, Represents medical image samples within the distribution. Indicates and The corresponding category label.

[0102] It is the augmented Lagrange penalty function, used to balance the degree of constraint violation with optimization stability, where u represents the amount of constraint violation.

[0103] Original update (model parameters)

[0104] Within each training epoch, this invention uses a stochastic gradient descent (SGD) optimizer to minimize the mini-batch augmented Lagrange approximation function. :

[0105]

[0106] The mini-batch version replaces the mean in the augmented Lagrangian function with the batch mean based on synthetic out-of-distribution samples and in-distribution medical image samples, where t represents the number of iterations and e represents the training period. This represents the multiplier at the e-th training epoch. The learning rate represents the number of times the model parameters are updated. For parameters The gradient operator represents finding the gradient with respect to the parameters. θ The partial derivatives of .

[0107] Dual update (multiplier)

[0108] At the end of the cycle, the present invention... Perform an upward update and project to the non-negative quadrant:

[0109]

[0110] in Indicates training period The last original iteration value. When At that time, penalty items can be optionally added. ( ),in represent The corresponding model performance metrics, The limit value is given by humans. This represents the learning rate during multiplier updates. For the sake of multipliers The gradient operator, representing the calculation of the gradient with respect to the multiplier, is used to find the gradient of the multiplier. The partial derivatives of .

[0111] The entire training process lasts for 100 cycles.

[0112] 5. Performance Evaluation:

[0113] In-distribution performance: On the in-distribution test set, the trained model was used for classification, and precision, recall, and F1 score were calculated. The results show that the in-distribution performance is on par with or higher than the baseline method; for example, the F1 score is 0.86, indicating that the in-distribution classification ability is not affected.

[0114] Out-of-distribution detection performance: Real out-of-distribution data (DF and VASC classes) used only in the testing phase were mixed with in-distribution test data and input into the model to calculate energy scores. Based on the energy scores, AUROC was calculated. The results show that the AUROC of this method reaches 82.05, which is much higher than the baseline (68.15) and all other comparative methods.

[0115] Feature analysis: such as Figure 3 As shown in the t-SNE visualization results, compared with the model trained only with in-distribution data, the clusters of in-distribution data (green circles) and real out-of-distribution data (red triangles) are more separated in the feature space of the model trained by this invention, and the SVM decision boundary (orange dashed line) is clearer and more effective.

[0116] The above detailed embodiments are a description of the present invention. It should not be considered that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, several simple deductions and substitutions can be made without departing from the concept of the present invention, and all of these should be considered to fall within the protection scope of the present invention.

Claims

1. A synthetic outlier-based medical image out-of-distribution detection system, comprising: include: The data acquisition module is used to acquire a set of medical image samples within a distribution. The hybrid synthetic outlier generation module is used to process the in-distribution medical image sample set and generate a synthetic out-of-distribution sample set with diverse structures and semantic relevance by randomly selecting and combining multiple image synthesis techniques. A constrained optimization training module is used to receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and to train a deep learning model. The training of the deep learning model includes: The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved using the augmented Lagrangian method. The deep learning model employs an energy function as an out-of-distribution scoring mechanism. The loss function used in the constrained optimization training module is: wherein, denotes the total loss function, denotes the model parameters, denotes the multiplier, denotes the penalty coefficient, m denotes the total number of data, denotes the binary cross-entropy loss using the sigmoid function, denotes out-of-distribution samples, denotes the out-of-distribution detector, denotes the augmented Lagrangian penalty function for in-distribution medical image sample detection, denotes the penalty coefficient first component, denotes a function measuring the false positive rate of the model for in-distribution medical image samples, denotes the multiplier first component, denotes the penalty coefficient second component, denotes a function measuring the classification error rate of the model for in-distribution medical image samples, denotes the augmented Lagrangian penalty function for in-distribution medical image sample classification, denotes the multiplier second component; The out-of-distribution detection and decision module is used to calculate the energy score of the medical image to be detected using the trained deep learning model, and to determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.

2. The synthetic outlier based medical image distribution outside detection system of claim 1, wherein, The various image synthesis techniques include at least global adjustment techniques, local perturbation techniques, and seamless fusion techniques.

3. The synthetic outlier based medical image distribution outside detection system of claim 2, wherein, The global adjustment technique generates out-of-distribution samples by linear interpolating two or more in-distribution images; the local perturbation technique simulates local anomalies by cropping and pasting patches within an image or between different images; and the seamless fusion technique extracts patches from in-distribution medical image samples and fuses the patches to random locations in out-of-distribution sample images.

4. The synthetic outlier based medical image distribution outside detection system of claim 2, wherein, The hybrid synthetic outlier generation module is also used to assist in the generation of out-of-distribution sample sets using image enhancement technology.

5. The synthetic outlier based medical image distribution outlier detection system of claim 1, wherein, The constraints during the training of the deep learning model include: Ensure that the model's false alarm rate for medical image samples within the distribution is lower than a first preset threshold, and ensure that the model's classification error rate for medical image samples within the distribution is lower than a second preset threshold.

6. A synthetic outlier-based medical image out-of-distribution detection method for the medical image out-of-distribution detection system of any one of claims 1-5, characterized in that, Includes the following steps: S1. Obtain a distributed medical image sample set through the data acquisition module; S2. The in-distribution medical image sample set is processed using a hybrid synthetic outlier generation module. By randomly selecting and combining multiple image synthesis techniques, a synthetic out-of-distribution sample set with diverse structures and semantic relevance is generated. S3. Using a constrained optimization training module, receive the in-distribution medical image sample set and the synthetic out-of-distribution sample set, and train a deep learning model. The training of the deep learning model includes: The optimization objective is to minimize the expected loss of the deep learning model when it misidentifies synthetic out-of-distribution samples as in-distribution medical image samples. The objective function is solved based on the augmented Lagrangian method. The deep learning model uses an energy function as an out-of-distribution scoring mechanism. S4. Input the medical image to be detected into the trained deep learning model, use the out-of-distribution detection and decision module to calculate the energy score of the medical image to be detected, and determine whether the medical image to be detected is an in-distribution sample or an out-of-distribution sample based on the energy score.