WorksComputer Science
NuJEV: Structured Visual Judgments for Consistent Nuclei Quantification
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 () 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 to . Pre-merger features pass through a 128-channel projection and two group-normalized GELU convolutions, producing four proposals per grid cell ():
Here, , , and denote anchor position, offset, and class logits. Hungarian matching [5] assigns targets by minimizing ; unmatched proposals are background. Training combines cross-entropy (background weight 0.1) and matched smooth- coordinate loss after dividing coordinates by 4, without truncating targets.
At decoding, presence and type derive from the same distribution; type is the highest-probability foreground class. We clip centers to image bounds, retain , and apply score-ordered, class-independent 8-pixel suppression. Dense training images ( 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 . We select nuclei within half-open rectangle and class set :
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 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: 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 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 , 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 and .
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 (95% interval ); 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.
| Method | All | Dense | Non-dense | F1 | Typed F1 |
| CellViT | 1.986 | 8.778 | 1.606 | 0.769 | 0.644 |
| HoVer-Net | 1.931 | 7.090 | 1.642 | 0.787 | 0.583 |
| Qwen-Count | 2.813 | 11.499 | 2.326 | — | — |
| Qwen-Points | 2.529 | 16.321 | 1.755 | 0.677 | 0.481 |
| CountGD | 3.698 | 9.466 | 3.374 | 0.727 | — |
| Grounding DINO | 2.465 | 8.617 | 2.120 | 0.777 | — |
| Ours | 1.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). (); pooled localization and typed F1 (). Bold: best; —: unavailable. Gains: relative MAE reduction or F1 increase versus the best baseline (+ better, − worse).
Figure 2. PanNuke test (). (a) Five density groups. (b) Baseline-minus-Ours dense error; positive favors Ours. Intervals: 95% paired image-bootstrap (2,000 resamples, ), 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. : count; AE = . 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 for dense versus uniform sampling and for adding augmentation; both include zero.
PanNuke test ablations: initialization, seed, decoder, and 300 updates are matched within each panel. (↓); F1 (↑). Bold: best per panel. Gains versus (a) the best other row per column; (b) the frozen encoder.
| Training | All | Dense | Non-dense | Dense F1 |
| Uniform | 1.896 | 5.650 | 1.686 | 0.8347 |
| Dense sampling | 1.900 | 5.477 | 1.700 | 0.8353 |
| Ours | 1.844 (+2.8%) | 5.266 (+3.9%) | 1.652 (+2.0%) | 0.8417 (+0.8%) |
| Setting | All | Dense | F1 | Typed F1 |
| Frozen encoder | 2.280 | 9.034 | 0.7496 | 0.5875 |
| Visual LoRA | 1.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. (↓); F1 (↑). Bold: best per panel. Gains versus (a) the best other row per column; (b) the frozen encoder.
CoNSeP. Images () use padded 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.
| Method | MAE | RMSE | F1 |
| CellViT | 114.571 | 165.260 | 0.665 |
| HoVer-Net | 123.643 | 179.803 | 0.688 |
| Qwen-Count | 212.429 | 275.658 | — |
| Qwen-Points | 190.571 | 246.909 | 0.560 |
| CountGD | 151.929 | 203.113 | 0.588 |
| Grounding DINO | 255.643 | 301.053 | 0.611 |
| Ours | 80.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.
| Method | MAE ↓ | Valid output ↑ | Prediction agreement ↑ |
| Qwen-Direct | 5.991 | 5359/5464 | — |
| Qwen-Records | 7.420 | 5441/5464 | 195/5464 |
| Ours | 1.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]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]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]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]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]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]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]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]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]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]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]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]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.


