Next Article in Journal
Advances and Applications of Organ-on-a-Chip and Tissue-on-a-Chip Technology
Next Article in Special Issue
Radiomic Analysis as a Powerful Tool for Cytological Images of Benign Thyroid Nodules Treated by Thermal Radiofrequency Ablation
Previous Article in Journal
Age Estimation of the Cervical Vertebrae Region Using Deep Learning
Previous Article in Special Issue
Explainable Computational Imaging for Precision Oncology: An Interpretable Deep Learning Framework for Bladder Cancer Histopathology Diagnosis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Subclass-Aware Contrastive Semi-Supervised Learning for Inflammatory Bowel Disease Classification from Colonoscopy Images

1
Department of Gastroenterology, Daping Hospital, Army Medical University (Third Military Medical University), Chongqing 400042, China
2
Institute of Medical Robotics, School of Biomedical Engineering, Shanghai Jiao Tong University, Shanghai 200240, China
3
Department of Digital Medicine, School of Biomedical Engineering and Imaging Medicine, Army Medical University (Third Military Medical University), Chongqing 400038, China
*
Authors to whom correspondence should be addressed.
These authors contributed equally to this work.
Bioengineering 2026, 13(1), 8; https://doi.org/10.3390/bioengineering13010008
Submission received: 16 November 2025 / Revised: 18 December 2025 / Accepted: 19 December 2025 / Published: 22 December 2025

Abstract

Inflammatory bowel disease (IBD) includes Crohn’s disease (CD) and ulcerative colitis (UC). The accurate classification of IBD from colonoscopy images is critical for diagnosis and treatment. However, the lack of labeled data poses a major challenge for developing deep learning-based IBD classification approaches. Recently, pseudo-labeling-based semi-supervised learning methods offer a promising solution in leveraging both labeled and unlabeled data to improve classification performance. Nevertheless, due to significant intra-class variability and the subtle inter-class differences in IBD colonoscopy images, pseudo-labels are often inaccurate, which results in confirmation bias and suboptimal performance. To address this challenge, a Subclass-Aware Contrastive Semi-Supervised Learning method, referred to as SACSSL, is proposed for accurate IBD classification by integrating a subclass-aware contrastive module into a pseudo-labeling-based semi-supervised framework, e.g., FixMatch. Specifically, unlabeled samples are first partitioned into confident and uncertain samples according to the confidence of pseudo-labels. An instance-level contrastive loss is then applied to uncertain samples, aiming to mitigate confirmation bias. Furthermore, intra-class heterogeneity is captured by introducing a set of prototypes for each subclass and assigning confident samples to these prototypes to form fine-grained subclasses, and supervised contrastive loss is applied to promote intra-subclass clustering, thereby enhancing inter-class separability while preserving intra-class diversity. Our method is evaluated on two datasets, i.e., an in-house collected Daping dataset for IBD classification and a publicly available LIMUC dataset for UC severity grading. On both datasets, our method achieves state-of-the-art performance under the semi-supervised setting. Specifically, with only 20% labeled data, the proposed method reaches an overall accuracy of 93.2% and an F1-score of 80.1% on the Daping dataset, which is close to the fully supervised upper bound (94.0% accuracy and 80.8% F1-score), and it achieves an overall accuracy of 76.4% and an F1-score of 68.9% on the LIMUC dataset. Comprehensive experimental results demonstrate the effectiveness of our method for semi-supervised colonoscopy image classification.

1. Introduction

Inflammatory bowel disease (IBD), including Crohn’s disease (CD) and ulcerative colitis (UC) [1], has emerged as a global health concern in recent years [2]. Recent epidemiological studies have shown that IBD has evolved across different global regions with increasing incidence in newly industrialized countries [3]. The symptoms of IBD includes diarrhea, abdominal pain, and rectal bleeding, which can seriously affect patients’ quality of life [4,5]. The diagnosis of IBD relies on comprehensive evaluation using endoscopic, histological, clinical, and radiological criteria [6]. In practice, colonoscopy plays a vital role in the diagnosis, treatment, and follow-up monitoring of IBD [7,8]. However, since UC and CD have a similar appearance in colonoscopy, endoscopists may misinterpret the images due to limited experience or unconscious bias, resulting in misdiagnosis, missed diagnoses, and delayed treatment [9]. Therefore, it is necessary to improve the IBD classification accuracy to better distinguish between UC and CD in colonoscopy images, which would enhance patients’ quality of life and equip endoscopists with tools that increase both the accuracy and efficiency of clinical care [10].
With the rapid development of artificial intelligence, data-driven deep learning-based approaches have demonstrated impressive performance in computer-aided endoscopic tasks [11,12,13]. However, the lack of labeled data presents a major challenge for deep learning-based IBD classification. Semi-supervised learning, which leverages both labeled and unlabeled data, provides a promising solution to this problem [14,15]. Commonly adopted semi-supervised learning paradigms in endoscopic classification are pseudo-labeling [16] and consistency regularization [17]. In particular, pseudo-labeling-based methods [16] assign pseudo-labels to unlabeled data based on model predictions, which are then used for supervised training. Consistency regularization [17] assumes that different perturbed or augmented versions of the same input should yield consistent predictions. Building on these two paradigms, previous studies combine pseudo-labeling and consistency regularization techniques to achieve impressive performance [18,19,20,21]. However, high intra-class heterogeneity and low inter-class variance among IBD colonoscopy images may lead to inaccurate pseudo-labels. When the model overfits to these inaccurate pseudo-labels, performance degrades due to confirmation bias [22]. Recently, inspired by self-supervised learning approaches [23,24], Yang et al. [25] designed a class-aware contrastive module to learn more separated feature clusters at the class-level to improve model predictions. This method demonstrates promising performance on the semi-supervised classification of natural images. However, under the context of the IBD semi-supervised classification task, it overlooks intra-class heterogeneity. Forcing highly diverse samples within the same class to learn overly aligned representations may suppress fine-grained semantic information, leading to suboptimal classification performance.
To explicitly model intra-class heterogeneity, previous works [26,27] have attempted to decompose each class into multiple subclasses via clustering and then train classifiers with subclass-aware supervision. However, these methods require all samples to have class labels, thus failing to leverage abundant unlabeled data. Additionally, prototype-based learning has been widely adopted in clustering-based self-supervised learning approaches such as SwAV [28] and DeepCluster [29]. These methods learn representations by contrasting predicted cluster assignments of correlated views of the same image. To aggregate samples together while avoiding collapsed solutions, they employ simple clustering-based pseudo-labeling algorithms (e.g., K-means clustering [30] or the Sinkhorn–Knopp algorithm [31]) to generate assignments. Without access to labeled data, these self-supervised methods learn prototypes that do not encode explicit class information, resulting in suboptimal performance when directly applied to classification tasks.
To address these challenges, a Subclass-Aware Contrastive Semi-Supervised Learning (SACSSL) framework is proposed, which incorporates a carefully designed subclass-aware contrastive module into a pseudo-labeling-based semi-supervised learning paradigm (i.e., FixMatch [18]). The key innovation of the proposed subclass-aware contrastive module lies in explicitly exploiting abundant unlabeled samples to effectively capture intra-class heterogeneity. Instead of treating each class as a single compact cluster, multiple prototypes per class are introduced to automatically discover fine-grained subclasses in the embedding space. By associating unlabeled samples with different prototypes and enforcing subclass-aware contrastive objectives, the proposed module enhances intra-subclass compactness while preserving rich intra-class diversity, leading to more discriminative and semantically meaningful representations. Specifically, in the subclass-aware contrastive module, unlabeled data are partitioned into confident and uncertain sets based on the maximum probability of their pseudo-labels. Because confident samples with high prediction confidence are more likely to provide reliable supervision, while uncertain samples with low prediction confidence tend to introduce noise and thus require cautious handling, different contrastive objectives are designed to different subsets of unlabeled data to fully exploit their potential. Specifically, an instance-level contrastive loss is applied to encourage the separation of uncertain samples from all other samples in the embedding space to mitigate the confirmation bias in the semi-supervised training. To model the intra-class heterogeneity of IBD images, each class is represented by a set of prototypes in the embedding space. Confident samples are assigned to different prototypes within the same class to form fine-grained subclasses, which allows the supervised contrastive loss [32] to promote intra-subclass clustering among confident samples, effectively enhancing class separability while preserving fine-grained intra-class semantics. The main contributions of the proposed method can be summarized as follows:
  • A novel subclass-aware contrastive semi-supervised learning framework for accurate colonoscopy image classification is introduced, which explicitly exploits abundant unlabeled samples to effectively capture intra-class heterogeneity.
  • A novel subclass-aware contrastive module that adaptively handles unlabeled data with different contrastive objectives based on pseudo-label confidence is designed, aiming to suppress confirmation bias for uncertain samples and discover fine-grained subclasses for confident samples, thereby enhancing class separability while capturing intra-class variations.
  • Comprehensive experiments are conducted on two colonoscopy image datasets, i.e., an in-house collected Daping dataset for IBD classification and a publicly available LIMUC dataset for UC severity grading. The experimental results demonstrate that the proposed method achieves superior classification performance compared to state-of-the-art semi-supervised learning methods on both datasets.

2. Related Works

2.1. Deep Learning-Based IBD Diagnosis Applications

