Abstract
Automated disease coding in veterinary medicine faces significant hurdles due to the lack of labeled data and substantial variations in clinical writing styles across hospitals. This paper introduces a large-scale generative modeling approach to address these challenges. By pre-training a Transformer-based model on over one million unlabeled clinical notes and employing an auxiliary generative loss during fine-tuning, the researchers demonstrate significant improvements in cross-hospital generalization. The proposed model outperforms existing baselines, including dictionary-based methods and standard supervised learning architectures, by a wide margin on a challenging out-of-distribution dataset.
The Cross-Hospital Challenge
In human medicine, clinical notes are routinely paired with standardized codes (e.g., ICD-10) for billing and research. In contrast, veterinary clinics rarely apply such codes, leaving valuable clinical data locked in unstructured text. While some labeled datasets exist from large teaching hospitals, they often fail to generalize to local clinics due to "domain shift"—differences in case types, abbreviations, and jargon. This study aims to leverage massive amounts of unlabeled text to build a system capable of working across diverse veterinary practices.
Methodology
The core of the proposed system is a two-stage training process designed to leverage massive amounts of unlabeled text through generative sequence modeling.
- Generative Pre-training: An encoder (either an LSTM or a Transformer) is first trained to predict the next word in a sequence using the SAGE dataset, which contains over one million raw clinical notes. This allows the model to learn the "language" of veterinary medicine—including abbreviations and clinical context—without requiring manual labels.
- Supervised Fine-tuning with Auxiliary Loss: When training the model to predict disease codes, the researchers include an auxiliary generative loss alongside the classification error. This forces the model to maintain its understanding of underlying text structure while learning to map that text to specific diseases.
Experimental Results
The models were evaluated on two primary datasets: CSU (in-distribution labeled data) and PP (out-of-distribution labeled data). The PP dataset, consisting of discharge summaries from a private practice, served as a rigorous test for cross-hospital robustness due to its distinct writing style and high use of abbreviations.
The "Transformer + Auxiliary + Pretrain" model emerged as the clear winner. On the challenging PP dataset, it achieved an F1 score of 68.0, significantly outperforming the previous state-of-the-art CAML (54.7) and the dictionary-based MetaMap baseline (51.6). Notably, the model nearly doubled the Exact Match (EM) performance of the MetaMap-MLP baseline, correctly predicting the entire set of disease codes for a record 25.2% of the time.
Key Insights and Conclusion
This work demonstrates that large-scale generative modeling is a powerful tool for learning discriminative features in specialized domains like veterinary medicine. Unlike traditional tools that rely on medical dictionaries, the deep learning model captured rare professional terms and complex clinical combinations that dictionary-based methods missed.
By pre-training on unlabeled data, models can overcome the limitations of small labeled datasets and bridge the gap between different clinical environments. While hardware constraints and performance on rare "long-tail" diseases remain areas for future research, this approach sets a new benchmark for automated veterinary disease coding.
Summary updated