Skip to content

Menu

WorksComputer Science

NuJEV: Structured Visual Judgments for Consistent Nuclei Quantification

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_x6qvmj6z. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

Nuclear quantification requires locating and typing nuclei, beyond generating a count. Inspired by Jev's structured decisions in place of free-form generation, we introduce NuJEV for nuclear perception in Qwen3-VL-2B. We jointly train visual LoRA and a parallel head to predict nuclear presence, centers, and types. One image encoding feeds both the nuclear head and original language decoder. The decoder interprets region and type requests, with counts computed from the predicted nuclei. On 2,732 PanNuke test images, NuJEV achieves a five-query mean absolute error (MAE5\mathrm{MAE}_5) of 1.844 overall and 5.268 on dense images, with localization/typed F1 of 0.816/0.682. A matched encoder ablation shows 41.0% lower dense error with visual adaptation. For language requests, NuJEV reduces request MAE by 76.2% relative to direct generation. Our code will be released as open source.

Introduction

Quantitative histology requires counts by nuclear type and image region, rather than a single total. Language-based interaction lets analysts express these requests, but answering them requires accurate localization and typing. How can a vision–language model learn this fine-grained perception and use it for quantitative requests?

HoVer-Net [1] and CellViT [2] recover nuclei through segmentation; PointNu-Net [3] and NuDetect [4] detect them directly. Parallel point prediction [5] provides explicit locations, whereas coordinate generation [6] uses sequential decoding. We learn nuclear predictions in the dialogue model’s visual encoder to share image features across perception and interaction.

We introduce NuJEV, extending Qwen3-VL-2B [7]. Inspired by Jev’s direct structured decisions instead of free-form generation [8], we learn nuclear presence, position, and type through jointly trained visual adapters and a parallel head. The same image encoding feeds the original language decoder, which interprets region and type requests for counting from these predictions.

Six baselines and CoNSeP transfer assess nuclear perception; encoder ablations test visual adaptation. Matched language comparisons on all 2,732 PanNuke test images examine whether the predictions improve quantitative answers.

Methods

NuJEV shares image encoding between nuclear prediction and language interaction (Figure 1). Its nuclear branch learns Jev-inspired structured judgments for quantitative requests.

Figure 1. NuJEV jointly trains visual LoRA and a nuclear head. Shared image features also feed Qwen’s language decoder. Counting operations use the predictions. Tissue: PanNuke development image.

Learning Nuclear Perception

Proposals encode centers and six-class probabilities: background, neoplastic, inflammatory, connective, dead, and epithelial. We train the head and rank-64 LoRA [9] across 24 visual blocks, freezing pretrained weights. Inputs are resized from 256×256256 \times256 to 512×512512 \times512. Pre-merger 32×32×102432 \times32 \times1024 features pass through a 128-channel 1×11 \times1 projection and two 3×33 \times3 group-normalized GELU convolutions, producing four proposals per grid cell (K=4096K = 4096):

p^k=ak+Δk,πk=softmax⁡(zk)∈[0,1]6.(1)\hat{p}_k = a_k + \Delta_k,\qquad\pi_k = \operatorname{softmax}(z_k) \in[0,1]^6. \tag*{(1)}

Here, aka_k, Δk\Delta_k, and zkz_k denote anchor position, offset, and class logits. Hungarian matching [5] assigns targets by minimizing 0.25∥p^k−pj∥2−πk,cj0.25\lVert\hat{p}_k-p_j\rVert_2-\pi_{k,c_j}; unmatched proposals are background. Training combines cross-entropy (background weight 0.1) and matched smooth-L1L_1 coordinate loss after dividing coordinates by 4, without truncating targets.

At decoding, presence sk=1−πk,0s_k=1-\pi_{k,0} and type derive from the same distribution; type is the highest-probability foreground class. We clip centers to image bounds, retain sk≥0.60s_k\ge0.60, and apply score-ordered, class-independent 8-pixel suppression. Dense training images (≥60\ge60 nuclei; 196/4,126) receive replacement-sampling weight 4 versus 1; rotations/reflections jointly transform images and centers.

Language Integration

Merged embeddings and DeepStack features feed the unchanged language decoder. Given image and question, Qwen answers directly or selects region, type, and output arguments. The head uses cached spatial features to predict centers and types S(I)={(pk,ck)}S(I)=\{(p_k,c_k)\}. We select nuclei within half-open rectangle RR and class set AA:

n^(I,R,A)=∑(p,c)∈S(I)1[p∈R]1[c∈A].(2)\hat{n}(I,R,A)=\sum_{(p,c)\in S(I)}1[p\in R]1[c\in A]. \tag*{(2)}