A variety of deep learning-based approaches have been developed to assist the IBD diagnosis across different modalities. [12,13,33,34,35,36,37,38,39,40,41]. In colonoscopy, Ruan et al. [12] developed a deep learning model based on a deep convolutional neural network to distinguish between UC and CD using over 47,000 endoscopic images from a private dataset, achieving better classification performance compared to junior endoscopists. Similarly, Mauricio et al. [33] developed interpretable deep learning models to classify UC and CD with visualization modules that highlight disease-relevant regions, thereby enhancing clinical trust. In another study, Stidham et al. [34] evaluated the performance of Inception V3, a 159-layer CNN [35], on the task of endoscopic severity grading of UC, showing performance on par with experienced human reviewers. To address the class imbalance commonly observed in IBD-related classification tasks, recent works have proposed specialized techniques, such as high-frequency balancing and augmentation [38] or class distance weighted loss functions [39] to improve minority-class recognition.
Beyond colonoscopy, Klang et al. [36] employed EfficientNet-B5 [37] for detecting strictures from capsule endoscopy images in CD, showing robust generalization capability in multi-center datasets. Similarly, Malik et al. [40] achieved 99.45% accuracy in multi-class classification of UC, polyps, and dyed-lifted polyps from wireless capsule endoscopy (WCE) images using hybrid CNN-GRU architectures. Extending to panenteric capsule endoscopy, Brodersen et al. [41] demonstrated that AI-assisted PCE can effectively differentiate CD, UC, and cancer in a prospective multi-center study, significantly reducing image review time using the AXARO® framework. More recently, Das et al. [42] developed a deep learning model for classifying IBD activity grades from histopathology whole slide images, achieving robust diagnostic performance that could assist pathologists in consistent IBD assessment.
However, these approaches heavily rely on large amount of expert-annotated data that is often difficult to acquire due to the time-consuming annotation process and expertise knowledge requirement.

2.2. Semi-Supervised Learning in Endoscopic Image Analysis

Semi-supervised learning has emerged as a promising paradigm by leveraging both labeled and unlabeled data to improve the IBD classification performance, thereby alleviating the heavy reliance on large amount of expert-annotated data. Previous studies have explored the application of semi-supervised learning in endoscopic image analysis [20,21,43,44,45], primarily employing two techniques: pseudo-labeling [16] and consistency regularization [17]. Guo et al. [43] proposed a semi-supervised learning framework with an Adaptive Aggregated Attention module for automatic wireless capsule endoscopy image classification, significantly outperforming supervised baselines. Muruganantham et al. [44] developed ACT-WISE, which employed a teacher–student framework to enforce consistency under perturbations of unlabeled wireless capsule endoscopy images, and integrated active learning for improving label efficiency. There exist other works that combine pseudo-labeling and consistency regularization techniques. Notably, FixMatch [18] integrated both techniques by applying weak and strong augmentations to each unlabeled image, where predictions from the weakly augmented image served as pseudo-labels for training on the strongly augmented image, which has shown impressive classification performance in natural image benchmarks. This has been extended by previous studies [20,21,45] to semi-supervised endoscopic image classification. For example, Huang et al. [20] proposed the class-specific distribution alignment strategy to improve the quality of pseudo-labels when training on highly imbalanced datasets and demonstrate its effectiveness in endoscopic image classification.
Beyond consistency regularization and pseudo-labeling, recent studies have explored incorporating auxiliary tasks into semi-supervised frameworks to enhance representation learning. These tasks can be employed either by self-supervised pretraining to provide better model initialization or incorporating auxiliary objectives into the semi-supervised framework to refine feature representations. For example, Wang et al. [46] proposed a semi-supervised framework that is first pretrained with self-supervised learning on a large unlabeled dataset and then fine-tuned on a limited labeled dataset, achieving promising performance on classifying colorectal neoplasia from narrow-band imaging colonoscopic images under low-label settings. Golhar et al. [47] proposed a novel semi-supervised method that combines an unsupervised jigsaw puzzle solving task with supervised learning, which has achieved promising results in classifying lesions from colonoscopy images. Yang et al. [25] incorporate a class-aware contrastive module into the pseudo-labeling-based semi-supervised framework. Specifically, they apply class-level clustering to in-distribution samples and instance discrimination contrastive loss to out-of-distribution samples, and they achieve impressive performance on natural image benchmarks.

3. Materials and Methods

In this work, we consider a semi-supervised IBD classification problem from colonoscopy images. Specifically, for a C-class classification problem, let the input image be x R H × W × 3 and the ground truth label be y { 1 , , C } , where H and W denote the height and width of the image, and 3 corresponds to the RGB channels. Let D l = { ( x l n , y l n ) n = 1 , , N l } and D u = { x u m m = 1 , , N u } be the labeled and unlabeled datasets, respectively, where x l n and y l n are the labeled images and the corresponding labels, and x u m are the unlabeled images. N l and N u are the number of samples in the labeled dataset and the unlabeled dataset, respectively, where N u N l . We employ a visual encoder g θ to obtain feature representation. We further attach a prediction head h θ to the visual encoder g θ to produce distribution over classes, i.e., p ( y | x ; θ ) = h θ ( g θ ( x ) ) . Moreover, we attach a projection head h ϕ to the visual encoder g θ to obtain low-dimensional features in embedding space for contrastive learning, i.e., z = h ϕ ( g θ ( x ) ) , where z represents the projected representation of input image x. At each epoch, we first randomly shuffle the labeled dataset D l and the unlabeled dataset D u , and then split each dataset into a series of smaller data chunks. We sample one data chunk from the labeled dataset and one from the unlabeled dataset at each iteration. Let B be a data batch which has B samples in total, containing labeled data B l = { ( x l n , y l n ) n = 1 , , B l } and unlabeled data B u = { x u m m = 1 , , B u } where B l and B u are the number of labeled samples and the unlabeled samples in the batch, respectively.
A schematic illustration of the proposed SACSSL is presented in Figure 1. The framework comprises a visual encoder g θ , a prediction head h θ and a projection head h ϕ , which are integrated with a semi-supervised learning module and a novel subclass-aware contrastive module. Within the framework, we first apply a weak augmentation A u g w ( · ) to all images and two strong augmentations A u g s 1 ( · ) and A u g s 2 ( · ) to the unlabeled images. All augmented images are then passed through the visual encoder to extract features, which are subsequently optimized by two complementary modules. In the semi-supervised learning module, ground-truth labels supervise the weakly augmented labeled samples, while pseudo-labels generated from weakly augmented unlabeled images serve as supervision targets for their first strongly augmented counterparts. Subsequently, embeddings from paired strongly augmented unlabeled images are extracted via the projection head h ϕ and jointly processed by the subclass-aware contrastive module. In the subclass-aware contrastive module, confident and uncertain samples are identified based on pseudo-labels, and then tailored contrastive learning strategies are applied to each group to preserve fine-grained intra-class semantics while enhancing inter-class separability, as detailed in Section 3.2. These components are jointly optimized in an end-to-end manner with three objectives: a supervised loss L s , an unsupervised loss L u , and a subclass-aware contrastive loss L s a c . Details will be presented below. For a quick reference, we list common symbols used in this section in Table 1.

3.1. Semi-Supervised Learning Module

Following FixMatch [18], the semi-supervised learning module consists of two cross-entropy loss terms: a supervised loss L s applied to labeled data and an unsupervised loss L u applied to unlabeled data.
For each labeled sample ( x l n , y l n ) (where n { 1 , , B l } ) , we are aiming at minimizing the cross-entropy loss between the model’s predicted distribution over classes on the weakly augmented view A u g w ( x l n ) and the corresponding ground truth label y l n . Accordingly, the supervised loss L s is defined as
L s = 1 B l n = 1 B l H ( y l n , p ( y | A u g w ( x l n ) ; θ ) )
where H ( · , · ) denotes the cross-entropy function.
For each unlabeled sample x u m (where m { 1 , , B u } ), we generate a weak augmented view A u g w ( x u m ) and a strong augmented view A u g s 1 ( x u m ) . The soft pseudo-label is derived by computing the model’s predicted distribution over classes on the weakly augmented view, i.e., q ( x u m ) = p ( y | A u g w ( x u m ) ; θ ) . Subsequently, the hard pseudo-label is obtained by taking the class with the highest predicted probability, i.e., q ^ ( x u m ) = arg max   q ( x u m ) . To ensure quality of the pseudo-label, we retain only those samples whose highest predicted probability exceeds a threshold T for training. Formally, we define a binary indicator: η m = I ( max q ( x u m ) > T ) , where I ( · ) is the indicator function that returns 1 if the condition holds and 0 otherwise. Finally, we aim to minimize the cross-entropy loss between the hard pseudo-label q ^ ( x u m ) and the model’s predicted distribution over classes on the strongly augmented view, i.e., p ( y | A u g s 1 ( x u m ) ; θ ) . Accordingly, the unsupervised loss L u is defined as
L u = 1 B u m = 1 B u η m · H ( q ^ ( x u m ) , p ( y | A u g s ( x u m ) ; θ ) )

3.2. Subclass-Aware Contrastive Module

