Pixel Counting Can Be Biased — Interactive Demo

Overview. Estimating area by simply counting positive pixels can be biased when the grid is coarse, boundaries are oblique/complex, or the map has classification error. A design-based, post-stratified estimator—using a probability sample of reference points within map strata (map=1 vs map=0)—yields unbiased area estimates and valid confidence intervals. This demo contrasts naïve pixel counting with the recommended stratified estimator following best practices described by Olofsson et al. (2014).

  • Pixel-count area: #positive cells × cell area. This can be biased with coarse grids and oblique/complex boundaries (especially with any-touched).
  • Corrected area (post-stratified): Unbiased estimator using point samples. Split the map by the raster prediction (map class 1 vs 0); sample n points per stratum; label each by the polygon (1 inside, 0 outside). With stratum means p̂₁, p̂₀ and area weights W₁, W₀, the estimated proportion is P̂ = W₁·p̂₁ + W₀·p̂₀ and the corrected area is  = P̂ × (total area). CI uses Var(P̂) = W₁²·p̂₁(1−p̂₁)/n₁ + W₀²·p̂₀(1−p̂₀)/n₀.
Reference: Olofsson, P., Foody, G. M., Herold, M., Stehman, S. V., Woodcock, C. E., & Wulder, M. A. (2014). Good practices for estimating area and assessing accuracy of land change. Remote Sensing of Environment, 148, 42–57.
GT polygon Predicted positive cells Sample points
Drag inside the polygon to move it; drag circular handles to edit vertices. Adjust cell size and rule to see bias appear.
80
True area
Pixel-count area
Pixel-count error
Corrected area (stratified)
95% CI
Corrected error
≤ 2% error ≤ 10% error > 10% error

Computation Details — Corrected Area

Step-by-step: Corrected area (post-stratified)