DMDSC: A Dynamic-Margin Deep Simplex Classifier for Open-Set Recognition on Medical Image Datasets

arXiv:2605.00675 · cs.CV · Submitted 2026-05-01 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: We're looking at the paper: "DMDSC: A Dynamic-Margin Deep Simplex Classifier for Open-Set Recognition on Medical Image Datasets".

Jane: Here's the gist of the paper. The gist: DMDSC, an enhanced framework featuring a dynamic margin approach, proposes automatically adapting class-specific margins based on label frequency to counteract data imbalance in OpenSet Recognition for medical image datasets.

Tom: Medical imaging datasets are often characterized by extreme class imbalances, where rare pathologies are significantly underrepresented compared to common conditions <ref:2605.00675#pg2>.

Jane: This imbalance poses a dual challenge for OpenSet Recognition (OSR): models must maintain high classification accuracy on known classes while reliably rejecting unknown samples unseen during training in the clinical settings <ref:2605.00675#pg3>.

Tom: While recently proposed Deep Simplex Classifier (DSC)

5: and UnCertainty-aware Deep Simplex Classifier (UCDSC)

2: successfully leverage Neural Collapse to ensure maximal inter-class separation, they rely on a uniform margin that does not account for the varying densities of medical classes <ref:2605.00675#pg3>.

Paper summary: Tom: So we're looking at a paper called "DMDSC: A Dynamic-Margin Deep Simplex Classifier for Open-Set Recognition on Medical Image Datasets". Jane, what's the big idea here?

Jane: Well, Tom, it tackles a really tough problem in medical imaging where the data is often super unbalanced. The core challenge for Open-Set Recognition or OSR is that models have to be good at recognizing known diseases but also reliably reject new ones they haven't seen before in a real clinical setting <ref:2605.00675#pg3>.

Tom: Exactly, and the authors say that existing methods, like Deep Simplex Classifier or UCDSC, use a uniform margin to keep things separate between classes. But that uniform margin doesn't work well when some medical conditions are much rarer than others <ref:2605.00675#pg3>.

Jane: That’s the point, right? They argue that this uniform constraint lets the majority classes dominate the embedding space, so they propose DMDSC which uses a dynamic margin approach <ref:2605.00675#pg1>. This means they automatically adapt those class-specific margins based on how often each label appears in the training data.

Tom: So, what does that dynamic margin actually look like technically? I need to know the mechanics behind it.

Jane: The total loss for DMDSC is defined as Ltotal equals Lintra plus lambda inter Linter plus lambda bgLbg <ref:2605.00675#pg5>. The intra-class loss is just encouraging features to cluster tightly around their class centers during training <ref:2605.00675#pg6>.

Tom: And the inter-class loss is where the magic happens, I assume? How does that interact with this dynamic margin idea?

Jane: It’s a triplet-style loss that pushes each feature embedding away from all rival class centers by at least a margin mi <ref:2605.00675#pg7>. The key is that this margin mi is dynamically set, adapting the separation strength based on label frequency <ref:2605.00675#pg9>.

Tom: Okay, so if a disease is rare, like a pathology with very few training samples, the margin for that class gets bigger? That enforces a tighter clustering around it and pushes other classes further away?

Jane: Precisely. The formulation they use is mc equals mmin plus (mmax minus mmin) times one minus nc PC where nc is the number of training samples in class c <ref:2605.00675#pg9>. This means the margin mc gets larger for minority classes and smaller for majority classes, which helps counteract the imbalance in that feature space <ref:2605.00675#pg9>.

Paper summary: Tom: That makes sense mathematically, but from a deployment standpoint, how does this affect things when we try to use it on real medical images? Meng’s perspective would be interesting here.

Meng: From a production side, the authors are purely discriminative; they aren't using generative models or synthetic data to train it <ref:2605.00675#pg3>. That’s good because it means we don't have to worry about the quality issues or biases that synthetic data can introduce when we try to run this at scale <ref:2605.00675#pg3>.

Jane: And they do enforce structure through geometric arrangement and these dynamic margins instead of relying on reconstruction errors or adversarial training <ref:2605.00675#pg3>. It’s a purely discriminative approach to enforcing separation <ref:2605.00675#pg3>.

Tom: So, the validation part is important. What did they actually show with this DMDSC framework on different medical datasets?

