CoolFace
Modelpublic

suitch/radbert-german-ctrate-classifier

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes13downloads
Model Card

RadBERT German CTRate Classifier

A RadBERT-based multi-label classifier for predicting 18 pathology labels from German-language radiology reports. The training data consists of German-translated reports from the CTRate dataset, translated using Qwen 3.5 9B.

Model Details

PropertyValue
Base modelRadBERT (RoBERTa-base architecture, pre-trained on radiology text)
TaskMulti-label text classification (18 labels)
LanguageGerman (de)
Framework🤗 Transformers + PyTorch
Problem typemulti_label_classification

Labels (18 pathologies)

IDLabel
0Medical material
1Arterial wall calcification
2Cardiomegaly
3Pericardial effusion
4Coronary artery wall calcification
5Hiatal hernia
6Lymphadenopathy
7Emphysema
8Atelectasis
9Lung nodule
10Lung opacity
11Pulmonary fibrotic sequela
12Pleural effusion
13Mosaic attenuation pattern
14Peribronchial thickening
15Consolidation
16Bronchiectasis
17Interlobular septal thickening

Quick Start

Installation

bash
pip install transformers torch

Loading the model

python
from transformers import AutoTokenizer, AutoConfig
from modeling_radbert import RadBertForSequenceClassification
import torch

repo_id = "suitch/radbert-german-ctrate-classifier"

# Download the custom model class (or copy modeling_radbert.py locally)
from huggingface_hub import hf_hub_download
import sys, os

modeling_path = hf_hub_download(repo_id=repo_id, filename="modeling_radbert.py")
sys.path.insert(0, os.path.dirname(modeling_path))

# Load config, model, and tokenizer
config = AutoConfig.from_pretrained(repo_id)
model = RadBertForSequenceClassification.from_pretrained(repo_id, config=config)
tokenizer = AutoTokenizer.from_pretrained(repo_id)

model.eval()

Inference example

python
text = "Das Herz ist leicht vergrößert. Es zeigt sich ein kleiner Pleuraerguss links."

inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)

with torch.no_grad():
    logits = model(**inputs)

probabilities = torch.sigmoid(logits).squeeze()
threshold = 0.5
predicted_labels = [
    config.id2label[i] for i, p in enumerate(probabilities) if p >= threshold
]

print("Predicted labels:", predicted_labels)
print("Probabilities:")
for i, p in enumerate(probabilities):
    print(f"  {config.id2label[i]}: {p:.4f}")

Training Details

  • —Base checkpoint: RadBERT (RoBERTa-base weights pre-trained on radiology corpora)
  • —Training data: German translations of CTRate radiology reports (translated with Qwen 2.5 9B)
  • —Classification head: Linear layer on top of the [CLS] / pooler output
  • —Loss: Binary Cross-Entropy with Logits (per-label sigmoid)

Limitations

  • —This model is trained for label inference from report text only — it does not process images.
  • —It should not be treated as a clinical decision support system.
  • —Performance is limited by the quality of the machine-translated training data.

Citation

If you use this model, please cite the CTRate dataset and RadBERT:

bibtex
@article{hamamci2024ctrate,
  title={CT-RATE: A Large-Scale Computed Tomography Report-Image Dataset for AI in Radiology},
  author={Hamamci, Ibrahim Ethem and others},
  journal={arXiv preprint},
  year={2024}
}

@article{yan2022radbert,
  title={RadBERT: Adapting Transformer-based Language Models to Radiology},
  author={Yan, Di and others},
  journal={Radiology: Artificial Intelligence},
  year={2022}
}

License

MIT