Counts (total, type, or quadrant) return to Qwen. Features and records are cached per request and cleared for new images; descriptions skip the head. Invalid arguments trigger corrective feedback. If the structured result is omitted, the interface appends the current successful tool output.

Experimental Setup

Nuclear prediction. PanNuke [10] has 4,126 training, 1,043 development, and 2,732 test images with disjoint keys; patient and slide identifiers are unavailable. Development selects checkpoints and decoding settings, fixed for test evaluation and ablations. Dense images have ≥60\ge60 nuclei (50 development, 145 test); inference is identical across densities.

NuJEV uses a template parser without language decoding for fixed-query benchmarks. The nuclear branch is evaluated with 12 counting requests per image: MAE5\mathrm{MAE}_5 averages count errors over the full image, left/right halves, and two fixed random rectangles; seven further requests cover five full-image types and two regional types. Pooled localization F1 uses one-to-one 6-pixel matching; typed F1 also requires class agreement. Point methods filter predictions by region and type; Qwen-Count answers requests directly.

CellViT and HoVer-Net [2, 1] train from scratch with instance/pixel supervision in 100-epoch searches; development selects dense-adapted CellViT and original HoVer-Net. Qwen-Count/Points adapt Qwen3-VL-2B with rank-32 language/visual LoRA (38.80M parameters), 1,284/1,200 updates, and greedy limits of 32/4,096 tokens. Invalid counts and point lists are scored as zero and empty predictions, respectively. CountGD and Grounding DINO [11, 12] adapt

the last visual stage/detection components for 1,200 updates, batch eight, with density weighting/augmentation and frozen BERT. CountGD uses 2×22\times2 center boxes; Grounding DINO uses instance boxes. Each predicts six independently conditioned sets, without joint typed centers.

Sampling ablations match initialization, seed, decoder, 300 AdamW updates, and batch size 64: adapter/head rates 10−5/2×10−510^{-5}/2\times10^{-5}, decay 0.01, warmup 20, cosine schedule, gradient clipping 1 (25.60M parameters). Both encoder arms start from the same original visual weights and trained head, with inherited adapters disabled. One trains only the head; the other also trains visual LoRA. Seed, sampling, augmentation, updates, batch, and decoder match; head and visual-LoRA rates are 10−410^{-4} and 5×10−55\times10^{-5}.

Language interaction. Each test image has a type-count and a quadrant-count request (5,464 per method). All three methods share images, the adapted visual encoder, and original language weights. Qwen-Direct answers from images; Qwen-Records also reads predicted centers and types; Ours accesses the trained nuclear head through counting operations. The latter two share identical full-precision predictions. Greedy generation allows 384 tokens/turn; Ours allows four generation turns and two tool calls with feedback. Request MAE averages absolute errors over requested counts, then tasks and images; invalid outputs use zero predictions. We also report validity and exact agreement with independently counted predictions. We separately check non-counting descriptions and shared-encoding efficiency.

Results

Nuclear prediction. On PanNuke, NuJEV’s nuclear branch leads overall and dense-image counting and both F1 scores (Table 1), reducing MAE by 4.5% overall and 25.7% on dense images versus HoVer-Net. The paired dense-image difference (Ours minus HoVer-Net) is −1.822-1.822 (95% interval [−2.612,−1.068][-2.612,-1.068]); Figure 2. Non-dense error remains 1.652 versus CellViT’s 1.606 and HoVer-Net’s 1.642. Selected predictions appear in Figure 3.

MethodAllDenseNon-denseF1Typed F1
CellViT1.9868.7781.6060.7690.644
HoVer-Net1.9317.0901.6420.7870.583
Qwen-Count2.81311.4992.326——
Qwen-Points2.52916.3211.7550.6770.481
CountGD3.6989.4663.3740.727—
Grounding DINO2.4658.6172.1200.777—
Ours1.844 (+4.5%)5.268 (+25.7%)1.652 (-2.9%)0.816 (+3.6%)0.682 (+5.8%)

Table 1. Nuclear quantification on PanNuke: 2,732 test images (145 dense). MAE5\mathrm{MAE}_5 (↓\downarrow); pooled localization and typed F1 (↑\uparrow). Bold: best; —: unavailable. Gains: relative MAE reduction or F1 increase versus the best baseline (+ better, − worse).