Jane: They tested it on several diverse medical benchmarks including BloodMNIST, OCTMNIST, DermaMNIST, and BreaKHis <ref:2605.00675#pg3>. The results show that DMDSC outperforms state-of-the-art methods on these datasets <ref:2605.00675#pg3>.

Tom: Can you give me some concrete numbers on how much better it is? I want to see the performance metrics they claim.

Jane: They show superior or at par performance across AUROC for unknown class detection, OSCR for joint recognition and classification, and Accuracy for closed-set performance <ref:2605.00675#pg3>. For example, on BloodMNIST, DMDSC achieves an AUROC of ninety-one point one two percent and an OSCR of ninety point four nine percent, which beats strong baselines like DSC and UCDSC <ref:2605.00675#pg2>.

Tom: That’s a solid number, but what about the robustness to imbalance? If we take that BloodMNIST example, how does tuning those lambda parameters affect things?

Jane: They show that just adding the inter-class loss term gives an improvement on AUROC/OSCR from eighty-seven point two three percent and eighty-six point seven five percent to eighty-nine point two seven percent and eighty-eight point eight seven percent, which is a gain of over two percent <ref:2605.00675#pg10>.

Tom: And then adding the class-inclusion loss term, Lbg, gives the best results on BloodMNIST with an AUROC of ninety-one point one two percent and OSCR of ninety point four nine percent, a gain of almost four percent <ref:2605.00675#pg2>. That’s a significant step up <ref:2605.00675#pg3>.

Paper summary: Jane: They also showed that on the more severe imbalance setting, with an imbalance ratio IR of one hundred on the ASC dataset, DMDSC consistently beats both baselines achieving fifty-seven point eight nine percent accuracy and forty-one point three nine percent OSCR <ref:2605.00675#pg4>.

Tom: So, it seems like incorporating this dynamic margin mechanism really helps stabilize the separation when the data is skewed, without adding extra complexity to the model structure itself <ref:two thousand six hundred five point zero zero six seven five#pg3.

Jane: That’s what they claim. They argue that by automatically adapting the margins based on label frequency, you enforce a higher penalty and tighter feature clustering specifically for rare pathologies <ref:2605.00675#pg1>. This is designed to counteract the effects of data imbalance directly in the feature space <ref:2605.00675#pg9>.

Tom: So, to wrap up what we've heard about "DMDSC: A Dynamic-Margin Deep Simplex Classifier for Open-Set Recognition on Medical Image Datasets", the authors are essentially taking a known geometric technique and making it sensitive to the actual distribution of medical diseases in the data they are training on.

Jane: That’s right. The implication here is that for any AI system dealing with rare medical conditions, having a margin that adjusts itself based on class frequency could lead to much safer diagnosis because it ensures those rare cases aren't just getting lost in the noise of the majority classes <ref:two thousand six hundred five point zero zero six seven five#pg2.

Tom: The paper is written by Vishal, Arnav Aditya, Nitin Kumar, and Saurabh Shigwan Shiv Nadar from Institution of Eminence Delhi NCR India <ref:two thousand six hundred five point zero zero six seven five#pg1. It’s a solid contribution to making OSR more robust in clinical settings.

Jane: It is. And while they show it works well with these benchmarks, the paper notes that their method relies on this specific affine function for the margin mc <ref:two thousand six hundred five point zero zero six seven five#pg9. They also mention that future work could involve extending this to a non-linear margin function m(p) <ref:two thousand six hundred five point zero zero six seven five#pg2.

Tom: That’s the limitation they acknowledge—the current formulation is based on an affine function, and they plan to explore non-linear versions next <ref:two thousand six hundred five point zero zero six seven five#pg2. It’s a good path forward, but it means we still need to keep an eye on those non-linear extensions.

Jane: Exactly. So the dynamic margin approach is a way to improve feature separation under class imbalance without increasing the overall model complexity <ref:two thousand six hundred five point zero zero six seven five#pg3. That's what DMDSC aims to achieve in open-set recognition for medical data.

Conclusion: Jane: So we're wrapping up our look at DMDSC, which stands for Dynamic-Margin Deep Simplex Classifier, and what it does is adapt how much separation between medical images classes needs to be based on how common those diseases are in the training data.