The limited visual difference between different classes and the significant appearance variability within the same class lead to inaccurate pseudo-labels, which post great challenges for accurate IBD classification. To meet these challenges, we introduce a subclass-aware contrastive module to regularize the low-dimensional feature embedding space. A schematic illustration of the proposed subclass-aware contrastive module is presented in Figure 2. In the subclass-aware contrastive module, confident and uncertain samples are first identified based on the pseudo-labels. To capture intra-class heterogeneity, each class is represented by a set of online-updated prototypes. Confident samples are then assigned to these prototypes to form subclasses, and distinct contrastive objectives are respectively applied to confident and uncertain samples in the embedding space. Specifically, uncertain samples are optimized with an instance-level contrastive loss to reduce the impact of inaccurate pseudo-labels. For confident samples, a subclass-level contrastive loss is designed to encourage subclass-level clustering, enabling the model to preserve fine-grained intra-class semantics and enhance inter-class separability. A step-by-step explanation of the details is presented below.
For each unlabeled sample x u m B u , we generate a second strongly augmented view A u g s 2 ( x u m ) in addition to the first view A u g s 1 ( x u m ) . We then construct two data batches composed of the strong augmented views and the corresponding soft pseudo-labels, which are defined as B u 1 = { ( A u g s 1 ( x u m ) , q ( x u m ) ) m = 1 , , B u } and B u 2 = { ( A u g s 2 ( x u m ) , q ( x u m ) ) m = 1 , , B u } . Subsequently, these batches are merged into a multi-view batch B m = B u 1 B u 2 , which contains 2 B u samples. For notational simplicity, we denote the multi-view batch as B m = { ( x ˜ i , q ˜ i ) i = 1 , , 2 B u } , where x ˜ i represents a strongly augmented view and q ˜ i is its corresponding soft pseudo-label. Subsequently, all images in the multi-view batch are fed through the visual encoder g θ ( · ) and the projection head h ϕ ( · ) to produce the embedding set Z = { z i i = 1 , , 2 B u } , where each embedding is 2 -normalized. Next, let I = { 1 , , 2 B u } be the set of indices of all augmented samples within the multi-view batch. We partition I into confident and uncertain sets based on the confidence of the corresponding pseudo-label: I c o n f = { i I max ( q ˜ i ) > T c o n f } ,   I u n c = { i I max ( q ˜ i ) T c o n f } , where T c o n f is a scalar hyperparameter that determines whether a sample should be considered as a confident sample. This separation allows the model to employ the instance-level contrastive loss L u n c and the subclass-level contrastive loss L c o n f anchored, respectively, at uncertain and confident samples. In the following, we describe the design of the instance-level and the subclass-level contrastive losses in detail.

3.2.1. Instance-Level Contrastive Loss

To mitigate the confirmation bias during training, we employ an instance-level contrastive loss on uncertain samples, following the formulation in SimCLR [23], where each image instance is treated as its own class. Specifically, taking an anchor embedding from the uncertain sample z i (where i I u n c ) and another embedding z j (where i j ) for example, we regard the embedding pair ( z i , z j ) to be positive only when z j is the embedding from the alternative augmented view of the same original image, which is denoted as z i . Otherwise, the embedding pair is considered to be negative. Subsequently, the instance-level contrastive loss L u n c is formulated as
L u n c = i I u n c log exp z i · z i / τ j = 1 2 B u I ( j i ) exp z i · z j / τ
where τ is a temperature parameter.

3.2.2. Prototype-Based Subclass-Level Contrastive Loss

To capture fine-grained intra-class semantics and improve inter-class separability, we propose a prototype-based subclass-level contrastive learning strategy. Confident samples are assigned to a set of class-specific prototypes, effectively forming subclasses. Inspired by [32], we designed a supervised contrastive loss to encourage samples within each subclass to cluster closely while remaining distinct from other subclasses. The details about the prototype-based subclass-level contrastive loss are presented below.
Online Prototype Assignment. For each class c { 1 , , C } , we incorporate K subclass prototypes { p k c } k = 1 K to represent this class, where each prototype p k c R D is an 2 -normalized vector in the embedding space. Let I c denote the indices of confident samples in the multi-view batch that are predicted as class c, i.e., I c = { i arg max q ˜ i = c , i I c o n f } , and let N c = | I c | denote the number of samples in I c . We enumerate these indices as I c = { i 1 c , , i N c c } . The corresponding confident samples are collected as X c = { x ˜ i n c n 1 , , N c } . Our objective is to assign the samples in X c to the K subclass prototypes of class c. We denote the sample-to-prototype mapping as M c = [ m i n c ] n = 1 N c R K × N c , where each m i n c R K represents the assignment probabilities of sample x i n c over the K prototypes.
Concretely, given the embedding matrix Z c = [ z i n c ] n = 1 N c R D × N c where each z i n c R D is the 2 -normalized embedding of x i n c , M c is optimized by solving an optimal transport problem [48] that maximizes the cosine similarity between Z c and the prototypes, i.e., P c = [ p k c ] k = 1 K R D × K with an entropy regularization term. The optimization objective is defined as
max M c Q Tr ( M c P c Z c ) + κ i , j M i , j c log M i , j c , s . t . M c R + K × N c , M c 1 N c = 1 K , M c 1 K = N c K 1 N c
where κ is a parameter controls the smoothness of M c , while 1 K and 1 N c denote all of the K-dimension and N c -dimension vectors, respectively. The unique assignment constraint, i.e., M c 1 N c = 1 K , ensures that each sample is assigned to one prototype. The equipartition constraint, i.e., M c 1 K = N c K 1 N c , enforces each prototype is selected at least N c K times on average in the multi-view batch, which prevents the trivial solution. The solution to this optimization problem is
M c = diag ( u ) exp P c Z c κ diag ( v )
where u R K and v R N are renormalization vectors, which can be updated by a few steps of the Sinkhorn–Knopp algorithm [31].
Prototype-based Subclass-level Contrastive Loss. With the assignment probability matrix M c , we online group the samples X c into K prototypes { p k c } k = 1 K within class c. After processing all confident samples in the multi-view batch, each confident sample x ˜ i (where i I c o n f ) is assigned to k i -th prototype of class c i , where c i = arg max q ˜ i and k i = arg max   m i .
Subsequently, taking an anchor embedding from a confident sample z i (where i I c o n f ) and an another embedding z j (where j i ) for example, we regard the embedding pair ( z i , z j ) to be positive if one of the following conditions holds: (1) z j is the embedding from the alternative augmented view of the same original image, which is denoted as z i , or (2) z j corresponds to a different original image but is assigned to the same prototype as z i . Formally, we define the set of cross-image positive indices as P o s ( i ) j I c o n f | c i = c j , k i = k j , j i , j i . Otherwise, the embedding pair is considered to be negative. To weaken the bias of enforcing alignment between samples with potentially incorrect pseudo-labels, we introduce a confident weight w i p for positive pairs from different images. Specifically, for a positive pair ( z i , z p ) where p P o s ( i ) , the confident weight is defined as w i p = max ( q ˜ i ) · max ( q ˜ p ) .
We calculate contrastive loss L c o n f , i anchored at z i as follows:
L c o n f , i = log exp z i · z i / τ j = 1 2 B u I ( j i ) exp z i · z j / τ p P o s ( i ) w i p · log exp z i · z p / τ j = 1 2 B u I ( j i ) exp z i · z j / τ
where τ denotes the temperature parameter.
The prototype-based subclass-level contrastive loss L c o n f is defined by
L c o n f = i I c o n f 1 1 + | P o s ( i ) | L c o n f , i
where | P o s ( i ) | is the number of positive samples for the i-th sample in the multi-view batch.
Prototype Update. At the training stage, the prototypes { p k c } c = 1 , k = 1 C , K are updated in an online manner using the embeddings assigned to them. Specifically, after each iteration, each prototype is updated based on the normalized center of its assigned embeddings, which can be formulated as
p k c α p k c + ( 1 α ) z i A c k z i | | z i A c k z i | | 2
where A c k represents the set of embeddings assigned to prototype p k c in the multi-view batch, and α is the momentum coefficient.

3.2.3. Subclass-Aware Contrastive Loss

The subclass-aware contrastive loss L s a c is defined as the average of losses anchored at the confident and the uncertain samples over the multi-view batch.
L s a c = 1 2 B u L c o n f + L u n c

3.3. Overall Objective Function

The overall objective function of the proposed method is
L t o t a l = L s + λ 1 L u + λ 2 L s a c
where λ 1 and λ 2 are weighting parameters for the unsupervised loss L u and the subclass-aware contrastive loss L s a c , respectively.

4. Results

4.1. Experimental Setting

