---
title: Automated BBPS Scoring Framework
url: https://www.emergentmind.com/topics/automated-bbps-scoring-framework
type: topic
---

# Automated BBPS Scoring Framework

Automated BBPS scoring frameworks implement objective, data-driven assessment of bowel cleanliness in colonoscopy imagery by algorithmically predicting Boston Bowel Preparation Scale (BBPS) scores. The framework described in recent research leverages a parameter-efficient, dual-branch vision–language model architecture and is validated using rigorously annotated datasets, setting a new benchmark for reproducibility and clinical utility in computer-aided bowel-preparation assessment [2512.20374].

## 1. Datasets and Expert Annotation Protocol

Two datasets underpin the evaluation and training of the automated BBPS scoring framework: a newly constructed, high-quality HDFD set and the publicly available NERTHU dataset. The HDFD dataset encompasses 2,240 colonoscopy still frames from 517 unique patients, acquired at 0.5 s intervals with motion-blurred frames excluded. Each image is labeled with a BBPS integer score in {0,1,2,3}, assigned independently by three board-certified endoscopists. Only cases of unanimous agreement are retained. Class balance is enforced (560 images per class); typical dataset splits (not explicitly stated) are 80/10/10 by patient. The NERTHU dataset includes 1,956 images from 10 subjects, similarly annotated into four BBPS classes and used exclusively for external validation.

## 2. Model Architecture

The framework employs a dual-branch architecture: a CLIP-based backbone with adapter modules for global feature encoding and a region-aware fecal-feature extraction branch. Both branches leverage multimodal fusion to exploit the synergy between visual and textual cues.

### 2.1 CLIP Backbone with Adapter-Based Transfer Learning

The primary branch employs ViT-B/16 from CLIP as a visual encoder. All backbone weights are frozen except lightweight *adapter modules* (inserted after each transformer block) and the final classifier. The adapter applies a bottleneck structure:
$$
\text{Adapter}(x) = x + W_{\text{up}}\, \sigma (W_{\text{down}}\, x)
$$
where $W_{\text{down}}\in\mathbb{R}^{(d/r)\times d}$, $W_{\text{up}}\in\mathbb{R}^{d\times (d/r)}$, and $\sigma$ is ReLU. This design maintains task-transfer efficiency and regularizes learning from limited data.

The post-adapter pooled output is denoted $z_v = g_{\text{ada}}(f_{\text{vit}}(x))$.

### 2.2 Fecal-Feature Extraction Branch

To model localized stool patterns and color/texture cues without explicit segmentation, the framework samples 180 rectangular anchors per image at multiple spatial scales and aspect ratios. Each anchor crop $x_{a,i}$ is passed through an independent CLIP + adapter branch yielding anchor features. Textual priors—prompt phrases representing stool cleanliness states (e.g., "yellow stool," "clear mucosa")—are encoded via the CLIP text encoder to generate prompt vectors $\{p_j\}_{j=1}^M$. For each anchor and prompt, cosine similarity is computed:
$$
s_{i,j} = \text{cosine}(g'_{\text{ada}}(f'_{\text{vit}}(x_{a,i})), p_j )
$$
An aggregated fecal feature vector is calculated as either the mean across anchors of the strongest stool-prompt score or via a learned pooling layer:
$$
z_f = \frac{1}{N} \sum_{i=1}^N \max_{j=1...M} s_{i,j}
$$

### 2.3 Region-Aware Feature Fusion

The fecal feature $z_f$ is projected to match the global feature dimensionality, concatenated with $z_v$, and processed by a gating MLP that produces fusion weights $\alpha\in[0,1]^d$:
$$
\alpha = \sigma (W_g[z_v; z_{f,\text{proj}}] + b_g),\quad \beta = 1 - \alpha
$$
The fused representation is
$$
z_{\text{all}} = \alpha \odot z_v + \beta \odot z_{f,\text{proj}}
$$
Classification logits are computed as $W_{\text{cls}} z_{\text{all}} + b_{\text{cls}}$; the predicted BBPS score is given by $\hat{y} = \arg\max_c\,\text{softmax}(\text{logits})_c$.

## 3. Training Procedures and Optimization

Supervised training employs a cross-entropy objective for four-way BBPS classification:
$$
\mathcal{L}_{\text{ce}} = -\sum_{i=1}^B \sum_{c=0}^3 y_{i,c}\,\log\;\text{softmax}_c (\text{logits}_i)
$$
No auxiliary feature or alignment losses are introduced.

