Skip to content
DecadentryPublic

About

Observer-agreement analysis for dental imaging studies: kappa, Gwet AC1, Krippendorff alpha, ICC, cluster bootstrap, protocol comparison, GRRAS reports. Research use only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

dentagree

tests DOI License: MIT Python

Observer-agreement analysis for dental imaging studies. Several observers, several imaging protocols (for example low-, standard- and high-dose CBCT), several devices, teeth nested in skulls or patients: dentagree computes the usual agreement coefficients with bootstrap confidence intervals, compares protocols with a paired test on the same teeth, helps plan the size of the next study, and writes a report structured by the GRRAS reporting guideline.

Research and education use only. This is statistics software, not a medical device, and it does not assess images.

Why

Reliability studies in dental radiology often report tables of pairwise kappa values per parameter, protocol and device, and protocols are then compared across those tables. This tool was motivated by the design of Rezai, Matzen, Kaaber and Schropp (2026), an ex vivo study of 25 impacted third molars in nine skulls scanned with three dose protocols on three CBCT units (doi:10.1016/j.oooo.2026.08.014). Their raw data and code are not public, so dentagree does not reproduce their results; it implements analyses for this type of design and adds three things:

  1. Uncertainty that respects clustering. Teeth from one skull are not independent. Every coefficient gets a bootstrap interval that resamples skulls, then teeth within skulls (two-stage bootstrap).
  2. A formal protocol comparison. The difference in agreement between two protocols is estimated on the same resampled teeth (paired bootstrap), with Holm adjustment across contrasts.
  3. Prevalence-robust companions to kappa. Gwet AC1/AC2, PABAK, mean prevalence and bias indices over observer pairs, and flags for the "high agreement, low kappa" paradox.

It was built independently (no code from the paper exists); the authors have not reviewed or endorsed it.

Install

pip install "git+https://github.com/Decadentry/dentagree"
# or, from a clone:  pip install -e ".[dev,figures]"

Python 3.10 or newer (CI tests 3.10-3.12); depends only on numpy, pandas and scipy. For the cross-check in experiments/run_all.py: pip install -e ".[crosscheck]" and, optionally, pip install --no-deps irrCAC.

Quickstart

dentagree demo --out-dir demo          # synthetic 25-teeth / 9-skull / 3x3-protocol study + full report
dentagree study demo/demo_ratings.csv --case tooth --cluster skull --condition unit,protocol \
    --ordinal resorption_grade:none,enamel,dentin,pulp --reference A/HD --out-dir out
dentagree plan --cases 25 --clusters 9 --observers 4 --kappa-a 0.8 --kappa-b 0.6 --prevalence 0.7,0.3 --tau 0.1

dentagree study writes inter.csv, intra.csv, compare.csv and report.md. The input is one long table, one row per rating:

tooth skull observer unit protocol session parameter rating
T01 S1 O1 A LD 1 canal_contact yes

Other commands: dentagree pair (two raters, one item), dentagree icc (six ICC forms with F-based CIs), dentagree bland-altman (bias and limits of agreement with CIs). In Python:

from dentagree import Study, ParameterSpec
st = Study(df, case="tooth", cluster="skull", condition=["unit", "protocol"],
           specs={"resorption_grade": ParameterSpec("ordinal", ["none", "enamel", "dentin", "pulp"])})
st.inter()                       # per parameter x condition: kappa, Fleiss, AC1/AC2, alpha, % agreement + CIs
st.intra()                       # session 1 vs 2 per observer
st.compare_all(reference="A/HD")  # paired protocol contrasts, Holm-adjusted

What it computes

Coefficient Notes
Cohen kappa unweighted, linear or quadratic weights; mean, min and max over observer pairs
Fleiss kappa any number of observers, missing ratings allowed (Gwet 2014 form)
Gwet AC1 / AC2 multi-rater, weighted for ordinal scales
Krippendorff alpha nominal, ordinal, interval; missing ratings allowed
PABAK, prevalence and bias indices Byrt, Bishop and Carlin (1993)
ICC ICC(1), ICC(A,1), ICC(C,1) and average-measure forms, McGraw and Wong (1996) CIs
Bland-Altman bias, limits of agreement and their CIs (Bland and Altman 1999)

Bootstrap schemes: two-stage (default, conservative), cluster (one-stage) and case. All runs are seeded; at least 200 resamples are required on the command line (default 2000). Ordinal scales need their category order (numeric labels are sorted as numbers); weights are refused on nominal scales.

Results (all numbers from results/, reproduced by python experiments/run_all.py)

1. Numerical cross-check (results/crosscheck.json). On 200 random data sets per check, the largest absolute difference from the reference implementation was at most 1.3e-15 for Cohen kappa (all weights; scikit-learn), Fleiss kappa (statsmodels), Krippendorff alpha with missing data (nominal, ordinal, interval; krippendorff package) and all six ICC forms (pingouin; 1,200 values). Against irrCAC (Gwet AC1/AC2, Fleiss with missing data and weights, Krippendorff nominal) the difference was at most 5.0e-6, which is irrCAC's rounding to five decimals. ICC confidence bounds matched pingouin's two-decimal output within 0.005.