Figure 2. PanNuke test (n=2,732n = 2,732). (a) Five density groups. (b) Baseline-minus-Ours dense error; positive favors Ours. Intervals: 95% paired image-bootstrap (2,000 resamples, n=145n = 145), excluding patient clustering and training-seed variation.

Figure 3. Sparse and dense examples selected for accurate Ours predictions and improvement over HoVer-Net in the dense case. nn: count; AE = ∣n−nGT∣\lvert n - n_{\mathrm{GT}}\rvert. F1: 6-pixel matching; typed F1 adds class agreement. Test-set averages: Table 1.

Visual adaptation. With matched training, visual LoRA reduces MAE by 12.5% overall and 41.0% on dense images versus freezing, improving both F1 scores (Table 2b, one seed). Dense sampling and augmentation also reduce dense error (Table 2a). Paired 95% intervals are [−0.350,0.004][-0.350, 0.004] for dense versus uniform sampling and [−0.556,0.110][-0.556, 0.110] for adding augmentation; both include zero.

PanNuke test ablations: initialization, seed, decoder, and 300 updates are matched within each panel. MAE5\mathrm{MAE}_{5} (↓); F1 (↑). Bold: best per panel. Gains versus (a) the best other row per column; (b) the frozen encoder.

TrainingAllDenseNon-denseDense F1
Uniform1.8965.6501.6860.8347
Dense sampling1.9005.4771.7000.8353
Ours1.844 (+2.8%)5.266 (+3.9%)1.652 (+2.0%)0.8417 (+0.8%)
SettingAllDenseF1Typed F1
Frozen encoder2.2809.0340.74960.5875
Visual LoRA1.994 (+12.5%)5.334 (+41.0%)0.8112 (+8.2%)0.6686 (+13.8%)

Table 2. PanNuke test ablations: initialization, seed, decoder, and 300 updates are matched within each panel. MAE5\mathrm{MAE}_{5} (↓); F1 (↑). Bold: best per panel. Gains versus (a) the best other row per column; (b) the frozen encoder.

CoNSeP. Images (1000×10001000 \times1000) use padded 4×44 \times4 tile grids. Out-of-image points are discarded; Qwen-Count queries only valid regions. Ours reduces MAE by 30.2% relative to CellViT and achieves the highest F1 (Table 3).

CoNSeP test: 14 images (8,777 nuclei), 16 tiles per image; PanNuke-trained models evaluated without retraining. MAE/RMSE (↓); 6-pixel F1 (↑). Bold and gains as in Table 1.

MethodMAERMSEF1
CellViT114.571165.2600.665
HoVer-Net123.643179.8030.688
Qwen-Count212.429275.658—
Qwen-Points190.571246.9090.560
CountGD151.929203.1130.588
Grounding DINO255.643301.0530.611
Ours80.000 (+30.2%)110.849 (+32.9%)0.696 (+1.3%)

Table 3. CoNSeP test: 14 images (8,777 nuclei), 16 tiles per image; PanNuke-trained models evaluated without retraining. MAE/RMSE (↓); 6-pixel F1 (↑). Bold and gains as in Table 1.

Language interaction. Using the learned nuclear predictions, NuJEV reduces request MAE by 76.2% and 80.8% versus direct and record-based answers (Table 4). Parameters are correct on 4,146/5,464 first calls and all final calls after feedback. All structured results match independent counts of predicted nuclei; request MAE also reflects nuclear prediction errors. Describing colors and nuclear morphology on 16 test images triggers neither the tool nor the head (0/16).

PanNuke test: 2,732 images, 5,464 type/quadrant requests/method. MAE: ground-truth error. Valid: parseable required integer counts. Agreement: exact match to independent counts of predicted nuclei. Gains: relative MAE reduction or percentage-point (pp) increases versus best other row.

MethodMAE ↓Valid output ↑Prediction agreement ↑
Qwen-Direct5.9915359/5464—
Qwen-Records7.4205441/5464195/5464
Ours1.423 (+76.2%)5464/5464 (+0.4 pp)5464/5464 (+96.4 pp)

Table 4. PanNuke test: 2,732 images, 5,464 type/quadrant requests/method. MAE: ground-truth error. Valid: parseable required integer counts. Agreement: exact match to independent counts of predicted nuclei. Gains: relative MAE reduction or percentage-point (pp) increases versus best other row.

Shared encoding. On eight test images (three paired repeats, MetaX C500), sharing reduces encoder passes from three to one and full-request time from 2.036 to 1.918 s (5.8%). Both peak at 4.74 GiB allocated. Counts agree in 22/24 pairs; two differ by one nucleus.

Discussion and conclusion

NuJEV extends Qwen3-VL-2B with learned nuclear localization and typing. Joint visual adaptation and head training provide the predictions, while shared encoding connects them to the pretrained language decoder. Visual adaptation reduces dense error, and using nuclear predictions improves numerical responses.

Compliance with ethical standards

We analyze publicly available PanNuke and CoNSeP images and collect no new human-subject data.

Acknowledgments

No funding was received for conducting this study. The authors have no relevant financial or non-financial interests to disclose. We used OpenAI Codex to assist with literature exploration and code inspection. We retain responsibility for the scientific content.

References

  1. [1]S. Graham, Q. D. Vu, S. E. A. Raza, A. Azam, Y. W. Tsang, J. T. K. Dwak, and N. Rajpoot, “Hover-net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images,” Medical image analysis, vol. 58, pp. 101563, 2019.DOI
  2. [2]F. Hörst, M. Rempe, L. Heine, C. Seibold, J. Keyl, G. Baldini, S. Ugurel, J. Sivke, B. Grünwald, J. Egger, et al., “Cellvit: Vision transformers for precise cell segmentation and classification,” Medical image analysis, vol. 94, pp. 103143, 2024.DOI
  3. [3]K. Yao, K. Huang, J. Sun, and A. Hussain, “Pointnu-net: Keypoint-assisted convolutional neural network for simultaneous multi-tissue histology nuclei segmentation and classification,” IEEE Transactions on Emerging Topics in Computational Intelligence, vol. 8, no. 1, pp. 802–813, 2023.arxiv.org/abs/2111.01557
  4. [4]K. Al-Thelaya, N. U. Gilal, F. Majeed, M. Alzubaidi, S. Boughorbel, W. Mifsud, M. Agus, and J. Schneider, “Nudetect: A point annotation-based framework for nuclei detection using density estimation and conformal thresholding,” Computer Methods and Programs in Biomedicine Update, p. 100225, 2025.
  5. [5]O. Song, C. Wang, Z. Jiang, Y. Wang, Y. Tai, C. Wang, J. Li, F. Huang, and Y. Wu, “Rethinking counting and localization in crowds: A purely point-based framework,” in 2021 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, 2021, pp. 3345–3354.arxiv.org/abs/2107.12746
  6. [6]S. Alghisi, M. Rizzoli, S. M. Mousavi, and G. Riccardi, “Getting to the point: Pointing improves lvms at counting,” arXiv preprint arXiv:2603.21746, 2026.arxiv.org/abs/2603.21746
  7. [7]S. Bai, Y. Cai, R. Chen, K. Chen, X. Chen, Z. Cheng, L. Deng, W. Ding, C. Gao, C. Ge, et al., “Qwen3-vl technical report,” arXiv preprint arXiv:2511.21631, 2025.arxiv.org/abs/2511.21631
  8. [8]Y. Li and J. Wagle, “Llm2jev: Llms are already jev-style decision models–when and how to fine-tune them,” arXiv preprint arXiv:2610.02076, 2026.
  9. [9]E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, and W. Chen, “Lora: Low-rank adaptation of large language models,” arXiv preprint arXiv:2106.09685, 2021.arxiv.org/abs/2106.09685
  10. [10]J. Gamper, N. A. Koohbanani, K. Benes, S. Graham, M. Jahanifar, S. A. Khurram, A. Azam, K. Hewitt, and N. Rajpoot, “Pannuke dataset extension, insights and baselines,” arXiv preprint arXiv:2003.10778, 2020.arxiv.org/abs/2003.10778
  11. [11]N. Amini-Naieni, T. Han, and A. Zisserman, “Countgd: Multi-modal open-world counting,” Advances in Neural Information Processing Systems, vol. 37, pp. 48810–48837, 2024.
  12. [12]S. Liu, Z. Zeng, T. Ren, F. Li, H. Zhang, J. Yang, Q. Jiang, C. Li, J. Yang, H. Su, et al., “Grounding dino: Marrying dino with grounded pre-training for open-set object detection,” in European conference on computer vision. Springer, 2024, pp. 38–55.arxiv.org/abs/2303.05499

Machine contribution statement

This work lists 1 machine contributor.

  • Codex · AI contributor

    Roles
    InvestigationSoftware
    Verification
    self-declared at submission

Recorded on the work at submission, not per version. Names and roles are shown as submitted; roles use the CRediT taxonomy.

How machine contributions are recorded

Paper details

Citation

Cite
Published
Version
Latest

Data & code

No code, data or supplementary files were declared for this version.

Contents

Pick where to look, or just type