Papers
Topics
Authors
Recent
Search
2000 character limit reached

Count2Density: Mapping Counts to Density

Updated 10 July 2026
  • Count2Density is a framework that transforms point annotations or global counts into spatially resolved density maps using Gaussian kernels and weakly supervised strategies.
  • It bridges diverse applications by converting count-only cues into meaningful density representations in computer vision, microscopy, and astrophysical analyses.
  • Key challenges include spatial granularity, indirect supervision, and model mismatches, driving research toward adaptive kernels and stronger density priors.

Searching arXiv for the key papers on Count2Density and closely related density/counting frameworks. arXiv search queries:

  1. id:(Litrico et al., 3 Sep 2025)
  2. id:(Guo et al., 21 Dec 2025)
  3. id:(Dai et al., 2019)
  4. id:(Jiang et al., 2018)
  5. id:(Chen et al., 2019) Count2Density denotes a family of formulations in which aggregate counts, count-in-cell observables, or column-density measurements are transformed into spatial density representations, density-aware latent variables, or characteristic local densities. In computer vision, the term appears both in the classical density-map paradigm—where point annotations are convolved with Gaussian kernels so that the density integral equals the object count—and in newer weakly supervised settings that attempt to recover meaningful density maps from count-only supervision (Dai et al., 2019, Litrico et al., 3 Sep 2025). In parallel, related count-to-density inversions appear in microscopy, where density maps are decoded into local object counts and locations, and in astrophysics and cosmology, where column densities or counts in cells are mapped to number densities or projected density PDFs (Li et al., 2022, Gaches et al., 2024, Pinon et al., 24 Jan 2025).

1. Scope of the Count2Density formulation

In image-based counting, the canonical Count2Density mapping begins from point annotations {xi}\{x_i\} and defines a density target as a sum of Gaussian kernels,

DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),

with the normalization chosen so that integrating or summing the map yields the count (Dai et al., 2019). Variants differ in whether σi\sigma_i is geometry-adaptive, fixed, or dataset-specific, but the operational principle is stable: density is a spatially resolved surrogate for count (Jiang et al., 2018, Gao et al., 2020).

A second usage of Count2Density emerges when only image-level counts are available. In that setting, the task is no longer to regress a known density target, but to induce internal or explicit density structure from a scalar supervision signal. Count2Density formalizes this as recovering “meaningful density maps containing quantitative spatial information using only count-level annotations” via pseudo-density generation, historical averaging, and contrastive spatial regularization (Litrico et al., 3 Sep 2025). TCFormer expresses the same idea at the feature level: image-level counts supervise token-level density scores and a density-aware aggregation module, so that counts induce “internal representations that behave like density maps (or density-related weights)” without location labels (Guo et al., 21 Dec 2025).

A third usage appears outside vision datasets with point supervision. In molecular-cloud analysis, observed column density NobsN_{\rm obs} is decomposed into turbulent and gravitational components and mapped to characteristic number densities nTn_T and nJn_J, plus an effective attenuating column NeffN_{\rm eff} (Gaches et al., 2024). In cosmology, counts in top-hat cells are related probabilistically to smoothed density contrast δR\delta_R through P(NδR)P(N|\delta_R), and density-split clustering is then expressed in terms of one- and two-point PDFs of that density field (Gruen et al., 2017, Pinon et al., 24 Jan 2025). This suggests that Count2Density is best understood as a general inversion principle linking discrete or integrated observables to a structured density description.

Regime Input supervision / observable Density object
Classical crowd or object counting Point annotations {xi}\{x_i\} Pixel-wise density map whose sum equals count
Weakly supervised crowd counting Image-level global count DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),0 Pseudo-density map, token-level density scores, or density-related weights
Physical/statistical inversion Column density or counts in cells Characteristic number density or smoothed density PDF

2. Classical density-map counting with explicit spatial supervision

The fully supervised Count2Density literature treats density estimation as the core representation, with count obtained by integration. DSNet exemplifies this paradigm through a VGG-16 front-end, three Dense Dilated Convolution Blocks, dense residual connections, and a multi-scale density level consistency loss. Its density targets use geometry-adaptive kernels for congested datasets and fixed kernels for sparse datasets, and the resulting count is computed as DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),1 (Dai et al., 2019). The architectural emphasis is on continuous scale coverage: dilation rates DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),2 are chosen to avoid gridding artifacts while preserving local continuity of the predicted density map (Dai et al., 2019).