Study approval. This retrospective study was approved by the ethics committee of Daping Hospital affiliated with Army Military Medical University (No. 2018-137). A waiver of informed consent was granted by the same ethics committee. In addition, the clinical study registration number is ChiCTR2100043278. The study complies with the Declaration of Helsinki.
Datasets. We conduct comprehensive experiments on two colonoscopy image datasets: an in-house collected Daping dataset for IBD classification and a publicly available LIMUC dataset [49] for UC severity grading.
(1)
Daping dataset: The Daping dataset comprises 17,161 colonoscopy images from 599 patients collected at the Department of Gastroenterology, Daping Hospital, Army Medical University, between January 2018 and November 2020. Following quality control, images were independently annotated by two experienced gastroenterologists with disagreements resolved by a third expert. Specifically, the Daping dataset consists of three categories, including 1093 CD images, 3379 UC images, and 12,689 normal mucosa images.
(2)
LIMUC dataset: The LIMUC dataset [49] consists of 11,276 colonoscopy images collected from 564 patients. The images are annotated by experienced gastroenterologists according to the Mayo Endoscopic Score (MES) and are distributed across four severity grades, including 6105 images with MES 0, 3052 images with MES 1, 1254 images with MES 2, and 865 images with MES 3.
We randomly split the dataset by patient into training and testing sets with a ratio of 8:2, ensuring that no images from the same patient appear in both sets. Within the training set, the labeled and unlabeled data are also split by patient to maintain patient-level separation. We adopt a default labeled-to-unlabeled data ratio of 2:8, meaning that 20% of the training samples are labeled while the remaining 80% are treated as unlabeled. The split is also performed at the patient level, ensuring that all images from a single patient are assigned exclusively to either the labeled or the unlabeled subset.
Implementation Details. The proposed framework is implemented in PyTorch 2.5.0, and all experiments are performed on one NVIDIA GeForce RTX 4090 GPU and an Intel(R) Xeon(R) Silver 4214R CPU @ 2.40GHz. The network backbone is ViT-B/16-224 [50]. For experiments on the in-house collected Daping dataset, the visual encoder is initialized through self-supervised pretraining on the training set using i-JEPA [51]. For experiments on the publicly available LIMUC dataset [49], we initialize the visual encoder directly with ImageNet-pretrained weights [52] to facilitate reproducibility. It is worth noting that for fair comparison, all competing methods evaluated on the same dataset employ the identical visual encoder with the same initialization strategy. The weak augmentation A u g w ( · ) includes random cropping and flipping. We adopt RandAugment [53] as the strong augmentation function A u g s ( · ) . The training batch sizes for labeled and unlabeled data are 40 and 80, respectively. For the hyperparameters, we empirically set T = 0.8 , λ 1 = 1 , λ 2 = 2 , T c o n f = 0.9 , D = 128 , κ = 0.05 , K = 3 , and α = 0.99 . The AdamW optimizer [54] is employed with a weight decay of 5 × 10 4 . The learning rate is initialized to 10 3 and linearly decreases to 10 6 over 150 epochs. The model saved at the end of 150 epochs is used for testing.
Evaluation Metrics. We report the classification performance using four evaluation metrics: accuracy, specificity, sensitivity and F1-score. Accuracy is calculated as the proportion of correctly classified samples over the entire test set. In addition, sensitivity, specificity, and F1-score are computed for each class and then averaged across all classes. Specifically, for each class c, T P c , T N c , F P c , and F N c denote the true positives, true negatives, false positives, and false negatives, respectively. Then, the evaluation metrics are calculated by
Accuracy = c = 1 C T P c + T N c c = 1 C T P c + T N c + F P c + F N c
Sensitivity = 1 C c = 1 C T P c T P c + F N c
Specificity = 1 C c = 1 C T N c T N c + F P c
F 1 - score = 1 C c = 1 C 2 T P c 2 T P c + F P c + F N c

4.2. Comparison with State-of-the-Art Semi-Supervised Learning Methods

To evaluate performance, we compared our method with five SOTA semi-supervised learning methods on both the Daping dataset and the LIMUC dataset [49]. The characteristics of each SOTA method are summarized as follows. (1) FixMatch [18], which combines pseudo-labeling with consistency regularization, and applies a fixed confidence threshold to ensure the quality of pseudo-labels; (2) FreeMatch [55], which extends FixMatch by adopting an adaptive thresholding strategy that dynamically adjusts the confidence threshold in a class-aware manner, achieving a better quality–quantity trade-off; (3) Class-aware Semi-supervised Contrastive Learning (CCSSL) [25], which integrates a class-aware contrastive module into the FixMatch framework. It separately handles in-distribution data with class-level clustering and out-of-distribution data with instance-level contrastive; (4) SoftMatch [56], which extends FixMatch by using a truncated Gaussian weighting function to assign confidence-based weights to unlabeled samples rather than using a fixed threshold to filter them; (5) Semantic-aware FixMatch (SA-FixMatch) [21], which replaces the standard random CutOut in FixMatch’s strong augmentation with a semantic-aware CutOut.
Moreover, to quantify the performance of different competing methods, we trained two additional models on the dataset. These two models had the same network architecture as our method. The first model, referred to as the upper bound, was trained on 100% labeled data in a fully supervised manner, while the second model, referred to as the baseline, was trained in a fully supervised manner on 20% labeled data without using any unlabeled data.
To assess the statistical significance of performance differences between models, we apply bootstrap resampling [57] to estimate the distribution of pairwise differences in F1-score, as the F1-score provides a more reliable overall metric than accuracy for imbalanced classification. A 95% confidence interval (CI) of the difference is then computed. Following established statistical interpretation [58,59], when a confidence interval (CI) includes zero, it means that the observed difference is not statistically significant at the 95% confidence level.
Results on the Daping Dataset. The quantitative comparison with the competing SOTA methods when using 20% labeled data for training is presented in Table 2. From this table, one can observe that our method achieves the best classification performance with an accuracy of 93.2 % , a sensitivity of 76.8 % and an F1-score of 80.1 % . Specifically, our method outperforms the second-best method (CCSSL [25]) by a margin of 0.5 % , 0.8 % and 1.9 % in terms of accuracy, sensitivity and F1-score, respectively. Moreover, the 95% CI of the F1-score difference is [0.003, 0.041], which does not include zero, indicating that the performance improvement of our method over CCSSL [25] is statistically significant at the 95% confidence level for the semi-supervised IBD classification task. The experimental results demonstrate the effectiveness of the proposed method in the semi-supervised IBD classification of colonoscopy images. Additionally, from Table 2, one can observe that our proposed SACSSL surpasses the baseline performance by a substantial margin of 2.2 % , 2.6 % , 1.0 % and 4.6 % in terms of accuracy, sensitivity, specificity and F1-score, respectively, and it is close to the upper-bound performance, with a small gap of 0.8 % , 1.6 % , 1.5 % and 0.7 % in terms of accuracy, sensitivity, specificity and F1-score, respectively. These results demonstrate the superior capability of our method in leveraging the unlabeled data for the semi-supervised IBD classification of colonoscopy images.
Results on the LIMUC Dataset. The quantitative comparison with the competing SOTA methods when using 20% labeled data for training is presented in Table 3. From this table, one can observe that our method achieves the highest accuracy (76.4%) and F1-score (68.9%) along with a sensitivity of 67.7% and a specificity of 91.0%. In comparison, CCSSL [25] attains a higher sensitivity of 68.9% and a specificity of 91.2% but with lower accuracy (75.9%) and F1-score (68.0%). The 95% CI of the F1-score difference between our method and CCSSL [25] is [−0.005, 0.026], indicating that the performance improvement is not statistically significant at the 95% confidence level. This outcome may be attributed to the inherent characteristics of the UC severity grading task, which consists of fine-grained categories with smaller inter-class differences and more constrained intra-class variation, naturally limiting the potential gains achievable by the subclass-aware contrastive module. Despite these constraints, our method still achieves the highest overall accuracy and F1-score. The experimental results demonstrate the effectiveness of the proposed method in semi-supervised UC severity grading, indicating its adaptability across different IBD-related colonoscopy image classification tasks.

4.3. Analytical Ablation Studies

