ddimunzio/bot-detector
1
Contest Log Bot Detector
Streamlit app to detect automated bots in amateur radio contest logs (Cabrillo format).
Features
- Upload and compare multiple Cabrillo
.logfiles side-by-side - 9 detection modules: S&P Burst, Frequency Entropy, RBN Trap, QRP Feasibility, Typo Decoupling, ISFE (band/frequency feasibility), Fatigue/Decay, 2BSIQ Cognitive Load, Clock-Phase Detector
- Bayesian adjudication output: posterior P(bot), P(suspicious), P(human)
- Color-highlighted comparison table (🔴 bot-level / 🟡 suspicious / 🟢 human)
- SO2R/SO3R aware scoring (multi-transmitter thresholds)
Methodology (Current)
- Hybrid adjudication: heuristic score + Bayesian posterior.
- Final
Likely BOTdecision is Bayesian-gated. Heuristic output can raise a case toSuspicious, but cannot forceLikely BOTon its own. - Bayesian evidence is aggregated in 5 active blocks (timing, rate, frequency, physical/cognitive, fatigue/clock-phase), each with clamped log-likelihood contribution.
- RBN contributes to Bayesian adjudication only through a confidence-gated statistical-window model (delay buckets + ambiguity/sample guards); when confidence is low it is automatically suppressed.
- Multi-operator and multi-transmitter contexts apply block suppression in Bayesian space to reduce false positives on legitimate high-performance team logs.
Calibration (How It Works)
- Runtime overrides are loaded automatically from
calibration.jsonwhenbot_detector_engine.pyis imported. - Tunable families include priors, mode log-LR offsets, block weights, verdict thresholds, heuristic offsets, and optional metric PDFs.
calibrate.pyperforms:- One-time metric extraction for all selected logs.
- Random search over parameter bounds.
- Phase-2 refinement strategy (
deby default,nelderoptional,noneto skip). - Optional profile overlay calibration (
--profile-split multi-op) when sample size is sufficient. - The objective combines hard verdict penalties and smooth softplus penalties, with support for:
HUMANlabeled logs (strong false-positive control),BOTlabeled logs (false-negative control),UNLABELEDlogs (soft-label weighting by mode prior).
App Runtime Modes
- Local runtime: both
DetectionandCalibrationtabs are available. - Deployment runtime: only
Detectionis shown; the UI displays aDEPLOYMENT MODE DETECTEDbadge and hides calibration controls. - Optional overrides:
BOT_DETECTOR_ENABLE_CALIBRATION_UI=1forces calibration tab visible.BOT_DETECTOR_DISABLE_CALIBRATION_UI=1forces calibration tab hidden.
Example calibration run:
python calibrate.py --contest all --sample 400 --n-random 5000 --phase2 de --de-maxiter 60 --de-popsize 8 --output-json calibration.jsonUsage
Upload one or more Cabrillo log files using the sidebar, then switch between Single Log and Compare Logs views.
Documentation
- Detection architecture and full indicator reference: docs/DETECTION_SYSTEM_GUIDE.md
- Version en espanol: docs/DETECTION_SYSTEM_GUIDE_ES.md
