# Fine-tuning foundational models to code diagnoses from veterinary health records

**Authors:** Mayla R. Boguslav, Adam Kiehl, David Kott, George Joseph Strecker, Tracy L. Webb, Nadia Saklou, Terri Ward, Michael Kirby, Yuzhe Yang, Xiaoli Liu, Yuzhe Yang, Xiaoli Liu

PMC · DOI: 10.1371/journal.pdig.0001147 · PLOS Digital Health · 2026-02-20

## TL;DR

This study improves veterinary health records by using advanced AI to automatically code diagnoses, making data more useful for research.

## Contribution

The study introduces a method using pre-trained language models to automate diagnosis coding in veterinary records with high accuracy.

## Key findings

- Fine-tuning large clinical language models on extensive labeled data yields the best automated diagnosis coding results.
- Comparable coding accuracy can be achieved with smaller models and limited data resources.
- The approach supports better interoperability of veterinary and human health records for integrated research.

## Abstract

Veterinary medical records represent a large data resource for application to veterinary and One Health clinical research efforts. Use of the data is limited by interoperability challenges including inconsistent data formats and data siloing. Clinical coding using standardized medical terminologies enhances the quality of medical records and facilitates their interoperability with veterinary and human health records from other sites. Previous studies, such as DeepTag and VetTag, evaluated the application of Natural Language Processing (NLP) to automate veterinary diagnosis coding, employing long short-term memory (LSTM) and transformer models to infer a subset of Systemized Nomenclature of Medicine - Clinical Terms (SNOMED-CT) diagnosis codes from free-text clinical notes. This study expands on these efforts by incorporating all 7,739 distinct SNOMED-CT diagnosis codes recognized by the Colorado State University (CSU) Veterinary Teaching Hospital (VTH) and by leveraging the increasing availability of pre-trained language models (LMs). 13 freely available pre-trained LMs (GatorTron, MedicalAI ClinicalBERT, medAlpaca, VetBERT, PetBERT, BERT, BERT Large, RoBERTa, GPT-2, GPT-2 XL, DeBERTa V3, ModernBERT, and Clinical ModernBERT) were fine-tuned on the free-text notes from 246,473 manually-coded veterinary patient visits included in the CSU VTH’s electronic health records (EHRs), which resulted in superior performance relative to previous efforts. The most accurate results were obtained when expansive labeled data were used to fine-tune relatively large clinical LMs, but the study also showed that comparable results can be obtained using more limited resources and non-clinical LMs. The results of this study contribute to the improvement of the quality of veterinary EHRs by investigating accessible methods for automated coding and support both animal and human health research by paving the way for more integrated and comprehensive health databases that span species and institutions.

In this study, we explored the use of advanced natural language processing (NLP) techniques to improve the quality and interoperability of veterinary medical records. By leveraging a variety of pre-trained language models (LMs) and a labeled training dataset curated by expert medical coders to apply standardized medical terminologies to diagnoses from free-text clinical notes, we demonstrate a powerful use-case for recent developments in NLP technologies. Our findings suggest that complex LMs fine-tuned on large volumes of curated data yield best results for quick and reliable automated diagnosis coding. However, we also show that comparable results can be attained using a more minimal set of computational and data resources. We believe this study can provide guidance for other clinical sites interested in enhancing the quality of electronic health records in both the veterinary and human domains. Accurate, automated medical record coding methods may facilitate and encourage clinical research and data sharing in the veterinary, human, and One Health contexts.

## Full-text entities

- **Diseases:** nutritional disorder (MESH:D009748), metabolic disease (MESH:D008659), CDM (MESH:D004195), stroke (MESH:D020521), LMs (MESH:D007806), Poisoning (MESH:D011041), gingival recession (MESH:D005889), pica (MESH:D010842), Inflammatory (MESH:D007249), dystonia (MESH:D004421), T2D (MESH:D003924), kidney disease (MESH:D007674), Toxicity (MESH:D064420), gingivitis (MESH:D005891), Rattlesnake Venom (MESH:D000092422), SNOMED-CT (MESH:D000088562)
- **Chemicals:** insulin (MESH:D007328), PDIG-D-24-00525R1 (-)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12923131/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12923131/full.md

## References

58 references — full list in the complete paper: https://tomesphere.com/paper/PMC12923131/full.md

---
Source: https://tomesphere.com/paper/PMC12923131