We further conduct analytical ablation studies on the Daping dataset to investigate the effectiveness of different components of the proposed method. In particular, we conduct the following analytical ablation studies: (1) We first evaluate the classification performance of the proposed method using different percentages of labeled data; (2) We then investigate the effectiveness of each loss to the overall classification performance gain in the proposed method; (3) We further investigate the influence of the confidence threshold T c o n f and the number of prototypes per class K in the subclass-aware contrastive module on the performance of the proposed method; (4) Additionally, we investigate the influence of the visual encoder backbone on the performance of the proposed method; (5) Finally, we conduct an analysis of learned features.
Evaluation under Different Percentages of Labeled Data. We conducted an ablation study to investigate the impact of the percentage of labeled data on the performance of the proposed method. We compared our method with the baseline model when 5%, 10%, 20% and 30% labeled data were used for training. In particular, the baseline model was trained in a supervised manner using only the labeled data, while our method was trained in a semi-supervised manner using both labeled and unlabeled data. The experimental results are presented in Table 4. As shown in this table, our method demonstrates consistent classification performance improvement under all proportions of labeled data compared to the baseline performance. Notably, when trained with only 5% labeled data, our method outperforms the baseline performance by a large margin of 4.7 % , 5.6 % , and 6.0 % in terms of accuracy, specificity and F1-score, respectively, demonstrating its effectiveness in leveraging unlabeled data under very limited labeled data. As the proportion of labeled data increases to 30%, our method outperforms the baseline performance by a margin of 1.9 % , 4.4 % , 1.4 % , and 4.9 % in terms of accuracy, sensitivity, specificity, and F1-score, respectively. These results demonstrate the superior capability of our method in leveraging the unlabeled data to improve classification performance.
Effectiveness of Different Losses. To validate the effectiveness of different losses used in our method, we conduct an ablation study by training the model with different combinations of losses using 20% labeled data: (1) L s ; (2) L s + L u ; (3) L s + L u + L u n c ; (4) L s + L u + L c o n f ; and (5) L s + L u + L s a c (where L s a c is a combination of L u n c and L c o n f ). The experimental results are reported in Table 5. Compared to the baseline model trained with L s alone, the model trained with L s and L u improves the classification performance by a margin of 1.0% in terms of accuracy, while showing a performance drop by a margin of 3.1% and 1.1% in terms of sensitivity and F1-score, respectively, which could be potentially attributed to confirmation bias. In addition to L u and L s , incorporating L u n c further improves the accuracy, sensitivity, specificity and F1-score by a margin of 0.4%, 4.2%, 0.8% and 2.9%, respectively, which demonstrates the effectiveness of the instance-level contrastive loss when applied to uncertain samples. Similarly, incorporating L c o n f in addition to L u and L s improves the classification performance by a margin of 0.5%, 2.0%, 0.5% and 1.5% in terms of accuracy, sensitivity, specificity and F1-score, respectively, demonstrating the effectiveness of the subclass-level contrastive loss when applied to confident samples. Finally, the model that incorporates all the losses results in the best classification performance, outperforming the second-best classification performance by a margin of 0.7%, 1.5%, 0.2%, and 2.8% in terms of accuracy, sensitivity, specificity, and F1-score, respectively, which demonstrates the two complementary components of our subclass-aware contrastive loss L s a c , composed of L u n c and L c o n f , provide synergistic benefits for representation learning. These results demonstrate that the subclass-aware contrastive loss, derived from our proposed subclass-aware contrastive module, effectively enhances representation learning and improves the overall classification performance.
Influence of the Confidence Threshold T conf . The confidence threshold T c o n f determines the separation of confident and uncertain samples in our method. A low T c o n f may include samples with incorrect pseudo-labels in the confident set, introducing noise to subclass-level contrastive learning, whereas a high T c o n f may exclude correctly pseudo-labeled samples from the confident set, which weakens the effectiveness of subclass-level contrastive learning. To investigate the influence of the confidence threshold, we conduct an ablation study by setting T c o n f to a value in { 0.6 , 0.7 , 0.8 , 0.9 , 0.95 } . The experimental results are reported in Table 6. From this table, one can observe that the model achieves the best classification performance when T c o n f is set to 0.9 with an accuracy of 93.2% and an F1-score of 80.1%. Therefore, we adopt T c o n f = 0.9 in our study.
Influence of the Number of Prototypes per Class K . The number of prototypes per class K controls the subclass granularity within each multi-view batch. Too few prototypes may fail to capture fine-grained intra-class variations in IBD colonoscopy images, while too many prototypes may push semantically similar samples away in the embedding space, reducing the effectiveness of contrastive learning. Here, we conduct an ablation study to investigate the performance of the proposed method when setting different K values, where K is in { 2 , 3 , 4 , 5 , 6 } . The experimental results are reported in Table 7. From this table, the model achieves the best classification performance when K is set to 3 with an accuracy of 93.2% and an F1-score of 80.1%. Therefore, we adopt K = 3 in our study.
Influence of the Visual Encoder Backbone. The choice of visual encoder backbone directly affects the quality of extracted visual features, which in turn influences classification performance. To evaluate this effect, we conduct an ablation study using three widely adopted models as the visual encoder backbone: two CNN-based models, ResNet50 [60] and EfficientNet-B5 [37], and a transformer-based model, ViT-B [50]. The experimental results are summarized in Table 8. From this table, one can observe that when using ViT-B [50] as the visual encoder, our method achieves the best classification performance, outperforming the best CNN-based backbone (ResNet-50 [60]) by a margin of 1.7%, 0.1%, 1.1%, and 2.5% in terms of accuracy, sensitivity, specificity, and F1-score, respectively. These results indicate that the transformer-based backbone consistently outperforms the CNN-based backbones in the semi-supervised colonoscopy image classification task. Accordingly, we adopt ViT-B as the visual encoder backbone in our study.
Analysis of the Learned Features. To validate the effectiveness of our method in representation learning, we use the t-SNE algorithm [61] to visualize the distributions of learned features extracted from the visual encoder g θ by projecting the embedded features into a two-dimensional space. In Figure 3, we present a qualitative comparison of the t-SNE visualization on the Daping test set between FixMatch [18] and the proposed SACSSL. The t-SNE analysis is implemented in Python using the scikit-learn package [62] (version 1.5.1). Each point in Figure 3 represents the embedded feature from one colonoscopy image and is color-coded using the ground truth class label. From this figure, one can see that the classification boundary learned by FixMatch, especially between UC and CD, is unclear, such that it is difficult to correctly classify IBD from colonoscopy images. By incorporating our proposed subclass-aware contrastive module, SACSSL learns feature representations with clearer inter-class boundaries, while intra-class features are further partitioned into multiple compact clusters according to their semantic information. This explains why the proposed SACSSL achieves superior classification performance.

5. Discussion

The accurate classification of IBD from colonoscopy images is critical for timely diagnosis and effective treatment. Although deep learning-based approaches have achieved impressive performance in various medical image classification tasks, developing robust models for IBD diagnosis remains challenging due to the limited availability of annotated endoscopic data and the severe intra-class heterogeneity of colonoscopy images. Semi-supervised learning methods provide a promising alternative to this problem by leveraging both labeled and unlabeled data. In particular, the pseudo-labeling-based framework combined with consistency regularization [18,55,56] has proven to be an effective and simple approach. CCSSL [25] extended pseudo-labeling-based frameworks by refining learned features through class-aware contrastive learning that promotes intra-class clustering. Although this approach performs well on natural image tasks, it struggles to capture the substantial intra-class heterogeneity of colonoscopy images in IBD classification. However, prior approaches for modeling intra-class heterogeneity either rely on fully supervised subclass decomposition that cannot exploit unlabeled data or adopt class-agnostic prototype learning in a self-supervised manner, making it difficult to simultaneously leverage unlabeled data and capture fine-grained intra-class variations for IBD classification. To address these limitations, we propose SACSSL, which incorporates the proposed subclass-aware contrastive module into the FixMatch framework. This design enables us to refine learned features by applying an instance-level contrastive loss to distinguish uncertain samples and applying a subclass-level contrastive loss to confident samples to learn hierarchical clustered representations within each class. We evaluate our method on an in-house collected colonoscopy image dataset for IBD classification, which is referred to as the Daping dataset. The proposed method outperforms the SOTA methods, as presented in Table 2. As demonstrated in Table 4, our method achieves consistently improved performance compared to the baseline performance regardless of the percentage of labeled data, which demonstrates that our model can effectively leverage unlabeled data. Moreover, we further evaluate our method on the publicly available LIMUC dataset for UC severity grading, which is an IBD-related classification task. As shown in Table 3, our method outperforms other competing SOTA methods, demonstrating its effectiveness on UC severity grading as an additional colonoscopy image classification task.
The key to the superior performance of SACSSL lies in the carefully designed subclass-aware contrastive module. In particular, we leverage subclass prototypes to partition confident samples into subclasses and apply supervised contrastive loss to learn hierarchical, clustered representations within each class. Quantitative and qualitative results from our analytical ablation studies conducted on the Daping dataset demonstrate that SACSSL learns better-separated feature representations with the proposed subclass-aware contrastive module, as demonstrated by Figure 3 and Table 5.
The clinical implications of the proposed method merit further discussion. In clinical practice, large amounts of colonoscopy data are readily available, whereas obtaining expert annotations remains costly and time consuming. By effectively leveraging abundant unlabeled data available in clinical archives, the proposed framework alleviates the heavy reliance on expert annotations, which is one of the major barriers to the real-world deployment of deep learning models. Moreover, the improved inter-class separability and preserved intra-class diversity achieved through subclass-aware contrastive learning enhance the model’s capability to distinguish between UC and CD, which is a clinically important yet challenging task even for experienced endoscopists. Collectively, these advantages highlight the potential clinical impact of the proposed method in supporting large-scale, annotation-efficient colonoscopy image diagnosis.
In addition, several limitations of the current study, as well as potential directions for future research, deserve further discussion. First, although the proposed method achieves consistently superior performance on both the in-house Daping dataset and the publicly available LIMUC dataset, the current evaluation is still limited to single-center data. However, differences in patient populations, imaging devices, and acquisition protocols across institutions may introduce domain shifts, which could potentially lead to degraded performance on external datasets. Recent studies [63,64,65] have shown that semi-supervised domain adaptation techniques can effectively mitigate such discrepancies by leveraging labeled source data and unlabeled target domain data, which provides a promising direction for extending the proposed framework to multi-center scenarios. Second, the present work follows a closed-set semi-supervised learning setting, where all categories in the unlabeled data are assumed to be known. However, in real-world clinical environments, unlabeled data may inevitably contain unknown categories. Recent advances in open-set and universal semi-supervised learning [21,66] offer potential solutions by explicitly handling unknown samples during training. In future studies, integrating such strategies into the proposed framework could further enhance its robustness in practical scenarios. Third, the hyperparameters in this study were selected empirically. Although the current configuration already yields superior performance compared to other competing SOTA methods, more systematic hyperparameter optimization strategies, such as grid search, could be explored in future work to potentially achieve further performance gains.

6. Conclusions

In this paper, we propose a novel subclass-aware contrastive semi-supervised learning framework for accurate colonoscopy image classification, which is referred to as SACSSL. The proposed framework features a novel subclass-aware contrastive module, which explicitly captures intra-class heterogeneity by adaptively applying instance-level contrastive learning to uncertain samples and prototype-based subclass-level contrastive learning to confident samples, thereby enhancing inter-class separability while preserving fine-grained intra-class diversity and mitigating confirmation bias. Comprehensive experiments on both the in-house Daping dataset and the public LIMUC dataset demonstrate that SACSSL consistently outperforms existing semi-supervised learning methods in both IBD classification and UC severity grading. In addition, the t-SNE analysis further confirms that SACSSL is capable of learning clear classification boundaries while preserving fine-grained intra-class semantics, highlighting its effectiveness in IBD classification from colonoscopy images. In future work, we will focus on extending the proposed framework to semi-supervised domain adaptation, aiming to improve robustness across centers with different endoscopy systems and patient populations. Moreover, we will explore the universal semi-supervised learning method to explicitly handle non-IBD or atypical colonoscopic findings that commonly appear in large-scale unlabeled clinical data.