AdamW is the optimizer of choice, with learning rates of $1\times 10^{-5}$ for backbone parameters (otherwise frozen) and $1\times10^{-3}$ for adapters, gating, and classifier layers; weight decay is set to $10^{-2}$. Standard CLIP-style data augmentation (random horizontal flip, rotation, color jitter, Gaussian blur) is applied. Training is conducted in mixed-precision (FP16) until convergence on a holdout validation set, with the checkpoint yielding the highest validation accuracy retained.

## 4. Empirical Results and Ablative Analysis

Performance is measured by per-class and mean BBPS accuracy. Main findings are summarized in the following tables:

**Internal Test (HDFD):**

| Backbone              | BBPS0 | BBPS1 | BBPS2 | BBPS3 | Avg Acc |
|-----------------------|-------|-------|-------|-------|---------|
| ViT-B/16 (PMC-CLIP)   | 32.0% | 75.0% | 67.0% | 64.0% | 59.5%   |
| ViT-B/16 (OpenAI)     | 73.0% | 91.0% | 95.0% | 92.0% | 87.8%   |
| ViT-B/16 (DFN2B)      | 84.0% | 86.0% | 90.0% | 88.0% | 87.0%   |
| RN50 (OpenAI)         | 73.0% | 56.0% | 48.0% | 88.0% | 66.3%   |
| ViT-B/32 (OpenAI)     | 77.0% | 70.0% | 70.0% | 87.0% | 76.0%   |
| Ours (fusion model)   | 86.0% | 91.0% | 91.0% | 96.0% | 91.0%   |

**External Test (NERTHU):**

| Backbone              | BBPS0 | BBPS1 | BBPS2 | BBPS3 | Avg Acc |
|-----------------------|-------|-------|-------|-------|---------|
| ViT-B/16 (PMC-CLIP)   |100.0% |100.0% |100.0% |  0.0% | 65.2%   |
| ViT-B/16 (OpenAI)     |100.0% |100.0% |100.0% |100.0% |100.0%   |
| ViT-B/16 (DFN2B)      |100.0% |100.0% |100.0% |100.0% |100.0%   |
| RN50 (OpenAI)         |100.0% |100.0% |100.0% | 29.2% | 82.3%   |
| ViT-B/32 (OpenAI)     |100.0% |100.0% |100.0% | 58.4% | 89.6%   |
| Ours (fusion model)   |100.0% |100.0% |100.0% |100.0% |100.0%   |

Ablation studies confirm the incremental contribution of adapters and the fecal-feature branch, with the full system attaining an average accuracy of 91.0% on HDFD. Anchor quantity analysis reveals that 180 anchors per image is optimal, balancing spatial coverage and computational tractability; additional anchors yield diminishing returns.

## 5. Practical Deployment and Clinical Implications

The system exhibits robust performance and generalizability, with 100% accuracy on the NERTHU external dataset and 91% on the more diverse HDFD set. Adapter-based fine-tuning mitigates overfitting on small medical datasets and preserves CLIP’s pretrained multimodal knowledge. The region-aware fusion strategy enhances accuracy at extreme BBPS scores (0: “unclean,” 3: “clean”), leveraging stool-specific cues to resolve visual ambiguities between hard-to-classify states.

Deployment as part of real-time colonoscopy software is feasible, enabling objective, reproducible BBPS scoring that standardizes clinical quality control and eliminates observer variability. The framework’s automation has the potential to streamline reporting and prompt intervention in cases of inadequate bowel preparation.

## 6. Limitations and Prospective Directions

Current anchor sampling is based on fixed heuristics; an end-to-end learned region proposal mechanism (e.g., via spatial attention masks) could further optimize spatial feature extraction. The absence of explicit fecal segmentation may limit granularity; incorporating mask supervision for fine-grained localization is a logical extension. Presently limited to still images, the architecture could be extended to handle temporal video streams for real-time endoscopy with temporal consistency constraints. Integration of additional clinical information (such as colonic segment specificity and patient demographics) via multimodal fusion represents another avenue for research.

By combining adapter-tuned CLIP vision–language foundations with region-aware, text-guided feature branches and sophisticated gated fusion, automated BBPS scoring frameworks advance the reproducibility, accuracy, and scalability of bowel cleanliness assessment in clinical endoscopy [2512.20374].

Source: https://www.emergentmind.com/topics/automated-bbps-scoring-framework