Tom: Yeah, the authors are Vishal and Aditya and Nitin Kumar from Institution of Eminence Delhi NCR India <ref:2605.00675#pg1>. They basically took a known technique, Neural Collapse, but they made it smarter by using a dynamic margin instead of one fixed number for separation.

Lu: What that means in practice is that if you have a rare pathology, the model gets to use a bigger margin for that class <ref:2605.00675#pg9>. This forces the features of that rare disease to cluster more tightly and keeps them well away from everything else.

Meng: For production, that sounds like it should help us handle those minority classes better when they show up in a clinical setting <ref:2605.00675#pg3>. But I need to know how much extra training time this dynamic adjustment takes at scale, Tom.

Tom: Well, the paper shows it doesn't really add much complexity to the model structure itself <ref:2605.00675#pg3>. It’s just changing the margin calculation during training based on label frequency <ref:two thousand six hundred five point zero zero six seven five#pg9.

Jane: They validated this across several medical datasets like BloodMNIST and OCTMNIST <ref:2605.00675#pg3>. The results show that DMDSC achieves the highest open-set recognition scores on those tests <ref:two thousand six hundred five point zero zero six seven five#pg2.

Lalam: I’m confident in this direction. The authors demonstrate that this dynamic margin approach improves feature separation under class imbalance without increasing model complexity <ref:two thousand six hundred five point zero zero six seven five#pg3. It’s a solid mechanism for making OSR more robust <ref:two thousand six hundred five point zero zero six seven five#pg1.

Tom: So, the main point here is that when you deal with rare medical stuff, you shouldn't use a one-size-fits-all separation distance between classes. You need it to grow or shrink based on how much data you have for each class <ref:two thousand six hundred five point zero zero six seven five#pg9.

Jane: It means this method could be useful in the real world when an AI system encounters a disease it hasn't seen before, allowing doctors to trust the known ones while still flagging the unknown ones reliably <ref:two thousand six hundred five point zero zero six seven five#pg2.

Lu: The authors also pointed out that they are using a specific affine function for this margin calculation <ref:two thousand six hundred five point zero zero six seven five#pg9. That’s something they plan to extend later to a non-linear margin function <ref:two thousand six hundred five point zero zero six seven five#pg2.

Meng: I'm not sure about the non-linear part yet, but the fact that it works on diverse datasets suggests this is a solid starting point for any production deployment <ref:two thousand six hundred five point zero zero six seven five#pg3.

Tom: Right, so we’ve seen how they fix the imbalance problem by making the separation distance flexible instead of rigid. That’s what DMDSC does <ref:two thousand six hundred five point zero zero six seven five#pg1.

Vishal, Arnav Aditya, Nitin Kumar, Saurabh Shigwan

Shiv Nadar Institution of Eminence, Delhi NCR, India

cs.CV

Submitted: 2026-05-01

Updated: 2026-10-20

License: http://creativecommons.org/licenses/by-nc-sa/4.0/

Importance score: 87/100

The gist: The gist: DMDSC, an enhanced framework featuring a dynamic margin approach, proposes automatically adapting class-specific margins based on label frequency to counteract data imbalance in OpenSet

Key concepts

Open-Set Recognition (OSR)
OSR is a task where a model must correctly classify known medical conditions while simultaneously identifying and rejecting samples that are entirely new or unseen during training. It's crucial in clinical settings to ensure safety when encountering rare pathologies.
Dynamic Margin (DM)
This technique automatically changes the required separation distance (margin) between different medical classes during training. Instead of using a single fixed margin for all classes, DM makes the separation tighter for rare diseases and looser for common ones, directly addressing data imbalance.
Class Adaptive Dynamic Margin ($m_c$)
The specific formula used to calculate the dynamic margin assigns larger margins to minority (rare) classes and smaller margins to majority (common) classes. This mathematical adjustment ensures that the model focuses more on distinguishing rare conditions, improving overall recognition accuracy.

Terminology

Summary

The gist: DMDSC, an enhanced framework featuring a dynamic margin approach, proposes automatically adapting class-specific margins based on label frequency to counteract data imbalance in OpenSet Recognition for medical image datasets.

Introduction and Motivation