2. Interval coverage (results/coverage.json, figure). 400 simulated studies per setting, nominal 95% intervals for kappa (Monte Carlo SE about 0.011), five settings (25 or 100 teeth, 2 or 4 observers, kappa 0.6 or 0.8, cluster effect tau 0-0.2). The two-stage bootstrap covered 0.958-0.980, the one-stage cluster bootstrap 0.880-0.933 and the case bootstrap 0.878-0.958. The case bootstrap also under-covered with no cluster effect at 25 teeth (0.928), so part of the problem is the small sample, not only clustering. The two-stage bootstrap is deliberately conservative: with no cluster effect its intervals were 22% (25 teeth) to 28% (100 teeth) wider than the case bootstrap's, and the paired test's false-positive rate was 1.75-3.25% instead of 5%. It is the default because it never fell clearly below nominal in these five settings; it does in harder ones (see 3).

3. What a 25-tooth design can detect (results/design_power.json, figure). Simulated paired two-protocol designs, tau = 0.1, kappa 0.8 in protocol A, 200 studies per cell, two-stage bootstrap (so the detection rates below are for a conservative test and are lower bounds for a well-calibrated one). With 25 teeth in 9 skulls, 4 observers and 30% prevalence, the mean width of the 95% CI for kappa was 0.53; a true drop from 0.8 to 0.6 was detected in 17.5% of simulated studies and a drop to 0.4 in 57%; with no true difference 2.5% were (falsely) positive. With 100 teeth in 36 skulls and 4 observers, the drop to 0.6 was detected in 53% and a drop to 0.5 in 91.5%. At 10% prevalence the picture is worse: with 25 teeth, intervals covered the true kappa in only 52% (2 observers) and 72% (4 observers) of studies, the false-positive rate was 8.4% and 7.1%, and kappa was undefined in 5% and 2% of studies. Under this model, a non-significant protocol difference in a study of this size is weak evidence of equal reproducibility; the interval of the difference shows how much is compatible with the data.

4. The kappa paradox (results/paradox.json, figure). With the same 90% observed agreement between two observers on 100 cases, Cohen kappa was 0.80 at 50% prevalence, 0.44 at 10% and -0.05 at 5%, while Gwet AC1 stayed between 0.80 and 0.89. The report flags such cases.

5. Demo (results/demo_summary.json). On the synthetic demo (no true protocol effect; 1,000 bootstrap resamples as in run_all.py), 1 of 24 protocol contrasts had an unadjusted bootstrap p < 0.05 and none after Holm adjustment.

Comparison with the source paper

Rezai et al. reported inter- and intra-observer agreement across parameters, protocols and units and concluded (abstract): "Reproducibility in the assessment of third molars was primarily influenced by the diagnostic parameter and the observer rather than by CBCT dose level or unit." dentagree cannot check those numbers (no public data). The simulations above describe designs of a similar size under a simple generating model; they are not a re-analysis of that study.

Limitations

  • Percentile bootstrap intervals are approximate. The two-stage default is conservative in moderate settings but under-covered in 6 of 12 design-simulation cells, all with high kappa and few positives or few observers (lowest 0.52: 25 teeth, 10% prevalence, 2 observers; 0.86: 25 teeth, 30% prevalence, 2 observers). With rare findings, report AC1 or PABAK next to kappa and treat kappa intervals with care.
  • Observers are not resampled: intervals and tests describe the observers in the study, not a population of observers.
  • Holm adjustment is applied within each parameter, not across all parameters.
  • The simulation model (observer accuracy mixture with a cluster random effect) is simple: observers have no systematic bias and no observer effect persists across protocols, so paired conditions are less correlated than in real reader studies; power for paired contrasts may be higher in practice.
  • Bootstrap p-values are coarse when kappa sits at the boundary (perfect agreement); replicates where a coefficient is undefined are dropped.
  • Landis-Koch labels are conventions for unweighted kappa; read the intervals.

Intended use

Analysis and planning of reliability and agreement studies in dental and maxillofacial imaging, teaching of agreement statistics. Not for clinical decisions about individual patients.

How to cite

Please cite the software and, for the methods and simulations, the technical note (docs/technical_note.pdf, also attached to the release):

Boustani Hezarani H. dentagree: observer-agreement analysis for dental imaging studies (version 1.0.0) [software]. Decadentry; 2026. doi:10.5281/zenodo.24601790 (all versions: 10.5281/zenodo.24601789).

Boustani Hezarani H. dentagree: technical note, version 1.0.0. Zenodo; 2026. doi:10.5281/zenodo.24601827

See also CITATION.cff. If your study design follows Rezai et al. (2026), please cite that paper.

Acknowledgement

The study design of Rezai E, Matzen LH, Kaaber L, Schropp L. Comparing reproducibility among observers for low-, standard-, and high-dose protocols of CBCT assessing anatomical landmarks and pathology related to third molars: an ex vivo study. Oral Surg Oral Med Oral Pathol Oral Radiol 2026. doi:10.1016/j.oooo.2026.08.014 motivated this tool.

Licence

MIT, (c) 2026 Hossein Boustani Hezarani / Decadentry.

About

Observer-agreement analysis for dental imaging studies: kappa, Gwet AC1, Krippendorff alpha, ICC, cluster bootstrap, protocol comparison, GRRAS reports. Research use only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages