Failures Reveal What Metrics Miss: An Evidence-Driven Agent for Recursive Refinement of ECG Classifiers

2026-07-27Artificial Intelligence

Artificial Intelligence
AI summary

The authors created RecursiveECG, a system that helps improve heart signal classifiers by using a large language model (LLM) to learn from specific mistakes rather than just overall scores. They convert ECG expert rules into accurate measurements, letting the LLM understand why certain cases fail and suggest fixes. These fixes are tested and only kept if they really help, resulting in better ECG analysis without needing the LLM afterward. Their method showed consistent improvements over existing models on multiple ECG datasets.

12-lead ECGDeep learningLarge language model (LLM)Classifier refinementDeterministic functionsFailure diagnosisModel evaluationPTB-XL datasetEvidence-based revisionAutomated model design
Authors
Jinliang Deng, Yiming Niu, Yibo Pan, Zhiqi Shao, Qin Luo, Yongxin Tong
Abstract
Deep models have substantially advanced 12-lead ECG classification, yet their refinement still relies heavily on human experts to inspect failures and iteratively revise classifier designs. Recent LLM-based agents have demonstrated the potential for automated model design, but when guided only by aggregate performance metrics, they lack insight into why individual cases fail and how the classifier should be revised. We present RecursiveECG, an evidence-driven LLM-as-Designer framework in which an LLM serves as an offline model designer that refines ECG classifiers based on concrete failures and objective ECG evidence. To ground failure diagnosis in executable evidence, Criteria-to-Measurement Compilation converts curated ECG criteria into validated deterministic functions that produce reproducible, reference-backed measurements for individual ECGs. Building on these measurements, Evidence-Grounded Failure Review analyzes failed and comparator cases by jointly considering raw waveforms, measurements, and model outputs, enabling the LLM to diagnose classifier limitations and formulate targeted revisions. Candidate revisions are executed and re-evaluated under a fixed problem contract, and only evidence-supported updates are retained. The resulting predictor is frozen after refinement and requires no LLM inference during deployment, while an audit trail links each accepted revision to its supporting evidence. Across PTB-XL, Georgia, and CPSC2018, RecursiveECG consistently outperforms strong baselines, achieving an average relative improvement of 10.0%. Extensive ablation and transfer studies further validate the effectiveness of its evidence-grounded refinement process.