Medical imaging datasets are often characterized by extreme class imbalances, where rare pathologies are significantly underrepresented compared to common conditions <ref:2605.00675#pg2>. This imbalance poses a dual challenge for OpenSet Recognition (OSR): models must maintain high classification accuracy on known classes while reliably rejecting unknown samples unseen during training in the clinical settings <ref:2605.00675#pg3>. While recently proposed Deep Simplex Classifier (DSC) [5] and UnCertainty-aware Deep Simplex Classifier (UCDSC) [2] successfully leverage Neural Collapse to ensure maximal inter-class separation, they rely on a uniform margin that does not account for the varying densities of medical classes <ref:2605.00675#pg3>. In imbalanced scenarios, uniform-margin constraints incorporated by DSC [5] and UCDSC [2] are suboptimal, where majority classes can dominate the embedding space <ref:2605.00675#pg3>.

Proposed Method Architecture

The proposed framework introduces the concept of Dynamic Margin (DM), which automatically adapts class-specific margins based on label frequency during training <ref:2605.00675#pg3>. The overall training objective is defined as Ltotal = Lintra + λinterLinter + λbgLbg, where the weight parameters λinter and λbg must be set by the user <ref:2605.00675#pg5>.

The loss terms are defined as follows:

  1. Intra-class loss (Lintra): This term encourages the learned feature embeddings to be compactly clustered around their respective class centers during training <ref:2605.00675#pg6>.

  2. Inter-class loss (Linter): This triplet-style loss pushes each feature embedding away from all rival class centers by at least a class-adaptive margin mi, which promotes well-separated class clusters while adapting the separation strength to class imbalance through the dynamic margin mi <ref:2605.00675#pg7>.

  3. Class-inclusion loss (Lbg): To incorporate auxiliary samples, this loss requires that feature embeddings of known class samples lie closer to their corresponding class centers than background samples by a minimum margin mi <ref:2605.00675#pg8>.

Class Adaptive Dynamic Margin

The dynamic margin mc for any class c is proposed as mc = mmin + (mmax − mmin)(1 − nc PC), where nc denotes the number of training samples belonging to class c, and C is the total number of known classes <ref:2605.00675#pg9>. This formulation assigns larger margins to minority classes and smaller margins to majority classes, thereby accounting for class imbalance in the feature space <ref:2605.00675#pg9>. The theorem proves that mc is bounded within [mmin, mmax) and that it is unique among all affine functions satisfying the boundary conditions.

Experimental Validation and Results

Extensive experiments conducted on diverse medical benchmarks on BloodMNIST[34], OCTMNIST[34], DermaMNIST[34], BreaKHis(40×) [28] and ASC[21] datasets demonstrate that our framework outperforms state-of-the-art methods <ref:2605.00675#pg3>. The results show that DMDSC consistently achieves superior or at-par performance across three primary metrics: AUROC for unknown class detection, OSCR for joint recognition and classification, and Accuracy (ACC) for closed-set performance <ref:2605.00675#pg3>.

In comparison with state-of-the-art (SOTA) methods, DMDSC achieves the best or competitive open-set recognition performance across the evaluated datasets <ref:2605.00675#pg2>. For instance, on BloodMNIST, DMDSC achieves the highest AUROC (91.12%) and OSCR (90.49%), outperforming strong baselines such as DSC, UCDSC, OMCL, and ARPL+CS <ref:2605.00675#pg2>. Furthermore, on the fine-grained BreaKHis(40×) dataset, DMDSC achieves the highest AUROC (71.90%) and OSCR (68.99%), while maintaining competitive closed-set accuracy (93.44%) <ref:2605.00675#pg2>.

Robustness to Class Imbalance

The effectiveness of the losses is demonstrated by varying λinter and λbg on various datasets <ref:2605.00675#pg3>. On BloodMNIST, adding Linter (λinter ̸= 0, λbg = 0) improves AUROC/OSCR from 87.23%/86.75% to 89.27%/88.87% (+2.04/+2.12%), and further introducing Lbg gives the best AUROC/OSCR of 91.12%/90.49% (+3.89%/+3.74%) <ref:2605.00675#pg2>. Similarly, on ASC, adding Linter (λinter ̸= 0, λbg = 0) improves AUROC/OSCR from 67.73%/64.48% to 72.73%/69.56% (+5.00/+5.08%), and further introducing Lbg gives the best AUROC/OSCR of 74.11%/71.38% (+6.38%/+6.90%) <ref:2605.00675#pg3>. Under the more severe class imbalance setting (IR = 100) on the ASC dataset, DMDSC consistently outperforms both baselines, achieving 57.89% ACC, 60.93% AUROC, and 41.39% OSCR <ref:2605.00675#pg4>.