Mask-aware counting refines the same density-map formulation by separating foreground/background segmentation from density regression. The binary mask DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),3 is derived from the density itself, and a dedicated mask branch is trained with pixel-wise classification loss while the density branch uses the mask posterior as an additional conditioning signal (Jiang et al., 2018). The best-performing design does not simply multiply density by a hard mask; instead, it transforms the predicted posterior into multi-channel mask features and fuses them with backbone features before density regression, so that gradients from density loss also update the mask predictor (Jiang et al., 2018). This addresses the asymmetry between sparse non-zero density support and dominant background pixels.

Remote-sensing counting adopts the same density-map logic but adapts it to extreme scale variation, orientation arbitrariness, and clutter. ASPDNet constructs density maps from object-center impulses convolved with a fixed Gaussian kernel with DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),4, then regresses them with a VGG16 front-end augmented by CBAM, a Scale Pyramid Module with dilated convolutions, and a Deformable Convolution Module (Gao et al., 2020). The count remains DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),5, but the architecture is specialized for remote-sensing morphology rather than pedestrian crowds (Gao et al., 2020).

A related supervised line focuses on extracting more information from point annotations than Gaussian-density generation alone. “Focus for Free in Density-Based Counting” repurposes point annotations to create object-aware occlusion simulation, foreground masks, an auxiliary foreground-only teacher, and segmentation/global-density focus branches (Shi et al., 2023). The underlying density target remains standard, but the learning signal becomes richer: the main regressor is distilled toward a density map predicted from blacked-out-background inputs, reducing background interference while preserving the Count2Density integral relation (Shi et al., 2023).

3. Count-only supervision and the recovery of spatial density

The most explicit Count2Density formulation under weak supervision is the 2025 pipeline that learns density maps from image-level counts alone (Litrico et al., 3 Sep 2025). A feature extractor DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),6 and decoder DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),7 predict DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),8, with global count recovered by summation,

DGT(x)=i=1Nδ(xxi)×Gσi(x),D^{GT}(x)=\sum_{i=1}^{N} \delta(x-x_i)\times G_{\sigma_i}(x),9

Since no ground-truth density map is available, the method maintains a Historical Map Bank σi\sigma_i0, initialized with BASNet saliency and updated by an exponential moving average,

σi\sigma_i1

with σi\sigma_i2 (Litrico et al., 3 Sep 2025). Each historical map is normalized into a spatial prior, from which exactly σi\sigma_i3 pseudo-locations are sampled using a hypergeometric-like scheme without replacement; these sampled points are then converted into a pseudo-density map σi\sigma_i4, yielding a map loss plus a contrastive spatial regularizer that encourages intra-crowd feature similarity and crowd/background separation (Litrico et al., 3 Sep 2025). The paper reports that the Historical Map Bank is the dominant contributor in ablation, and that hypergeometric sampling substantially outperforms a naïve top-σi\sigma_i5 strategy (Litrico et al., 3 Sep 2025).

TCFormer solves a closely related problem with a different mechanism. It uses TinyViT as a 4-stage hierarchical backbone and predicts only from image-level global counts σi\sigma_i6, with no point annotations, no density maps, and no bounding boxes (Guo et al., 21 Dec 2025). The final stage produces σi\sigma_i7 tokens, and the Learnable Density-Weighted Averaging module assigns each token a scalar density score,

σi\sigma_i8

before constructing a density-weighted global descriptor,

σi\sigma_i9

There is no explicit loss on NobsN_{\rm obs}0 or NobsN_{\rm obs}1; the token weights are learned only through count regression, so minimizing count error forces high-density regions to receive larger weights and background regions to be down-weighted (Guo et al., 21 Dec 2025). TCFormer further introduces a density-level classification loss obtained by uniformly quantizing the global count range into NobsN_{\rm obs}2 grades, thereby adding a discrete density supervision signal derived entirely from counts (Guo et al., 21 Dec 2025). This suggests two distinct Count2Density strategies under weak supervision: explicit pseudo-density reconstruction (Litrico et al., 3 Sep 2025) and implicit density-aware feature aggregation (Guo et al., 21 Dec 2025).

