Image Classification
Transformers
Safetensors
PyTorch
convnextv2
chest-xray
convnext
medical
medical-imaging
pneumonia
Eval Results (legacy)
Instructions to use kiselyovd/chest-xray-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kiselyovd/chest-xray-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="kiselyovd/chest-xray-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("kiselyovd/chest-xray-classifier") model = AutoModelForImageClassification.from_pretrained("kiselyovd/chest-xray-classifier") - Notebooks
- Google Colab
- Kaggle
metadata
license: mit
library_name: transformers
pipeline_tag: image-classification
base_model: facebook/convnextv2-tiny-22k-224
tags:
- chest-xray
- convnext
- convnextv2
- image-classification
- medical
- medical-imaging
- pneumonia
- pytorch
- transformers
datasets:
- keremberke/chest-xray-classification
metrics:
- accuracy
- f1
widget:
- src: >-
https://huggingface.co/kiselyovd/chest-xray-classifier/resolve/main/samples/bacterial_pneumonia.png
example_title: bacterial_pneumonia
- src: >-
https://huggingface.co/kiselyovd/chest-xray-classifier/resolve/main/samples/normal.png
example_title: normal
- src: >-
https://huggingface.co/kiselyovd/chest-xray-classifier/resolve/main/samples/viral_pneumonia.png
example_title: viral_pneumonia
model-index:
- name: kiselyovd/chest-xray-classifier
results:
- task:
type: image-classification
dataset:
type: keremberke/chest-xray-classification
name: Chest X-Ray Images (Pneumonia)
metrics:
- type: auroc_macro_ovr
value: 0.9752638346619307
- type: accuracy
value: 0.9134615384615384
- type: macro_f1
value: 0.9029730638714358
chest-xray-classifier
Production-grade 3-class chest X-ray classifier: normal vs bacterial pneumonia vs viral pneumonia.
Metrics
| Metric | Value |
|---|---|
| auroc_macro_ovr | 0.9752638346619307 |
| accuracy | 0.9134615384615384 |
| macro_f1 | 0.9029730638714358 |
Usage
from transformers import AutoImageProcessor, AutoModelForImageClassification
import torch
from PIL import Image
processor = AutoImageProcessor.from_pretrained("kiselyovd/chest-xray-classifier")
model = AutoModelForImageClassification.from_pretrained("kiselyovd/chest-xray-classifier")
image = Image.open("your_image.png")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = logits.argmax(-1).item()
print(model.config.id2label[predicted_class])
Training Data
Trained on Chest X-Ray Images (Pneumonia).
Source Code
Intended Use
This model is provided for research and educational purposes. The authors make no warranties about its suitability for any particular application. Users are responsible for evaluating the model's fitness for their use case, including fairness, safety, and compliance with applicable regulations.
Note: This model card was generated from the ml-project-template scaffold.