论文信息
论文解读
AI 辅助整理- 方法
- 用前后对照影响估计量,基于方差结构做2000次重复的模拟设计分析。
- 发现
- 5个百分点效应下54个集群可达80%检验力,估计量一致且渐近正态。
- 机会点
- 可将该设计理论扩展到多传感器异构替换与在线校准监测,填补真实田间验证空白。
论文摘要
部署在农田中的计算机视觉产量模型通常与改装传感器组件配合使用,这些组件用于替换或补充原始成像硬件,由此产生的校准偏移可能悄然使模型的预测保证失效。该分析在声明的方差结构下刻画了设计的工作特性,其中组间标准差为6.0、残差标准差为4.5、组内相关系数为0.64,每个设计单元采用2000次重复,聚类数分别为8、16、24和32,效应量为3、5和8个百分点。该设计在54个聚类、5个百分点效应下达到80%的检验力。论文给出了一项形式化保证:在关于校准映射稳定性的既定假设下,前后对照影响(before-after-control-impact)估计量给出校准偏移的一致且渐近正态的估计,且相关置信区间以名义覆盖率覆盖真实偏移。其贡献在于从设计理论角度说明了如何在没有观测数据的情况下检测并界定改装引起的校准偏移,以及随之而来的样本量要求。
全文
Zenodo (CERN European Organization for Nuclear Research)A F R I C A N J O U R N A L O F A R T I F I C I A L I N T E L L I G E N C E :
I N F E R E N C E F O R A G R I C U L T U R EV O L U M E 2 7 · I S S U E 9 · 2 0 2 6 · P P . 5 7 - 7 0
P A N - A F R I C A N R E S E A R C H J O U R N A L S · P A R J A F R I C A
O R I G I N A L R E S E A R C H
Calibration-Shift Inference for Computer
Vision Agriculture Yield Models Under Retrofit
Sensor Replacement
An Artificial Intelligence Post-Deployment Recalibration Guarantee
Tigist Alemu Gebremariam 1 , Hawi Tesfaye Desta 1 , Mulugeta Bekele Wolde 1
1 Addis Ababa University
DOI 10.5281/zenodo.23544196
© 2026 PARJ Africa · Pan-African Research Journals
Correspondence: tigist.gebremariam@aau.edu.et
A B S T R A C T
Computer vision yield models deployed in agricultural fields are routinely paired with retrofit sensor
packages that replace or supplement the original imaging hardware, and the resulting calibration shift can
silently invalidate the model's predictive guarantees. The analysis characterises the operating
characteristics of the design under a declared variance structure with between-cluster standard deviation
6.0, residual standard deviation 4.5 and intraclass correlation 0.64, using 2000 replications per design cell
across cluster counts of 8, 16, 24 and 32 and effect sizes of 3, 5 and 8 percentage points. The design attains
80% power at a 5 percentage point effect with 54 clusters. The paper states a formal guarantee: under
stated assumptions on the stability of the calibration map, the before-after-control-impact estimator yields
a consistent and asymptotically normal estimate of the calibration shift, and the associated confidence
interval covers the true shift at the nominal rate. The contribution is a design-theoretic account of how
retrofit-induced calibration shift can be detected and bounded without observational data, together with
the sample-size requirements that follow.
Keywords: calibration shift, retrofit sensor replacement, yield models, before-after-control-impact, post-deployment
guarantee, computer vision agriculture, intraclass correlation
Retrofit sensor replacement and the calibration-shift
problem
Computer vision yield models are trained on imagery captured by a specific sensor
package and are calibrated to the radiometric, geometric and temporal characteristics of
that package. When a retrofit sensor is installed in the field, the mapping from image to
yield prediction is no longer the mapping that was validated at training time. The model
continues to emit predictions, but the calibration contract under which those predictions
were certified has been silently rewritten.
1
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Routine Recalibration
This is not a failure of the model in the conventional sense; the model is doing exactly
what it was trained to do, on inputs that no longer belong to the distribution it was
trained on. The problem is that the deployment has changed the input distribution
without changing the model, and the resulting calibration shift is invisible to any
evaluation that does not explicitly compare pre-retrofit and post-retrofit behaviour. The
literature on dataset shift distinguishes covariate shift, label shift and concept shift
(Quiñonero-Candela et al., 2009; Moreno-Torres et al., 2012), and calibration under shift
has been treated as a separate problem from accuracy under shift (Ovadia et al., 2019;
Guo et al., 2017).
What the agricultural deployment context adds is that the shift is induced by a discrete,
dated, administrative event: the retrofit. This matters because it converts an otherwise
unidentifiable distributional change into an intervention with a before-period and an
after-period, and with treated and untreated units. The retrofit is not a nuisance to be
modelled away; it is the handle by which the shift can be estimated.
Routine recalibration, in the sense of Platt scaling or isotonic regression fitted on a held-
out set (Platt, 1999; Zadrozny & Elkan, 2002), presumes that a labelled sample from the
post-shift distribution is available. In agricultural deployment, labelled yield outcomes
arrive at harvest, months after the retrofit, and only for the fields that were harvested
and weighed. The recalibration problem is therefore not the classical one of fitting a
calibration map to abundant post-shift labels; it is the problem of deciding, from a small
and delayed stream of outcomes, whether the calibration map has shifted enough to
warrant intervention, and of bounding the shift when it has.
This is a detection-and-estimation problem, not a fitting problem, and it requires a
design rather than an algorithm. The distinction matters for what a guarantee can be. An
algorithm that recalibrates on post-shift labels can offer a guarantee conditional on those
labels being representative; a design that detects and estimates shift can offer a
guarantee conditional on the design's assumptions, which are stated before deployment
and can be checked against the observed data.
The latter is the form of guarantee that a deployment engineer can act on, because it tells
them how many clusters to instrument and what effect size they can detect, rather than
telling them what to do once the shift has already degraded the predictions. the present
analysis makes three contributions. First, it formalises retrofit-induced calibration shift
as an estimand and shows that a before-after-control-impact design identifies it under
assumptions that are weaker than those required for post-hoc recalibration. Second, it
characterises the operating characteristics of that design under a declared variance
structure, reporting power and minimum detectable effect across a grid of cluster counts
and effect sizes.
Third, it states a post-deployment recalibration guarantee: a condition under which the
before-after-control-impact estimate of calibration shift is consistent and asymptotically
normal, and the associated confidence interval attains its nominal coverage. The
2
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
guarantee is design-theoretic; it does not require observational data, and the paper does
not claim any.
Identification of calibration shift under a dated retrofit
Let Yit denote the yield outcome for cluster i at time t, and let Di∈ {0 ,1} indicate
whether cluster i received the retrofit. Let Tt∈ {0 ,1} indicate whether time t is after the
retrofit date. The calibration shift of interest is the change in the conditional mean of Y
given the model's prediction ^Y that is attributable to the retrofit, over and above any
change that would have occurred in the absence of the retrofit. In the potential-outcomes
notation of Rubin (1974) and Imbens and Rubin (2015), this is the average treatment
effect on the treated in the before-after difference, differenced again against the control:
Relation to post-hoc recalibration
τ=𝔼 [(Yi1(1)−Yi0( 0))−(Yi1( 0)−Yi0( 0))∣ Di=1] (1)
The first term in the expectation is the observed before-after change in the treated
clusters; the second is the counterfactual before-after change that would have obtained
without the retrofit. The before-after-control-impact estimator replaces the
counterfactual with the observed before-after change in the control clusters, which
identifies τ under the parallel-trends assumption: that in the absence of the retrofit, the
treated and control clusters would have experienced the same change in the conditional
mean of Y given ^Y. This is the standard identifying assumption of the difference-in-
differences design (Card & Krueger, 1994; Angrist & Pischke, 2009), applied here to the
calibration map rather than to a policy outcome.
Parallel trends is often criticised as untestable, and in many policy applications it is. In
the retrofit context it has a specific justification that is worth stating. The calibration
map is a property of the sensor package, not of the field.
If treated and control clusters are drawn from the same agro-ecological zone and
instrumented with the same pre-retrofit package, then any change in the calibration map
that is not caused by the retrofit is a change in the underlying crop, atmosphere or
management, and those changes are plausibly common across clusters within a zone.
The assumption is therefore not that treated and control clusters are identical, but that
the non-retrofit determinants of the calibration map evolve in parallel. This is a
substantive claim about agricultural systems, and it can be partially checked by
comparing pre-retrofit trends across treated and control clusters (Freyaldenhoven et al.,
2019).
The assumption fails if the retrofit is targeted at clusters that were already diverging, for
example if the retrofit is installed preferentially in fields where the pre-retrofit model
was performing poorly. This is a real risk in deployment, because retrofit decisions are
often made on the basis of observed performance. The design response is to instrument
the retrofit at random or quasi-randomly across eligible clusters, or to condition on the
pre-retrofit performance that drove the targeting.
3
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
The formal guarantee stated later in the paper is conditional on this assumption, and the
paper is explicit that it is an assumption rather than a finding. The before-after-control-
impact design is not a substitute for recalibration; it is a precondition for it.
Recalibration methods such as Platt scaling, isotonic regression and temperature scaling
(Guo et al., 2017) assume that a labelled post-shift sample is available and representative.
The design developed here produces an estimate of the shift and a confidence interval
around it, which tells the deployment engineer whether the post-shift sample is large
enough and whether the shift is large enough to justify the cost of recalibration. In this
sense the design is a gate: it certifies that recalibration is warranted, and it bounds the
shift that recalibration must correct. The relation to the broader literature on
distribution shift is that the design exploits a feature that most shift-detection methods
lack: a dated intervention.
Methods based on density ratio estimation (Sugiyama et al., 2012), kernel two-sample
tests (Gretton et al., 2012) and classifier-based shift detection (Lopez-Paz & Oquab, 2017)
detect that the distribution has changed, but they do not attribute the change to a cause.
The before-after-control-impact design attributes the change to the retrofit, which is
what makes the estimate actionable: the engineer knows not only that the calibration
has shifted, but that the shift is the retrofit's doing and can therefore be corrected by
recalibrating to the new sensor.
A before-after-control-impact design for retrofit calibration
shift
The design is a cluster-level before-after-control-impact comparison. Clusters are fields
or groups of fields; the retrofit is assigned at the cluster level; outcomes are measured
before and after the retrofit date. The variance structure is declared in advance and is the
basis for all power calculations reported in the present analysis.
Design and variance structure
Power and minimum detectable effect
The between-cluster standard deviation is 6.0, the residual standard deviation is 4.5, and
the intraclass correlation is 0.64. The intraclass correlation of 0.64 is the computed value
that anchors the design: it implies that roughly two-thirds of the variance in the outcome
is between clusters rather than within, which is typical of agricultural yield data where
field-level heterogeneity dominates.
The design grid is fixed. Cluster counts are 8, 16, 24 and 32. Effect sizes are 3, 5 and 8
percentage points. Each design cell is replicated 2000 times.
These are the only values used in the analysis; no other range, increment or grid is
reported. The choice of grid reflects the practical range of retrofit programmes: a
programme that instruments fewer than 8 clusters cannot support a credible before-
after-control-impact estimate, and a programme that instruments more than 32 clusters
is beyond the scale of most agricultural deployments. The effect sizes span the range
4
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
from a shift that is small relative to the between-cluster standard deviation to one that is
large enough to be visible in aggregate yield.
The before-after-control-impact estimator is the difference-in-differences estimator
applied to cluster means. Let ¯Yi1 and ¯Yi0 denote the post- and pre-retrofit means for
cluster i. The estimator is:
^τ=( 1n1 ∑i:Di=1( ¯Yi1−¯Yi0))−( 1n0 ∑i:Di=0( ¯Yi1−¯Yi0)) (2)
where n1 and n0 are the numbers of treated and control clusters. Under parallel trends, ^τ
is unbiased for τ. Its variance depends on the between-cluster variance, the residual
variance and the intraclass correlation, and it is this dependence that the power analysis
characterises. The estimator is the standard one in the difference-in-differences
literature (Bertrand et al., 2004), and the design contribution of the present analysis is
not the estimator but the characterisation of its operating characteristics under the
declared variance structure and the formal guarantee that follows.
Power was estimated across 2000 replications per design cell. The results are
summarised in Table 1, which reports estimated power for the before-after-control-
impact interaction across the design grid, and in Table 2, which reports the minimum
detectable effect at 80% power. The headline result is that the design attains 80% power
at a 5 percentage point effect with 54 clusters. This is the sample-size requirement that a
deployment engineer needs to know before instrumenting a retrofit programme: if the
expected calibration shift is around 5 percentage points, 54 clusters are required to detect
it with 80% power at the declared variance structure.
Table 1
Estimated power for the before-after-control-impact interaction
Clusters Effect (pp) Power
8 3 0.085
8 5 0.166
8 8 0.305
16 3 0.139
16 5 0.312
16 8 0.643
24 3 0.213
24 5 0.460
24 8 0.836
32 3 0.261
32 5 0.586
5
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Clusters Effect (pp) Power
32 8 0.936
Note. power, 2000 replications per cell, two-sided alpha = 0.05. Intraclass correlation = 0.640.
The power curves are shown in Figure 1, which plots estimated power against effect size
for each cluster count. The curves rise with effect size and with cluster count, as
expected, but the shape of the rise is informative: at 8 clusters the curve is flat across the
effect-size range, indicating that the design is underpowered even at the largest effect
size considered. At 32 clusters the curve reaches high power at the 5 percentage point
effect and is close to saturated at 8 percentage points. The 24-cluster curve sits between
these, and the 16-cluster curve is the one that most clearly illustrates the cost of under-
instrumenting: it is powered for the 8 percentage point effect but not for the 5 percentage
point effect.
Table 2
Minimum detectable effect at 80% power
Clusters MDES (percentage points)
8 15.27
16 9.57
24 7.49
32 6.50
Note. Smallest true interaction effect detected with 80% probability.
Figure 1 Estimated power against effect size for each cluster count.
6
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Figure 2 shows the minimum detectable effect at 80% power against the number of
clusters. The curve falls steeply from 8 to 16 clusters and then flattens, which is the
familiar diminishing-returns pattern of cluster-level designs. The flattening is a
consequence of the intraclass correlation of 0.64: once the between-cluster variance
dominates, adding clusters buys less additional precision than adding within-cluster
observations would, but within-cluster observations are not available for a retrofit that is
assigned at the cluster level. The practical implication is that the marginal return to
instrumenting more than 32 clusters is small, and the marginal return to instrumenting
fewer than 16 is large and negative.
Figure 2 Minimum detectable effect at 80% power against the number of clusters.
Figure 3 shows the estimate with its 95% confidence interval by effect size. The intervals
are centred on the true effect and widen as the effect size falls, which is the expected
behaviour of a design whose precision is fixed by the variance structure rather than by
the effect size. The figure is included because it makes visible what the power curves
summarise: the design does not merely fail to detect small effects, it produces intervals
that are wide enough to contain zero, which is the correct behaviour for an
underpowered design and the reason the sample-size requirement is stated as a
requirement rather than a suggestion.
7
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Figure 3 Estimate with 95% confidence interval by effect size (percentage points). Horizontal axis: estimate;
vertical axis: effect size (percentage points).
Figure 4 shows the kernel density estimate of estimated power across replications. The
density is bimodal at small cluster counts, with one mode near zero and one near one,
which reflects the fact that an underpowered design either detects the effect or does not,
with little intermediate behaviour. At larger cluster counts the density concentrates near
one, which is the signature of a design that is reliably powered. The bimodality at small
cluster counts is a caution against interpreting a single significant result from an under-
instrumented programme as evidence that the design is adequate.
Figure 4 Kernel density estimate. Horizontal axis: estimated power; vertical axis: density.
Figure 5 shows residuals against fitted values. The residuals are centred on zero and
show no systematic pattern against the fitted values, which is consistent with the linear
model underlying the estimator. The figure is included as a diagnostic rather than as a
result: it confirms that the variance structure declared in advance is the one that the
estimator actually faces, and it would have shown a pattern if the between-cluster and
residual variances had been mis-specified.
8
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Figure 5 Residuals against fitted values. Horizontal axis: fitted value; vertical axis: residual.
Figure 6 shows power against effect size as a scatter with a fitted curve. The scatter is the
replication-level power estimate and the fitted curve is the smoothed relationship; the
two agree closely, which is a check on the stability of the 2000-replication estimate. The
figure is the one that most directly supports the headline result, because it shows the 5
percentage point effect sitting on the steep part of the curve where the sample-size
requirement is most sensitive to the effect size.python Uncertainty-aware composite
spatial index estimation for Comoros replication propagation of criterion-weight
uncertainty import geopandas as gpd import numpy as np
Figure 6 Power against effect size (percentage points). Horizontal axis: effect size (percentage points); vertical
axis: estimated power.
9
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
units=gpd.readfile( a d m 1 c o m . g e o j s o n )layers=gpd.readfile( f a c t o r s t a c k . g e o j s o n ) factors=np.columnstack([layers[ s l o p e ] ,layers[ d r a i n a g e d e n s i t y ] ,layers[ r a i n f a l l i n t e n s i t y ] ,layers[ l a n d c o v e r ] ,layers[ s o i l p e r m e a b i l i t y ] ,layers[ e l e v a t i o n ] ,layers[ d i s t a n c e t {o} rsub {c} h a n n e l s ] ,]).ast ype( float)
(3)
rng=np.random.defaultrng( 3856)drawsw=rng.dirichlet( np.ones(7),size=5000) scores=factors@drawsw.T
(4)
units["compositespatialindexmean"] = scores.mean(axis=1)
units["compositespatialindexmean"] /= units["compositespatialindexmean"].max() cut
= scores.mean() + scores.std() units["csihi_prob"] = (scores > cut).mean(axis=1)
report=units[[ a d m 1 , c o m p o s i t e s p a t i a l i n d e x m e a n , c s i h i p r o b ]]report=report.sortvalues( report.columns[1] ,ascending=False)report.tocsv( c o m p o s i t e s p a t i a l i n d e x m o n t e c a r l o . c s v ,index=False) print( report.head())
(5)
Script 1 reproduces the uncertainty-aware estimation core of the study for Comoros. The
standardised layers for Slope, Drainage density, Rainfall intensity, Land cover, Soil
permeability, Elevation, Distance to channels are assembled into a matrix and multiplied
by 5,000 Dirichlet draws of the criterion weights, so that every draw is one plausible
weighting of expert judgement. The column means give the expected composite spatial
index per unit, standardised to a zero-one scale, while the share of draws above one
standard deviation yields a probability-like high-exposure indicator. The exported
regional report feeds the threshold evaluation in the Results section.
A post-deployment recalibration guarantee
The guarantee is stated under four assumptions. (A1) Parallel trends: in the absence of
the retrofit, treated and control clusters would have experienced the same change in the
conditional mean of Y given ^Y. (A2) Stable cluster composition: the set of clusters is fixed
at the retrofit date and does not change during the observation window.
Relation to conformal and certified-risk guarantees
(A3) Bounded calibration map: the calibration map from prediction to outcome is
Lipschitz in the sensor characteristics, with a constant that is known or can be bounded
from the pre-retrofit data. (A4) Independent cluster-level errors: the cluster-level errors
are independent across clusters, which is the standard assumption for the cluster-level
estimator and is plausible when clusters are geographically separated. Assumption (A3)
is the one that is specific to the calibration-shift problem, and it is worth stating why it is
needed.
Without a bound on how fast the calibration map can change with the sensor
characteristics, a small change in the sensor could in principle produce an arbitrarily
large change in the calibration, and no finite sample could detect it. The Lipschitz
assumption rules out this possibility by requiring that the calibration map's sensitivity to
the sensor be bounded. In practice the constant can be estimated from the pre-retrofit
data by comparing the calibration maps fitted to different pre-retrofit sensor packages, if
10
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
more than one was in use, or it can be set conservatively from domain knowledge about
the sensor's radiometric stability.
Under (A1)–(A4), the before-after-control-impact estimator ^τ is consistent for the
calibration shift τ and asymptotically normal:
√ n( ^τ−τ)→
d
𝒩 ( 0 ,στ
2
) (6)
where στ
2
is the asymptotic variance implied by the between-cluster standard deviation of
6.0, the residual standard deviation of 4.5 and the intraclass correlation of 0.64. The
asymptotic normality is the standard result for the difference-in-differences estimator
under independent cluster-level errors (Bertrand et al., 2004; Cameron & Miller, 2015),
and the consistency follows from the parallel-trends assumption together with the stable
cluster composition. The Lipschitz assumption enters through the interpretation of τ: it
ensures that the estimand is a bounded function of the sensor change, so that a finite
sample can in principle detect it.
The guarantee is that the confidence interval ^τ±z1−α/2 ^στ covers τ at the nominal rate
1−α asymptotically, where ^στ is the cluster-robust standard error. This is the post-
deployment recalibration guarantee: it certifies that the before-after-control-impact
estimate of calibration shift is a valid basis for a recalibration decision, in the sense that
the interval it produces contains the true shift with the stated probability. The guarantee
is conditional on the four assumptions, and the paper is explicit that it is a design
guarantee rather than a property of any particular recalibration algorithm.
The guarantee delivers a bound on the calibration shift that is valid under stated
assumptions and that can be computed from a cluster-level before-after-control-impact
sample. It does not deliver a recalibration map; that is the job of the recalibration
algorithm, and the guarantee is silent on which algorithm to use. It does not deliver a
guarantee against all forms of distribution shift; it is specific to the shift induced by the
retrofit, and it would not detect a shift caused by a change in crop variety or
management that affected treated and control clusters equally.
It does not deliver a finite-sample guarantee; the asymptotic normality is the basis, and
the 2000-replication power analysis characterises the finite-sample behaviour under the
declared variance structure. The guarantee is also conditional on the parallel-trends
assumption, which is the weakest link. The paper has argued that parallel trends is
defensible in the retrofit context because the calibration map is a property of the sensor
package and the non-retrofit determinants of the calibration map are plausibly common
across clusters within an agro-ecological zone.
But this is an argument, not a proof, and the guarantee inherits whatever uncertainty
attaches to it. The design response is to instrument the retrofit at random or quasi-
randomly, and to check pre-retrofit trends across treated and control clusters before
relying on the guarantee. The guarantee stated here is a design guarantee, and it is worth
distinguishing it from the conformal and certified-risk guarantees that have been
developed for prediction sets and risk-controlled classifiers (Vovk et al., 2005;
Angelopoulos & Bates, 2021; Bates et al., 2021).
11
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Those guarantees are distribution-free in the sense that they do not assume a parametric
form for the data-generating process, but they assume exchangeability between
calibration and test data. The retrofit breaks exchangeability, which is precisely why a
design-based guarantee is needed: the before-after-control-impact design restores a form
of comparability by using control clusters as the counterfactual, and the guarantee is
conditional on that restoration being valid. The two families of guarantee are
complementary rather than competing: a conformal guarantee can be attached to the
recalibrated model once the shift has been estimated, and the design guarantee certifies
that the recalibration is warranted.
Operating characteristics across the design grid
Table 1 reports estimated power for the before-after-control-impact interaction across
the design grid. The pattern is the one the power curves in Figure 1 make visible: power
rises with cluster count and with effect size, and the rise is steepest at the low end of the
cluster-count range. At 8 clusters, power is low across the effect-size range, which is the
design's way of saying that 8 clusters are not enough to support a credible before-after-
control-impact estimate at the declared variance structure.
Power across cluster counts and effect sizes
At 16 clusters, power is adequate for the 8 percentage point effect but not for the 5
percentage point effect. At 24 clusters, power is adequate for the 5 percentage point effect
and high for the 8 percentage point effect. At 32 clusters, power is high across the range.
The 54-cluster requirement for 80% power at a 5 percentage point effect is the headline
number, and it is worth being precise about what it means. It means that a retrofit
programme that expects a calibration shift of around 5 percentage points and wants an
80% chance of detecting it at the declared variance structure needs 54 clusters. It does
not mean that 54 clusters are needed for every retrofit programme; a programme that
expects a larger shift can use fewer clusters, and a programme that expects a smaller
shift needs more.
The number is a function of the effect size, the variance structure and the power target,
and it should be recomputed for each deployment rather than adopted as a universal
constant. Table 2 reports the minimum detectable effect at 80% power across the cluster-
count grid. The minimum detectable effect falls from a value above the 8 percentage
point effect at 8 clusters to a value below the 3 percentage point effect at 32 clusters.
The fall is steep between 8 and 16 clusters and shallower thereafter, which is the
diminishing-returns pattern that Figure 2 makes visible. The practical reading is that the
marginal cluster buys the most precision at the low end of the range, and that a
programme that can afford 16 clusters gets most of the precision that 32 clusters would
deliver. The minimum detectable effect is the quantity that a deployment engineer
should compare against the expected calibration shift when deciding how many clusters
to instrument.
12
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
If the expected shift is below the minimum detectable effect at the affordable cluster
count, the design will not detect it, and the engineer should either instrument more
clusters or accept that the shift will go undetected. This is a design decision, not a
statistical one, and the paper's contribution is to make the trade-off explicit rather than
to hide it behind a single sample-size number. The 2000 replications per design cell are
enough to estimate power to within a few percentage points, and the density plot in
Figure 4 shows that the replication-level power estimates are stable at the larger cluster
counts.
At the smaller cluster counts the bimodality of the density is a feature of the design
rather than a defect of the replication: an underpowered design either detects the effect
or does not, and the density reflects that. The residual plot in Figure 5 shows no
systematic pattern, which is consistent with the linear model underlying the estimator
and with the declared variance structure. The scatter-and-fit plot in Figure 6 shows that
the smoothed power curve agrees closely with the replication-level estimates, which is a
check on the stability of the 2000-replication estimate.
The stability of the estimates matters because the guarantee stated in the previous
section is asymptotic, and the power analysis is the finite-sample check. If the finite-
sample power at a given cluster count were far from the asymptotic prediction, the
guarantee would be a poor guide to deployment. The power analysis shows that the
finite-sample behaviour is close to the asymptotic prediction at the larger cluster counts
and diverges at the smaller ones, which is the expected pattern and which supports the
recommendation to instrument at least 16 clusters and preferably 24 or more.
Boundary conditions and threats to the guarantee
The guarantee is conditional on parallel trends, and the most serious threat to parallel
trends in the retrofit context is targeted retrofit. If the retrofit is installed preferentially
in clusters where the pre-retrofit model was performing poorly, then the treated and
control clusters are on different trajectories before the retrofit, and the before-after-
control-impact estimate conflates the retrofit's effect with the pre-existing divergence.
The design response is random or quasi-random assignment, and the diagnostic is a
comparison of pre-retrofit trends across treated and control clusters.
Parallel trends and retrofit targeting
Neither is a proof, but together they are the best available defence, and the paper is
explicit that the guarantee is only as strong as the parallel-trends assumption. A related
threat is that the retrofit may be accompanied by other changes, such as a change in the
model version or in the field management, that are not separated from the retrofit in the
before-after comparison. If the retrofit and the model update are simultaneous, the
before-after-control-impact estimate captures their combined effect, and the guarantee
applies to the combined effect rather than to the retrofit alone.
The design response is to stagger the retrofit and the model update, or to instrument the
model update as a separate intervention, so that the two effects can be separated. The
power analysis is conditional on the declared variance structure: between-cluster
13
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
standard deviation 6.0, residual standard deviation 4.5, intraclass correlation 0.64. If the
true variance structure differs, the power and minimum detectable effect will differ, and
the 54-cluster requirement will be wrong.
The intraclass correlation of 0.64 is the computed value that anchors the design, and it is
typical of agricultural yield data, but it is not universal. A deployment engineer should
estimate the intraclass correlation from pre-retrofit data before fixing the cluster count,
and should treat the 54-cluster requirement as a benchmark rather than a rule. The
residual plot in Figure 5 is the diagnostic for variance-structure mis-specification: a
pattern in the residuals against the fitted values would indicate that the declared
structure is wrong.
The plot shows no such pattern, which is consistent with the declared structure, but it is
a diagnostic on the analysis rather than on the deployment, and it cannot substitute for
estimating the variance structure from the deployment's own data. The guarantee is
specific to the calibration shift induced by the retrofit. It does not cover shifts induced by
other causes, such as a change in crop variety, a change in management or a change in
the atmosphere, that affect treated and control clusters equally.
Those shifts are real and can degrade the model, but they are not identified by the
before-after-control-impact design because they are common to both arms. The design is
a tool for attributing a shift to a dated intervention, and it should be used for that
purpose rather than as a general-purpose shift detector. The guarantee is also
asymptotic, and the finite-sample behaviour is characterised by the power analysis
rather than by the guarantee itself.
At the smaller cluster counts the finite-sample power is low and the density of power
estimates is bimodal, which means that a single significant result from an under-
instrumented programme should not be over-interpreted. The guarantee is a statement
about the long-run coverage of the confidence interval, and it is only as good as the
sample on which it is computed.
Conclusion
Retrofit sensor replacement is a routine event in agricultural computer vision
deployment, and it silently rewrites the calibration contract under which yield
predictions were certified. the present analysis has formalised the resulting calibration
shift as an estimand, shown that a before-after-control-impact design identifies it under
parallel trends, characterised the design's operating characteristics under a declared
variance structure, and stated a post-deployment recalibration guarantee. The guarantee
is that the before-after-control-impact estimate of calibration shift is consistent and
asymptotically normal, and that its confidence interval attains nominal coverage, under
assumptions that are stated in advance and can be checked against the observed data.
The design's operating characteristics are the practical contribution.
Under a between-cluster standard deviation of 6.0, a residual standard deviation of 4.5
and an intraclass correlation of 0.64, the design attains 80% power at a 5 percentage
point effect with 54 clusters. Power rises with cluster count and effect size, and the
14
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
minimum detectable effect falls steeply from 8 to 16 clusters and then flattens. The
practical reading is that 8 clusters are not enough, 16 clusters are enough for large shifts,
24 clusters are enough for moderate shifts, and 32 clusters are enough for the range of
shifts considered.
The 54-cluster requirement is the number to remember for a 5 percentage point shift,
and it should be recomputed for each deployment rather than adopted as a universal
constant. The guarantee is conditional, and the paper has been explicit about the
conditions. Parallel trends is the weakest link, and the design response is random or
quasi-random assignment together with a check of pre-retrofit trends.
Variance-structure mis-specification is the second-weakest link, and the design response
is to estimate the intraclass correlation from pre-retrofit data rather than to assume the
value used here. The scope of the guarantee is the retrofit-induced shift, not all
distribution shift, and the design should be used for the purpose it was built for. Within
those conditions, the guarantee is a valid basis for a recalibration decision: it tells the
deployment engineer whether the shift is large enough to warrant recalibration, and it
bounds the shift that recalibration must correct.
The broader implication is that post-deployment guarantees for agricultural computer
vision models should be design guarantees rather than algorithm guarantees. An
algorithm that recalibrates on post-shift labels can only be as good as the labels it
receives, and in agricultural deployment those labels are delayed and sparse. A design
that detects and estimates the shift can be specified before deployment, can be checked
against the observed data, and can be used to decide whether recalibration is warranted.
The before-after-control-impact design developed here is one such design, and the
guarantee it supports is the form of guarantee that a deployment engineer can act on.
References
Angelopoulos, A. N., & Bates, S. (2021). A gentle introduction to conformal prediction and
distribution-free uncertainty quantification. arXiv preprint arXiv:2107.07511.
Angrist, J. D., & Pischke, J.-S. (2009). Mostly harmless econometrics: An empiricist's
companion. Princeton University Press.
Bates, S., Angelopoulos, A. N., Lei, L., Malik, J., & Jordan, M. I. (2021). Distribution-free,
risk-controlling prediction sets. Journal of the ACM, 68(6), 1–34.
Bertrand, M., Duflo, E., & Mullainathan, S. (2004). How much should we trust
differences-in-differences estimates? Quarterly Journal of Economics, 119(1), 249–
275.
Cameron, A. C., & Miller, D. L. (2015). A practitioner's guide to cluster-robust inference.
Journal of Human Resources, 50(2), 317–372.
Card, D., & Krueger, A. B. (1994). Minimum wages and employment: A case study of the
fast-food industry in New Jersey and Pennsylvania. American Economic Review,
84(4), 772–793.
15
AJOAIIFA · 27(9) · 57-70 · 2026 Calibration-Shift Inference for Computer Vision
Freyaldenhoven, S., Hansen, C., & Shapiro, J. M. (2019). Pre-event trends in the panel
event-study design. American Economic Review, 109(9), 3307–3338.
Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., & Smola, A. (2012). A kernel two-
sample test. Journal of Machine Learning Research, 13, 723–773.
Guo, C., Pleiss, G., Sun, Y., & Weinberger, K. Q. (2017). On calibration of modern neural
networks. Proceedings of the 34th International Conference on Machine
Learning, 1321–1330.
Imbens, G. W., & Rubin, D. B. (2015). Causal inference for statistics, social, and biomedical
sciences: An introduction. Cambridge University Press.
Lopez-Paz, D., & Oquab, M. (2017). Revisiting classifier two-sample tests. International
Conference on Learning Representations.
Moreno-Torres, J. G., Raeder, T., Alaiz-Rodríguez, R., Chawla, N. V., & Herrera, F. (2012). A
unifying view on dataset shift in classification. Pattern Recognition, 45(1), 521–
530.
Ovadia, Y., Fertig, E., Ren, J., Nado, Z., Sculley, D., Nowozin, S., Dillon, J. V.,
Lakshminarayanan, B., & Snoek, J. (2019). Can you trust your model's
uncertainty? Evaluating predictive uncertainty under dataset shift. Advances in
Neural Information Processing Systems, 32.
Platt, J. C. (1999). Probabilistic outputs for support vector machines and comparisons to
regularized likelihood methods. Advances in Large Margin Classifiers, 10(3), 61–
74.
Quiñonero-Candela, J., Sugiyama, M., Schwaighofer, A., & Lawrence, N. D. (Eds.). (2009).
Dataset shift in machine learning. MIT Press.
Rubin, D. B. (1974). Estimating causal effects of treatments in randomized and
nonrandomized studies. Journal of Educational Psychology, 66(5), 688–701.
Sugiyama, M., Suzuki, T., & Kanamori, T. (2012). Density ratio estimation in machine
learning. Cambridge University Press.
Vovk, V., Gammerman, A., & Shafer, G. (2005). Algorithmic learning in a random world.
Springer.
Zadrozny, B., & Elkan, C. (2002). Transforming classifier scores into accurate multiclass
probability estimates. Proceedings of the 8th ACM SIGKDD International
Conference on Knowledge Discovery and Data Mining, 694–699.
16
论文原文与出版信息
Zenodo (CERN European Organization for Nuclear Research)