Conclusion

In this work, we proposed DMDSC, a Dynamic-Margin Deep Simplex Classifier for open-set recognition in imbalanced medical image datasets <ref:2605.00675#pg2>. The findings indicate that incorporating a dynamic margin improves feature separation under class imbalance without increasing model complexity <ref:2605.00675#pg3>. This work can be useful in the healthcare domain where AI systems encounter rare diseases, imaging artifacts, or previously unseen pathologies, enabling safer diagnosis by accurately classifying known diseases while reliably rejecting unknown cases <ref:2605.00675#pg2>. The plan to extend our method to non-linear margin function m(p) is noted as a part of future work <ref:2605.00675#pg2>.

Table 1. Comparison with state-of-the-art methods across five datasets based on ACC, AUROC, and OSCR metrics. t = number of open-set trials (known and unknown classes are chosen randomly in each trial). Mean results over five runs are reported <ref:2605.00675#pg9>.

Table 2. Results on Datasets with varying λinter and λbg. (a) BloodMNIST,λinter 0 0.01 0.1 1 10,λbg 0 0.1 1, ACC/AUROC/OSCR values <ref:2605.00675#pg10>.

Table 3. Comparison of DSC, UCDSC, and the proposed DMDSC on the ASC dataset with varying imbalance ratios (IR). Performance is evaluated using ACC, AUROC, and OSCR metrics.

Table 4. Hyperparameter values used for each dataset. BL: BloodMNIST, OCT: OCTMNIST, DE: DermaMNIST, ASC: Augmented Skin Conditions, BK: BreaKHis (40×). Parameter BL OCT DE BK ASC Batch size mmin mmax λinter λbg R.

Improvements for AI systems

  1. A class-adaptive dynamic margin enforces a higher penalty and tighter feature clustering for rare pathologies to counteract the effects of data imbalance, which ensures even minority classes maintain discriminative feature clusters that are resilient to encroachment by majority classes.

  2. The DMDSC framework can maintain stable geometric separation for both majority and minority pathologies within a simplex ETF space, addressing the limitation of existing methods where majority classes form dense clusters and minority classes form sparse clusters under imbalanced conditions.

  3. The system can achieve superior rejection capabilities compared to previous uniform-margin UCDSC and other state-of-the-art (SOTA) methods, demonstrated by achieving a high AUROC for unknown class detection across diverse medical benchmarks like BloodMNIST and BreaKHis(40×).

  4. The model exhibits remarkable resilience to skewed data distributions, meaning it can maintain high performance stability even under severe imbalance ratios (IR = 100) on datasets like Augmented Skin Conditions, where it outperforms baselines by significant margins.

  5. By incorporating the auxiliary dataset, DMDSC can improve open-set recognition performance by enforcing separation between unknown regions and known-class centers, leveraging data from 300k Random Images to enhance discrimination in Near-OOD tasks.

Abstract

Medical imaging datasets are often characterized by extreme class imbalances, where rare pathologies are significantly underrepresented compared to common conditions. This imbalance poses a dual challenge for Open-Set Recognition (OSR): models must maintain high classification accuracy on known classes while reliably rejecting unknown samples unseen during training in the clinical settings. While recently proposed Deep Simplex Classifier (DSC) and UnCertainty-aware Deep Simplex Classifier (UCDSC) successfully leverage Neural Collapse to ensure maximal inter-class separation, they rely on a uniform margin that does not account for the varying densities of medical classes. In this paper, we propose DMDSC an enhanced framework featuring a dynamic margin approach. Our approach automatically adapts class-specific margins based on label frequency, enforcing a higher penalty and tighter feature clustering for rare pathologies to counteract the effects of data imbalance. Extensive experiments conducted on diverse medical benchmarks on BloodMNIST, OCTMNIST, DermaMNIST, and BreaKHis datasets, demonstrate that our framework outperforms state-of-the-art methods.

Sources

Related papers