A common misconception is that count-only supervision can only support scalar regression. The weakly supervised literature here contradicts that view in two ways. First, Count2Density reports meaningful density maps supporting subregion counting and localization despite using only image-level counts during training (Litrico et al., 3 Sep 2025). Second, TCFormer shows that even when explicit density maps are absent, token-level density scores and weights can behave as coarse density surrogates under global-count supervision (Guo et al., 21 Dec 2025). At the same time, both papers also delimit the achievable resolution: Count2Density relies on iterative pseudo-label refinement and substantial memory for the Historical Map Bank, while TCFormer operates on a NobsN_{\rm obs}3 final token grid at NobsN_{\rm obs}4 resolution and therefore learns only coarse spatial density structure (Litrico et al., 3 Sep 2025, Guo et al., 21 Dec 2025).

4. Alternative count–density couplings beyond direct density regression

Several systems depart from the simple rule “predict density, integrate to count” while retaining density as an auxiliary or intermediate structure. DeepCount is a density-aware global count regressor: during training, a single-column backbone predicts a scalar count together with five auxiliary density maps at progressively coarser resolutions, obtained from multilevel pixelation of the original density map by repeated NobsN_{\rm obs}5 sum pooling (Chen et al., 2019). The key argument is that pixelation increases SNR exponentially with depth, so coarse density targets provide more robust supervision than a single high-resolution map. The backbone is trained by multilayer gradient fusion from all branches, but at test time the density branches can be detached, yielding a faster count-only model (Chen et al., 2019). Count is therefore not computed as NobsN_{\rm obs}6, yet the count regressor remains density-aware by construction.

DENet combines counting-by-detection and counting-by-density-estimation. A Mask R-CNN detector counts clearly visible people, producing NobsN_{\rm obs}7, while an encoder–decoder estimation network predicts a density map on the remaining masked image, producing NobsN_{\rm obs}8. The final count is

NobsN_{\rm obs}9

and training includes a counting loss that explicitly enforces global consistency between detection count, density integral, and ground-truth count (Liu et al., 2019). This architecture is a concrete Count2Density decomposition across visibility regimes: sparse, segmentable individuals are counted discretely; dense ambiguous regions are represented as continuous density (Liu et al., 2019).

A different variant appears in high-density object localization from aerial imagery. The network of (Arruda et al., 2021) predicts per-pixel confidence maps nTn_T0 across multiple refinement stages, with each stage supervised by Gaussian kernels of different nTn_T1. Although the representation is density-like, inference counts peaks rather than integrating the map: nTn_T2 with nTn_T3 and minimum separation nTn_T4 pixel (Arruda et al., 2021). This suggests a useful distinction: not every Count2Density representation is a normalized density whose sum equals the count; some are center-likelihood maps whose count is obtained by peak enumeration (Arruda et al., 2021).

Microscopy work pushes this distinction further. “Improved Counting and Localization from Density Maps for Object Detection in 2D and 3D Microscopy Imaging” argues that plain integration of the density map can preserve global count while failing at localization when peaks merge (Li et al., 2022). The proposed Density Map Analysis interprets the predicted density as a mixture of Gaussian components, computes truncated mass inside each thresholded connected component, and estimates a local object count by dividing that truncated mass by the fixed mass nTn_T5 of a Gaussian above threshold nTn_T6. Components with counts near 1 are rounded, while merged components use the estimated integer count as a prior for Gaussian Mixture Model fitting on Monte Carlo samples drawn from the normalized density within the blob (Li et al., 2022). Here the Count2Density relation becomes local and statistical rather than purely integral.

5. Physical and statistical Count2Density outside image supervision

The same logical structure appears in astrophysical inversion. In molecular-cloud analysis, the observable is not an object count but a column density map nTn_T7, and the goal is to infer local representative number densities along the line of sight. The proposed probabilistic model assumes

nTn_T8

where nTn_T9 is a turbulent column drawn from a truncated lognormal prior and nJn_J0 is a gravitational component associated with a Jeans-scale dense structure (Gaches et al., 2024). Given a sampled nJn_J1, the residual column nJn_J2 is used to solve for a dense number density nJn_J3, while the remaining path length yields a diffuse density nJn_J4. The method thereby maps a 2D column-density observable into pixel-wise distributions over nJn_J5, plus an effective attenuating column nJn_J6 for astrochemical modeling (Gaches et al., 2024). This is a physical Count2Density inversion rather than a supervised learning problem.

In cosmology, the inversion is framed in terms of counts in cells and density-split clustering. For spherical top-hat smoothing, counts in a cell satisfy

nJn_J7

and the observable counts PDF is modeled as

nJn_J8

with nJn_J9 typically Poisson or generalized Poisson and NeffN_{\rm eff}0 modeled by Gaussian, shifted lognormal, or Large Deviation Theory (Gruen et al., 2017, Pinon et al., 24 Jan 2025). Density-split correlation functions are then expressed through the two-point PDF of NeffN_{\rm eff}1, and the environmental dependence is summarized by a density bias function NeffN_{\rm eff}2 (Pinon et al., 24 Jan 2025). Earlier density-split work in DES Y1 and SDSS already used galaxy counts in apertures to split lines of sight by density and calibrated the count-to-density relation with weak lensing, thereby constraining cosmology, galaxy bias, stochasticity, and skewness of the matter PDF (Gruen et al., 2017). “Cylinders out of a top hat” similarly constructs projected count-in-cylinder densities and derives their one-point PDF and cylinder bias from large deviation statistics (Uhlemann et al., 2017).

A misconception in this statistical literature is that simple Gaussian or lognormal assumptions are always sufficient once one has a smoothed count field. The supplied papers argue otherwise: Gaussian approximations fail for density-split clustering at relevant mildly nonlinear scales, shifted lognormal improves but remains systematically less accurate, and LDT provides the best agreement in the large-separation regime (Pinon et al., 24 Jan 2025). Likewise, line-of-sight number-density inference depends materially on assumptions about cloud depth NeffN_{\rm eff}3, temperature NeffN_{\rm eff}4, and the turbulence model, so Count2Density in physical systems is inseparable from the prior imposed on the latent density field (Gaches et al., 2024).

6. Limitations, misconceptions, and open directions

Across these literatures, the first recurrent limitation is spatial granularity. TCFormer’s final representation comprises NeffN_{\rm eff}5 tokens at NeffN_{\rm eff}6 input, which is sufficient for global counting but not for fine-grained density detail (Guo et al., 21 Dec 2025). DeepCount intentionally moves toward coarser density maps because pixelation improves SNR, but this also means the auxiliary density structure is lower resolution than a classical full-resolution map (Chen et al., 2019). In cosmological LDT-based modeling, accuracy depends on large separations NeffN_{\rm eff}7, so small-scale density-split correlations remain outside the formal regime of control (Pinon et al., 24 Jan 2025).

The second limitation is the indirectness of supervision. Count2Density’s Historical Map Bank can recover useful pseudo-density maps from count labels alone, but it stores a full map per training image and increases training cost and memory linearly with dataset size and resolution (Litrico et al., 3 Sep 2025). TCFormer’s LDWA weights are never directly supervised, and there is no explicit compositional constraint tying a function of NeffN_{\rm eff}8 to the count (Guo et al., 21 Dec 2025). DeepCount’s backbone becomes density-aware through auxiliary branches, yet those branches are discarded at test time, so the learned density structure remains implicit rather than directly inspectable unless a branch is retained (Chen et al., 2019).

The third limitation is model mismatch. In microscopy, density-based counting assumes object contributions are approximately Gaussian with shared covariance; when this breaks, truncated-mass counting and GMM-based localization become only approximate (Li et al., 2022). In remote sensing, ASPDNet uses a fixed Gaussian kernel with NeffN_{\rm eff}9 for all objects, even though object scales vary strongly across categories and scenes (Gao et al., 2020). In molecular clouds, inferred δR\delta_R0 and δR\delta_R1 depend on choices for δR\delta_R2, δR\delta_R3, and the lognormal turbulent prior (Gaches et al., 2024). In density-split clustering, Count2Density mappings inherit the limitations of the bias model and shot-noise model used for δR\delta_R4 (Gruen et al., 2017, Pinon et al., 24 Jan 2025).

Taken together, the literature suggests two broad research directions. One is to tighten the coupling between count constraints and density structure: examples already proposed include region-level weak labels, pseudo-density consistency losses, and image-conditioned density-level heads for weakly supervised crowd counting (Guo et al., 21 Dec 2025). The other is to make the density prior more faithful to the domain: adaptive kernels, physically richer priors, multi-scale tokens, and improved stochasticity models all serve the same purpose of making the inferred density field more than a counting surrogate. In that sense, Count2Density is not a single architecture but a unifying problem class: how to turn coarse or indirect observables into density representations that remain quantitatively meaningful for counting, localization, or physical inference (Litrico et al., 3 Sep 2025, Gaches et al., 2024, Pinon et al., 24 Jan 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Count2Density.