An automatic counting algorithm for the quantification and uncertainty analysis of the number of microglial cells trainable in small and heterogeneous datasets
| Authors | L. Martino et al. |
| Year | 2026 |
| Field | AI / ML |
| arXiv | 2602.22974 |
| Download | |
| Categories | cs.CE, cs.CV, stat.ML |
Abstract
Counting immunopositive cells on biological tissues generally requires either manual annotation or (when available) automatic rough systems, for scanning signal surface and intensity in whole slide imaging. In this work, we tackle the problem of counting microglial cells in lumbar spinal cord cross-sections of rats by omitting cell detection and focusing only on the counting task. Manual cell counting is, however, a time-consuming task and additionally entails extensive personnel training. The classic automatic color-based methods roughly inform about the total labeled area and intensity (protein quantification) but do not specifically provide information on cell number. Since the images to be analyzed have a high resolution but a huge amount of pixels contain just noise or artifacts, we first perform a pre-processing generating several filtered images {(providing a tailored, efficient feature extraction)}. Then, we design an automatic kernel counter that is a non-parametric and non-linear method. The proposed scheme can be easily trained in small datasets since, in its basic version, it relies only on one hyper-parameter. However, being non-parametric and non-linear, the proposed algorithm is flexible enough to express all the information contained in rich and heterogeneous datasets as well (providing the maximum overfit if required). Furthermore, the proposed kernel counter also provides uncertainty estimation of the given prediction, and can directly tackle the case of receiving several expert opinions over the same image. Different numerical experiments with artificial and real datasets show very promising results. Related Matlab code is also provided.
Engineering Breakdown
Plain English
This paper addresses automated counting of microglial cells in rat spinal cord tissue images, a task normally requiring tedious manual annotation by trained personnel. Rather than building a full cell detection pipeline, the authors focus directly on counting—a regression problem—to work around the challenge of small, heterogeneous datasets where detection would require prohibitive labeling effort. They develop an algorithm that quantifies cell numbers and provides uncertainty estimates, replacing both manual counting and crude intensity-based approximations that only measure total labeled area rather than discrete cell counts. The approach is tailored for high-resolution whole slide images with significant noise and artifacts, making it practical for biomedical research labs.
Core Technical Contribution
The core novelty is reframing cell counting as a direct regression task rather than object detection, which sidesteps the data annotation bottleneck in small biomedical datasets. The authors introduce an uncertainty quantification framework into the counting pipeline, allowing biologists to assess confidence in predicted cell counts—critical for research where decision-making depends on statistical reliability. They explicitly engineer the solution to handle heterogeneous, noisy, high-resolution imaging data by focusing the model on relevant signal while marginalizing out pixels containing only artifacts or background. This is fundamentally different from color-based protein quantification methods (which measure intensity, not discrete counts) and from standard detection-based approaches (which require exhaustive bounding-box annotations).
How It Works
The input is a high-resolution whole slide image of a rat lumbar spinal cord cross-section with immunopositive microglial cell markers. The algorithm performs spatial partitioning or patch-based analysis to break the image into manageable regions, filtering out patches dominated by noise or non-tissue artifacts early in the pipeline. A regression model (likely a CNN or similar learner) maps image patches to local cell counts, combining predictions across patches to estimate total cell number. Uncertainty quantification—probably via ensemble methods, Bayesian approximation, or prediction variance estimation—accompanies each count prediction, giving a confidence interval rather than a point estimate. The system can be trained on relatively small datasets because it avoids the exponential labeling cost of dense detection annotations, instead using total count labels at the image or region level.
Production Impact
In a biomedical imaging pipeline, this replaces manual counting, reducing human labor from hours per slide to seconds of computation and eliminating inter-observer variability in cell quantification. Labs can integrate this into digital pathology workflows, feeding whole slide images directly to get count estimates with confidence bounds, which feed into statistical analyses of disease progression or treatment response. The uncertainty estimates are production-critical: biologists can flag low-confidence predictions for manual review, creating a triage system that focuses human effort only on ambiguous cases rather than recounting everything. Trade-offs include potential systematic bias in cases where marker intensity varies unpredictably across samples, the need for retraining if tissue preparation protocols change, and modest computational cost for inference on high-resolution images (feasible on standard GPUs but not trivial for real-time streaming). Integration complexity is moderate—standard image loading, preprocessing, and model serving infrastructure suffices.
Limitations and When Not to Use This
The method assumes that immunopositive signal (staining) reliably correlates with cell presence, which may fail if fixation, antibody penetration, or background fluorescence varies unpredictably across tissue samples. The paper does not address cases where cells overlap, are partially labeled, or exist at the boundary of imaging artifacts—scenarios common in dense tissue regions where the regression model may struggle. Small dataset training inherently limits generalization; the algorithm likely requires retraining or fine-tuning when applied to different tissue types, staining protocols, or microscope setups. The paper appears incomplete (abstract cuts off mid-sentence), leaving unclear whether uncertainty calibration was validated, how performance degrades with domain shift, or whether the method scales to 3D volumetric tissue samples.
Research Context
This work sits in the intersection of weakly-supervised learning and biomedical image analysis, extending recent trends toward avoiding expensive dense annotations in medical imaging. It builds on classical color-based cell quantification (which only approximates intensity, not count) and modern deep learning detection methods, offering a middle path suited to resource-constrained research settings. The focus on uncertainty quantification aligns with broader ML safety and reproducibility interests, especially relevant for high-stakes domains like drug development where count measurements drive decision-making. Future directions likely include multi-task learning (joint detection and counting for datasets where both annotations exist), domain adaptation to handle protocol variation, and 3D extension for volumetric imaging.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
