|
--- |
|
license: openrail |
|
language: |
|
- en |
|
pipeline_tag: fill-mask |
|
tags: |
|
- biology |
|
- medical |
|
--- |
|
|
|
# PetBERT |
|
|
|
PetBERT is a masked language model based on the BERT architecture further trained on over 500 million additional words from first-opinion veterinary clinicians from across the UK |
|
|
|
## Paper Abstract |
|
Effective public health surveillance requires consistent monitoring of disease signals such that researchers and decision-makers can react dynamically to changes in disease occurrence. However, whilst surveillance initiatives exist in production animal veterinary medicine, comparable frameworks for companion animals are lacking. First-opinion veterinary electronic health records (EHRs) have the potential to reveal disease signals and often represent the initial reporting of clinical syndromes in animals presenting for medical attention, highlighting their possible significance in early disease detection. Yet despite their availability, there are limitations surrounding their free text-based nature, inhibiting the ability for national-level mortality and morbidity statistics to occur. This paper presents PetBERT, a large language model trained on over 500 million words from 5.1 million EHRs across the UK. PetBERT-ICD is the additional training of PetBERT as a multi-label classifier for the automated coding of veterinary clinical EHRs with the International Classification of Disease 11 framework, achieving F1 scores exceeding 83% across 20 disease codings with minimal annotations. PetBERT-ICD effectively identifies disease outbreaks, outperforming current clinician-assigned point-of-care labelling strategies up to 3 weeks earlier. The potential for PetBERT-ICD to enhance disease surveillance in veterinary medicine represents a promising avenue for advancing animal health and improving public health outcomes. |
|
|
|
- **Developed by:** SAVSNET |
|
- **Model type:** Masked Language Model |
|
- **Language(s) (NLP):** English |
|
- **License:** openrail |
|
- **Finetuned from model [optional]:** [More Information Needed] |
|
|
|
### Model Sources |
|
|
|
- **Repository:** https://github.com/SAVSNET/PetBERT |
|
- **Paper [optional]:** https://www.nature.com/articles/s41598-023-45155-7 |
|
|
|
|
|
## How to Get Started with the Model |
|
|
|
|
|
|
|
## Training Details |
|
|
|
### Training Data |
|
|
|
Electronic health records have been collected since March 2014 by SAVSNET, the Small Animal Veterinary Surveillance Network, comprising a sentinel network of 253 volunteer veterinary practices across the United Kingdom. A complete description of SAVSNET has been presented elsewhere5. In summary, based on convenience, veterinary practices with compatible practice management software with the SAVSNET data exchange are recruited. Within these participating practices, data is collected from each booked consultation (where an appointment has been made to see a veterinary practitioner or nurse). All owners within these practices can opt-out at the time of consultation, and therefore, their data will be excluded. Data is collected on a consultation-by-consultation basis and includes information such as species, breed, sex, neuter status, age, owner’s postcode, insurance and microchipping status, and crucial to this study, a free-text clinical narrative outlining the events that occurred within that consultation. At the end of each consultation, veterinary practitioners are given 10 ‘main presenting complaint’ (MPC) groups to categorise the main reason the animal presented; these are gastrointestinal, respiratory, pruritus, tumour, renal, trauma, post-operative checkups, vaccination and, other healthy and other unwell. Sensitive information, such as personal identifiers, is cleaned from the data without further preprocessing. SAVSNET has ethical approval from the University of Liverpool Research Ethics Committee (RETH001081). Table 4 summarises the cleaned SAVSNET dataset after the above process for cats and dogs only. We segregated EHRs into training and testing sets based on their respective source practices. This stratification approach ensures that the clinical notes used for testing were separate from those generated by clinicians who had contributed to the training sets, thereby fortifying the robustness of our results and mitigating potential bias. |
|
|
|
### Dataset availability statement: |
|
The datasets analysed during the current study are not publicly available due to issues surrounding owner confidentiality. Reasonable requests can be made to the SAVSNET Data Access and Publication Panel (savsnet@liverpool.ac.uk) for researchers who meet the criteria for access to confidential data. |
|
|
|
### Training Procedure |
|
|
|
Adaption of the ULMFiT framework was utilised in the production of ‘PetBERT’ based upon minimal modifications to the BERT architecture. Firstly, the pre-trained BERT-base model previously exposed to the general-purpose language of Wikipedia and BooksCorpus was further fine-tuned on the 500 million token dataset of first opinion clinical free-text narratives on a simultaneous training task of Masked Language (MLM) and Next Sentence Prediction (NSP), mimicking the tasks used in the initial pre-training of BERT. For MLM training, 15% of the words within a given clinical narrative were masked randomly across the entire training dataset. The model was tasked to substitute the masked word with a suitable word, requiring a deep bidirectional understanding of the text. For NSP training, sentences between narratives were randomly split and rejoined either to the same sentence or to a random sentence with a [SEP] token in between. The model had to determine whether the new sentence pairs made sense, enabling a cross-sentence understanding of the text. The model had a 10% evaluation set created randomly to calculate a validation loss to determine the number of training epochs required. The training ended when evaluation loss increased, occurring beyond epoch 8, with the final model selected for downstream tasks. Training took 450 hours on a single Nvidia A100 GPU. |
|
|
|
|
|
|
|
|
|
## Model Examination [optional] |
|
|
|
<!-- Relevant interpretability work for the model goes here --> |
|
|
|
[More Information Needed] |
|
|
|
## Environmental Impact |
|
|
|
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly --> |
|
|
|
|
|
- **Hardware Type:** 1 x NVidia A100 |
|
- **Hours used:** ~450 hours |
|
- **Cloud Provider:** https://www.dur.ac.uk/arc/nvidiacuda/ |
|
- **Carbon Emitted:** ~30kg CO2 eq. *[Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) |
|
|
|
|
|
## Citation |
|
|
|
**BibTeX:** |
|
|
|
@article{Farrell2023PetBERT:Records, |
|
title = {{PetBERT: automated ICD-11 syndromic disease coding for outbreak detection in first opinion veterinary electronic health records}}, |
|
year = {2023}, |
|
journal = {Scientific Reports 2023 13:1}, |
|
author = {Farrell, Sean and Appleton, Charlotte and Noble, Peter John Mäntylä and Al Moubayed, Noura}, |
|
number = {1}, |
|
month = {10}, |
|
pages = {1--14}, |
|
volume = {13}, |
|
publisher = {Nature Publishing Group}, |
|
url = {https://www.nature.com/articles/s41598-023-45155-7}, |
|
isbn = {0123456789}, |
|
doi = {10.1038/s41598-023-45155-7}, |
|
issn = {2045-2322}, |
|
pmid = {37865683}, |
|
keywords = {Data mining, Machine learning} |
|
} |