Hardness-Aware Contrastive Learning With Data Condensation for Open-Set Hyperspectral Image Classification
Abstract
In recent years, hyperspectral image classification (HSIC) has been widely applied in precision agriculture, environmental monitoring, and remote sensing. However, the frequent emergence of unknown categories, such as novel land-cover types and anomalous regions, poses significant challenges to traditional closed-set classifiers. Open-set classification seeks to accurately recognize known classes while rejecting unknown ones, but existing methods are often limited by high intraclass spectral variability, insufficient exploitation of hard samples, and imprecise class representations. To overcome these challenges, this article proposes an open-set detection framework called HACL-DC, which combines hardness-aware contrastive learning with soft-label-weighted data condensation. The framework consists of three key components. First, a similarity contrastive weighting module enhances contrastive learning by assigning higher weights to hard intraclass positives and interclass negatives through linear transformations combined with sigmoid and inverse-sigmoid functions, promoting compact intraclass features and stronger interclass separation. Second, a soft-label-weighted condensation algorithm (SWCA) constructs compact etalon sets for each known class by leveraging soft-label assignment, dual-parameter gradient optimization, and adaptive etalon resetting to capture fine-grained class distributions and local density information. Finally, weighted similarities between test samples and class etalons are computed using etalon influence scores, enabling accurate known-class classification and effective detection of out-of-distribution (OOD) samples. Extensive experiments on three public hyperspectral datasets demonstrate the effectiveness and robustness of the proposed HACL-DC framework.