Author Contributions

Conceptualization, K.L., X.Z., Y.N., Y.W. and G.Z.; Methodology, K.L., G.R., X.Z., Y.W. and G.Z.; Software, K.L.; Validation, K.L., G.R. and X.Z.; Formal analysis, K.L.; Investigation, K.L., G.R., X.Z., Y.N. and G.Z.; Resources, Y.W. and G.Z.; Data curation, K.L., G.R., X.Z. and Y.N.; Writing—original draft, K.L.; Writing—review & editing, G.R., X.Z., Y.N., Y.W. and G.Z.; Visualization, K.L.; Supervision, Y.N., Y.W. and G.Z.; Project administration, Y.N., Y.W. and G.Z.; Funding acquisition, Y.N., Y.W. and G.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Program of Chongqing Technology Innovation and Application Development Special Project (CSTB2022TIAD-KPX0161), the Natural Science Foundation of Chongqing, China (CSTB2024NSCQ-LZX0141), the Chongqing Excellence Program for Innovation and Entrepreneurship Leadership Talent Project (CQYC20220303576), and the National Nature Science Foundation of China (Project no.: 62471293).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
IBDInflammatory bowel disease
CDCrohn’s disease
UCUlcerative colitis
WCEWireless capsule endoscopy
PCEPanenteric capsule endoscopy
MESMayo Endoscopic Score
CIConfidence interval

