TRANSMISSION // 2306.00879v2

When a Class Appears in Only One Domain, Can AI Still Generalize?

Source published

A classification model may learn the setting around a rare class instead of the class itself. FOND aims to use patterns shared across domains to improve performance on classes found in just one training domain.

AI-generated conceptual illustration for When a Class Appears in Only One Domain, Can AI Still Generalize?
AI-generated conceptual illustration; not documentary evidence.

Machine-learning systems often face a basic data problem: some categories appear in only one hospital, region or other setting. A model can then mistake clues about that setting for clues about the category. Researchers propose FOND, a training method designed to transfer domain-robust features from classes seen in several settings to classes seen in only one.

The problem: a class tied to one setting

Domain generalization is the effort to train a model on several environments and have it work in a new one. For example, an image classifier might learn from photographs taken in several hospitals, then be tested at a hospital it has never encountered. A core difficulty is that a class should ideally appear across multiple training environments: otherwise, the model may associate that class with the particular environment where it was observed.

The paper calls a category domain-linked if it appears in only one training domain, and domain-shared if it appears in more than one. The authors argue that this distinction matters because a model can perform well overall while struggling on domain-linked categories. Their question is whether information learned from domain-shared classes can help a model recognize domain-linked classes in a new environment.

How FOND is meant to help

The proposed method, FOND, combines contrastive learning with a fairness-inspired objective. Contrastive learning trains a model to arrange examples in a useful feature space: examples of the same class are encouraged to have similar representations, while examples of different classes are separated. FOND gives particular attention to relationships between examples from different domains and to different-class examples from the same domain, aiming to reduce reliance on environment-specific visual cues.

The fairness-inspired part has a specific meaning here. It is not a method for balancing outcomes across demographic groups. Instead, it aims to reduce the performance gap between domain-linked and domain-shared classes, so that features learned from shared classes can benefit linked ones. The full training objective combines ordinary classification loss, a domain-aware contrastive loss and a loss based on the difference in performance between the two class groups.

The authors tested FOND and a range of existing domain-generalization methods on three image-classification benchmarks—PACS, VLCS and OfficeHome—and on Camelyon17, a medical-image dataset containing tissue images from five hospitals. They varied how many classes were shared across domains. In the Camelyon17 experiment, they deliberately restricted tumour-positive training examples to one hospital, then evaluated on a held-out hospital. The study used ImageNet-pretrained ResNet-18 models and reported class-averaged accuracy for domain-linked classes in its benchmark experiments.

What the study reports

Across the three general-purpose image benchmarks, FOND performed best among the tested methods in the setting with more domain-shared classes. The authors report that its domain-linked-class performance was strongest on average, while performance on shared classes remained competitive. Results were less impressive when fewer classes were shared, consistent with the method having less cross-domain information to draw on.

On Camelyon17, the authors report tumour-detection accuracy of 67.0% on the held-out hospital for FOND, compared with 58.7% for the strongest baseline in their table, Transfer. The table gives average out-of-distribution accuracy of 83.4% for FOND and 79.3% for Transfer. This is a controlled benchmark exercise, not evidence that FOND is ready for clinical use or will improve diagnosis in hospitals generally.

The results also were not uniform across settings. On OfficeHome, increasing the number of shared classes did not improve domain-linked performance for any tested method; the authors suggest that making many classes shared may shift learning away from the remaining linked classes. They also report that FOND struggles when the supply of shared classes is low. These qualifications matter: the approach depends on having enough useful shared-class data, and more shared classes do not guarantee better results in every dataset.

What remains uncertain

The paper’s theory offers a way to reason about why linked classes may generalize poorly, focusing on sample availability and differences between training and target domains. Such bounds depend on assumptions and do not guarantee that a model will work in a particular deployment. Likewise, experiments on four established datasets cannot capture every kind of domain shift or data limitation encountered in practice. The authors themselves identify the binary linked/shared distinction as a simplification and suggest studying classes with varying degrees of sharedness.

The source provided is an accepted version of a paper published in IEEE Transactions on Pattern Analysis and Machine Intelligence in 2025, rather than an unreviewed preprint. The paper also points to an earlier non-archival workshop version and provides code. This publication history is relevant, but it does not remove the usual limits of benchmark research: independent replication and evaluation in real deployment settings would be needed to establish broader usefulness. The findings support FOND as a promising approach under the tested conditions, not a general solution to data scarcity or domain shift.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.