FluoCLIP: Stain-Aware Focus Quality Assessment in Fluorescence Microscopy
Authors: Hyejin Park, Jiwon Yoon, Sumin Park, Suree Kim, Sinae Jang, Eunsoo Lee, Dongmin Kang, Dongbo Min
Organizations: Division of AI and Software, Ewha Womans University, South Korea · Analytical Solution Team, Daesang Corporation, South Korea · Bioimaging Data Curation Center (BDCC), Department of Life Science, Ewha Womans University, South Korea
Accurate focus quality assessment (FQA) in fluorescence microscopy is challenging due to stain-dependent optical variations that induce heterogeneous focus behavior across images. Existing methods, however, treat focus quality as a stain-agnostic problem, assuming a shared global ordering. We formulate stain-aware FQA for fluorescence microscopy, showing that focus-rank relationships vary substantially across stains due to stain-dependent imaging characteristics and invalidate this assumption. To support this formulation, we introduce FluoMix, the first dataset for stain-aware FQA spanning multiple tissues, fluorescent stains, and focus levels. We further propose FluoCLIP, a two-stage vision-language framework that grounds stain semantics and enables stain-conditioned ordinal reasoning for focus prediction, effectively decoupling stain representation from ordinal structure. By explicitly modeling stain-dependent focus behavior, FluoCLIP consistently outperforms both conventional FQA methods and recent vision-language baselines, demonstrating strong generalization across diverse fluorescence microscopy conditions. Code and dataset are publicly available at https://fluoclip.github.io/.
Figures & tables
Figure 1: Modality gap in focus quality assessment. Simple edge-based models such as FocusLiteNN [ 22 ] perform reliably on bright-field datasets like FocusPath [ 13 ] , where blur is spatially uniform, but struggles on fluorescence datasets (BBBC006 [ 17 ] and FluoMix) that exhibit stain-dependent, non-uniform defocus—underscoring the need for stain-aware FQA.
Figure 2: Overview of FluoCLIP Framework. FluoCLIP consists of two sequential stages for stain-aware focus quality assessment (FQA). In the Stage 1: Stain-Grounding , learnable stain tokens are aligned with CLIP’s visual encoder through an adapter to form stain-specific textual features. In the Stage 2: Stain-Guided Ranking , these grounded stain embeddings are used to condition rank prompts via interpolation and projection, producing stain-aware focus rank representations. Both stages jointly enable FluoCLIP to model stain-dependent focus behavior and align text–image features for stain-aware FQA. All parameters except explicitly noted as frozen were tuned in each stage.
Figure 3: Empirical Analysis of Stain-Dependent Focus Behavior: (a) Mean spatial frequency (SF) versus focus rank for three datasets; the shaded region indicates ± 1 standard deviation across samples. SF decreases monotonically with increasing rank, confirming that SF reliably captures focus degradation. (b)–(d) Boxplots of SF values across stains for each dataset (x-axis: stain identity, y-axis: SF distribution). FocusPath shows stain-invariant SF trends, wherease BBBC006 and FluoMix display pronounced stain-dependent variability.
Figure 4: Stain-dependent appearance across focus levels. Images from different stains exhibit distinct visual characteristics across focus levels due to wavelength-dependent optical effects ( d∝λ/NA ). Focus level 0 corresponds to well-focused images, while higher levels (e.g., level 9) indicate increasing defocus. These differences indicate that identical focus levels can correspond to different visual patterns across stains, challenging the assumption of a universal ordinal mapping.
Metric
FluoMix
FocusPath
BBBC006
SRCC ρ
−0.528±0.0940
−0.840±0.0923
−0.343±0.2920
Table 1: Spearman Rank Correlation Coefficient (SRCC) statistics of the Spatial Frequency (SF) metric and focus rank. The results reported are mean ± standard deviation across all stains in each datasets.
Method
Accuracy (%)
PLCC ↑
SRCC ↑
MAE ↓
FocusLiteNN
-
0.621 ± 0.0042
0.624 ± 0.0047
1.610 ± 0.0058
CE
54.59 ± 1.42
0.952 ± 0.0023
0.957 ± 0.0017
0.510 ± 0.0148
OE
63.46 ± 1.38
0.966 ± 0.0019
0.969 ± 0.0017
0.395 ± 0.0171
CO2
47.26 ± 1.99
0.927 ± 0.0054
0.931 ± 0.0052
0.653 ± 0.0335
QULCE
55.55 ± 2.12
0.951 ± 0.0050
0.957 ± 0.0041
0.512 ± 0.0320
CLIP
81.59 ± 0.52
0.988 ± 0.0007
0.987 ± 0.0007
0.187 ± 0.0056
Table 2: Comparison of FluoCLIP with existing methods using a ResNet50 image encoder on FluoMix. The results are mean ± standard deviation over five runs with different random seeds.
Method
Accuracy (%)
PLCC ↑
SRCC ↑
MAE ↓
CLIP
89.13 ± 0.26
0.993 ± 0.0002
0.991 ± 0.0001
0.110 ± 0.0029
OrdinalCLIP
89.95 ± 0.31
0.993 ± 0.0002
0.991 ± 0.0002
0.102 ± 0.0032
NumCLIP
-
0.987 ± 0.0014
0.988 ± 0.0003
0.133 ± 0.0031
BiomedCLIP
83.99 ± 0.25
0.990 ± 0.0003
0.988 ± 0.0003
0.163 ± 0.0027
FluoCLIP
90.75 ± 0.52
0.994 ± 0.0005
0.992 ± 0.0004
0.093 ± 0.0055
Table 3: Performance comparison of CLIP-based models with existing methods using a ViT/B-16 image encoder on FluoMix. The results are mean ± standard deviation over five runs with different random seeds.
Method
Accuracy (%)
PLCC ↑
SRCC ↑
MAE ↓
FocusLiteNN
-
0.618 ± 0.0062
0.657 ± 0.0080
1.599 ± 0.6571
CE
75.71 ± 8.24
0.973 ± 0.0102
0.975 ± 0.0091
0.266 ± 0.0928
OE
75.03 ± 12.55
0.967 ± 0.0176
0.969 ± 0.0159
0.296 ± 0.1565
CO2
68.84 ± 3.91
0.965 ± 0.0056
0.968 ± 0.0050
0.347 ± 0.0469
QULCE
75.25 ± 7.57
0.962 ± 0.0123
0.965 ± 0.0109
0.301 ± 0.1069
OrdinalCLIP
90.67 ± 0.54
0.991 ± 0.0004
0.989 ± 0.0002
0.104 ± 0.0058
Table 4: Comparison of FluoCLIP with existing methods using a ResNet50 image encoder on BBBC006 [ 17 ] . The results are mean ± standard deviation over five runs with different random seeds.
Method
Accuracy (%)
PLCC ↑
SRCC ↑
MAE ↓
OrdinalCLIP
94.98 ± 0.99
0.997 ± 0.0006
0.993 ± 0.0004
0.051 ± 0.0099
FluoCLIP
91.11 ± 1.40
0.995 ± 0.0007
0.992 ± 0.0005
0.092 ± 0.0142
Table 5: Comparison of FluoCLIP with existing methods using a ResNet50 image encoder on FocusPath [ 13 ] . The results are mean ± standard deviation over five runs with different random seeds.
Type
Configuration
Splain
Strain
S
R
R~S
Acc. (%)
Step Gain
Total Gain
(A)
Baseline (OrdinalCLIP) with Rank ( R )
✓
83.12 ± 0.41
-
-
(B)
(A) + Plain Stain Token ( Splain )
✓
✓
83.21 ± 3.93
0.09
-
(C)
(A) + Learnable Stain Token ( Strain )
✓
✓
81.38 ± 0.63
-1.74
-
(D)
(A) + Grounded Stain Token ( S )
✓
✓
84.28 ± 0.88
1.16
1.16
(E)
(D) + Stain-Guided Rank Token ( R~S )
✓
✓
85.21 ± 0.88
0.93
2.09
Table 6: Ablation study on FluoCLIP components on the FluoMix dataset. The baseline (OrdinalCLIP [ 15 ] ) includes only the focus token. We incrementally add grounded stain tokens (C) and stain-guided rank modules (D) to evaluate their individual contributions.
Type
Configuration
Accuracy (%)
PLCC ↑
SRCC ↑
MAE ↓
(A)
BiomedCLIP
83.99 ± 0.25
0.990 ± 0.0003
0.988 ± 0.0003
0.163 ± 0.0027
(B)
(A) + Splain
84.35 ± 0.27
0.990 ± 0.0002
0.9883 ± 0.0002
0.159 ± 0.0027
(C)
(B) + R~S
86.29 ± 0.51
0.991 ± 0.0004
0.989 ± 0.0003
0.140 ± 0.0055
(D)
FluoCLIP
90.75 ± 0.52
0.994 ± 0.0005
0.992 ± 0.0004
0.093 ± 0.0055
Table 7: Performance Evaluation of FluoCLIP using BiomedCLIP [ 25 ] and OrdinalCLIP [ 15 ] as backbones. (A)–(C) use BiomedCLIP, while (D) corresponds to our main model based on CLIP ViT/B-16. Results are reported as mean ± standard deviation over five runs on FluoMix.
Figure 5: Examples of dataset classes: The figure displays samples of images from three datasets across different focus levels. (Top) FocusPath dataset images numbered from 0 to 11, each showing different staining techniques. (Middle) BBBC006 dataset images numbered from 0 to 9. (Bottom) FluoMix dataset images numbered from 0 to 9, representing different focus levels.
Brain Tissue
Dataset
Hoechst 34580
Alexa 488
Cy3
Alexa 647
# Sets
D1
nucleus
Iba-1
Tuj-1
Collagen IV
504
D2
nucleus
Neurofilament-M (NFM)
Tyrosine Hydroxylase (TH)
Collagen IV
152
D3
nucleus
NeuN
Tyrosine Hydroxylase (TH)
Collagen IV
554
D4
nucleus
GFAP
Tuj-1
CD31
623
Lung Tissue
Table 8: Overview of the FluoMix dataset, summarizing tissue types, fluorescent stains, and associated biological targets. Each stain is paired with distinct protein markers (e.g., neuronal, microglial, vascular, epithelial), reflecting the heterogeneity of fluorescence signals across tissues. The rightmost column reports the number of fields of view collected for each stain–target combination.
Figure 6: Sample images illustrating stain diversity in the three datasets. (Top) FocusPath : bright-field microscopy images with eight different histological dyes. (Bottom left) BBBC006 : fluorescence microscopy images of cell lines labeled with Hoechst 33342 and Phalloidin. (Bottom right) FluoMix : tissue-level fluorescence microscopy images covering six distinct fluorescent staining protocols.
Generalization Type
Model Initialization
Adaptation Stain
Adaptation Tissue
Description
Few-Shot Learning
CLIP-pretrained on Natural Images
Alexa 488, Cy3, Alexa 647, Hoechst 34580
Brain
Test whether the model can learn stain-aware FQA with only k-shot samples
Cross-Tissue
FluoCLIP-pretrained on Brain (D1-D4)
Alexa 488, Cy3, Alexa 647 (Seen Stains)
Lung (Unseen Tissue)
Adaptation to new tissue with distinct morphology while keeping stains unchanged
Cross-Stain & Cross-Tissue
FluoCLIP-pretrained on Brain (D1-D4)
Hoechst 33342, DAPI (Unseen Stains)
Lung, Liver (Unseen Tissues)
Most challenging: test adaptation to entirely new stain-tissue pairs
Table 9: Overview of the three few-shot evaluation settings used to assess label efficiency, cross-stain transfer, and cross-tissue generalization.
#-Shots
1
8
16
32
64
128
CoOp [ 26 ]
11.72 ± 1.10
16.32 ± 0.91
17.88 ± 0.44
18.36 ± 0.61
18.38 ± 0.44
18.50 ± 0.50
CoOp+ Eimg [ 26 ]
13.58 ± 1.88
14.92 ± 1.10
14.98 ± 0.88
15.82 ± 1.17
17.06 ± 0.78
19.22 ± 1.17
OrdinalCLIP [ 15 ]
15.51 ± 1.15
19.43 ± 0.98
19.55 ± 0.29
20.60 ± 0.91
21.18 ± 0.50
19.99 ± 2.06
FluoCLIP
11.69 ± 1.15
15.92 ± 0.89
18.90 ± 1.32
20.45 ± 0.87
24.41 ± 0.52
29.11 ± 2.13
Table 10: Comparison of accuracy (%) under few-shot learning settings on the FluoMix mouse brain dataset. CoOp follows the experimental protocol from the original paper [ 26 ] , using prompt tuning only. CoOp+ Eimg extends CoOp by additionally fine-tuning the image encoder together with the prompts. OrdinalCLIP and FluoCLIP follow the main ResNet-50 experiment configuration described in Section 6 . FluoCLIP exhibits the steepest improvement curve as supervision increases, demonstrating a strong stain-aware prior that enables rapid adaptation in low-data regimes. Results are reported as mean ± standard deviation over five runs with different random seeds.
#-Shots
1
8
16
32
64
128
OrdinalCLIP [ 15 ]
20.09 ± 0.42
21.87 ± 1.23
23.99 ± 0.50
29.14 ± 0.66
41.26 ± 1.01
61.73 ± 0.62
FluoCLIP
20.35 ± 0.79
20.95 ± 1.05
23.51 ± 0.62
29.43 ± 0.63
43.27 ± 1.19
67.97 ± 1.31
Table 11: Comparison of accuracy (%) results under few-shot settings on a held-out fluorescence microscopy dataset acquired from mouse lung tissue with a known staining combination (Alexa 488, Cy3, and Alexa 647). We observe that from the 32-shot regime, FluoCLIP exhibits a clear advantage, suggesting that its stain-aware modeling begins to effectively leverage stain-specific signal variation when sufficient examples are available. The results are mean ± standard deviation over five random seeds.
#-Shots
1
8
16
32
64
128
OrdinalCLIP [ 15 ]
19.82 ± 1.85
25.36 ± 1.23
29.37 ± 0.68
34.46 ± 1.25
42.82 ± 0.74
54.35 ± 1.17
FluoCLIP
18.75 ± 2.04
24.54 ± 0.93
29.20 ± 1.00
34.90 ± 1.45
44.57 ± 1.18
57.71 ± 0.46
Table 12: Comparison of accuracy (%) under few-shot settings on held-out fluorescence microscopy datasets of unseen mouse lung, liver tissues with an unseen staining combination (Hoechst 33342 and DAPI). Because both stains target the nucleus and are visually similar to Hoechst 34580 used during base training, OrdinalCLIP performs better in the extremely low-shot regime. However, from the 32-shot setting onward, FluoCLIP shows a clear advantage, demonstrating its ability to leverage stain-aware adaptation once sufficient examples become available. The results are reported as mean ± standard deviation over five random seeds.
Type
Configuration
Fine-tune (S)
Two Stage
Adapter
Accuracy (%) ↑
(A)
Splain
×
×
×
81.04 ± 0.81
(B)
Splain + Adapter
×
×
o
83.21 ± 3.93
(C)
Strain
o
×
×
80.50 ± 0.67
(D)
Strain + Adapter
o
×
o
81.38 ± 0.63
(E)
S
o
o
×
81.83 ± 0.95
(F)
S + Adapter
o
o
o
84.28 ± 0.88
Table 13: Ablation of FluoCLIP’s learning strategy. We evaluate how stain tokens should be trained and whether the text-side adapter provides additional gains. Configuration (A-F) combines three stain-token variants ( Splain : frozen, Strain : naïvely trained, S : grounded via two-stage learning) with optional use of the grounding pipeline (Two Stages) and the adapter (Adapter). Results (mean ± std over five seeds) isolate the contribution of stain grounding, trainability, and adapter design.
Method
PubMedCLIP
PMC-CLIP
FluoCLIP
Accuracy (%)
81.48 ± 0.34
84.06 ± 0.23
85.21 ± 0.88
Table 14: Comparison with biomedical CLIP variants on FluoMix. Each method uses its own pretrained ResNet50-based vision encoder corresponding to its original pretraining. Results are reported as mean ± standard deviation over five runs.
Institute of Artificial Intelligence, Center for Medical Data Science, Medical University of Vienna, Vienna, Austria · Christian Doppler Lab for Artificial Intelligence in Retina, Center for Medical Data Science, Medical University of Vienna, Vienna, Austria
Institute of Artificial Intelligence, Center for Medical Data Science, Medical University of Vienna, Austria · Christian Doppler Lab for Artificial Intelligence in Retina, Medical University of Vienna, Austria