References

  1. Baumgart, D.C.; Carding, S.R. Inflammatory bowel disease: Cause and immunobiology. Lancet 2007, 369, 1627–1640. [Google Scholar] [CrossRef] [PubMed]
  2. Ng, S.C.; Shi, H.Y.; Hamidi, N.; Underwood, F.E.; Tang, W.; Benchimol, E.I.; Panaccione, R.; Ghosh, S.; Wu, J.C.; Chan, F.K.; et al. Worldwide incidence and prevalence of inflammatory bowel disease in the 21st century: A systematic review of population-based studies. Lancet 2017, 390, 2769–2778. [Google Scholar] [CrossRef] [PubMed]
  3. Hracs, L.; Windsor, J.W.; Gorospe, J.; Cummings, M.; Coward, S.; Buie, M.J.; Quan, J.; Goddard, Q.; Caplan, L.; Markovinović, A.; et al. Global evolution of inflammatory bowel disease across epidemiologic stages. Nature 2025, 642, 458–466. [Google Scholar] [CrossRef]
  4. Harbord, M.; Eliakim, R.; Bettenworth, D.; Karmiris, K.; Katsanos, K.; Kopylov, U.; Kucharzik, T.; Molnár, T.; Raine, T.; Sebastian, S.; et al. Third European evidence-based consensus on diagnosis and management of ulcerative colitis. Part 2: Current management. J. Crohn’s Colitis 2017, 11, 769–784. [Google Scholar] [CrossRef]
  5. Moran, G.W.; Gordon, M.; Sinopolou, V.; Radford, S.J.; Darie, A.M.; Vuyyuru, S.K.; Alrubaiy, L.; Arebi, N.; Blackwell, J.; Butler, T.D.; et al. British Society of Gastroenterology guidelines on inflammatory bowel disease in adults: 2025. Gut 2025, 74, s1–s101. [Google Scholar] [CrossRef]
  6. Miehlke, S.; Verhaegh, B.; Tontini, G.E.; Madisch, A.; Langner, C.; Münch, A. Microscopic colitis: Pathophysiology and clinical management. Lancet Gastroenterol. Hepatol. 2019, 4, 305–314. [Google Scholar] [CrossRef]
  7. Jung, S.A. Differential diagnosis of inflammatory bowel disease: What is the role of colonoscopy? Clin. Endosc. 2012, 45, 254–262. [Google Scholar] [CrossRef]
  8. Spiceland, C.M.; Lodhia, N. Endoscopy in inflammatory bowel disease: Role in diagnosis, management, and treatment. World J. Gastroenterol. 2018, 24, 4014. [Google Scholar] [CrossRef] [PubMed]
  9. Shichijo, S.; Nomura, S.; Aoyama, K.; Nishikawa, Y.; Miura, M.; Shinagawa, T.; Takiyama, H.; Tanimoto, T.; Ishihara, S.; Matsuo, K.; et al. Application of convolutional neural networks in the diagnosis of Helicobacter pylori infection based on endoscopic images. EBioMedicine 2017, 25, 106–111. [Google Scholar] [CrossRef]
  10. Karadag, P.; Morris, B.; Woolfall, K. The information and support needs of patients living with inflammatory bowel disease: A qualitative study. Chronic Illn. 2022, 18, 356–369. [Google Scholar] [CrossRef]
  11. Chang, Y.; Wang, Z.; Sun, H.B.; Li, Y.Q.; Tang, T.Y. Artificial intelligence in inflammatory bowel disease endoscopy: Advanced development and new horizons. Gastroenterol. Res. Pract. 2023, 2023, 3228832. [Google Scholar] [CrossRef]
  12. Ruan, G.; Qi, J.; Cheng, Y.; Liu, R.; Zhang, B.; Zhi, M.; Chen, J.; Xiao, F.; Shen, X.; Fan, L.; et al. Development and validation of a deep neural network for accurate identification of endoscopic images from patients with ulcerative colitis and Crohn’s disease. Front. Med. 2022, 9, 854677. [Google Scholar] [CrossRef]
  13. Bin, Y.; Peng, R.; Lee, Y.; Lee, Z.; Liu, Y. Artificial intelligence-assisted capsule endoscopy for detecting lesions in Crohn’s disease: A systematic review and meta-analysis. Front. Artif. Intell. 2025, 8, 1531362. [Google Scholar] [CrossRef]
  14. Van Engelen, J.E.; Hoos, H.H. A survey on semi-supervised learning. Mach. Learn. 2020, 109, 373–440. [Google Scholar] [CrossRef]
  15. Guo, L.Z.; Jia, L.H.; Shao, J.J.; Li, Y.F. Robust semi-supervised learning in open environments. Front. Comput. Sci. 2025, 19, 198345. [Google Scholar] [CrossRef]
  16. Lee, D.H. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Proceedings of the Workshop on Challenges in Representation Learning, ICML, Atlanta, GA, USA, 6–21 June 2013; Volume 3, p. 896. [Google Scholar]
  17. Sajjadi, M.; Javanmardi, M.; Tasdizen, T. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. Adv. Neural Inf. Process. Syst. 2016, 29, 1–9. [Google Scholar]
  18. Sohn, K.; Berthelot, D.; Carlini, N.; Zhang, Z.; Zhang, H.; Raffel, C.A.; Cubuk, E.D.; Kurakin, A.; Li, C.L. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Adv. Neural Inf. Process. Syst. 2020, 33, 596–608. [Google Scholar]
  19. Weng, W.; Zhu, X.; Cheikh, F.A.; Ullah, M.; Imaizumi, M.; Murono, S.; Kubota, S. A simple framework for depth-augmented contrastive learning for endoscopic image classification. IEEE Trans. Instrum. Meas. 2024, 73, 5033612. [Google Scholar] [CrossRef]
  20. Huang, Z.; Wu, J.; Wang, T.; Li, Z.; Ioannou, A. Class-specific distribution alignment for semi-supervised medical image classification. Comput. Biol. Med. 2023, 164, 107280. [Google Scholar] [CrossRef] [PubMed]
  21. Li, W.; Ju, L.; Tang, F.; Xia, P.; Xiong, X.; Hu, M.; Zhu, L.; Ge, Z. Towards Realistic Semi-supervised Medical Image Classification. In Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA, 25 February–4 March 2025; Volume 39, pp. 4968–4976. [Google Scholar]
  22. Arazo, E.; Ortego, D.; Albert, P.; O’Connor, N.E.; McGuinness, K. Pseudo-labeling and confirmation bias in deep semi-supervised learning. In Proceedings of the 2020 International Joint Conference on Neural Networks (IJCNN), Glasgow, UK, 19–24 July 2020; pp. 1–8. [Google Scholar]
  23. Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A simple framework for contrastive learning of visual representations. In Proceedings of the International Conference on Machine Learning, Online, 13–18 July 2020; pp. 1597–1607. [Google Scholar]
  24. He, K.; Fan, H.; Wu, Y.; Xie, S.; Girshick, R. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 9729–9738. [Google Scholar]
  25. Yang, F.; Wu, K.; Zhang, S.; Jiang, G.; Liu, Y.; Zheng, F.; Zhang, W.; Wang, C.; Zeng, L. Class-aware contrastive semi-supervised learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 14421–14430. [Google Scholar]
  26. Sohoni, N.; Dunnmon, J.; Angus, G.; Gu, A.; Ré, C. No subclass left behind: Fine-grained robustness in coarse-grained classification problems. Adv. Neural Inf. Process. Syst. 2020, 33, 19339–19352. [Google Scholar]
  27. Grcic, M.; Gadetsky, A.; Brbic, M. Fine-Grained Classes and How to Find Them. In Proceedings of the International Conference on Machine Learning, Vienna, Austria, 21–27 July 2024; pp. 16275–16294. [Google Scholar]
  28. Caron, M.; Misra, I.; Mairal, J.; Goyal, P.; Bojanowski, P.; Joulin, A. Unsupervised learning of visual features by contrasting cluster assignments. Adv. Neural Inf. Process. Syst. 2020, 33, 9912–9924. [Google Scholar]
  29. Caron, M.; Bojanowski, P.; Joulin, A.; Douze, M. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8 September 2018; pp. 132–149. [Google Scholar]
  30. McQueen, J.B. Some methods of classification and analysis of multivariate observations. In Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, Berkeley, CA, USA, 21 June–18 July 1967; pp. 281–297. [Google Scholar]
  31. Cuturi, M. Sinkhorn distances: Lightspeed computation of optimal transport. Adv. Neural Inf. Process. Syst. 2013, 26, 1–9. [Google Scholar]
  32. Khosla, P.; Teterwak, P.; Wang, C.; Sarna, A.; Tian, Y.; Isola, P.; Maschinot, A.; Liu, C.; Krishnan, D. Supervised contrastive learning. Adv. Neural Inf. Process. Syst. 2020, 33, 18661–18673. [Google Scholar]
  33. Maurício, J.; Domingues, I. Distinguishing between Crohn’s disease and ulcerative colitis using deep learning models with interpretability. Pattern Anal. Appl. 2024, 27, 1. [Google Scholar] [CrossRef]
  34. Stidham, R.W.; Liu, W.; Bishu, S.; Rice, M.D.; Higgins, P.D.; Zhu, J.; Nallamothu, B.K.; Waljee, A.K. Performance of a deep learning model vs human reviewers in grading endoscopic disease severity of patients with ulcerative colitis. JAMA Netw. Open 2019, 2, e193963. [Google Scholar] [CrossRef] [PubMed]
  35. Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2818–2826. [Google Scholar]
  36. Klang, E.; Grinman, A.; Soffer, S.; Margalit Yehuda, R.; Barzilay, O.; Amitai, M.M.; Konen, E.; Ben-Horin, S.; Eliakim, R.; Barash, Y.; et al. Automated detection of Crohn’s disease intestinal strictures on capsule endoscopy images using deep neural networks. J. Crohn’s Colitis 2021, 15, 749–756. [Google Scholar] [CrossRef]
  37. Tan, M.; Le, Q. Efficientnet: Rethinking model scaling for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 6105–6114. [Google Scholar]
  38. Shah, S.A.; Taj, I.; Usman, S.M.; Hassan Shah, S.N.; Imran, A.S.; Khalid, S. A hybrid approach of vision transformers and CNNs for detection of ulcerative colitis. Sci. Rep. 2024, 14, 24771. [Google Scholar] [CrossRef] [PubMed]
  39. Polat, G.; Ergenc, I.; Kani, H.T.; Alahdab, Y.O.; Atug, O.; Temizel, A. Class distance weighted cross-entropy loss for ulcerative colitis severity estimation. In Proceedings of the Annual Conference on Medical Image Understanding and Analysis, Cambridge, UK, 27–29 July 2022; Springer: Berlin/Heidelberg, Germany, 2022; pp. 157–171. [Google Scholar]
  40. Malik, H.; Naeem, A.; Sadeghi-Niaraki, A.; Naqvi, R.A.; Lee, S.W. Multi-classification deep learning models for detection of ulcerative colitis, polyps, and dyed-lifted polyps using wireless capsule endoscopy images. Complex Intell. Syst. 2024, 10, 2477–2497. [Google Scholar] [CrossRef]
  41. Brodersen, J.B.; Jensen, M.D.; Leenhardt, R.; Kjeldsen, J.; Histace, A.; Knudsen, T.; Dray, X. Artificial intelligence-assisted analysis of pan-enteric capsule endoscopy in patients with suspected Crohn’s disease: A study on diagnostic performance. J. Crohn’s Colitis 2024, 18, 75–81. [Google Scholar] [CrossRef]
  42. Das, A.; Shukla, T.; Tomita, N.; Richards, R.; Vidis, L.; Ren, B.; Hassanpour, S. Deep Learning for Classification of Inflammatory Bowel Disease Activity in Whole Slide Images of Colonic Histopathology. Am. J. Pathol. 2025, 195, 680–689. [Google Scholar] [CrossRef]
  43. Guo, X.; Yuan, Y. Semi-supervised WCE image classification with adaptive aggregated attention. Med. Image Anal. 2020, 64, 101733. [Google Scholar] [CrossRef]
  44. Muruganantham, P.K.; Balakrishnan, S.M. Uncertainty-driven active learning in a deep semi-supervised framework for WCE image classification. Results Eng. 2025, 27, 106174. [Google Scholar] [CrossRef]
  45. Lazo, J.F.; Rosa, B.; Catellani, M.; Fontana, M.; Mistretta, F.A.; Musi, G.; De Cobelli, O.; de Mathelin, M.; De Momi, E. Semi-supervised bladder tissue classification in multi-domain endoscopic images. IEEE Trans. Biomed. Eng. 2023, 70, 2822–2833. [Google Scholar] [CrossRef]
  46. Wang, Y.; Ni, H.; Zhou, J.; Liu, L.; Lin, J.; Yin, M.; Gao, J.; Zhu, S.; Yin, Q.; Zhu, J.; et al. A Semi-Supervised learning framework for classifying colorectal neoplasia based on the NICE classification. J. Imaging Inform. Med. 2024, 37, 2342–2353. [Google Scholar] [CrossRef]
  47. Golhar, M.; Bobrow, T.L.; Khoshknab, M.P.; Jit, S.; Ngamruengphong, S.; Durr, N.J. Improving colonoscopy lesion classification using semi-supervised deep learning. IEEE Access 2020, 9, 631–640. [Google Scholar] [CrossRef] [PubMed]
  48. Asano, Y.M.; Rupprecht, C.; Vedaldi, A. Self-labelling via simultaneous clustering and representation learning. arXiv 2019, arXiv:1911.05371. [Google Scholar]
  49. Polat, G.; Kani, H.T.; Ergenc, I.; Ozen Alahdab, Y.; Temizel, A.; Atug, O. Improving the computer-aided estimation of ulcerative colitis severity according to mayo endoscopic score by using regression-based deep learning. Inflamm. Bowel Dis. 2023, 29, 1431–1439. [Google Scholar] [CrossRef] [PubMed]
  50. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16×16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  51. Assran, M.; Duval, Q.; Misra, I.; Bojanowski, P.; Vincent, P.; Rabbat, M.; LeCun, Y.; Ballas, N. Self-supervised learning from images with a joint-embedding predictive architecture. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 15619–15629. [Google Scholar]
  52. Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar]
  53. Cubuk, E.D.; Zoph, B.; Shlens, J.; Le, Q.V. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Seattle, WA, USA, 14–19 June 2020; pp. 702–703. [Google Scholar]
  54. Kinga, D.; Adam, J.B. A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), San Diego, CA, USA, 7–9 May 2015; Volume 5. [Google Scholar]
  55. Wang, Y.; Chen, H.; Heng, Q.; Hou, W.; Fan, Y.; Wu, Z.; Wang, J.; Savvides, M.; Shinozaki, T.; Raj, B.; et al. Freematch: Self-adaptive thresholding for semi-supervised learning. arXiv 2022, arXiv:2205.07246. [Google Scholar]
  56. Chen, H.; Tao, R.; Fan, Y.; Wang, Y.; Wang, J.; Schiele, B.; Xie, X.; Raj, B.; Savvides, M. Softmatch: Addressing the quantity-quality trade-off in semi-supervised learning. arXiv 2023, arXiv:2301.10921. [Google Scholar]
  57. DiCiccio, T.J.; Efron, B. Bootstrap confidence intervals. Stat. Sci. 1996, 11, 189–228. [Google Scholar] [CrossRef]
  58. Aberson, C. Interpreting Null Results: Improving Presentation and Conclusions with Confidence Intervals. J. Artic. Support Null Hypothesis 2002, 1, 36–42. [Google Scholar]
  59. Nakagawa, S.; Cuthill, I.C. Effect size, confidence interval and statistical significance: A practical guide for biologists. Biol. Rev. 2007, 82, 591–605. [Google Scholar] [CrossRef]
  60. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  61. Maaten, L.v.d.; Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 2008, 9, 2579–2605. [Google Scholar]
  62. Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
  63. Saito, K.; Kim, D.; Sclaroff, S.; Darrell, T.; Saenko, K. Semi-supervised domain adaptation via minimax entropy. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 8050–8058. [Google Scholar]
  64. Berthelot, D.; Roelofs, R.; Sohn, K.; Carlini, N.; Kurakin, A. Adamatch: A unified approach to semi-supervised learning and domain adaptation. arXiv 2021, arXiv:2106.04732. [Google Scholar]
  65. Matsui, I.; Matsumoto, A.; Imai, A.; Okushima, H.; Niioka, H.; Abe, M.; Tamai, N.; Nagasu, H.; Kanda, E.; Uchino, E.; et al. Domain-adaptive semi-supervised learning for efficient rare pathological lesion detection with minimal annotation. npj Digit. Med. 2025, in press. [Google Scholar] [CrossRef]
  66. Saito, K.; Kim, D.; Saenko, K. Openmatch: Open-set semi-supervised learning with open-set consistency regularization. Adv. Neural Inf. Process. Syst. 2021, 34, 25956–25967. [Google Scholar]
Figure 1. A schematic overview of the proposed SACSSL. The framework comprises a visual encoder, a prediction head, and a projection head. These components are integrated with two complementary modules: a semi-supervised learning module and a subclass-aware contrastive module. See main text for a detailed explanation.
Figure 1. A schematic overview of the proposed SACSSL. The framework comprises a visual encoder, a prediction head, and a projection head. These components are integrated with two complementary modules: a semi-supervised learning module and a subclass-aware contrastive module. See main text for a detailed explanation.
Bioengineering 13 00008 g001
Figure 2. A schematic illustration of the subclass-aware contrastive module. The module processes embeddings from two strong augmentations ( A u g s 1 and A u g s 2 , shown as solid and dashed shapes, respectively) of each image. It first separates embeddings into confident and uncertain groups based on pseudo-label confidence. Confident embeddings are assigned to online-updated subclass prototypes (numbered squares) to form subclasses, where black dashed circles indicate embeddings belonging to the same subclass. Subclass-level contrastive learning then optimizes these confident embeddings by attracting intra-subclass embeddings while repelling inter-subclass ones. Meanwhile, instance-level contrastive learning optimizes uncertain embeddings to repel samples from different images, where gray rectangles enclose augmentation pairs from the same original image. Together, these two components form the subclass-aware contrastive loss.
Figure 2. A schematic illustration of the subclass-aware contrastive module. The module processes embeddings from two strong augmentations ( A u g s 1 and A u g s 2 , shown as solid and dashed shapes, respectively) of each image. It first separates embeddings into confident and uncertain groups based on pseudo-label confidence. Confident embeddings are assigned to online-updated subclass prototypes (numbered squares) to form subclasses, where black dashed circles indicate embeddings belonging to the same subclass. Subclass-level contrastive learning then optimizes these confident embeddings by attracting intra-subclass embeddings while repelling inter-subclass ones. Meanwhile, instance-level contrastive learning optimizes uncertain embeddings to repel samples from different images, where gray rectangles enclose augmentation pairs from the same original image. Together, these two components form the subclass-aware contrastive loss.
Bioengineering 13 00008 g002
Figure 3. Comparison of the t-SNE visualization of the embedded feature distributions on the Daping test set between FixMatch [18] and the proposed SACSSL using t-SNE. Each color denotes one of the 3 classes.
Figure 3. Comparison of the t-SNE visualization of the embedded feature distributions on the Daping test set between FixMatch [18] and the proposed SACSSL using t-SNE. Each color denotes one of the 3 classes.
Bioengineering 13 00008 g003
Table 1. Common symbols used in Section 3.
Table 1. Common symbols used in Section 3.
SymbolMeaningSec.
x l n , y l n Labeled image and the corresponding ground truth labelSection 3
x u m Unlabeled imageSection 3
g θ Visual encoderSection 3
h θ Prediction headSection 3
h ϕ Projection headSection 3
p ( y | x ; θ ) Model’s predicted distribution over classesSection 3
zProjected representation in embedding spaceSection 3
B l , B u Labeled and unlabeled subsets in a data batchSection 3
B l , B u Number of labeled and unlabeled samples in a data batchSection 3
A u g w ( · ) Weak augmentationSection 3
A u g s 1 ( · ) First strong augmentationSection 3
A u g s 2 ( · ) Second strong augmentationSection 3
q ( · ) Soft pseudo-labelSection 3.1
q ^ ( · ) Hard pseudo-labelSection 3.1
B m Multi-view batchSection 3.2
x ˜ i , q ˜ i Strongly augmented view and its soft pseudo-labelSection 3.2
T c o n f Confidence threshold for separating confident and uncertain samplesSection 3.2
I c o n f Index set of confident samplesSection 3.2
I u n c Index set of uncertain samplesSection 3.2
I c Index set of confident samples predicted as class cSection 3.2.2
p k c k-th prototype of class cSection 3.2.2
M c Sample-to-prototype assignment probability matrix for class cSection 3.2.2
Z c Embedding matrix for confident samples of class cSection 3.2.2
P c Prototype matrix containing K prototypes for class cSection 3.2.2
Table 2. Quantitative comparison with SOTA semi-supervised learning methods on the Daping dataset. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
Table 2. Quantitative comparison with SOTA semi-supervised learning methods on the Daping dataset. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
MethodPercentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
Upper-Bound100094.078.496.480.8
Baseline20091.074.293.975.5
FixMatch [18]208092.071.793.974.4
FreeMatch [55]208092.273.894.276.1
CCSSL [25]208092.776.095.078.2
SoftMatch [56]208092.374.993.977.1
SA-FixMatch [21]208091.774.594.476.5
Ours208093.276.894.980.1
Table 3. Quantitative comparison with SOTA semi-supervised learning methods on the LIMUC dataset [49]. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
Table 3. Quantitative comparison with SOTA semi-supervised learning methods on the LIMUC dataset [49]. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
MethodPercentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
Upper-Bound100079.674.492.273.4
Baseline20072.162.389.263.2
FixMatch [18]208075.165.990.466.9
FreeMatch [55]208075.268.290.868.7
CCSSL [25]208075.968.991.268.0
SoftMatch [56]208076.167.491.167.3
SA-Fixmatch [21]208075.766.890.367.8
Ours208076.467.791.068.9
Table 4. Performance of our method on the Daping dataset under different percentages of labeled data (%). The best results are highlighted in bold font. LDP: labeled data percentage; UDP: unlabeled data percentage.
Table 4. Performance of our method on the Daping dataset under different percentages of labeled data (%). The best results are highlighted in bold font. LDP: labeled data percentage; UDP: unlabeled data percentage.
MethodPercentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
Upper-Bound100094.078.496.480.8
Baseline5085.670.886.865.3
Ours59590.368.592.471.3
Baseline10089.273.592.271.1
Ours109092.275.094.677.1
Baseline20091.074.293.975.5
Ours208093.276.894.980.1
Baseline30091.573.094.174.9
Ours307093.477.495.579.8
Table 5. Results on validating the effectiveness of different losses. The best results are highlighted in bold font. LDP: labeled data percentage; UDP: unlabeled data percentage.
Table 5. Results on validating the effectiveness of different losses. The best results are highlighted in bold font. LDP: labeled data percentage; UDP: unlabeled data percentage.
MethodLoss FunctionsPercentage (%)Metrics (%)
L s L u L unc L conf LDP UDP Accuracy Sensitivity Specificity F1-Score
Upper-Bound 100094.078.496.480.8
Baseline 20091.074.293.975.5
L s + L u 208092.071.193.974.4
L s + L u + L u n c 208092.475.394.777.3
L s + L u + L c o n f 208092.573.194.475.9
Ours208093.276.894.980.1
Table 6. Results on investigating the influence of the confidence threshold T c o n f . The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
Table 6. Results on investigating the influence of the confidence threshold T c o n f . The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
T conf Percentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
0.6208092.178.594.878.8
0.7208093.077.995.379.7
0.8208092.976.495.178.7
0.9208093.276.894.980.1
0.95208092.374.694.077.5
Table 7. Results on investigating the influence of the number of prototypes per class K. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
Table 7. Results on investigating the influence of the number of prototypes per class K. The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
KPercentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
2208092.773.394.776.2
3208093.276.894.980.1
4208092.774.694.977.3
5208092.573.794.776.4
6208092.974.295.077.2
Table 8. Results on investigating the influence of architecture of the visual encoder f θ . The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
Table 8. Results on investigating the influence of architecture of the visual encoder f θ . The best results are highlighted in bold. LDP: percentage of labeled data; UDP: percentage of unlabeled data.
BackbonePercentage (%)Metrics (%)
LDP UDP Accuracy Sensitivity Specificity F1-Score
ResNet-50 [60]208091.576.693.877.6
EfficientNet-B5 [37]208092.172.994.175.5
ViT-B [50]208093.276.894.980.1
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lin, K.; Ruan, G.; Zou, X.; Nian, Y.; Wei, Y.; Zheng, G. Subclass-Aware Contrastive Semi-Supervised Learning for Inflammatory Bowel Disease Classification from Colonoscopy Images. Bioengineering 2026, 13, 8. https://doi.org/10.3390/bioengineering13010008

AMA Style

Lin K, Ruan G, Zou X, Nian Y, Wei Y, Zheng G. Subclass-Aware Contrastive Semi-Supervised Learning for Inflammatory Bowel Disease Classification from Colonoscopy Images. Bioengineering. 2026; 13(1):8. https://doi.org/10.3390/bioengineering13010008

Chicago/Turabian Style

Lin, Kechen, Guangcong Ruan, Xiaoyang Zou, Yongjian Nian, Yanling Wei, and Guoyan Zheng. 2026. "Subclass-Aware Contrastive Semi-Supervised Learning for Inflammatory Bowel Disease Classification from Colonoscopy Images" Bioengineering 13, no. 1: 8. https://doi.org/10.3390/bioengineering13010008

APA Style

Lin, K., Ruan, G., Zou, X., Nian, Y., Wei, Y., & Zheng, G. (2026). Subclass-Aware Contrastive Semi-Supervised Learning for Inflammatory Bowel Disease Classification from Colonoscopy Images. Bioengineering, 13(1), 8. https://doi.org/10.3390/bioengineering13010008

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop